Class

BasicAnimation

BasicAnimation(data)

Holds animation data without methods

Constructor

# new BasicAnimation(data)

Creates new animation data object

Parameters:
Name Type Description
data object

View Source classes/animation.ts, line 16

Classes

BasicAnimation
BasicAnimation

Methods

# static countAnimations(ctx, ifilters) → {Promise.<number>}

Counts animations matching given filters

Parameters:
Name Type Description
ctx RequestContext
ifilters IFilters

View Source classes/animation.ts, line 717

Promise.<number>

# async static fromDatabase(data, ctx) → {Promise.<BasicAnimation>}

Parameters:
Name Type Description
data DBAnimation | DBAnimationFull
ctx RequestContext

View Source classes/animation.ts, line 622

Promise.<BasicAnimation>

# async static getAnimation(id, ctx) → {Promise.<BasicAnimation>}

Fetches animation by snowflake from DB

Parameters:
Name Type Description
id AnimationResolvable
ctx RequestContext

View Source classes/animation.ts, line 631

Promise.<BasicAnimation>

# static getAnimations(ctx, ifilters) → {Promise.<Collection.<SnowflakeString, BasicAnimation>>}

Gets animations that fit into the specified filters

Parameters:
Name Type Description
ctx RequestContext
ifilters IFilters

View Source classes/animation.ts, line 725

Promise.<Collection.<SnowflakeString, BasicAnimation>>

# async static getFullAnimation(id, ctx) → {Promise.<Animation>}

Expands animation to full animation

Parameters:
Name Type Description
id AnimationResolvable
ctx RequestContextWithClient

View Source classes/animation.ts, line 640

Promise.<Animation>

# static isAnimation(animation) → {boolean}

Returns if the param is animation or not. Used for TS.

Parameters:
Name Type Description
animation AnimationResolvable

View Source classes/animation.ts, line 607

boolean

# async static newAnimation(data) → {Promise.<Animation>}

Fetches all animations from DB

Parameters:
Name Type Description
data any

View Source classes/animation.ts, line 648

Promise.<Animation>

# static resolveAnimationID(animation) → {SnowflakeString}

Resolves params to string

Parameters:
Name Type Description
animation UserResolvable

View Source classes/animation.ts, line 614

SnowflakeString

# async getAverageRating() → {Promise.<(number|null)>}

View Source classes/animation.ts, line 678

Promise.<(number|null)>

# getCommentCount() → {Promise.<Cnumber>}

Fetches comments on the animation

View Source classes/animation.ts, line 663

Promise.<Cnumber>

# async getComments(max, page) → {Promise.<Collection.<SnowflakeString, Comment>>}

Fetches comments on the animation

Parameters:
Name Type Description
max number

items per page

page number

View Source classes/animation.ts, line 657

Promise.<Collection.<SnowflakeString, Comment>>

# getRatingCount() → {Promise.<number>}

View Source classes/animation.ts, line 683

Promise.<number>

# getRatingFrom(user) → {Promise.<(Rating|null)>}

Returns a rating from given user, if any

Parameters:
Name Type Description
user UserResolvable

View Source classes/animation.ts, line 696

Promise.<(Rating|null)>

# async getRatings(max, page) → {Promise.<Collection.<SnowflakeString, Rating>>}

Fetches ratings on the animation

Parameters:
Name Type Description
max number

items per page

page number

View Source classes/animation.ts, line 672

Promise.<Collection.<SnowflakeString, Rating>>

# async registerView() → {Promise.<void>}

View Source classes/animation.ts, line 689

Promise.<void>

# toJSON() → {Object}

Converts animations to JSON-compatible object for saving resources

View Source classes/animation.ts, line 709

Object

# toMinimal(includeAuthor) → {object}

Returns minimum animation representation

Parameters:
Name Type Description
includeAuthor boolean

View Source classes/animation.ts, line 703

object