UNPKG

@dapplets/dapplet-extension

Version:
23 lines (22 loc) 594 B
export type WidgetConfig<T> = { [key: string]: T; } & { id?: string; initial?: string; }; export declare class State<T> { private config; readonly ctx: any; private getTheme; readonly INITIAL_STATE: any; private _currentStateName; state: T; private _cache; changedHandler: (newValues: Partial<T>) => void; id: string; constructor(config: WidgetConfig<T>, ctx: any, getTheme: () => string); setState(stateName: string, resetState?: boolean): any; getStateValues(): T; private createNewStateFromConfig; private _themifyState; }