IWithThumbnailBehavior

Interface

Composable behavior that adds Thumbnail support to an entity class

Methods

Method Returns Notes
string

Return the full url to the thumbnail for the item backed entity. Optionally, pass in a width. Default width is 200px, with 1:1.5 aspect ratio. Other widths are: 400px, 800px and 2400px. A request for any other width will snap to the next highest supported width. If the original image dimension is smaller than the size queried, the original image will be returned.

void

Set the thumbnail for an item backed entity. This call does not actuall upload the thumbnail until .save() is called.

getThumbnailUrl

Interface Method

Return the full url to the thumbnail for the item backed entity. Optionally, pass in a width. Default width is 200px, with 1:1.5 aspect ratio. Other widths are: 400px, 800px and 2400px. A request for any other width will snap to the next highest supported width. If the original image dimension is smaller than the size queried, the original image will be returned.

  • getThumbnailUrl(width: number) : string

Parameters

Parameter Type Default Notes
width Optional number

Returns

string

setThumbnail

Interface Method

Set the thumbnail for an item backed entity. This call does not actuall upload the thumbnail until .save() is called.

  • setThumbnail(file: any, filename: string) : void

Parameters

Parameter Type Default Notes
file Required any
filename Required string

Returns

void

Interface defined in common/src/core/behaviors/IWithThumbnailBehavior.ts:4