import { SecurityTetraplet } from './securityTetraplet'; export interface CallServiceResult { ret_code: number; result: string; } export declare abstract class Service { serviceId: string; /** * Calls the function from local client * @param fnName - name of the function to call * @param args - arguments to be passed to the function * @param tetraplets - array of arrays of tetraplets. First index corresponds to argument number. * If the argument is not an array the second array will always contain exactly one element. * If the argument is an array the second index will correspond to the index of element in argument's array */ abstract call(fnName: string, args: any[], tetraplets: SecurityTetraplet[][]): CallServiceResult; } /** * Creates one function for all function names. */ export declare class ServiceOne implements Service { serviceId: string; fn: (fnName: string, args: any[], tetraplets: SecurityTetraplet[][]) => object; constructor(serviceId: string, fn: (fnName: string, args: any[], tetraplets: SecurityTetraplet[][]) => object); /** * Calls the function from local client * @param fnName - name of the function to call * @param args - arguments to be passed to the function * @param tetraplets - array of arrays of tetraplets. First index corresponds to argument number. * If the argument is not an array the second array will always contain exactly one element. * If the argument is an array the second index will correspond to the index of element in argument's array */ call(fnName: string, args: any[], tetraplets: SecurityTetraplet[][]): CallServiceResult; } /** * Creates function per function name. Returns an error when call a name without registered function. */ export declare class ServiceMultiple implements Service { serviceId: string; functions: Map object>; constructor(serviceId: string); /** * Registers a callback function into Aquamarine * @param fnName - the function name to be registered * @param fn - callback function which will be called from Aquamarine. * The callback function has the following parameters: * args - arguments to be passed to the function * tetraplets - array of arrays of tetraplets. First index corresponds to argument number. * If the argument is not an array the second array will always contain exactly one element. * If the argument is an array the second index will correspond to the index of element in argument's array */ registerFunction(fnName: string, fn: (args: any[], tetraplets: SecurityTetraplet[][]) => object): void; /** * Calls the function from local client * @param fnName - name of the function to call * @param args - arguments to be passed to the function * @param tetraplets - array of arrays of tetraplets. First index corresponds to argument number. * If the argument is not an array the second array will always contain exactly one element. * If the argument is an array the second index will correspond to the index of element in argument's array */ call(fnName: string, args: any[], tetraplets: SecurityTetraplet[][]): CallServiceResult; } export declare function service(service_id: string, fn_name: string, args: string, tetraplets: string): CallServiceResult; //# sourceMappingURL=service.d.ts.map