Installation
npm install --save @types/node-turn
Summary
This package contains type definitions for node-turn (https://github.com/Atlantis-Software/node-turn#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-turn.
index.d.ts
/// <reference types="node" />
import { EventEmitter } from "events";
type TurnDebugLevel = "OFF" | "FATAL" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE" | "ALL";
type TurnAuthMech = "none" | "short-term" | "long-term";
interface TurnCredentials {
[user: string]: string;
}
interface TurnProps {
listeningPort: number;
listeningIps: string[];
relayIps: string[];
externalIps: string | { [localIp: string]: string } | null;
minPort: number;
maxPort: number;
authMech: TurnAuthMech;
realm: string;
maxAllocateLifetime: number;
defaultAllocatetLifetime: number;
debugLevel: TurnDebugLevel;
log: (...args: any[]) => void;
debug: (debugLevel: TurnDebugLevel, message: string) => void;
}
interface TurnOptions extends Partial<TurnProps> {
credentials?: TurnCredentials;
}
interface TurnServer extends Readonly<TurnProps> {}
declare class TurnServer extends EventEmitter {
constructor(options?: TurnOptions);
start(): void;
stop(): void;
addUser(username: string, password: string): void;
removeUser(username: string): void;
readonly software: string;
readonly staticCredentials: TurnCredentials;
}
declare namespace TurnServer {
export { TurnAuthMech, TurnCredentials, TurnDebugLevel, TurnOptions, TurnProps };
}
export = TurnServer;
Additional Details
- Last updated: Tue, 07 Nov 2023 09:09:39 GMT
- Dependencies: @types/node
Credits
These definitions were written by Johannes Garz.