livekit-client 0.17.2 → 0.17.5

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 (41) hide show
  1. package/dist/api/SignalClient.d.ts +2 -1
  2. package/dist/api/SignalClient.js +6 -1
  3. package/dist/api/SignalClient.js.map +1 -1
  4. package/dist/proto/google/protobuf/timestamp.d.ts +132 -0
  5. package/dist/proto/google/protobuf/timestamp.js +108 -0
  6. package/dist/proto/google/protobuf/timestamp.js.map +1 -0
  7. package/dist/proto/livekit_models.d.ts +596 -16
  8. package/dist/proto/livekit_models.js +1012 -642
  9. package/dist/proto/livekit_models.js.map +1 -1
  10. package/dist/proto/livekit_rtc.d.ts +3416 -29
  11. package/dist/proto/livekit_rtc.js +830 -1210
  12. package/dist/proto/livekit_rtc.js.map +1 -1
  13. package/dist/room/Room.d.ts +2 -1
  14. package/dist/room/Room.js +16 -1
  15. package/dist/room/Room.js.map +1 -1
  16. package/dist/room/events.d.ts +12 -2
  17. package/dist/room/events.js +10 -0
  18. package/dist/room/events.js.map +1 -1
  19. package/dist/room/participant/LocalParticipant.d.ts +4 -1
  20. package/dist/room/participant/LocalParticipant.js +18 -0
  21. package/dist/room/participant/LocalParticipant.js.map +1 -1
  22. package/dist/room/participant/Participant.d.ts +5 -1
  23. package/dist/room/participant/Participant.js +15 -1
  24. package/dist/room/participant/Participant.js.map +1 -1
  25. package/dist/room/track/Track.js +10 -3
  26. package/dist/room/track/Track.js.map +1 -1
  27. package/dist/room/track/options.d.ts +1 -1
  28. package/dist/version.d.ts +2 -2
  29. package/dist/version.js +2 -2
  30. package/package.json +2 -2
  31. package/src/api/SignalClient.ts +8 -1
  32. package/src/proto/google/protobuf/timestamp.ts +232 -0
  33. package/src/proto/livekit_models.ts +1134 -570
  34. package/src/proto/livekit_rtc.ts +834 -1135
  35. package/src/room/Room.ts +30 -9
  36. package/src/room/events.ts +12 -0
  37. package/src/room/participant/LocalParticipant.ts +25 -2
  38. package/src/room/participant/Participant.ts +22 -2
  39. package/src/room/track/Track.ts +10 -4
  40. package/src/room/track/options.ts +1 -1
  41. package/src/version.ts +2 -2
