@4players/odin-common 3.2.0 → 4.0.0

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 (89) hide show
  1. package/README.md +11 -5
  2. package/mod.d.ts +4431 -0
  3. package/mod.js +1182 -0
  4. package/mod.mjs +1065 -0
  5. package/package.json +6 -30
  6. package/eslint.config.mjs +0 -30
  7. package/lib/cjs/index.js +0 -44
  8. package/lib/cjs/plugin/api.js +0 -19
  9. package/lib/cjs/rpc/commands.js +0 -96
  10. package/lib/cjs/rpc/notifications.js +0 -39
  11. package/lib/cjs/schema/channels.js +0 -44
  12. package/lib/cjs/schema/media.js +0 -25
  13. package/lib/cjs/schema/message.js +0 -10
  14. package/lib/cjs/schema/peer.js +0 -34
  15. package/lib/cjs/schema/room.js +0 -136
  16. package/lib/cjs/schema/serialization.js +0 -15
  17. package/lib/cjs/schema/token.js +0 -33
  18. package/lib/cjs/schema/webrtc.js +0 -23
  19. package/lib/cjs/tsconfig.cjs.tsbuildinfo +0 -1
  20. package/lib/cjs/utility/base64.js +0 -29
  21. package/lib/cjs/utility/bytearray.js +0 -28
  22. package/lib/cjs/utility/codec.js +0 -89
  23. package/lib/cjs/utility/environment.js +0 -32
  24. package/lib/cjs/utility/iterable.js +0 -10
  25. package/lib/cjs/utility/json.js +0 -6
  26. package/lib/cjs/utility/log.js +0 -224
  27. package/lib/cjs/utility/msgpack.js +0 -11
  28. package/lib/cjs/utility/result.js +0 -31
  29. package/lib/cjs/utility/selector.js +0 -18
  30. package/lib/cjs/utility/sleep.js +0 -27
  31. package/lib/cjs/utility/strand.js +0 -38
  32. package/lib/cjs/utility/url.js +0 -27
  33. package/lib/cjs/utility/uuid.js +0 -11
  34. package/lib/cjs/utility/validation.js +0 -38
  35. package/lib/esm/index.js +0 -27
  36. package/lib/esm/plugin/api.js +0 -16
  37. package/lib/esm/rpc/commands.js +0 -93
  38. package/lib/esm/rpc/notifications.js +0 -36
  39. package/lib/esm/schema/channels.js +0 -40
  40. package/lib/esm/schema/media.js +0 -22
  41. package/lib/esm/schema/message.js +0 -7
  42. package/lib/esm/schema/peer.js +0 -31
  43. package/lib/esm/schema/room.js +0 -133
  44. package/lib/esm/schema/serialization.js +0 -12
  45. package/lib/esm/schema/token.js +0 -29
  46. package/lib/esm/schema/webrtc.js +0 -20
  47. package/lib/esm/tsconfig.esm.tsbuildinfo +0 -1
  48. package/lib/esm/utility/base64.js +0 -25
  49. package/lib/esm/utility/bytearray.js +0 -24
  50. package/lib/esm/utility/codec.js +0 -85
  51. package/lib/esm/utility/environment.js +0 -24
  52. package/lib/esm/utility/iterable.js +0 -7
  53. package/lib/esm/utility/json.js +0 -3
  54. package/lib/esm/utility/log.js +0 -210
  55. package/lib/esm/utility/msgpack.js +0 -7
  56. package/lib/esm/utility/result.js +0 -23
  57. package/lib/esm/utility/selector.js +0 -14
  58. package/lib/esm/utility/sleep.js +0 -22
  59. package/lib/esm/utility/strand.js +0 -34
  60. package/lib/esm/utility/url.js +0 -23
  61. package/lib/esm/utility/uuid.js +0 -7
  62. package/lib/esm/utility/validation.js +0 -27
  63. package/lib/index.d.ts +0 -27
  64. package/lib/plugin/api.d.ts +0 -159
  65. package/lib/rpc/commands.d.ts +0 -253
  66. package/lib/rpc/notifications.d.ts +0 -1626
  67. package/lib/schema/channels.d.ts +0 -11
  68. package/lib/schema/media.d.ts +0 -122
  69. package/lib/schema/message.d.ts +0 -12
  70. package/lib/schema/peer.d.ts +0 -226
  71. package/lib/schema/room.d.ts +0 -1673
  72. package/lib/schema/serialization.d.ts +0 -12
  73. package/lib/schema/token.d.ts +0 -58
  74. package/lib/schema/webrtc.d.ts +0 -42
  75. package/lib/utility/base64.d.ts +0 -3
  76. package/lib/utility/bytearray.d.ts +0 -4
  77. package/lib/utility/codec.d.ts +0 -15
  78. package/lib/utility/environment.d.ts +0 -6
  79. package/lib/utility/iterable.d.ts +0 -1
  80. package/lib/utility/json.d.ts +0 -4
  81. package/lib/utility/log.d.ts +0 -79
  82. package/lib/utility/msgpack.d.ts +0 -2
  83. package/lib/utility/result.d.ts +0 -18
  84. package/lib/utility/selector.d.ts +0 -7
  85. package/lib/utility/sleep.d.ts +0 -4
  86. package/lib/utility/strand.d.ts +0 -8
  87. package/lib/utility/url.d.ts +0 -3
  88. package/lib/utility/uuid.d.ts +0 -2
  89. package/lib/utility/validation.d.ts +0 -10
