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() @Column() name: string;
@Column('varchar') @Column('varchar') type: AssetType;
@Column() @Column() mimeType: string;
@Column({ default: 0 }) @Column({ default: 0 }) width: number;
@Column({ default: 0 }) @Column({ default: 0 }) height: number;
@Column() @Column() fileSize: number;
@Column() @Column() source: string;
@Column() @Column() preview: string;
@Column('simple-json', { nullable: true }) @Column('simple-json', { nullable: true })
focalPoint?: { x: number; y: number };
@ManyToMany(type => Tag) @JoinTable() @ManyToMany(type => Tag)
@JoinTable()
tags: Tag[];
@ManyToMany(type => Channel) @JoinTable() @ManyToMany(type => Channel)
@JoinTable()
channels: Channel[];
@Column(type => CustomAssetFields) @Column(type => CustomAssetFields)
customFields: CustomAssetFields;
}
Extends
Implements
- Taggable
- ChannelAware
- HasCustomFields
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 }
tags
property
type:
Tag[]
channels
property
type:
Channel[]
customFields
property
type:
CustomAssetFields