@kontent-ai/delivery-sdk
Version:
Official Kontent.AI Delivery API SDK
90 lines (74 loc) • 2.04 kB
text/typescript
import { Contracts } from '../contracts';
import { IContentItemSystemAttributes } from '../models/item-models';
import { ElementType } from './element-type';
export namespace ElementModels {
export interface IElementWrapper {
element: string;
system: IContentItemSystemAttributes;
rawElement: Contracts.IElementContract;
}
export interface IElement<TValue> {
/**
* Name of the element
*/
name: string;
/**
* Element type
*/
type: ElementType;
/**
* Element value
*/
value: TValue;
}
export interface AssetModel {
/**
* Name of the asset
*/
name: string;
/**
* Type of the asset
*/
type: string;
/**
* Size of the asset
*/
size: number;
/**
* Description of the asset
*/
description: string | null;
/**
* Url of the asset
*/
url: string;
/**
* Width in pixels for image assets
*/
width: number | null;
/**
* Height in pixels for image assets
*/
height: number | null;
/**
* Dictionary with rendition preset codenames as keys and respective renditions as values.
*/
renditions: { [renditionPresetCodename: string]: Rendition } | null;
}
export interface Rendition {
rendition_id: string;
preset_id: string;
width: number;
height: number;
query: string;
url: string;
}
export interface MultipleChoiceOption<TOptionCodename extends string = string> {
name: string;
codename: TOptionCodename;
}
export interface TaxonomyTerm<TTaxonomyCodename extends string = string> {
name: string;
codename: TTaxonomyCodename;
}
}