@dapplets/dapplet-extension
Version:
The Bridge to the Augmented Web.
21 lines (20 loc) • 514 B
TypeScript
export type WidgetConfig<T> = {
[key: string]: T;
} & {
id?: string;
initial?: string;
};
export declare class State<T> {
private config;
readonly ctx: any;
readonly INITIAL_STATE: any;
private _currentStateName;
state: T;
private _cache;
changedHandler: (newValues: any) => void;
id: string;
constructor(config: WidgetConfig<T>, ctx: any);
setState(stateName: string, resetState?: boolean): any;
getStateValues(): T;
private createNewStateFromConfig;
}