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 implements Taggable, ChannelAware, HasCustomFields {
    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 };
    @ManyToMany(type => Tag)
    @JoinTable()
    tags: Tag[];
    @ManyToMany(type => Channel)
    @JoinTable()
    channels: Channel[];
    @OneToMany(type => Collection, collection => collection.featuredAsset)
    featuredInCollections?: Collection[];
    @OneToMany(type => ProductVariant, productVariant => productVariant.featuredAsset)
    featuredInVariants?: ProductVariant[];
    @OneToMany(type => Product, product => product.featuredAsset)
    featuredInProducts?: Product[];
    @Column(type => CustomAssetFields)
    customFields: CustomAssetFields;
}
- 
Extends: VendureEntity
- 
Implements: Taggable,ChannelAware,HasCustomFields
constructor
method
(input?: DeepPartial<Asset>) => Assetname
property
stringtype
property
AssetTypemimeType
property
stringwidth
property
numberheight
property
numberfileSize
property
numbersource
property
stringpreview
property
stringfocalPoint
property
{ x: number; y: number }tags
property
Tag[]channels
property
Channel[]featuredInCollections
property
featuredInVariants
property
featuredInProducts
property
Product[]customFields
property
CustomAssetFields