getTemplatePreviews
Mengambil semua objek template.
Deskripsi
Metode ini mengambil semua objek template dari API. Ini mengembalikan sebuah Promise yang menyelesaikan menjadi array dari objek template ITemplatesPreviewEntity.
TemplatePreviews.getTemplatePreviews(
langCode);
Skema parameter
Skema
langCode: string
Kode bahasa. Default: "en_US"
contoh: "en_US"
Contoh
Contoh minimal
const response = await TemplatePreviews.getTemplatePreviews();
Contoh dengan atribut
const response = await TemplatePreviews.getTemplatePreviews('en_US');
Contoh respons
[
{
"id": 3,
"title": "Preview Templates",
"proportions": {
"default": {
"horizontal": {
"width": 234,
"height": 324,
"alignmentType": "middleBottom"
},
"vertical": {
"width": 2,
"height": 3,
"alignmentType": "leftTop"
},
"square": {
"side": 360,
"alignmentType": "middleMiddle"
},
"default": true
}
},
"identifier": "preview-templates",
"version": 1,
"attributeValues": {},
"position": 1,
"isUsed": true
}
]
Skema respons
Skema: ITemplatesPreviewEntity[]
id: number
Pengidentifikasi unik dari posisi.
contoh: 3
title: string
Nama dari pratinjau template.
contoh: "Template Produk"
proportions: object
Objek yang berisi info tentang proporsi pratinjau template.
contoh:
{
"default": {
"horizontal": {
"width": 234,
"height": 324,
"alignmentType": "middleBottom"
},
"vertical": {
"width": 2,
"height": 3,
"alignmentType": "leftTop"
},
"square": {
"side": 3,
"alignmentType": "leftTop"
}
}
}
proportions.horizontal: IProportion | null
Proporsi horizontal dari pratinjau template.
contoh:
{
"width": 234,
"height": 324,
"alignmentType": "middleBottom"
}
proportions.horizontal.width: string | number | null
lebar dari pratinjau template.
contoh: 100
proportions.horizontal.height: string | number | null
tinggi dari pratinjau template.
contoh: 200
proportions.horizontal.alignmentType: string
tipe penyelarasan dari pratinjau template.
contoh: "center"
proportions.vertical: IProportion | null
Proporsi vertikal dari pratinjau template.
contoh:
{
"width": 2,
"height": 3,
"alignmentType": "leftTop"
}
proportions.square: ISquare
Proporsi persegi dari pratinjau template.
contoh:
{
"side": 3,
"alignmentType": "leftTop"
}
proportions.square.side: number | string
Panjang sisi dari pratinjau template persegi, bisa berupa angka atau string.
contoh: 100
proportions.square.alignmentType: string
Jenis penyelarasan dari pratinjau template persegi.
contoh: "center"
identifier: string
Pengidentifikasi tekstual untuk bidang catatan.
contoh: "preview-templates"
version: number
Nomor versi dari objek.
contoh: 1
attributeValues: IAttributeValues
Nilai atribut dari indeks.
contoh:
{}
position: number
Posisi dari objek.
contoh: 1
isUsed: boolean
Menunjukkan apakah pratinjau template digunakan.
contoh: true
attributeSetIdentifier: string | null
Pengidentifikasi teks yang digunakan untuk sekumpulan atribut.
contoh: "attribute_set_1"