Created
February 27, 2023 19:09
-
-
Save xorus/32d816d3fad433e6d4e6d18a9b489a01 to your computer and use it in GitHub Desktop.
pipobscure asterisk-manager type definitions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Type definitions for asterisk-manager.js v0.2.0 | |
| declare module 'asterisk-manager' { | |
| export type Response = Record<string, string>; | |
| export type Event = { event: string } & Response; | |
| export type Callback = (err: Response, response: Response) => void; | |
| export default class Asterisk extends require("events").EventEmitter { | |
| constructor( | |
| port: string, | |
| host: string, | |
| username: string, | |
| password: string, | |
| events: boolean | |
| ); | |
| public on(event: string, callback: (event: Response) => void): void; | |
| public on(event: 'managerevent', callback: (event: Event) => void): void; | |
| public connect(port: string, host: string, callback: () => void): void; | |
| public keepConnected(): void; | |
| public login(callback: Callback): void; | |
| public action(action: Record<string, string> & { action: string }, callback?: Callback): string; | |
| public disconnect(callback: () => void): void; | |
| public isConnected(): boolean; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment