You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is guessed using ChatGPT, and fix some any by me.
/* eslint-disable unicorn/prevent-abbreviations *//* eslint-disable unicorn/prefer-event-target */declare module 'noflo-runtime-base'{// noflo-runtime-base/blob/master/src/protocol/Component.jsimport{EventEmitter}from'events';import{ComponentLoader}from'noflo';import{Graph}from'fbp-graph';interfacePortDef{addressable?: boolean;default?: any;description?: string;id: string;required?: boolean;schema?: string;type: string;values?: any[];}interfaceInstance{description: string;getIcon?: ()=>string;inPorts: Record<string,any>;isSubgraph: ()=>boolean;outPorts: Record<string,any>;}interfaceComponentProtocolextendsEventEmitter{getLoader: (baseDir: string,options?: Record<string,any>)=>ComponentLoader;getSource: (payload: any,context: any)=>void;listComponents: (payload: any,context: any)=>void;loaders: Record<string,ComponentLoader>;processComponent: (loader: ComponentLoader,component: string,context: any)=>Promise<any>;processPort: (portName: string,port: any)=>PortDef;receive: (topic: string,payload: any,context: any)=>any;registerGraph: (id: string,graph: Graph,context: any)=>void;send: (topic: string,payload: any,context: any)=>any;sendComponent: (component: string,instance: Instance,context: any)=>void;setSource: (payload: any,context: any)=>void;transport: BaseTransport;}constComponentProtocol: {new(transport: BaseTransport): ComponentProtocol;initClass: ()=>void;};// noflo-runtime-base/blob/master/src/protocol/Graph.jsimport{EventEmitter}from'events';exportinterfaceNode{component?: string;id: string;metadata?: any;}exportinterfaceEdge{metadata?: any;src: {index?: number;node: string;port: string;};tgt: {index?: number;node: string;port: string;};}exportinterfaceInitial{metadata?: any;src: {data: any;};tgt: {index?: number;node: string;port: string;};}exportinterfaceGroup{metadata?: any;name: string;nodes: string[];}exportinterfacePort{metadata?: any;port: string;process: string;}exportinterfacePayload{description?: string;from?: string;graph: string;icon?: string;id?: string;library?: string;main?: boolean;metadata?: any;name?: string;node?: string;nodes?: string[];port?: string;public?: string;}enumTopic{AddEdge='addedge',AddGroup='addgroup',AddInitial='addinitial',AddInport='addinport',AddNode='addnode',AddOutport='addoutport',ChangeEdge='changeedge',ChangeGroup='changegroup',ChangeNode='changenode',Clear='clear',Error='error',RemoveEdge='removeedge',RemoveGroup='removegroup',RemoveInitial='removeinitial',RemoveInport='removeinport',RemoveNode='removenode',RemoveOutport='removeoutport',RenameGroup='renamegroup',RenameInport='renameinport',RenameNode='renamenode',RenameOutport='renameoutport',}classGraphProtocolextendsEventEmitter{transport: BaseTransport;graphs: Record<string,Graph>;constructor(transport: BaseTransport);send(topic: string,payload: Payload,context: Context): any;sendAll(topic: string,payload: Payload): any;receive(topic: GraphProtocolCommands,payload: Payload,context: Context): void;resolveGraph(payload: Payload,context: Context): any;getLoader(baseDirectory: string): any;sendGraph(id: string,graph: Graph,context: Context): any;initGraph(payload: Payload,context: Context): void;registerGraph(id: string,graph: Graph,context?: Context,propagate?: boolean): Promise<any>;subscribeGraph(id: string,graph: Graph,context: Context): void;addNode(graph: Graph,node: Node,context: Context): void;removeNode(graph: Graph,payload: Payload,context: Context): void;renameNode(graph: Graph,payload: Payload,context: Context): void;changeNode(graph: Graph,payload: Payload,context: Context): void;addEdge(graph: Graph,edge: Edge,context: Context): void;removeEdge(graph: Graph,edge: Edge,context: Context): void;changeEdge(graph: Graph,edge: Edge,context: Context): void;addInitial(graph: Graph,payload: Initial,context: Context): void;removeInitial(graph: Graph,payload: Initial,context: Context): void;addInport(graph: Graph,payload: Payload,context: Context): void;removeInport(graph: Graph,payload: Payload,context: Context): void;renameInport(graph: Graph,payload: Payload,context: Context): void;addOutport(graph: Graph,payload: Payload,context: Context): void;removeOutport(graph: Graph,payload: Payload,context: Context): void;renameOutport(graph: Graph,payload: Payload,context: Context): void;addGroup(graph: Graph,payload: Group,context: Context): void;removeGroup(graph: Graph,payload: Payload,context: Context): void;renameGroup(graph: Graph,payload: Payload,context: Context): void;changeGroup(graph: Graph,payload: Group,context: Context): void;}// noflo-runtime-base/blob/master/src/protocol/Runtime.jsdeclarefunctionsendToInport(port: any,event: string,payload: any): void;declarefunctionfindPort(network: Network|null,name: string,inPort: boolean): any|null;interfacePortPayload{addressable: boolean;description: string|undefined;id: string;required: boolean;type: string;}declarefunctionportToPayload(pub: string,internal: any,network: Network|null,inPort: boolean): PortPayload;declarefunctionportsPayload(name: string,network: Network|null): any;typeOutputSockets=Record<string,InternalSocket>;interfaceRuntimeProtocolOptions{capabilities?: string[];id?: string;label?: string;namespace?: string;repository?: string;repositoryVersion?: string;}typeRuntimeProtocolConstructor=new(transport: BaseTransport)=>RuntimeProtocol;exportinterfaceRuntimeProtocolextendsEventEmitter{getRuntime(request: any,context: any): any[];getRuntimeDefinition(): RuntimeProtocolOptions;mainGraph: string|null;outputSockets: OutputSockets;receive(topic: string,payload: any,context: any): any;registerNetwork(name: string,network: Network): void;send(topic: string,payload: any,context: any): any;sendAll(topic: string,payload: any): any;sendError(err: Error,context: any): any;sendPacket(payload: any): Promise<void>;sendPorts(name: string,network: Network|null,context: any): any;setMainGraph(id: string): void;subscribeExportedPorts(name: string,network: Network,add: boolean): void;subscribeOutPorts(name: string,network: Network,add?: boolean): void;subscribeOutdata(graphName: string,network: Network,add: boolean): void;transport: BaseTransport;}/// noflo-runtime-base/blob/master/src/protocol/Network.jsinterfaceSocketEvent{data: any;datatype?: string;group?: string;id: string;// Replace with a more accurate type if knownmetadata?: any;schema?: string;socket: any;// Replace with a more accurate type if knownsubgraph?: string;// Replace with a more accurate type if known}interfaceEdge{src: any;// Replace with a more accurate type if knowntgt: any;// Replace with a more accurate type if known}interfaceConnection{port: string;process: {id: string};}interfaceNetwork{// Replace with a more accurate type if knownisRunning: ()=>boolean;isStarted: ()=>boolean;on: (event: string,callback: (event: any)=>void)=>void;setDebug: (enable: boolean)=>void;start: ()=>Promise<any>;// Replace with a more accurate type if knownstop: ()=>Promise<any>;// Replace with a more accurate type if known}exportclassNetworkProtocolextendsEventEmitter{constructor(transport: BaseTransport);send: (topic: string,payload: any,context: any)=>void;// Replace with a more accurate type if knownsendAll: (topic: string,payload: any)=>void;// Replace with a more accurate type if knownreceive: (topic: string,payload: any,context: any)=>void;// Replace with a more accurate type if knownresolveGraph: (payload: any,context: any)=>any;// Replace with a more accurate type if knowngetNetwork: (graphName: string)=>Network|null;updateEdgesFilter: (graph: Graph,payload: any,context: any)=>void;// Replace with a more accurate type if knowneventFiltered: (graph: string,event: SocketEvent)=>boolean;initNetwork: (graph: Graph,graphName: string,context: any)=>Promise<Network>;// Replace with a more accurate type if knownsubscribeNetwork: (network: Network,graphName: string,context: any)=>void;// Replace with a more accurate type if knownstartNetwork: (graph: Graph,payload: any,context: any)=>void;// Replace with a more accurate type if knownstopNetwork: (graph: Graph,payload: any,context: any)=>void;// Replace with a more accurate type if knowndebugNetwork: (graph: Graph,payload: any,context: any)=>void;// Replace with a more accurate type if knowngetStatus: (graph: Graph,payload: any,context: any)=>void;// Replace with a more accurate type if known}// noflo-runtime-base/blob/master/src/protocol/Trace.jstypeTopicType='start'|'stop'|'dump'|'clear'|string;interfacePayload{buffersize?: number;flowtrace?: any;graph: string;type?: string;}typeContext=Record<string,any>;interfaceNetwork{getNetwork(graph: string): Network|null;setFlowtrace(flowtrace: Flowtrace|null,graphName?: string,flag?: boolean): any;}interfaceRuntime{getRuntimeDefinition(): any;network: Network;}exportclassTraceProtocol{transport: BaseTransport;traces: Record<string,Flowtrace>;constructor(transport: BaseTransport);send(topic: TopicType,payload: Payload,context: Context): Promise<void>;sendAll(topic: TopicType,payload: Payload): Promise<void>;receive(topic: TopicType,payload: Payload,context: Context): void;resolveGraph(payload: Payload,context: Context): Flowtrace|null;startTrace(graphName: string,network: Network,buffersize: number): Flowtrace;start(payload: Payload,context: Context): void;stop(payload: Payload,context: Context): void;dump(payload: Payload,context: Context): void;clear(payload: Payload,context: Context): void;}// noflo-runtime-base/blob/master/src/Base.jsexportinterfaceBaseTransportOptions{capabilities?: string[];captureOutput?: boolean;defaultGraph?: Graph;defaultPermissions?: string[];namespace?: string;permissions?: Record<string,string[]>;}enumProtocol{Component='component',Graph='graph',Network='network',Runtime='runtime',Trace='trace',}enumCanInputTopic{debug='debug',edges='edges',getruntime='getruntime',getsource='getsource',getstatus='getstatus',list='list',packet='packet',source='source',start='start',stop='stop',}exportdefaultclassBaseTransportextendsEventEmitter{constructor(options: BaseTransportOptions);version: string;component: Component;graph: Graph;network: Network;runtime: Runtime;trace: Trace;context: any;options: BaseTransportOptions;/** * Generate a name for the main graph */getGraphName(graph: Graph): string;/** * Check if a given user is authorized for a given capability @param [Array] Capabilities to check @param [String] Secret provided by user */canDo(capability: string|string[],secret: string): boolean;/** * Check if a given user is authorized to send a given message */canInput(protocol: Protocol,topic: CanInputTopic,secret: string): boolean;/** * Get enabled capabilities for a user @param [String] Secret provided by user */getPermitted(secret: string): string[];/** * Send a message back to the user via the transport protocol. Each transport implementation should provide their own implementation of this method. The context is usually the context originally received from the transport with the request. This could be an iframe origin or a specific WebSocket connection. @param [String] Name of the protocol @param [String] Topic of the message @param [Object] Message payload @param [Object] Message context, dependent on the transport */send(protocol: string,topic: string,payload: any,context?: any): void;/* *all users* via the transport protocol The transport should verify that the recipients are authorized to receive the message by using the `canDo` method. Like send() only it sends to all. @param [String] Name of the protocol @param [String] Topic of the message @param [Object] Message payload @param [Object] Message context, dependent on the transport */sendAll(protocol?: string,topic?: string,payload?: any,context?: any): void;/** * This is the entry-point to actual protocol handlers. When receiving a message, the runtime should call this to make the requested actions happen The context is originally received from the transport. This could be an iframe origin or a specific WebSocket connection. The context will be utilized when sending messages back to the requester. @param [String] Name of the protocol @param [String] Topic of the message @param [Object] Message payload @param [Object] Message context, dependent on the transport */receive(protocol: string,topic: string,payload?: any,context?: any): void;}exportfunctiondirect(options: object): void;}
The text was updated successfully, but these errors were encountered:
This is guessed using ChatGPT, and fix some any by me.
The text was updated successfully, but these errors were encountered: