export declare class Model { static default?: any; static template?: any; /** * @default __storage = a wrapper of global.localStorage, with handling Object */ static __storage: any; /** * implementNativeStorage * Implements chomex.Storage interface from localStorage/sessionStorage. * @param nativeStorage: Object which has window.Storage interface. * @return storage: class Object which has chomex.Storage interface. */ static implementNativeStorage(nativeStorage: any): any; static useStorage(storage?: any): void; static new(props?: {}): T; static create(dict?: any): T; /** * it returs all saved entities **as Models** */ static all(): { [id: string]: T; }; /** * list is an alias of `Model.filter(() => true);` * @return {array} of model instances */ static list(): T[]; static find(id: any): T; static filter(fn: (entry: T) => boolean): T[]; /** * Drops the database. */ static drop(): void; static nextID(all?: any): number | string; protected static schema: any; /** * Programmers can change the namespace of this model inside the storage. * This namespace is "prototype.name" by default. * You might need it to avoid problems caused by uglifying/mangling. * e.g) `"User"` namespace for `class User extends Model`. */ protected static __ns?: string; protected static _ns(): string; protected static timestampID(): number; protected static sequentialID(all: any): number; protected static timestampAndSequentialID(all?: {}): string; /** * it returns all saved entities **as Objects** */ private static _all; private static __nextID; errors: any[]; _id: string; /** * @interface storage * @method getItem(key: string): Object? * @method setItem(key: string, value: Object?) * @method removeItem(key: string) */ constructor(props?: {}, id?: string, ns?: string); save(): T; delete(): boolean; update(dict: any): T; error(err: any): any; decode(obj: any): T; encode(): any; _validate(): any; /** * fixes next properties with template * prefer properties this already has and next properties given. */ private _fixture; }