UNPKG

kentico-cloud-delivery

Version:

Official Kentico Cloud Delivery SDK

177 lines (176 loc) 5.49 kB
import { FieldInterfaces } from './field-interfaces'; import { FieldModels } from './field-models'; import { FieldType } from './field-type'; import { Link } from '..'; export declare namespace Fields { class TextField implements FieldInterfaces.IField { name: string; value: any; /** * Text stored in the field */ text: string; /** * Type of the field */ type: FieldType; /** * Represents text field of Kentico Cloud item * @constructor * @param {string} name - Name of the field * @param {string} value - Value of the field */ constructor(name: string, value: any); } class MultipleChoiceField implements FieldInterfaces.IField { name: string; value: any; /** * Multiple choice options */ options: FieldModels.MultipleChoiceOption[]; /** * Type of the field */ type: FieldType; /** * Represents multiple choice field of Kentico Cloud item * @constructor * @param {string} name - Name of the field * @param {string} value - Value of the field */ constructor(name: string, value: any); } class DateTimeField implements FieldInterfaces.IField { name: string; value: any; /** * Date time value */ datetime: Date; /** * Type of the field */ type: FieldType; /** * Represents date time field of Kentico Cloud item * @constructor * @param {string} name - Name of the field * @param {string} value - Value of the field */ constructor(name: string, value: any); } class RichTextField implements FieldInterfaces.IField { name: string; value: any; /** * Function that is responsible for getting resolved HTML of the field */ private resolveHtml; /** * Resolved html in field - store here once the html was resolved to avoid resolving it multiple times */ private resolvedHtml; /** * Type of the field */ type: FieldType; /** * Links */ links: Link[]; /** * Represents rich text field of Kentico Cloud item * @constructor * @param {string} name - Name of the field * @param {string} value - Value of the field * @param {() => string} resolveHtml - Function that resolves HTML * @param {Link[]} links - Links for this rich text field */ constructor(name: string, value: any, data: { resolveHtml: () => string; links: Link[]; }); getHtml(): string; } class NumberField implements FieldInterfaces.IField { name: string; value: any; /** * Type of the field */ type: FieldType; /** * Number value of this field */ number: number; /** * Represents number field of Kentico Cloud item * @constructor * @param {string} name - Name of the field * @param {string} value - Value of the field */ constructor(name: string, value: any); } class AssetsField implements FieldInterfaces.IField { name: string; value: any; /** * Type of the field */ type: FieldType; /** * List of assets used in this field */ assets: FieldModels.AssetModel[]; /** * Represents asset field of Kentico Cloud item * @constructor * @param {string} name - Name of the field * @param {any} value - Value of the field */ constructor(name: string, value: any); } class UrlSlugField implements FieldInterfaces.IField { name: string; value: string; private resolvedUrl?; private resolveUrl; /** * Type of the field */ type: FieldType; /** * Represents URL slug field of Kentico Cloud item * @constructor * @param {string} name - Name of the field * @param {string} value - Value of the field * @param {() => string | undefined} resolveUrl - Function to get url of the link */ constructor(name: string, value: string, data: { resolveUrl: () => string | undefined; }); getUrl(): string | undefined; } class TaxonomyField implements FieldInterfaces.IField { name: string; value: any; taxonomyGroup: string | undefined; /** * Type of the field */ type: FieldType; /** * List of assigned taxonomy terms */ taxonomyTerms: FieldModels.TaxonomyTerm[]; /** * Represents number field of Kentico Cloud item * @constructor * @param {string} name - Name of the field * @param {string} value - Value of the field * @param {string | undefined} taxonomyGroup - Codename of the taxonomy group */ constructor(name: string, value: any, taxonomyGroup: string | undefined); } }