export interface IBaseModel { id?: string; owner?: { email: string; }; } export declare class Model { _template: any; _resolved: any; _valid: any; _meta: any; _options: any; _cid: any; _data: T; _promise: any; _permission: any; _Resource: any; constructor(model?: any, template?: any, options?: { autoId: boolean; autoOwner: any; }); _responseHook(data: any, action: any, options: any): any; _assignId(): this; _doRequest(action: any, data: any): any; _processResponse(promise: any, action: any): any; _action(action: any, data?: any): any; _initPromise(promise: any): any; _assignAutoOwner(): void; _stripDollars(data: any): any; _parseCollection(collectionString: any, data: any): any; _parseModel(modelString: any, data: any): any; /** * Merges current with source while preserving collection item references * * @param current * @param source * @returns {object} * @private */ _smartMerge(current: any, source: any): any; /** * Parses the data according to defaults definition. * Removes properties starting with "$" * * The parsed data is used for internal model representation. * * @param data * @param defaults * @returns {object} * @private */ _parse(data: any, defaults: any): any; /** * Formats the data according to filter definition. * The formatted data is used for server request payloads. * * @param data * @param filter * @returns {object} * @private */ _format(data: any, filter: any): any; static Resource: any; get id(): any; set id(value: any); get data(): T; set data(data: T); get promise(): any; get resolved(): any; get permission(): any; isNew(): boolean; isValid(): any; setPermission(Permission: any): this; setValidity(valid: any): void; format(): any; parse(data: any): any; fetch(id: any, ...rest: any[]): any; /** * Clones current model and returns a new instance. * New model will be considered new (isNew() === true). * * @params fetch {boolean} - if true will fetch model data from server before cloning * @returns {Model} - new model */ clone(fetch?: boolean, params?: any): any; save(): any; /** * Deletes the model on server. * Does nothing for new models. * * @returns {Promise} - promise resolved with self */ destroy(): any; meta(key: any, value?: any, once?: boolean): any; }