UNPKG

amocrm-client

Version:
15 lines (14 loc) 1.01 kB
import { IResourceCollection, IResourceEntity, IResourceFactory } from "../../../interfaces/api"; import { ICustomFieldValue } from "../../../interfaces/custom_field"; import { TConstructor, TEntityConstructor } from "../../../types"; import { ResourceCollection } from "../../ResourceCollection"; interface IResourceEntityWithCustomFields<T extends IResourceFactory<IResourceEntity<T>>> extends IResourceEntity<T> { custom_fields_values: IResourceCollection<ICustomFieldValue>; } export interface IHasCustomFieldsEntity<T extends IResourceFactory<IResourceEntityWithCustomFields<T>>> extends IResourceEntityWithCustomFields<T> { cf(identity: number): ResourceCollection<ICustomFieldValue>; cf(identity: number): ICustomFieldValue | null; cf(identity: number, value: any): ICustomFieldValue; } export declare function hasCustomFields<T extends IResourceFactory<IHasCustomFieldsEntity<T>>>(Base: TEntityConstructor<T>): TConstructor<IResourceEntityWithCustomFields<T>>; export {};