import { Signer } from 'ethers'; import type { JsonRpcProvider } from '@ethersproject/providers'; import { PluginInstance } from './Fct'; import { ChainId, ParamsSchemas } from './generics'; import { Flow } from './plugins/corelibTypes'; type Options = { flow?: Flow; jumpOnSuccess?: NodeId; jumpOnFail?: NodeId; }; type NodeId = string; export type Subscriptions = { fromNodeId: string; fromParamKey: string; toParamKey: string; type?: 'INPUT' | 'OUTPUT'; }[]; type PluginNodeDate = { nodeId: NodeId; from: string; options: Options; subscriptions?: Subscriptions; outputVariables?: Subscriptions; }; type PluginNode = { plugin: PluginInstance; } & PluginNodeDate; type PluginNodeJSON = { plugin: ReturnType; } & PluginNodeDate; export type PluginsModuleJSON = { type: 'MODULE'; method: 'MODULE'; startNodeId: string; name: string; data: { [key: string]: PluginNodeJSON; }; } & string; type Plugins = Map; type UpdateEvent = { nodeId: string; value?: ParamsSchemas['value']; key?: string; estimatedValue?: ParamsSchemas['value'] | number; }; type Callback = (p?: UpdateEvent, error?: { nodeId: string; error: string; }) => void; export declare class PluginsModule { private _chainId; private _plugins; private _startNodeIn?; private _error?; constructor({ chainId }: { chainId: ChainId; }); onChange: undefined | Callback; get type(): string; get protocol(): string; get chainId(): ChainId; get plugins(): Plugins; get error(): string | undefined; getOutputValues: (testProvider: { provider: { provider: InstanceType; signer: InstanceType; }; execute?: boolean; }) => Promise<{}>; get pluginsList(): PluginNode[]; createNewModule(initNodeId?: string): void; getInterface({ chainId, initModuleJSON, startNodeId, }: { chainId: ChainId; startNodeId?: string; initModuleJSON?: PluginsModuleJSON; }): { instance: import("./createPlugin").NewPluginType>; moduleInstance: PluginsModule; } | undefined; get input(): { paramsList: { param: ParamsSchemas; key: string; nodeId: string; id: string; }[]; }; get output(): { paramsList: { param: ParamsSchemas; key: string; nodeId: string; id: string; }[]; }; get inputs(): { param: ParamsSchemas; key: string; nodeId: string; id: string; }[]; get outputs(): { param: ParamsSchemas; key: string; nodeId: string; id: string; }[]; get startNodeIn(): string | undefined; setStartNodeIn(nodeId: NodeId): void; clear: () => void; create: () => void; upsertPlugin: (pluginNodeJSON: PluginNodeJSON) => Plugins | undefined; setPlugin: (nodeId: string, plugin: PluginNode) => Plugins; getPlugin: (nodeId: string) => PluginNode | undefined; removePlugin: (nodeId: string) => boolean; private _name; private generateName; get name(): string; set name(name: string); toJSON: () => PluginsModuleJSON; fromJSONWithMeta: (moduleJson: PluginsModuleJSON) => boolean; jsonToPlugin: (plugin: PluginNodeJSON['plugin'], chainId: ChainId) => import("./createPlugin").NewPluginType> | undefined; subscribe: ({ callback, id }: { callback: (p: UpdateEvent) => void; id: string; }) => void; unsubscribe: ({ id }: { id: string; }) => void; private observers; private subscribeOnUpdate; updateVariablesSubsciptions: () => void; private onUpdate; } export {};