janus-simple-videoroom-client 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +11 -17
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,21 +1,15 @@
1
- import Janus from "janus-gateway";
1
+ import Janus, { JanusJS } from "janus-gateway";
2
2
  export { Janus };
3
- type JanusSessionOptions = ConstructorParameters<typeof Janus>[0];
4
- type JanusPluginOptions = Parameters<Janus["attach"]>[0];
5
- type JanusPluginHandle = Parameters<NonNullable<JanusPluginOptions["success"]>>[0];
6
3
  type JanusMid = unknown;
7
- type JanusOfferParams = Parameters<JanusPluginHandle["createOffer"]>[0];
8
- type JanusTrackOption = NonNullable<JanusOfferParams["tracks"]>[number];
9
- type Jsep = Parameters<NonNullable<JanusOfferParams["success"]>>[0];
10
4
  interface JanusMessage {
11
5
  [key: string]: any;
12
6
  }
13
7
  interface JanusMediaOptions {
14
- tracks?: JanusTrackOption[];
8
+ tracks?: JanusJS.TrackOption[];
15
9
  trickle?: boolean;
16
10
  stream?: MediaStream;
17
- customizeSdp?: (jsep: Jsep) => void;
18
- customizeRemoteSdp?: (jsep: Jsep) => void;
11
+ customizeSdp?: (jsep: JanusJS.JSEP) => void;
12
+ customizeRemoteSdp?: (jsep: JanusJS.JSEP) => void;
19
13
  }
20
14
  interface JanusStreamSpec {
21
15
  feed: unknown;
@@ -51,7 +45,7 @@ interface JanusSubscriberConfigureOptions {
51
45
  audio_active_packets?: number;
52
46
  }
53
47
  export interface VideoRoomClient {
54
- createSession(server: string | string[], options?: JanusSessionOptions): Promise<VideoRoomSession>;
48
+ createSession(server: string | string[], options?: Partial<JanusJS.ConstructorOptions>): Promise<VideoRoomSession>;
55
49
  }
56
50
  export interface VideoRoomSession {
57
51
  eventTarget: ReturnType<typeof makeEventTarget>;
@@ -115,7 +109,7 @@ export interface StreamingSubscriber {
115
109
  }): Promise<void>;
116
110
  unsubscribe(): Promise<void>;
117
111
  }
118
- export interface JanusPluginHandleEx extends JanusPluginHandle {
112
+ export interface JanusPluginHandleEx extends JanusJS.PluginHandle {
119
113
  eventTarget: ReturnType<typeof makeEventTarget>;
120
114
  sendRequest(message: JanusMessage & {
121
115
  request: string;
@@ -124,18 +118,18 @@ export interface JanusPluginHandleEx extends JanusPluginHandle {
124
118
  message: JanusMessage & {
125
119
  request: string;
126
120
  };
127
- jsep?: Jsep;
121
+ jsep?: JanusJS.JSEP;
128
122
  expectResponse: (response: AsyncResponse) => boolean;
129
123
  }): Promise<AsyncResponse>;
130
- handleRemoteJsep(params: Parameters<JanusPluginHandle["handleRemoteJsep"]>[0] & {
131
- customizeSdp?: (jsep: Jsep) => void;
124
+ handleRemoteJsep(params: JanusJS.PluginHandleRemoteJsepParam & {
125
+ customizeSdp?: (jsep: JanusJS.JSEP) => void;
132
126
  }): void;
133
127
  }
134
128
  interface AsyncResponse {
135
129
  message: JanusMessage;
136
- jsep?: Jsep;
130
+ jsep?: JanusJS.JSEP;
137
131
  }
138
- export declare function createVideoRoomClient(options?: Parameters<typeof Janus.init>[0]): Promise<VideoRoomClient>;
132
+ export declare function createVideoRoomClient(options?: JanusJS.InitOptions): Promise<VideoRoomClient>;
139
133
  declare function makeEventTarget(): {
140
134
  addEventListener(name: string, callback: (event: CustomEvent) => void): void;
141
135
  removeEventListener(name: string, callback: (event: CustomEvent) => void): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "janus-simple-videoroom-client",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Provides a simple high-level API that makes it easy to work with the Janus VideoRoom plugin",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",