@@ -1,210 +0,0 @@
1
- import { failure, success, unwrap } from './result';
2
- import { isNumber } from './validation';
3
- export var LogVerbosity;
4
- (function (LogVerbosity) {
5
- LogVerbosity[LogVerbosity["NONE"] = 0] = "NONE";
6
- LogVerbosity[LogVerbosity["ERROR"] = 1] = "ERROR";
7
- LogVerbosity[LogVerbosity["WARN"] = 2] = "WARN";
8
- LogVerbosity[LogVerbosity["INFO"] = 3] = "INFO";
9
- LogVerbosity[LogVerbosity["DEBUG"] = 4] = "DEBUG";
10
- })(LogVerbosity || (LogVerbosity = {}));
11
- export const LogLevels = Object.values(LogVerbosity).filter((key) => !isNaN(Number(key)));
12
- export const LogLevelNames = Object.keys(LogVerbosity).filter((key) => isNaN(Number(key)));
13
- export const LogSymbols = {
14
- [LogVerbosity.NONE]: '⚫',
15
- [LogVerbosity.ERROR]: '🔴',
16
- [LogVerbosity.WARN]: '🟡',
17
- [LogVerbosity.INFO]: '🔵',
18
- [LogVerbosity.DEBUG]: '🟣',
19
- };
20
- export const LogFunctions = {
21
- [LogVerbosity.NONE]: console.log,
22
- [LogVerbosity.ERROR]: console.error,
23
- [LogVerbosity.WARN]: console.warn,
24
- [LogVerbosity.INFO]: console.info,
25
- [LogVerbosity.DEBUG]: console.debug,
26
- };
27
- export function getLevelByName(name) {
28
- const level = LogVerbosity[name];
29
- if (level === undefined) {
30
- return failure(`invalid log level name '${name}'; valid names are: ${LogLevelNames.join(', ')}`);
31
- }
32
- return success(level);
33
- }
34
- export function getLevelName(level) {
35
- const name = LogVerbosity[level];
36
- if (name === undefined) {
37
- return failure(`invalid log level ${level}; valid levels are: ${LogLevels[0]}-${LogLevels[LogLevels.length - 1]}`);
38
- }
39
- return success(name);
40
- }
41
- const LOG_DEFAULT_ID = 'default';
42
- const LOG_COLLECTION = new Map();
43
- export function getLogger(name = LOG_DEFAULT_ID) {
44
- let logger = LOG_COLLECTION.get(name);
45
- if (!logger) {
46
- logger = new Logger('WARN', name);
47
- }
48
- return logger;
49
- }
50
- export function error(msg, ...args) {
51
- if (msg instanceof Function) {
52
- return getLogger(LOG_DEFAULT_ID).error(msg, ...args);
53
- }
54
- return getLogger(LOG_DEFAULT_ID).error(msg, ...args);
55
- }
56
- export function warn(msg, ...args) {
57
- if (msg instanceof Function) {
58
- return getLogger(LOG_DEFAULT_ID).warn(msg, ...args);
59
- }
60
- return getLogger(LOG_DEFAULT_ID).warn(msg, ...args);
61
- }
62
- export function info(msg, ...args) {
63
- if (msg instanceof Function) {
64
- return getLogger(LOG_DEFAULT_ID).info(msg, ...args);
65
- }
66
- return getLogger(LOG_DEFAULT_ID).info(msg, ...args);
67
- }
68
- export function debug(msg, ...args) {
69
- if (msg instanceof Function) {
70
- return getLogger(LOG_DEFAULT_ID).debug(msg, ...args);
71
- }
72
- return getLogger(LOG_DEFAULT_ID).debug(msg, ...args);
73
- }
74
- export class Logger {
75
- constructor(level, name, options) {
76
- this.name = name ?? LOG_DEFAULT_ID;
77
- if (isNumber(level)) {
78
- this._Level = unwrap(getLevelByName(unwrap(getLevelName(level))));
79
- }
80
- else {
81
- this._Level = unwrap(getLevelByName(level));
82
- }
83
- this._Handlers = options?.handlers || [new LogHandler(level)];
84
- LOG_COLLECTION.set(this.name, this);
85
- }
86
- get level() {
87
- return this._Level;
88
- }
89
- set level(value) {
90
- this.levelName = unwrap(getLevelName(value));
91
- }
92
- get levelName() {
93
- return unwrap(getLevelName(this._Level));
94
- }
95
- set levelName(value) {
96
- this._Level = unwrap(getLevelByName(value));
97
- this._Handlers.forEach((handler) => (handler.level = this._Level));
98
- }
99
- get handlers() {
100
- return this._Handlers;
101
- }
102
- addHandler(handler) {
103
- this._Handlers.push(handler);
104
- }
105
- removeHandler(handler) {
106
- const index = this._Handlers.indexOf(handler);
107
- if (index !== -1)
108
- this._Handlers.splice(index, 1);
109
- }
110
- log(level, msg, ...args) {
111
- if (this.level < level) {
112
- return msg instanceof Function ? undefined : msg;
113
- }
114
- let fnResult;
115
- let message;
116
- if (msg instanceof Function) {
117
- fnResult = msg();
118
- message = this.asString(fnResult);
119
- }
120
- else {
121
- message = this.asString(msg);
122
- }
123
- this._Handlers.forEach((handler) => {
124
- handler.handle({
125
- date: new Date(),
126
- level,
127
- levelName: unwrap(getLevelName(level)),
128
- logger: this.name,
129
- message,
130
- args,
131
- });
132
- });
133
- return msg instanceof Function ? fnResult : msg;
134
- }
135
- error(msg, ...args) {
136
- return this.log(LogVerbosity.ERROR, msg, ...args);
137
- }
138
- warn(msg, ...args) {
139
- return this.log(LogVerbosity.WARN, msg, ...args);
140
- }
141
- info(msg, ...args) {
142
- return this.log(LogVerbosity.INFO, msg, ...args);
143
- }
144
- debug(msg, ...args) {
145
- return this.log(LogVerbosity.DEBUG, msg, ...args);
146
- }
147
- asString(data, isProperty = false) {
148
- if (typeof data === 'string') {
149
- if (isProperty)
150
- return `"${data}"`;
151
- return data;
152
- }
153
- else if (data === null ||
154
- typeof data === 'number' ||
155
- typeof data === 'bigint' ||
156
- typeof data === 'boolean' ||
157
- typeof data === 'undefined' ||
158
- typeof data === 'symbol') {
159
- return String(data);
160
- }
161
- else if (data instanceof Error) {
162
- return data.stack;
163
- }
164
- else if (typeof data === 'object') {
165
- return `{${Object.entries(data)
166
- .map(([k, v]) => `"${k}":${this.asString(v, true)}`)
167
- .join(',')}}`;
168
- }
169
- return 'undefined';
170
- }
171
- }
172
- export const DEFAULT_FORMATTER = ({ message }) => message;
173
- export const PRETTY_FORMATTER = (record) => {
174
- const date = `[${record.date.toISOString()}]`;
175
- const level = `[${record.levelName}]`;
176
- const logger = record.logger !== LOG_DEFAULT_ID ? `[${record.logger}] ` : '';
177
- const symbol = LogSymbols[record.level];
178
- return `${date} ${symbol} ${level.padEnd(7, ' ')} ${logger}${record.message}`;
179
- };
180
- export class LogHandler {
181
- constructor(level, formatter = DEFAULT_FORMATTER) {
182
- if (isNumber(level)) {
183
- this._Level = unwrap(getLevelByName(unwrap(getLevelName(level))));
184
- }
185
- else {
186
- this._Level = unwrap(getLevelByName(level));
187
- }
188
- this._FormatterFn = formatter;
189
- }
190
- get level() {
191
- return this._Level;
192
- }
193
- set level(value) {
194
- this.levelName = unwrap(getLevelName(value));
195
- }
196
- get levelName() {
197
- return unwrap(getLevelName(this._Level));
198
- }
199
- set levelName(value) {
200
- this._Level = unwrap(getLevelByName(value));
201
- }
202
- handle(record) {
203
- if (this._Level < record.level)
204
- return;
205
- this.log(this._FormatterFn(record), record);
206
- }
207
- log(formattedString, record) {
208
- LogFunctions[record.level](formattedString, ...record.args);
209
- }
210
- }
@@ -1,7 +0,0 @@
1
- import { encode, decode } from '@msgpack/msgpack';
2
- export function msgpackEncode(value) {
3
- return encode(value, { forceFloat32: true, ignoreUndefined: true });
4
- }
5
- export function msgpackDecode(buffer) {
6
- return decode(buffer);
7
- }
@@ -1,23 +0,0 @@
1
- export function assert(condition, message) {
2
- if (!condition) {
3
- fail(message);
4
- }
5
- }
6
- export function fail(message) {
7
- throw new Error(message);
8
- }
9
- export function success(value) {
10
- return { type: 'Success', value };
11
- }
12
- export function failure(reason) {
13
- return { type: 'Failure', reason };
14
- }
15
- export function unwrap(result) {
16
- if (result.type === 'Failure') {
17
- fail(result.reason);
18
- }
19
- return result.value;
20
- }
21
- export function unwrapOr(result, fallback) {
22
- return result.type === 'Success' ? result.value : fallback;
23
- }
@@ -1,14 +0,0 @@
1
- export class Selector {
2
- constructor(_Generators) {
3
- this._Generators = _Generators;
4
- this._Futures = _Generators.map(Selector.addIndex);
5
- }
6
- async next() {
7
- const [result, index] = await Promise.race(this._Futures);
8
- this._Futures[index] = Selector.addIndex(this._Generators[index], index);
9
- return result;
10
- }
11
- static async addIndex(generator, index) {
12
- return [await generator(), index];
13
- }
14
- }
@@ -1,22 +0,0 @@
1
- export function sleep(ms, value) {
2
- if (ms <= 0) {
3
- return Promise.resolve(value);
4
- }
5
- return new Promise((resolve) => setTimeout(() => resolve(value), ms));
6
- }
7
- export function abortableSleep(ms, signal) {
8
- if (signal.aborted) {
9
- return Promise.resolve('aborted');
10
- }
11
- return new Promise((resolve) => {
12
- const onAbort = () => resolve('aborted');
13
- signal.addEventListener('abort', onAbort, { once: true });
14
- setTimeout(() => {
15
- signal.removeEventListener('abort', onAbort);
16
- resolve(undefined);
17
- }, ms);
18
- });
19
- }
20
- export function nextTick() {
21
- return new Promise((resolve) => setTimeout(resolve, 0));
22
- }
@@ -1,34 +0,0 @@
1
- export class Strand {
2
- constructor(...values) {
3
- this._Tasks = [];
4
- this._Running = false;
5
- this._Values = values;
6
- }
7
- enqueue(task) {
8
- return new Promise((resolve, reject) => {
9
- const wrapped = async () => {
10
- try {
11
- const result = await task(...this._Values);
12
- resolve(result);
13
- }
14
- catch (error) {
15
- reject(error);
16
- }
17
- };
18
- this._Tasks.push(wrapped);
19
- if (!this._Running) {
20
- this.execute();
21
- }
22
- });
23
- }
24
- async execute() {
25
- this._Running = true;
26
- while (true) {
27
- const task = this._Tasks.shift();
28
- if (task === undefined)
29
- break;
30
- await task();
31
- }
32
- this._Running = false;
33
- }
34
- }
@@ -1,23 +0,0 @@
1
- import { failure, success } from './result';
2
- export function normalizeUrl(url) {
3
- let normalized = url.trim();
4
- if (url.indexOf('://') === -1)
5
- normalized = `https://${normalized}`;
6
- try {
7
- return success(new URL(normalized));
8
- }
9
- catch (error) {
10
- return failure(String(error));
11
- }
12
- }
13
- export function extendUrl(base, path) {
14
- let pathname = base.pathname;
15
- if (pathname.endsWith('/') === false)
16
- pathname += '/';
17
- try {
18
- return success(new URL(pathname + path, base));
19
- }
20
- catch (error) {
21
- return failure(String(error));
22
- }
23
- }
@@ -1,7 +0,0 @@
1
- import { v4, validate } from 'uuid';
2
- export function generateUUID() {
3
- return v4();
4
- }
5
- export function validateUUID(uuid) {
6
- return validate(uuid);
7
- }
@@ -1,27 +0,0 @@
1
- export function isProperty(object, name) {
2
- return name in object;
3
- }
4
- export function isFunction(value) {
5
- return typeof value === 'function';
6
- }
7
- export function isNull(value) {
8
- return typeof value === 'object' && value === null;
9
- }
10
- export function isNumber(value) {
11
- return typeof value === 'number';
12
- }
13
- export function isObject(value) {
14
- return typeof value === 'object';
15
- }
16
- export function isString(value) {
17
- return typeof value === 'string';
18
- }
19
- export function isUndefined(value) {
20
- return typeof value === 'undefined';
21
- }
22
- export function isFailure(result) {
23
- return result.type === 'Failure';
24
- }
25
- export function isSuccess(result) {
26
- return result.type === 'Success';
27
- }
package/lib/index.d.ts DELETED
@@ -1,27 +0,0 @@
1
- export * as zod from 'zod';
2
- export * from './schema/serialization';
3
- export * from './schema/token';
4
- export * from './schema/room';
5
- export * from './schema/peer';
6
- export * from './schema/media';
7
- export * from './schema/message';
8
- export * from './schema/webrtc';
9
- export * from './schema/channels';
10
- export * from './rpc/commands';
11
- export * from './rpc/notifications';
12
- export * from './utility/base64';
13
- export * from './utility/bytearray';
14
- export * from './utility/codec';
15
- export * from './utility/iterable';
16
- export * from './utility/environment';
17
- export * from './utility/json';
18
- export * from './utility/msgpack';
19
- export * from './utility/result';
20
- export * from './utility/selector';
21
- export * from './utility/sleep';
22
- export * from './utility/strand';
23
- export * from './utility/url';
24
- export * from './utility/uuid';
25
- export * from './utility/validation';
26
- export * from './utility/log';
27
- export * from './plugin/api';
@@ -1,159 +0,0 @@
1
- export declare const MinDBFS = -758.596;
2
- export declare namespace Backend {
3
- type UID = string;
4
- type OnStatusChanged = (status: 'started' | 'stopped') => void;
5
- type OnEvent = (method: string, properties: unknown) => void;
6
- type Version = '5';
7
- enum Transport {
8
- H3 = "h3",
9
- WebRTC = "webrtc"
10
- }
11
- interface Plugin {
12
- readonly version: Version;
13
- readonly playbackVolume: PlaybackVolume;
14
- readonly supportedTransports: (Transport.WebRTC | Transport.H3)[];
15
- joinRoom(parameters: JoinRoomParameters): Room;
16
- createAudioPlayback(parameters: CreateAudioPlaybackParameters): Promise<AudioPlayback>;
17
- createAudioCapture(parameters: CreateAudioCaptureParameters): Promise<AudioCapture>;
18
- createVideoCapture(ms: MediaStream, options?: VideoInputOptions): Promise<VideoCapture>;
19
- createVideoPlayback(parameters: CreateVideoPlaybackParameters): Promise<VideoPlayback>;
20
- enumerateDevices(): Promise<Array<Device>>;
21
- setOutputVolume(volume: PlaybackVolume): void;
22
- setOutputDevice(device: DeviceParameters): Promise<void>;
23
- close(): void;
24
- }
25
- interface Device {
26
- readonly type: 'AudioPlayback' | 'AudioCapture';
27
- readonly name: string;
28
- readonly id: string;
29
- readonly isDefault: boolean;
30
- }
31
- interface DeviceParameters {
32
- readonly device?: Device;
33
- onStatusChanged?: OnStatusChanged;
34
- }
35
- interface Activity {
36
- isSilent: boolean;
37
- rmsDBFS: number;
38
- }
39
- interface JitterStats {
40
- packetsSeen: number;
41
- packetsProcessed: number;
42
- packetsTooEarly: number;
43
- packetsTooLate: number;
44
- packetsDropped: number;
45
- packetsInvalid: number;
46
- packetsRepeated: number;
47
- packetsLost: number;
48
- }
49
- interface ConnectionStats {
50
- bytesSent: number;
51
- bytesReceived: number;
52
- packetsSent: number;
53
- packetsReceived: number;
54
- rtt: number;
55
- }
56
- interface JoinRoomParameters {
57
- readonly gateway: string | undefined;
58
- readonly token: string;
59
- readonly roomId?: string;
60
- readonly userData?: Uint8Array;
61
- readonly position?: [number, number, number];
62
- readonly cipher?: SetupCipherSettings;
63
- readonly onEvent: OnEvent;
64
- readonly transport?: Transport;
65
- }
66
- interface Room {
67
- readonly token: string;
68
- readonly cipher: Cipher | undefined;
69
- connectionStats: ConnectionStats;
70
- request(method: string, properties: unknown): Promise<unknown>;
71
- link(media: Media): Promise<void>;
72
- unlink(media: Media): void;
73
- close(): void;
74
- }
75
- interface Media {
76
- readonly customType?: string;
77
- close(): void;
78
- }
79
- interface AudioMedia extends Media {
80
- readonly activity: Activity;
81
- }
82
- interface CreateAudioPlaybackParameters {
83
- readonly uid: UID;
84
- readonly volume?: PlaybackVolume;
85
- readonly customType?: string;
86
- }
87
- interface CreateVideoPlaybackParameters {
88
- readonly uid: UID;
89
- readonly customType?: string;
90
- }
91
- interface AudioPlayback extends AudioMedia {
92
- readonly volume: PlaybackVolume;
93
- readonly uid: UID;
94
- jitterStats: JitterStats;
95
- setVolume(value: PlaybackVolume): Promise<void>;
96
- }
97
- interface CreateAudioCaptureParameters extends Partial<DeviceParameters> {
98
- readonly volume?: CaptureVolume;
99
- readonly vad?: VadConfig;
100
- readonly apm?: ApmConfig;
101
- }
102
- interface AudioCapture extends AudioMedia {
103
- readonly volume: CaptureVolume;
104
- readonly vad?: VadConfig;
105
- readonly apm?: ApmConfig;
106
- setVad(config: VadConfig): void;
107
- setApm(config: ApmConfig): Promise<void>;
108
- setDevice(device: DeviceParameters): Promise<void>;
109
- setVolume(value: CaptureVolume): Promise<void>;
110
- }
111
- interface VideoCapture extends Media {
112
- mediaStream?: MediaStream;
113
- setDevice(ms: MediaStream): Promise<void>;
114
- }
115
- interface VideoPlayback extends Media {
116
- readonly mediaStream?: MediaStream;
117
- readonly uid: UID;
118
- }
119
- type PlaybackVolume = [number, number];
120
- type CaptureVolume = 'muted' | number;
121
- interface VadConfig {
122
- voiceActivity?: SensitivityRange;
123
- volumeGate?: SensitivityRange;
124
- }
125
- interface SensitivityRange {
126
- attackThreshold: number;
127
- releaseThreshold: number;
128
- }
129
- interface ApmConfig {
130
- echoCanceller: boolean;
131
- highPassFilter: boolean;
132
- preAmplifier: boolean;
133
- captureLevelAdjustment: boolean;
134
- noiseSuppression: 'None' | 'Low' | 'Moderate' | 'High' | 'VeryHigh';
135
- transientSuppressor: boolean;
136
- gainController: boolean;
137
- }
138
- type SetupCipherSettings = {
139
- type: 'OdinCrypto';
140
- } & OdinCryptoSettings;
141
- type CipherSettings = OdinCryptoSettings;
142
- interface OdinCryptoSettings {
143
- password: string | null;
144
- }
145
- enum PeerCipherStatus {
146
- InvalidPassword = -1,
147
- Unknown = 0,
148
- Unencrypted = 1,
149
- Encrypted = 2
150
- }
151
- interface Cipher {
152
- configure(settings: CipherSettings): void;
153
- getPeerStatus(peerId: number): PeerCipherStatus;
154
- }
155
- type VideoInputOptions = {
156
- codec?: 'H264' | 'VP8' | 'VP9';
157
- customType?: string;
158
- };
159
- }