Asset

Asset

Asset

An Asset represents a file such as an image which can be associated with certain other entities such as Products.

Signature

class Asset extends VendureEntity {
  constructor(input?: DeepPartial<Asset>)
  @Column() name: string;
  @Column('varchar') type: AssetType;
  @Column() mimeType: string;
  @Column({ default: 0 }) width: number;
  @Column({ default: 0 }) height: number;
  @Column() fileSize: number;
  @Column() source: string;
  @Column() preview: string;
  @Column('simple-json', { nullable: true })
    focalPoint?: { x: number; y: number };
}

Members

constructor

method
type:
(input?: DeepPartial<Asset>) => Asset

name

property
type:
string

type

property
type:
AssetType

mimeType

property
type:
string

width

property
type:
number

height

property
type:
number

fileSize

property
type:
number

source

property
type:
string

preview

property
type:
string

focalPoint

property
type:
{ x: number; y: number }