import { NodeRfcEnvironment } from "./noderfc-bindings"; import { RfcConnectionParameters, RfcLoggingLevel, RFC_RC, RFC_UNIT_STATE } from "./sapnwrfc"; export type RfcSecurityAttributes = { abapFunctionName: string[30]; sysId: string; client: string[3]; user: string; progName: string; sncName: string; ssoTicket: string; sncAclKey: string; sncAclKeyLength: number; }; export type RfcAuthHandlerResponse = undefined | RFC_RC.RFC_OK | boolean | string; export type RfcAuthHandler = (securityAttributes: RfcSecurityAttributes, ...[unknown]: [any]) => RfcAuthHandlerResponse | Promise; export type RfcUnitIdentifier = { queued: boolean; id: string; }; export type RfcBgRfcHandler = (connHandle: number, unitIdentifier: RfcUnitIdentifier) => RFC_RC | Promise; export type RfcBgRfcHandlerGetState = (connHandle: number, unitIdentifier: RfcUnitIdentifier) => RFC_UNIT_STATE | Promise; export type RfcBgRfcHandlers = { check?: RfcBgRfcHandler; commit?: RfcBgRfcHandler; rollback?: RfcBgRfcHandler; confirm?: RfcBgRfcHandler; getState?: RfcBgRfcHandlerGetState; }; export type RfcServerOptions = { logLevel?: RfcLoggingLevel; port?: number; authHandler?: RfcAuthHandler; bgRfcHandlers?: RfcBgRfcHandlers; }; export type RfcServerConfiguration = { serverConnection: RfcConnectionParameters; clientConnection: RfcConnectionParameters; serverOptions?: RfcServerOptions; }; export interface RfcServerBinding { new (serverConfiguration: RfcServerConfiguration): RfcServerBinding; (serverConfiguration: RfcServerConfiguration): RfcServerBinding; _id: number; _alive: boolean; _server_conn_handle: number; _client_conn_handle: number; start(callback?: Function): void; stop(callback?: Function): void; addFunction(abapFunctionName: string, jsFunction: Function, callback?: Function): void; removeFunction(abapFunctionName: string, callback?: Function): void; getFunctionDescription(rfmName: string, callback?: Function): void; } export declare class Server { private __server; constructor(serverConfiguration: RfcServerConfiguration); start(callback?: Function): void | Promise; stop(callback?: Function): void | Promise; addFunction(abapFunctionName: string, jsFunction: Function, callback?: Function): void | Promise; removeFunction(abapFunctionName: string, callback?: Function): void | Promise; getFunctionDescription(rfmName: string, callback?: Function): void | Promise; static get environment(): NodeRfcEnvironment; get environment(): NodeRfcEnvironment; get binding(): RfcServerBinding; get id(): number; get alive(): boolean; get server_connection(): number; get client_connection(): number; }