@dapplets/dapplet-extension
Version:
The Bridge to the Augmented Web.
23 lines (22 loc) • 594 B
TypeScript
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;
}