UNPKG

@integromat/proto

Version:
46 lines 1.72 kB
import { EventEmitter } from 'events'; import { CommonData, EnvironmentData, InternalData, Parameters } from './base'; import { DoneCallback, DoneWithResultCallback } from './types'; /** * Base class for RPC. * * @property {Object} common Collection of common parameters. Read only. * @property {Object} environment Collection of environment parameters. Read only. * @property {Object} parameters Collection of config parameters. Read only. */ export declare class IMTRPC extends EventEmitter { common: CommonData | null; parameters: Parameters | null; environment: EnvironmentData | null; internal: InternalData | null; constructor(); /** * Initializes the RPC. Function that overrides should always call super. * * @callback done Callback to call when RPC is initialized. * @param {Error} err Error on error, otherwise null. */ initialize(done: DoneCallback): void; /** * Finalizes the RPC. Function that overrides should always call super. * * @callback done Callback to call when RPC is finalized. * @param {Error} err Error on error, otherwise null. */ finalize(done: DoneCallback): void; /** * Executes the RPC. * * @callback done Callback to call when RPC is done. * @param {Error} err Error on error, otherwise null. * @param {Object} response RPC response. */ execute(done: DoneWithResultCallback): void; /** * Print debug message to Scenario info log. Debug messages are only visible to system administrators. * * @param {...*} message Message to be printed to Scenario info log. */ debug(): void; } //# sourceMappingURL=rpc.d.ts.map