@dazejs/framework
Version:
Daze.js - A powerful web framework for Node.js
53 lines (52 loc) • 1.68 kB
TypeScript
import { Application } from '../foundation/application';
import { ResourceInterface } from '../interfaces';
export declare const enum EResourceTypeList {
Item = "item",
Collection = "collection"
}
export declare class Resource {
app: Application;
key?: string;
data: any;
formatter: any;
metaFormatter: any;
meta: any;
type: EResourceTypeList;
constructor(formatter?: any);
item(data: any): this;
static item(data: any): Resource;
collection(data: any): this;
static collection(data: any): Resource;
setFormatter(formatter: any): this;
getFormatter(): any;
getKey(): string | undefined;
setKey(val: string): this;
getData(): any;
setData(val: any): this;
getMeta(): any;
setMeta(val: any): this;
getMetaFormatter(): any;
setMetaFormatter(val: any): this;
addMeta(name: string | object, value?: any): this;
withoutKey(): this;
transformResourceMeta(): any;
transformResourceData(): any;
useTransformer(formatter: any, data: any): any;
isResourceFormatter(formatter: {
new (): any;
} | ((...args: any[]) => any)): formatter is {
new (): any;
};
useStringFormatter(formatterName: string, data: any): any;
useResourceFormatter(formatter: {
new (): ResourceInterface;
}, data: any): any;
useCallbackFormatter(formatter: (...args: any[]) => any, data: any): any;
serializeResourceData(isOverstore?: boolean, hasMeta?: boolean): any;
serializeResourceMeta(): {
meta: any;
} | null;
transform(isOverstore?: boolean): any;
private recursiveFilter;
output(isOverstore?: boolean): any;
}