@dapplets/dapplet-extension
Version:
The Bridge to the Augmented Web.
42 lines (41 loc) • 1.76 kB
TypeScript
import { WidgetConfig } from '../../../common/state';
import Core from '../../core';
import { IContentAdapter } from '../../types';
import { DappletConfig, IWidgetBuilderConfig } from './types';
import { WidgetBuilder } from './widgets';
export interface IDynamicAdapter extends IContentAdapter {
configure(config: {
[contextName: string]: IWidgetBuilderConfig;
}, adapterName: string): void;
createWidgetFactory<T>(Widget: any): (config: {
[state: string]: T;
}) => (builder: WidgetBuilder, insPointName: string, order: number, contextNode: Element) => any;
resetConfig(config: DappletConfig, newConfig: DappletConfig, adapterName: string): {
$: (ctx: any, id: string) => any;
};
}
export declare class DynamicAdapter implements IDynamicAdapter {
private _core;
private observer;
private dappletConfigEnvelopes;
private contextBuilders;
private stateStorage;
private locator;
constructor(_core: Core);
attachConfig(config: DappletConfig, adapterName: string): {
$: (ctx: any, id: string) => any;
reset: (newConfig?: DappletConfig) => any;
};
detachConfig(config: DappletConfig): void;
resetConfig(config: DappletConfig, newConfig: DappletConfig | undefined, adapterName: string): {
$: (ctx: any, id: string) => any;
reset: (newConfig?: DappletConfig) => any;
};
configure(config: {
[contextName: string]: IWidgetBuilderConfig;
}, adapterName: string): void;
private updateObservers;
createWidgetFactory<T>(Widget: any): (config: WidgetConfig<T>) => (builder: WidgetBuilder, insPointName: string, order: number, contextNode: Element) => any;
deactivate(): void;
private _getDappletConfigsForAdapter;
}