ImageAssetUtil
Table of contents
Extends AssetUtil<TLImageAsset>.
class ImageAssetUtil extends AssetUtil<TLImageAsset> {}Constructor
from AssetUtil
Constructs a new instance of the AssetUtil class
Parameters
| Name | Description |
|---|---|
|
Properties
migrations
static
static migrations: import("@tldraw/store").MigrationSequence;props
static
static props: {
fileSize: import("@tldraw/validate").Validator<number | undefined>;
h: import("@tldraw/validate").Validator<number>;
isAnimated: import("@tldraw/validate").Validator<boolean>;
mimeType: import("@tldraw/validate").Validator<null | string>;
name: import("@tldraw/validate").Validator<string>;
pixelRatio: import("@tldraw/validate").Validator<number | undefined>;
src: import("@tldraw/validate").Validator<null | string>;
w: import("@tldraw/validate").Validator<number>;
};type
static
static type: "image";editor
from AssetUtil
editor: Editor;options
options: {
maxDimension: number;
supportedMimeTypes: null | readonly string[];
};Methods
configure( )
static
from AssetUtil
Configure this asset util's options.
static configure<T extends TLAssetUtilConstructor<any, any>>(
this: T,
options: T extends new (...args: any[]) => {
options: infer Options;
}
? Partial<Options>
: never,
): T;Parameters
| Name | Description |
|---|---|
| |
| |
Returns
T;acceptsMimeType( )
from AssetUtil
Check whether this asset type accepts a given MIME type.
acceptsMimeType(mimeType: string): boolean;Parameters
| Name | Description |
|---|---|
| |
Returns
boolean;getAssetFromFile( )
getAssetFromFile(
file: File,
assetId: TLAssetId,
): Promise<null | TLImageAsset>;Parameters
| Name | Description |
|---|---|
| |
|
Returns
Promise<null | TLImageAsset>;getDefaultProps( )
getDefaultProps(): TLImageAsset["props"];getSupportedMimeTypes( )
getSupportedMimeTypes(): readonly string[];Prev
HighlightShapeUtilNext
ImageShapeUtil