export declare enum Code { ERROR_CODE_NOT_SET = 268959743, INTERFACE_NOT_FOUND = 268632064, METHOD_NOT_FOUND = 268894210, REQUEST_INVALID = 268894209, REQUEST_INVALID_PARAM = 268894211, SESSION_INVALID = 28763750, USER_NOT_VALID = 268632070, PASSWORD_NOT_VALID = 268632071, IN_BLACK_LIST = 268632073, HAS_BEEN_USED = 268632074, HAS_BEEN_LOCKED = 268632081, BUSY = 268632075 } export type TRPC = object; export type TResponse = { id: number; error?: { code: number; message: string; }; params: T; result: R; session: string; }; export type TOptions = { protocol?: "http" | "https"; rpcURI?: string; }; /** * Base RPC class that can send RPC and has the Global module. */ export declare class RPCBase { readonly baseURL: string; readonly rpcURI: string; _id: number; _session: string; _username: string; Global: { firstLogin: (username: string, params?: object | undefined, clientType?: string | undefined) => Promise>; secondLogin: (username: string, password: string, params?: object | undefined, clientType?: string | undefined) => Promise>; logout: () => Promise>; keepAlive: (timeout?: number | undefined) => Promise; getCurrentTime: () => Promise; setCurrentTime: (time: string, tolerance: unknown) => Promise>; }; /** * @param address ip or ip:port */ constructor(address: string, options?: TOptions); _nextID(): number; _setSession(username: string, session: string): void; getSessionUsername(): string; getSession(): string; /** * Generate a RPC. * @param method The method to call on the remote device. * @param params The arguments to pass to the method. * @param options Extra options for the RPC. * @returns */ rpc(method: string, params?: object | null, options?: object): TRPC; /** * Send RPC without inspecting response for errors. */ sendRPCRaw(rpc: TRPC, uri?: string | null): Promise, any>>; /** * Send RPC. */ sendRPC(rpc: TRPC, uri?: string | null): Promise>; /** * Generate and send a single or multiple RPC. * @param methodOrArray Method or an array of methods. * @param paramsOrArray Parameter or an array of parameters. */ send(methodOrArray: string[] | string, paramsOrArray?: object[] | object | null, options?: object, uri?: string): Promise>; /** * Create instance that is used for other send calls. * @param method setup method. * @param useCache Use cached response if available. */ sendSetup(method: string, useCache?: boolean): (params?: object, options?: object) => Promise>; } //# sourceMappingURL=index.d.ts.map