libaribhtml5 0.1.5 → 0.1.7
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/dist/sdk/libaribhtml5.js +10 -10
- package/dist/sdk/libaribhtml5.mjs +1484 -1187
- package/dist/types/receiver/canvas-controller.d.ts +30 -0
- package/dist/types/receiver/protocol.d.ts +21 -0
- package/dist/types/receiver/runtime-session-controller.d.ts +40 -0
- package/dist/types/receiver/types.d.ts +91 -0
- package/dist/types/receiver-host.d.ts +9 -108
- package/dist/types/runtime/application-controller.d.ts +48 -0
- package/dist/types/runtime/caption-controller.d.ts +27 -0
- package/dist/types/runtime/external-media-hole.d.ts +28 -0
- package/dist/types/runtime/external-network.d.ts +7 -0
- package/dist/types/runtime/install.d.ts +2 -10
- package/dist/types/runtime/media-plane-runtime.d.ts +54 -0
- package/dist/types/service-worker-vfs.d.ts +3 -84
- package/dist/types/vfs/service-worker-backend.d.ts +27 -0
- package/dist/types/vfs/session.d.ts +36 -0
- package/dist/types/vfs/types.d.ts +23 -0
- package/package.json +3 -2
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { BroadcastVfsBackend, BroadcastVfsResource, BroadcastVfsSessionOptions } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Ordered, recoverable write session above a VFS backend. enqueue() copies
|
|
4
|
+
* callback-lifetime data synchronously and returns a revision barrier.
|
|
5
|
+
*/
|
|
6
|
+
export declare class BroadcastVfsSession {
|
|
7
|
+
private readonly backend;
|
|
8
|
+
private readonly onError?;
|
|
9
|
+
private readonly scheduleTask;
|
|
10
|
+
private readonly mirror;
|
|
11
|
+
private readonly queue;
|
|
12
|
+
private waiters;
|
|
13
|
+
private generation;
|
|
14
|
+
private nextRevision;
|
|
15
|
+
private completedRevision;
|
|
16
|
+
private drainScheduled;
|
|
17
|
+
private ioTail;
|
|
18
|
+
private sessionReady;
|
|
19
|
+
private disposed;
|
|
20
|
+
constructor(backend: BroadcastVfsBackend, options?: BroadcastVfsSessionOptions);
|
|
21
|
+
beginSession(): Promise<void>;
|
|
22
|
+
enqueue(resource: BroadcastVfsResource): number;
|
|
23
|
+
waitFor(revision: number): Promise<void>;
|
|
24
|
+
/** Ensure a staged path is readable, replaying the page-owned mirror if needed. */
|
|
25
|
+
ensure(path: string, revision?: number): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Stop accepting resources, discard queued writes, and wait for the one
|
|
28
|
+
* backend operation which may already be running. The backend itself remains
|
|
29
|
+
* owned by the caller and can be reset or disposed after this resolves.
|
|
30
|
+
*/
|
|
31
|
+
dispose(): Promise<void>;
|
|
32
|
+
private appendIo;
|
|
33
|
+
private scheduleDrain;
|
|
34
|
+
private drainOne;
|
|
35
|
+
private resolveWaiters;
|
|
36
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type BroadcastVfsResource = {
|
|
2
|
+
path: string;
|
|
3
|
+
contentType?: string;
|
|
4
|
+
data: Uint8Array | ArrayBuffer;
|
|
5
|
+
};
|
|
6
|
+
export type ServiceWorkerBroadcastVfsOptions = {
|
|
7
|
+
workerUrl: string | URL;
|
|
8
|
+
/** Same-origin scope used to expose broadcast files. */
|
|
9
|
+
baseUrl?: string | URL;
|
|
10
|
+
/** Compatibility fallback for applications which omit a carousel directory. */
|
|
11
|
+
uniqueBasenameFallback?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type BroadcastVfsBackend = {
|
|
14
|
+
begin(): Promise<void>;
|
|
15
|
+
put(resource: BroadcastVfsResource): Promise<void>;
|
|
16
|
+
canRead(path: string): Promise<boolean>;
|
|
17
|
+
};
|
|
18
|
+
export type BroadcastVfsSessionOptions = {
|
|
19
|
+
/** Report background write failures; ensure() still rejects to its caller. */
|
|
20
|
+
onError?: (error: unknown) => void;
|
|
21
|
+
/** Override background scheduling, primarily for embedded hosts and tests. */
|
|
22
|
+
schedule?: (task: () => void) => void;
|
|
23
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libaribhtml5",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Browser runtime and receiver host for ARIB HTML5 data broadcasting",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arib",
|
|
@@ -60,9 +60,10 @@
|
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"dev": "vite --host 127.0.0.1",
|
|
63
|
-
"test": "node --experimental-strip-types scripts/test-runtime-contracts.mjs && node --experimental-strip-types scripts/test-vfs-worker.mjs",
|
|
63
|
+
"test": "node --experimental-strip-types scripts/test-runtime-contracts.mjs && node --experimental-strip-types scripts/test-external-network.mjs && node --experimental-strip-types scripts/test-caption-controller.mjs && node --experimental-strip-types scripts/test-runtime-application.mjs && node --experimental-strip-types scripts/test-receiver-protocol.mjs && node --experimental-strip-types scripts/test-receiver-canvas.mjs && node --experimental-strip-types scripts/test-receiver-session.mjs && node --experimental-strip-types scripts/test-media-plane-characterization.mjs && node --experimental-strip-types scripts/test-vfs-worker.mjs",
|
|
64
64
|
"build": "tsc --noEmit && vite build && vite build --config vite.sdk.config.mjs && vite build --config vite.worker.config.mjs",
|
|
65
65
|
"build:sdk": "tsc --noEmit && vite build --config vite.sdk.config.mjs && vite build --config vite.worker.config.mjs && npm run build:types",
|
|
66
|
+
"build:tv": "tsc --noEmit && node --experimental-strip-types scripts/test-tv-input.mjs && vite build --config vite.tv.config.mjs",
|
|
66
67
|
"build:types": "tsc -p tsconfig.build.json && node scripts/rewrite-declaration-imports.mjs",
|
|
67
68
|
"preview": "vite preview --host 127.0.0.1"
|
|
68
69
|
}
|