import type { NodeClass } from "node-opcua-data-model"; import type { NodeId } from "node-opcua-nodeid"; import type { CallbackT } from "node-opcua-status-code"; import type { Argument, CallMethodResultOptions } from "node-opcua-types"; import type { Variant, VariantLike } from "node-opcua-variant"; import type { BaseNode, BaseNodeEvents, ListenerSignature } from "./base_node.js"; import type { CloneExtraInfo, CloneFilter, CloneOptions } from "./clone_options.js"; import type { ISessionContext } from "./session_context.js"; import type { UAObject } from "./ua_object.js"; import type { UAObjectType } from "./ua_object_type.js"; import type { UAVariable } from "./ua_variable.js"; export declare type MethodFunctorC = ( this: UAMethod, inputArguments: Variant[], context: ISessionContext, callback: CallbackT ) => void; export declare type MethodFunctorA = ( this: UAMethod, inputArguments: Variant[], context: ISessionContext ) => Promise; export type MethodFunctor = MethodFunctorC | MethodFunctorA; export interface UAMethodEvents extends BaseNodeEvents { method_executed: (inputArguments: Variant[], context: ISessionContext, callMethodResult: CallMethodResultOptions) => void; afterCall: (context: ISessionContext, inputArguments: Variant[], callMethodResult: CallMethodResultOptions) => void; } export interface UAMethod = UAMethodEvents> extends BaseNode { readonly nodeClass: NodeClass.Method; readonly typeDefinition: NodeId; readonly typeDefinitionObj: UAObjectType; readonly parent: UAObject | null; readonly inputArguments?: UAVariable; readonly outputArguments?: UAVariable; readonly methodDeclarationId: NodeId; /** * */ _getExecutableFlag?: (sessionContext: ISessionContext | null) => boolean; bindMethod(methodFunction: MethodFunctor): void; getExecutableFlag(context: ISessionContext): boolean; getInputArguments(): Argument[]; getOutputArguments(): Argument[]; /** */ execute( object: UAObject | UAObjectType | null, inputArguments: VariantLike[] | null, context: ISessionContext, callback: CallbackT ): void; execute( object: UAObject | UAObjectType | null, inputArguments: null | VariantLike[], context: ISessionContext ): Promise; clone(options: CloneOptions, optionalFilter?: CloneFilter, extraInfo?: CloneExtraInfo): UAMethod; isBound(): boolean; }