@supraio/client-daemon-js 0.0.1-mz-warmup.0 → 0.0.1-mz-warmup.1

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.
@@ -0,0 +1 @@
1
+ export declare function injectScript(url: string): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const FORCE_PLAIN_KEY = "_forcePlain";
@@ -0,0 +1,5 @@
1
+ /// <reference types="node" />
2
+ declare global {
3
+ type NodeBuffer = Buffer;
4
+ }
5
+ export declare function initBrowserFS(): Promise<any>;
package/go/go.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ declare global {
2
+ class Go {
3
+ /** Accessed by x264/decode_wasm.go directly to optimize memory usage */
4
+ h264: WebAssembly.Memory;
5
+ env: {
6
+ [name: string]: string;
7
+ };
8
+ importObject: WebAssembly.Imports;
9
+ argv: string[];
10
+ run(instance: WebAssembly.Instance): Promise<void>;
11
+ }
12
+ }
13
+ export declare function getGoEnv(): {
14
+ HOME: string;
15
+ USER: string;
16
+ };
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "@supraio/client-daemon-js",
3
- "version": "0.0.1-mz-warmup.0",
3
+ "version": "0.0.1-mz-warmup.1",
4
4
  "description": "",
5
5
  "main": "sdk.js",
6
6
  "scripts": {
7
7
  "build-daemon": "esbuild --bundle --sourcemap --target=chrome88,firefox86,edge89 --outfile=dist/daemon.js daemon.ts",
8
8
  "build-screen": "esbuild --bundle --sourcemap --target=chrome88,firefox86,edge89 --outfile=dist/screen.js screen.ts",
9
- "build-sdk": "esbuild --bundle --sourcemap --target=chrome88,firefox86,edge89 --outfile=dist/sdk.js sdk.ts",
9
+ "build-sdk": "esbuild --bundle --sourcemap --target=chrome88,firefox86,edge89 --outfile=dist/sdk.js --format=cjs sdk.ts",
10
+ "build-types": "tsc --declaration --emitDeclarationOnly",
11
+ "clean": "rm -rf dist/*",
10
12
  "check": "tsc --noEmit",
11
13
  "lint": "eslint \"**/*.ts\""
12
14
  },
@@ -0,0 +1,10 @@
1
+ export interface IScreenOptions {
2
+ screenID: string;
3
+ screenDriver: string;
4
+ screenHost: string;
5
+ metadataDriver: string;
6
+ metadataHost: string;
7
+ clientID: string;
8
+ clientSecret: string;
9
+ secure: boolean;
10
+ }
@@ -0,0 +1 @@
1
+ export declare function startPlainScreen(): Promise<void>;
@@ -0,0 +1,15 @@
1
+ /// <reference types="node" />
2
+ import '../go/go';
3
+ import { H264Decoder } from 'h264decoder';
4
+ import nodeFs from 'fs';
5
+ import { IScreenOptions } from './options';
6
+ declare global {
7
+ interface Window {
8
+ /** Make it global accessible for x264/decode_wasm.go */
9
+ h264Decoder: H264Decoder;
10
+ /** Make it global accessible for wasm_exec.js */
11
+ fs: typeof nodeFs;
12
+ module: any;
13
+ }
14
+ }
15
+ export declare function startWasmScreen(options?: IScreenOptions): Promise<void>;
package/screen.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
package/screen.js CHANGED
@@ -17514,8 +17514,10 @@
17514
17514
  window.addEventListener("load", async () => {
17515
17515
  try {
17516
17516
  await startScreen();
17517
+ } catch (error) {
17518
+ console.error("Error process", error);
17517
17519
  } finally {
17518
- console.error("Reloading window");
17520
+ console.log("Reloading window");
17519
17521
  location.reload();
17520
17522
  }
17521
17523
  });