UNPKG

routeros-api

Version:

Mikrotik Routerboard RouterOS API for NodeJS

57 lines (56 loc) 1.39 kB
/// <reference types="node" /> import { RosApiMenu } from "./RosApiMenu"; import { EventEmitter } from "events"; import { IRosOptions } from "./IRosOptions"; export declare class RouterOSClient extends EventEmitter { /** * Options of the connection */ private options; /** * The raw API which this class wraps around */ private rosApi; /** * Creates a client with the options provided, * so you are able to connect and input actions * * @param options Connection options */ constructor(options: IRosOptions); /** * If it is connected or not */ isConnected(): boolean; /** * Connects to the routerboard with the options provided */ connect(): Promise<RosApiMenu>; /** * Change current connection options * but it doesn't reconnect * * @param options Connection options */ setOptions(options: any): RouterOSClient; /** * Get an instance of the API to handle operations */ api(): RosApiMenu; /** * Disconnect from the routerboard */ disconnect(): Promise<RouterOSClient>; /** * Alias to disconnect */ close(): Promise<RouterOSClient>; /** * Alias to disconnect */ end(): Promise<RouterOSClient>; /** * Return the options provided */ getOptions(): IRosOptions; }