easy-peasy-classes
Version:
easy-peasy enhanced with classes, full typescript type safety, nested store stuctures and model inheritance
54 lines (53 loc) • 1.57 kB
TypeScript
interface IModelMetadata {
ctor: any;
}
interface IPropertyMetadata {
proto: any;
fieldName: any;
initialValue?: any;
}
declare type IChildMetadata = IPropertyMetadata;
interface IMethodMetadata {
proto: any;
fieldName: any;
handler: any;
}
interface IActionMetadata extends IMethodMetadata {
}
interface IComputedMetadata extends IMethodMetadata {
}
interface IThunkMetadata extends IMethodMetadata {
}
interface IListenerMetadata extends IMethodMetadata {
actionFn: any;
}
export declare class MetadataStorage {
private def;
private properties;
private children;
private actions;
private computed;
private listeners;
private thunks;
private instances;
_isHoldingChildren: boolean;
addModelMetadata(definition: IModelMetadata): void;
addPropertyMetadata(definition: IPropertyMetadata): void;
addChildMetadata(definition: IChildMetadata): void;
addActionMetadata(definition: IActionMetadata): void;
addComputedMetadata(definition: IComputedMetadata): void;
addListenerMetadata(definition: IListenerMetadata): void;
addThunkMetadata(definition: IThunkMetadata): void;
buildModel(): any;
}
declare class MetadataStoragePool {
pool: Array<MetadataStorage>;
currentIndex: number;
constructor();
next(): void;
getCurrentIndex(): number;
getCurrentStorage(): MetadataStorage;
getStorageByIndex(index: any): MetadataStorage;
}
export declare const metaDataStoragePool: MetadataStoragePool;
export {};