@4players/odin-plugin-web 1.0.0-alpha.2 → 1.0.0-alpha.21

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 (46) hide show
  1. package/lib/plugin/index.d.ts +21 -0
  2. package/lib/plugin/index.js +1 -0
  3. package/lib/worker/shared.js +1 -0
  4. package/lib/worker/unshared.js +1 -0
  5. package/package.json +32 -26
  6. package/backend/lib/audioController.d.ts +0 -102
  7. package/backend/lib/audioController.d.ts.map +0 -1
  8. package/backend/lib/audioController.js +0 -442
  9. package/backend/lib/audioController.js.map +0 -1
  10. package/backend/lib/config.d.ts +0 -11
  11. package/backend/lib/config.d.ts.map +0 -1
  12. package/backend/lib/config.js +0 -11
  13. package/backend/lib/config.js.map +0 -1
  14. package/backend/lib/connectionPool.d.ts +0 -17
  15. package/backend/lib/connectionPool.d.ts.map +0 -1
  16. package/backend/lib/connectionPool.js +0 -111
  17. package/backend/lib/connectionPool.js.map +0 -1
  18. package/backend/lib/index.d.ts +0 -53
  19. package/backend/lib/index.d.ts.map +0 -1
  20. package/backend/lib/index.js +0 -293
  21. package/backend/lib/index.js.map +0 -1
  22. package/backend/lib/mainConnection.d.ts +0 -40
  23. package/backend/lib/mainConnection.d.ts.map +0 -1
  24. package/backend/lib/mainConnection.js +0 -294
  25. package/backend/lib/mainConnection.js.map +0 -1
  26. package/backend/lib/roomConnection.d.ts +0 -37
  27. package/backend/lib/roomConnection.d.ts.map +0 -1
  28. package/backend/lib/roomConnection.js +0 -299
  29. package/backend/lib/roomConnection.js.map +0 -1
  30. package/backend/lib/rpcConnection.d.ts +0 -49
  31. package/backend/lib/rpcConnection.d.ts.map +0 -1
  32. package/backend/lib/rpcConnection.js +0 -235
  33. package/backend/lib/rpcConnection.js.map +0 -1
  34. package/backend/lib/token.d.ts +0 -16
  35. package/backend/lib/token.d.ts.map +0 -1
  36. package/backend/lib/token.js +0 -67
  37. package/backend/lib/token.js.map +0 -1
  38. package/backend/package.json +0 -13
  39. package/wasm/lib/index.d.ts +0 -97
  40. package/wasm/lib/index.js +0 -19
  41. package/wasm/package.json +0 -14
  42. package/worker/lib/common.d.ts +0 -27
  43. package/worker/lib/index.d.ts +0 -46
  44. package/worker/lib/index.js +0 -2
  45. package/worker/lib/messages.d.ts +0 -93
  46. package/worker/package.json +0 -13
@@ -1,93 +0,0 @@
1
- import { Result } from '@4players/odin-common';
2
- import type { VadConfig } from './index';
3
- export type CaptureWorkletMessages = {
4
- init: {
5
- workerPort: MessagePort;
6
- };
7
- close: void;
8
- };
9
- export type PlaybackWorkletMessages = {
10
- init: {
11
- workerPort: MessagePort;
12
- };
13
- samples: {
14
- id: number;
15
- buffer: Float32Array;
16
- };
17
- close: void;
18
- };
19
- export type WorkerMessages = {
20
- captureInit: {
21
- sampleRate: number;
22
- refreshRate: number;
23
- workletPort: MessagePort;
24
- };
25
- captureSetMedias: {
26
- connections: Array<{
27
- id: number;
28
- mediaIds: number[];
29
- }>;
30
- };
31
- captureSetVad: VadConfig;
32
- captureSetVolume: {
33
- value: number;
34
- };
35
- captureTick: {
36
- buffer: Float32Array;
37
- };
38
- playbackInit: {
39
- refreshRate: number;
40
- workletPort: MessagePort;
41
- };
42
- playbackUpdateMedias: {
43
- added: Array<{
44
- index: number;
45
- connectionId: number;
46
- mediaId: number;
47
- }>;
48
- removed: Array<{
49
- index: number;
50
- connectionId: number;
51
- mediaId: number;
52
- }>;
53
- };
54
- playbackSetVolume: {
55
- index: 'global' | number;
56
- value: number;
57
- };
58
- playbackReceivePacket: {
59
- connectionId: number;
60
- packet: Uint8Array;
61
- };
62
- playbackTick: void;
63
- close: void;
64
- };
65
- export type MainMessages = {
66
- sendPacket: {
67
- connectionId: number;
68
- packet: Uint8Array;
69
- };
70
- captureReady: void;
71
- playbackReady: void;
72
- captureUpdate: {
73
- active: boolean;
74
- rmsDBFs: number;
75
- speechProbability: number;
76
- };
77
- playbackUpdate: {
78
- activities: Float32Array;
79
- };
80
- };
81
- export type Messages = Record<string, unknown>;
82
- export type Message<Name, Values> = [Name, Values];
83
- export type Inflate<T extends Messages> = {
84
- [Name in keyof T]: Message<Name, T[Name]>;
85
- }[keyof T];
86
- export type MessageResult<T extends Messages> = Result<Inflate<T> | 'closed'>;
87
- export declare function send<T extends Messages>(port: {
88
- postMessage(message: unknown, transfer?: Transferable[]): void;
89
- }, message: Inflate<T>, transfer?: Transferable[]): void;
90
- export declare function waitFor<T extends Messages, Name extends Extract<keyof T, string>>(port: {
91
- addEventListener(type: 'message', listener: (event: MessageEvent) => void): void;
92
- removeEventListener(type: 'message', listener: (event: MessageEvent) => void): void;
93
- }, name: Name): Promise<T[Name]>;
@@ -1,13 +0,0 @@
1
- {
2
- "name": "@4players/odin-plugin-web-worker",
3
- "version": "0.0.0",
4
- "author": "Maximilian Münchow <maximilian.muenchow@4players.io>",
5
- "private": true,
6
- "license": "UNLICENSED",
7
- "main": "./lib/index.js",
8
- "types": "./lib/index.d.ts",
9
- "scripts": {
10
- "clean": "rm -rf lib",
11
- "build": "ts-node build.ts && tsc"
12
- }
13
- }