-
Notifications
You must be signed in to change notification settings - Fork 704
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { IncomingByeRequest, IncomingRequestMessage, ResponseOptions } from "../core"; | ||
/** | ||
* A request to end a {@link Session} (incoming BYE). | ||
* @public | ||
*/ | ||
export declare class Bye { | ||
private incomingByeRequest; | ||
/** @internal */ | ||
constructor(incomingByeRequest: IncomingByeRequest); | ||
/** Incoming BYE request message. */ | ||
get request(): IncomingRequestMessage; | ||
/** Accept the request. */ | ||
accept(options?: ResponseOptions): Promise<void>; | ||
/** Reject the request. */ | ||
reject(options?: ResponseOptions): Promise<void>; | ||
} | ||
//# sourceMappingURL=bye.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* A request to end a {@link Session} (incoming BYE). | ||
* @public | ||
*/ | ||
export class Bye { | ||
/** @internal */ | ||
constructor(incomingByeRequest) { | ||
this.incomingByeRequest = incomingByeRequest; | ||
} | ||
/** Incoming BYE request message. */ | ||
get request() { | ||
return this.incomingByeRequest.message; | ||
} | ||
/** Accept the request. */ | ||
accept(options) { | ||
this.incomingByeRequest.accept(options); | ||
return Promise.resolve(); | ||
} | ||
/** Reject the request. */ | ||
reject(options) { | ||
this.incomingByeRequest.reject(options); | ||
return Promise.resolve(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { IncomingInfoRequest } from "../core"; | ||
import { Info } from "./info"; | ||
/** | ||
* A DTMF signal (incoming INFO). | ||
* @deprecated Use `Info`. | ||
* @internal | ||
*/ | ||
export declare class DTMF extends Info { | ||
private _tone; | ||
private _duration; | ||
/** @internal */ | ||
constructor(incomingInfoRequest: IncomingInfoRequest, tone: string, duration: number); | ||
get tone(): string; | ||
get duration(): number; | ||
} | ||
//# sourceMappingURL=dtmf.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Info } from "./info"; | ||
/** | ||
* A DTMF signal (incoming INFO). | ||
* @deprecated Use `Info`. | ||
* @internal | ||
*/ | ||
export class DTMF extends Info { | ||
/** @internal */ | ||
constructor(incomingInfoRequest, tone, duration) { | ||
super(incomingInfoRequest); | ||
this._tone = tone; | ||
this._duration = duration; | ||
} | ||
get tone() { | ||
return this._tone; | ||
} | ||
get duration() { | ||
return this._duration; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { EventEmitter } from "events"; | ||
/** | ||
* Generic observable. | ||
* @public | ||
*/ | ||
export interface Emitter<T> { | ||
/** | ||
* Sets up a function that will be called whenever the target changes. | ||
* @param listener - Callback function. | ||
* @param options - An options object that specifies characteristics about the listener. | ||
* If once true, indicates that the listener should be invoked at most once after being added. | ||
* If once true, the listener would be automatically removed when invoked. | ||
*/ | ||
addListener(listener: (data: T) => void, options?: { | ||
once?: boolean; | ||
}): void; | ||
/** | ||
* Removes from the listener previously registered with addListener. | ||
* @param listener - Callback function. | ||
*/ | ||
removeListener(listener: (data: T) => void): void; | ||
/** | ||
* Registers a listener. | ||
* @param listener - Callback function. | ||
* @deprecated Use addListener. | ||
*/ | ||
on(listener: (data: T) => void): void; | ||
/** | ||
* Unregisters a listener. | ||
* @param listener - Callback function. | ||
* @deprecated Use removeListener. | ||
*/ | ||
off(listener: (data: T) => void): void; | ||
/** | ||
* Registers a listener then unregisters the listener after one event emission. | ||
* @param listener - Callback function. | ||
* @deprecated Use addListener. | ||
*/ | ||
once(listener: (data: T) => void): void; | ||
} | ||
/** | ||
* Creates an {@link Emitter}. | ||
* @param eventEmitter - An event emitter. | ||
* @param eventName - Event name. | ||
* @internal | ||
*/ | ||
export declare function _makeEmitter<T>(eventEmitter: EventEmitter, eventName?: string): Emitter<T>; | ||
//# sourceMappingURL=emitter.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Creates an {@link Emitter}. | ||
* @param eventEmitter - An event emitter. | ||
* @param eventName - Event name. | ||
* @internal | ||
*/ | ||
export function _makeEmitter(eventEmitter, eventName = "event") { | ||
return { | ||
addListener: (listener, options = {}) => { | ||
if (options.once) { | ||
eventEmitter.once(eventName, listener); | ||
} | ||
else { | ||
eventEmitter.addListener(eventName, listener); | ||
} | ||
}, | ||
removeListener: (listener) => { | ||
eventEmitter.removeListener(eventName, listener); | ||
}, | ||
on: (listener) => { | ||
eventEmitter.on(eventName, listener); | ||
}, | ||
off: (listener) => { | ||
eventEmitter.removeListener(eventName, listener); | ||
}, | ||
once: (listener) => { | ||
eventEmitter.once(eventName, listener); | ||
} | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Exception } from "../../core"; | ||
/** | ||
* An exception indicating an unsupported content type prevented execution. | ||
* @public | ||
*/ | ||
export declare class ContentTypeUnsupportedError extends Exception { | ||
constructor(message?: string); | ||
} | ||
//# sourceMappingURL=content-type-unsupported.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Exception } from "../../core"; | ||
/** | ||
* An exception indicating an unsupported content type prevented execution. | ||
* @public | ||
*/ | ||
export class ContentTypeUnsupportedError extends Exception { | ||
constructor(message) { | ||
super(message ? message : "Unsupported content type."); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export * from "./content-type-unsupported"; | ||
export * from "./request-pending"; | ||
export * from "./session-description-handler"; | ||
export * from "./session-terminated"; | ||
export * from "./state-transition"; | ||
//# sourceMappingURL=index.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export * from "./content-type-unsupported"; | ||
export * from "./request-pending"; | ||
export * from "./session-description-handler"; | ||
export * from "./session-terminated"; | ||
export * from "./state-transition"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Exception } from "../../core"; | ||
/** | ||
* An exception indicating an outstanding prior request prevented execution. | ||
* @public | ||
*/ | ||
export declare class RequestPendingError extends Exception { | ||
/** @internal */ | ||
constructor(message?: string); | ||
} | ||
//# sourceMappingURL=request-pending.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Exception } from "../../core"; | ||
/** | ||
* An exception indicating an outstanding prior request prevented execution. | ||
* @public | ||
*/ | ||
export class RequestPendingError extends Exception { | ||
/** @internal */ | ||
constructor(message) { | ||
super(message ? message : "Request pending."); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Exception } from "../../core"; | ||
/** | ||
* An exception indicating a session description handler error occured. | ||
* @public | ||
*/ | ||
export declare class SessionDescriptionHandlerError extends Exception { | ||
constructor(message?: string); | ||
} | ||
//# sourceMappingURL=session-description-handler.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Exception } from "../../core"; | ||
/** | ||
* An exception indicating a session description handler error occured. | ||
* @public | ||
*/ | ||
export class SessionDescriptionHandlerError extends Exception { | ||
constructor(message) { | ||
super(message ? message : "Unspecified session description handler error."); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Exception } from "../../core"; | ||
/** | ||
* An exception indicating the session terminated before the action completed. | ||
* @public | ||
*/ | ||
export declare class SessionTerminatedError extends Exception { | ||
constructor(); | ||
} | ||
//# sourceMappingURL=session-terminated.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Exception } from "../../core"; | ||
/** | ||
* An exception indicating the session terminated before the action completed. | ||
* @public | ||
*/ | ||
export class SessionTerminatedError extends Exception { | ||
constructor() { | ||
super("The session has terminated."); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Exception } from "../../core"; | ||
/** | ||
* An exception indicating an invalid state transition error occured. | ||
* @public | ||
*/ | ||
export declare class StateTransitionError extends Exception { | ||
constructor(message?: string); | ||
} | ||
//# sourceMappingURL=state-transition.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Exception } from "../../core"; | ||
/** | ||
* An exception indicating an invalid state transition error occured. | ||
* @public | ||
*/ | ||
export class StateTransitionError extends Exception { | ||
constructor(message) { | ||
super(message ? message : "An error occurred during state transition."); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* A simple yet powerful API which takes care of SIP signaling and WebRTC media sessions for you. | ||
* @packageDocumentation | ||
*/ | ||
export * from "./exceptions"; | ||
export * from "./bye"; | ||
export * from "./emitter"; | ||
export * from "./info"; | ||
export * from "./invitation-accept-options"; | ||
export * from "./invitation-progress-options"; | ||
export * from "./invitation-reject-options"; | ||
export * from "./invitation"; | ||
export * from "./inviter-cancel-options"; | ||
export * from "./inviter-invite-options"; | ||
export * from "./inviter-options"; | ||
export * from "./inviter"; | ||
export * from "./message"; | ||
export * from "./messager-message-options"; | ||
export * from "./messager-options"; | ||
export * from "./messager"; | ||
export * from "./notification"; | ||
export * from "./publisher-options"; | ||
export * from "./publisher-publish-options"; | ||
export * from "./publisher-state"; | ||
export * from "./publisher-unpublish-options"; | ||
export * from "./publisher"; | ||
export * from "./referral"; | ||
export * from "./registerer-options"; | ||
export * from "./registerer-register-options"; | ||
export * from "./registerer-state"; | ||
export * from "./registerer-unregister-options"; | ||
export * from "./registerer"; | ||
export * from "./session-bye-options"; | ||
export * from "./session-delegate"; | ||
export * from "./session-description-handler-factory"; | ||
export * from "./session-description-handler"; | ||
export * from "./session-info-options"; | ||
export * from "./session-invite-options"; | ||
export * from "./session-message-options"; | ||
export * from "./session-options"; | ||
export * from "./session-refer-options"; | ||
export * from "./session-state"; | ||
export * from "./session"; | ||
export * from "./subscriber-options"; | ||
export * from "./subscriber-subscribe-options"; | ||
export * from "./subscriber"; | ||
export * from "./subscription-delegate"; | ||
export * from "./subscription-options"; | ||
export * from "./subscription-state"; | ||
export * from "./subscription-subscribe-options"; | ||
export * from "./subscription-unsubscribe-options"; | ||
export * from "./subscription"; | ||
export * from "./transport"; | ||
export * from "./transport-state"; | ||
export * from "./user-agent-delegate"; | ||
export * from "./user-agent-options"; | ||
export * from "./user-agent-state"; | ||
export * from "./user-agent"; | ||
//# sourceMappingURL=index.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.