UNPKG

@adpt/core

Version:
56 lines 2.22 kB
import { MessageLogger } from "@adpt/utils"; import { DomDiff } from "../dom_utils"; import { AdaptElementOrNull } from "../jsx"; import { Deployment } from "../server/deployment"; import { ActComplete, Action, ActOptions, ExecutionPlan, Plugin, PluginConfig, PluginInstances, PluginManager, PluginManagerStartOptions, PluginModules, PluginObservations, PluginRegistration } from "./deploy_types"; export declare function createPluginManager(modules: PluginModules): PluginManager; /** * For testing only. */ export declare function isPluginManagerImpl(val: any): val is PluginManagerImpl; declare enum PluginManagerState { Initial = "Initial", Starting = "Starting", PreObserve = "PreObserve", Observing = "Observing", PreAnalyze = "PreAnalyze", Analyzing = "Analyzing", PreAct = "PreAct", Acting = "Acting", PreFinish = "PreFinish", Finishing = "Finishing" } export declare function checkPrimitiveActions(diff: DomDiff, actions: Action[]): void; interface AnyObservation { [name: string]: any; } declare class PluginManagerImpl implements PluginManager { plugins: PluginInstances; modules: PluginModules; deployment?: Deployment; dom?: AdaptElementOrNull; prevDom?: AdaptElementOrNull; diff?: DomDiff; parallelActions: Action[]; logger?: MessageLogger; state: PluginManagerState; observations: AnyObservation; constructor(config: PluginConfig); transitionTo(next: PluginManagerState): void; start(prevDom: AdaptElementOrNull, dom: AdaptElementOrNull, options: PluginManagerStartOptions): Promise<void>; observe(): Promise<PluginObservations>; analyze(): Action[]; addActions(actions: Action[], plugin: Plugin): void; /** * Creates an ExecutionPlan. Solely intended for unit testing. * @internal */ _createExecutionPlan(options: ActOptions): Promise<ExecutionPlan>; act(options: ActOptions): Promise<ActComplete>; finish(): Promise<void>; private readonly actions; } export declare function registerPlugin(plugin: PluginRegistration): void; export declare function createPluginConfig(modules: PluginModules): PluginConfig; export {}; //# sourceMappingURL=plugin_support.d.ts.map