@@ -0,0 +1,232 @@
1
+ /* eslint-disable */
2
+ import Long from "long";
3
+ import * as _m0 from "protobufjs/minimal";
4
+
5
+ export const protobufPackage = "google.protobuf";
6
+
7
+ /**
8
+ * A Timestamp represents a point in time independent of any time zone or local
9
+ * calendar, encoded as a count of seconds and fractions of seconds at
10
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
11
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
12
+ * Gregorian calendar backwards to year one.
13
+ *
14
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
15
+ * second table is needed for interpretation, using a [24-hour linear
16
+ * smear](https://developers.google.com/time/smear).
17
+ *
18
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
19
+ * restricting to that range, we ensure that we can convert to and from [RFC
20
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
21
+ *
22
+ * # Examples
23
+ *
24
+ * Example 1: Compute Timestamp from POSIX `time()`.
25
+ *
26
+ * Timestamp timestamp;
27
+ * timestamp.set_seconds(time(NULL));
28
+ * timestamp.set_nanos(0);
29
+ *
30
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
31
+ *
32
+ * struct timeval tv;
33
+ * gettimeofday(&tv, NULL);
34
+ *
35
+ * Timestamp timestamp;
36
+ * timestamp.set_seconds(tv.tv_sec);
37
+ * timestamp.set_nanos(tv.tv_usec * 1000);
38
+ *
39
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
40
+ *
41
+ * FILETIME ft;
42
+ * GetSystemTimeAsFileTime(&ft);
43
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
44
+ *
45
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
46
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
47
+ * Timestamp timestamp;
48
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
49
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
50
+ *
51
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
52
+ *
53
+ * long millis = System.currentTimeMillis();
54
+ *
55
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
56
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
57
+ *
58
+ *
59
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
60
+ *
61
+ * Instant now = Instant.now();
62
+ *
63
+ * Timestamp timestamp =
64
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
65
+ * .setNanos(now.getNano()).build();
66
+ *
67
+ *
68
+ * Example 6: Compute Timestamp from current time in Python.
69
+ *
70
+ * timestamp = Timestamp()
71
+ * timestamp.GetCurrentTime()
72
+ *
73
+ * # JSON Mapping
74
+ *
75
+ * In JSON format, the Timestamp type is encoded as a string in the
76
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
77
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
78
+ * where {year} is always expressed using four digits while {month}, {day},
79
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
80
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
81
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
82
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
83
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
84
+ * able to accept both UTC and other timezones (as indicated by an offset).
85
+ *
86
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
87
+ * 01:30 UTC on January 15, 2017.
88
+ *
89
+ * In JavaScript, one can convert a Date object to this format using the
90
+ * standard
91
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
92
+ * method. In Python, a standard `datetime.datetime` object can be converted
93
+ * to this format using
94
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
95
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
96
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
97
+ * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
98
+ * ) to obtain a formatter capable of generating timestamps in this format.
99
+ */
100
+ export interface Timestamp {
101
+ /**
102
+ * Represents seconds of UTC time since Unix epoch
103
+ * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
104
+ * 9999-12-31T23:59:59Z inclusive.
105
+ */
106
+ seconds: number;
107
+ /**
108
+ * Non-negative fractions of a second at nanosecond resolution. Negative
109
+ * second values with fractions must still have non-negative nanos values
110
+ * that count forward in time. Must be from 0 to 999,999,999
111
+ * inclusive.
112
+ */
113
+ nanos: number;
114
+ }
115
+
116
+ function createBaseTimestamp(): Timestamp {
117
+ return { seconds: 0, nanos: 0 };
118
+ }
119
+
120
+ export const Timestamp = {
121
+ encode(
122
+ message: Timestamp,
123
+ writer: _m0.Writer = _m0.Writer.create()
124
+ ): _m0.Writer {
125
+ if (message.seconds !== 0) {
126
+ writer.uint32(8).int64(message.seconds);
127
+ }
128
+ if (message.nanos !== 0) {
129
+ writer.uint32(16).int32(message.nanos);
130
+ }
131
+ return writer;
132
+ },
133
+
134
+ decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp {
135
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
136
+ let end = length === undefined ? reader.len : reader.pos + length;
137
+ const message = createBaseTimestamp();
138
+ while (reader.pos < end) {
139
+ const tag = reader.uint32();
140
+ switch (tag >>> 3) {
141
+ case 1:
142
+ message.seconds = longToNumber(reader.int64() as Long);
143
+ break;
144
+ case 2:
145
+ message.nanos = reader.int32();
146
+ break;
147
+ default:
148
+ reader.skipType(tag & 7);
149
+ break;
150
+ }
151
+ }
152
+ return message;
153
+ },
154
+
155
+ fromJSON(object: any): Timestamp {
156
+ return {
157
+ seconds: isSet(object.seconds) ? Number(object.seconds) : 0,
158
+ nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
159
+ };
160
+ },
161
+
162
+ toJSON(message: Timestamp): unknown {
163
+ const obj: any = {};
164
+ message.seconds !== undefined &&
165
+ (obj.seconds = Math.round(message.seconds));
166
+ message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
167
+ return obj;
168
+ },
169
+
170
+ fromPartial<I extends Exact<DeepPartial<Timestamp>, I>>(
171
+ object: I
172
+ ): Timestamp {
173
+ const message = createBaseTimestamp();
174
+ message.seconds = object.seconds ?? 0;
175
+ message.nanos = object.nanos ?? 0;
176
+ return message;
177
+ },
178
+ };
179
+
180
+ declare var self: any | undefined;
181
+ declare var window: any | undefined;
182
+ declare var global: any | undefined;
183
+ var globalThis: any = (() => {
184
+ if (typeof globalThis !== "undefined") return globalThis;
185
+ if (typeof self !== "undefined") return self;
186
+ if (typeof window !== "undefined") return window;
187
+ if (typeof global !== "undefined") return global;
188
+ throw "Unable to locate global object";
189
+ })();
190
+
191
+ type Builtin =
192
+ | Date
193
+ | Function
194
+ | Uint8Array
195
+ | string
196
+ | number
197
+ | boolean
198
+ | undefined;
199
+
200
+ export type DeepPartial<T> = T extends Builtin
201
+ ? T
202
+ : T extends Array<infer U>
203
+ ? Array<DeepPartial<U>>
204
+ : T extends ReadonlyArray<infer U>
205
+ ? ReadonlyArray<DeepPartial<U>>
206
+ : T extends {}
207
+ ? { [K in keyof T]?: DeepPartial<T[K]> }
208
+ : Partial<T>;
209
+
210
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
211
+ export type Exact<P, I extends P> = P extends Builtin
212
+ ? P
213
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & Record<
214
+ Exclude<keyof I, KeysOfUnion<P>>,
215
+ never
216
+ >;
217
+
218
+ function longToNumber(long: Long): number {
219
+ if (long.gt(Number.MAX_SAFE_INTEGER)) {
220
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
221
+ }
222
+ return long.toNumber();
223
+ }
224
+
225
+ if (_m0.util.Long !== Long) {
226
+ _m0.util.Long = Long as any;
227
+ _m0.configure();
228
+ }
229
+
230
+ function isSet(value: any): boolean {
231
+ return value !== null && value !== undefined;
232
+ }