@waitaya.buc/client-js 0.1.0-alpha.2 → 0.1.0-alpha.3
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.
- package/README.md +11 -4
- package/dist/adapters/livekit/react-native.d.ts +1 -7
- package/dist/adapters/livekit/react-native.d.ts.map +1 -1
- package/dist/adapters/livekit/react-native.js +5 -0
- package/dist/adapters/livekit/react-native.js.map +1 -1
- package/dist/core/ports/outbound/react-native-bindings.port.d.ts +39 -0
- package/dist/core/ports/outbound/react-native-bindings.port.d.ts.map +1 -0
- package/dist/core/ports/outbound/react-native-bindings.port.js +2 -0
- package/dist/core/ports/outbound/react-native-bindings.port.js.map +1 -0
- package/dist/react-native.d.ts +17 -0
- package/dist/react-native.d.ts.map +1 -0
- package/dist/react-native.js +17 -0
- package/dist/react-native.js.map +1 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -17,15 +17,22 @@ npm install @waitaya.buc/client-js
|
|
|
17
17
|
|
|
18
18
|
### React Native
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
On iOS/Android, the active provider adapter prepares its required WebRTC globals
|
|
21
|
+
automatically inside `Vroom.connect()` (during adapter creation). You do not need
|
|
22
|
+
to register polyfills manually.
|
|
22
23
|
|
|
23
|
-
If
|
|
24
|
+
If you need RN-specific helpers (e.g., `RTCView` for rendering remote video),
|
|
25
|
+
import them from the provider-agnostic subpath:
|
|
24
26
|
|
|
25
27
|
```typescript
|
|
26
|
-
import { RTCView, MediaStream
|
|
28
|
+
import { RTCView, MediaStream } from '@waitaya.buc/client-js/react-native'
|
|
27
29
|
```
|
|
28
30
|
|
|
31
|
+
This subpath is served by the SDK composition root (`src/react-native.ts`),
|
|
32
|
+
which re-exports from the active adapter's bindings. Consumer code stays
|
|
33
|
+
provider-agnostic — the import path does not change if the active adapter
|
|
34
|
+
changes.
|
|
35
|
+
|
|
29
36
|
#### React Native Dependency Note (v0.x)
|
|
30
37
|
|
|
31
38
|
The current RTC adapter is LiveKit (internal adapter), and React Native native-module autolinking
|
|
@@ -8,13 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { MediaStream, RTCView } from '@livekit/react-native-webrtc';
|
|
10
10
|
export { RTCView, MediaStream };
|
|
11
|
-
export
|
|
12
|
-
streamURL: string | null;
|
|
13
|
-
objectFit?: 'cover' | 'contain';
|
|
14
|
-
mirror?: boolean;
|
|
15
|
-
zOrder?: number;
|
|
16
|
-
style?: unknown;
|
|
17
|
-
}
|
|
11
|
+
export type { RTCViewProps } from '../../core/ports/outbound/react-native-bindings.port';
|
|
18
12
|
/**
|
|
19
13
|
* Registers all globals required by LiveKit on React Native.
|
|
20
14
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-native.d.ts","sourceRoot":"","sources":["../../../src/adapters/livekit/react-native.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"react-native.d.ts","sourceRoot":"","sources":["../../../src/adapters/livekit/react-native.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAInE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAA;AAC/B,YAAY,EAAE,YAAY,EAAE,MAAM,sDAAsD,CAAA;AAUxF;;;;;GAKG;AACH,wBAAsB,iCAAiC,IAAI,OAAO,CAAC,IAAI,CAAC,CAwBvE"}
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
import { registerGlobals as registerLiveKitGlobals } from '@livekit/react-native';
|
|
10
10
|
import { MediaStream, RTCView } from '@livekit/react-native-webrtc';
|
|
11
11
|
export { RTCView, MediaStream };
|
|
12
|
+
// Compile-time check: exports must satisfy the ReactNativeBindings port.
|
|
13
|
+
// If LiveKit ever changes the shape of RTCView/MediaStream, this will fail
|
|
14
|
+
// to typecheck — surface the breakage at build time, not at runtime.
|
|
15
|
+
const _contract = { RTCView, MediaStream };
|
|
16
|
+
void _contract;
|
|
12
17
|
let globalsRegistered = false;
|
|
13
18
|
/**
|
|
14
19
|
* Registers all globals required by LiveKit on React Native.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-native.js","sourceRoot":"","sources":["../../../src/adapters/livekit/react-native.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,IAAI,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"react-native.js","sourceRoot":"","sources":["../../../src/adapters/livekit/react-native.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,IAAI,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAInE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAA;AAG/B,yEAAyE;AACzE,2EAA2E;AAC3E,qEAAqE;AACrE,MAAM,SAAS,GAAG,EAAE,OAAO,EAAE,WAAW,EAAgC,CAAA;AACxE,KAAK,SAAS,CAAA;AAEd,IAAI,iBAAiB,GAAG,KAAK,CAAA;AAE7B;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC;IACrD,IAAI,iBAAiB;QAAE,OAAM;IAE7B,sBAAsB,EAAE,CAAA;IAExB,IACE,OAAO,UAAU,CAAC,WAAW,KAAK,WAAW;QAC7C,OAAO,UAAU,CAAC,WAAW,KAAK,WAAW,EAC7C,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAA;IACzF,CAAC;IAED,IAAI,OAAO,UAAU,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAA;IAC9E,CAAC;IAED,IACE,OAAO,UAAU,CAAC,cAAc,KAAK,WAAW;QAChD,OAAO,UAAU,CAAC,cAAc,KAAK,WAAW,EAChD,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAA;IAC7E,CAAC;IAED,iBAAiB,GAAG,IAAI,CAAA;AAC1B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract that React Native bindings of any provider adapter must satisfy.
|
|
3
|
+
*
|
|
4
|
+
* Scope: This port currently reflects the **WebRTC family** of providers
|
|
5
|
+
* (LiveKit, Daily, Twilio Video, etc.) which all expose `RTCView` from
|
|
6
|
+
* `react-native-webrtc` and a `MediaStream` with `.toURL()`.
|
|
7
|
+
*
|
|
8
|
+
* If a non-WebRTC provider (e.g., Agora with `RtcSurfaceView`) is added
|
|
9
|
+
* later, do NOT force-fit it into this shape — split into a parallel port
|
|
10
|
+
* or generalize this one with a clear migration plan. The current shape
|
|
11
|
+
* is intentional, not a placeholder.
|
|
12
|
+
*
|
|
13
|
+
* This is an **optional contract** — only providers that support React
|
|
14
|
+
* Native need to satisfy it. Web-only adapters can ignore this port.
|
|
15
|
+
*/
|
|
16
|
+
export interface ReactNativeBindings {
|
|
17
|
+
RTCView: ReactComponentType<RTCViewProps>;
|
|
18
|
+
MediaStream: new (...args: never[]) => MediaStreamLike;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Minimal structural type matching React's `ComponentType`.
|
|
22
|
+
*
|
|
23
|
+
* Defined locally so this port (and the core) does not take a dependency on
|
|
24
|
+
* `react` types. Adapters that import `ComponentType` from `react` will
|
|
25
|
+
* remain assignable to this shape via structural typing.
|
|
26
|
+
*/
|
|
27
|
+
export type ReactComponentType<P> = (props: P) => unknown;
|
|
28
|
+
export interface RTCViewProps {
|
|
29
|
+
streamURL: string | null;
|
|
30
|
+
objectFit?: 'cover' | 'contain';
|
|
31
|
+
mirror?: boolean;
|
|
32
|
+
zOrder?: number;
|
|
33
|
+
style?: unknown;
|
|
34
|
+
}
|
|
35
|
+
export interface MediaStreamLike {
|
|
36
|
+
toURL(): string;
|
|
37
|
+
readonly id: string;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=react-native-bindings.port.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native-bindings.port.d.ts","sourceRoot":"","sources":["../../../../src/core/ports/outbound/react-native-bindings.port.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAA;IACzC,WAAW,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,eAAe,CAAA;CACvD;AAED;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAA;AAEzD,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,IAAI,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native-bindings.port.js","sourceRoot":"","sources":["../../../../src/core/ports/outbound/react-native-bindings.port.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK composition root for React Native.
|
|
3
|
+
*
|
|
4
|
+
* This file (and only this file) knows which provider adapter is active —
|
|
5
|
+
* it re-exports the active adapter's React Native bindings so consumers
|
|
6
|
+
* can import them via the provider-agnostic public subpath
|
|
7
|
+
* `@waitaya.buc/client-js/react-native`.
|
|
8
|
+
*
|
|
9
|
+
* Hexagonal rule: core code under `src/core/` MUST NOT import this file.
|
|
10
|
+
* The composition root is allowed to know the concrete adapter; the core
|
|
11
|
+
* is not.
|
|
12
|
+
*
|
|
13
|
+
* Swapping providers (e.g., LiveKit → Daily) is a build-time change to
|
|
14
|
+
* this single line — consumers do not need to update import paths.
|
|
15
|
+
*/
|
|
16
|
+
export * from './adapters/livekit/react-native';
|
|
17
|
+
//# sourceMappingURL=react-native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native.d.ts","sourceRoot":"","sources":["../src/react-native.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,cAAc,iCAAiC,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK composition root for React Native.
|
|
3
|
+
*
|
|
4
|
+
* This file (and only this file) knows which provider adapter is active —
|
|
5
|
+
* it re-exports the active adapter's React Native bindings so consumers
|
|
6
|
+
* can import them via the provider-agnostic public subpath
|
|
7
|
+
* `@waitaya.buc/client-js/react-native`.
|
|
8
|
+
*
|
|
9
|
+
* Hexagonal rule: core code under `src/core/` MUST NOT import this file.
|
|
10
|
+
* The composition root is allowed to know the concrete adapter; the core
|
|
11
|
+
* is not.
|
|
12
|
+
*
|
|
13
|
+
* Swapping providers (e.g., LiveKit → Daily) is a build-time change to
|
|
14
|
+
* this single line — consumers do not need to update import paths.
|
|
15
|
+
*/
|
|
16
|
+
export * from './adapters/livekit/react-native';
|
|
17
|
+
//# sourceMappingURL=react-native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native.js","sourceRoot":"","sources":["../src/react-native.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,cAAc,iCAAiC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@waitaya.buc/client-js",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.3",
|
|
4
4
|
"description": "Vroom Core SDK - Platform-agnostic RTC abstraction layer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"default": "./dist/index.js"
|
|
14
14
|
},
|
|
15
15
|
"./react-native": {
|
|
16
|
-
"types": "./dist/
|
|
17
|
-
"import": "./dist/
|
|
18
|
-
"default": "./dist/
|
|
16
|
+
"types": "./dist/react-native.d.ts",
|
|
17
|
+
"import": "./dist/react-native.js",
|
|
18
|
+
"default": "./dist/react-native.js"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"files": [
|