fullstacked 1.0.0-alpha.1783 → 1.0.0-alpha.1789

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/index.js CHANGED
@@ -6541,8 +6541,9 @@ async function BridgeNodeInit() {
6541
6541
  webSocketUrl.protocol = webSocketUrl.protocol === "https:" ? "wss:" : "ws:";
6542
6542
  const ctx = await (await fetch("/ctx")).json();
6543
6543
  let ws;
6544
+ const NativeWebSocket = globalThis.fullstacked?.WebSocket || WebSocket;
6544
6545
  const webSocketForCallback = new Promise((res) => {
6545
- ws = new WebSocket(webSocketUrl);
6546
+ ws = new NativeWebSocket(webSocketUrl);
6546
6547
  ws.binaryType = "arraybuffer";
6547
6548
  ws.onmessage = (e) => {
6548
6549
  globalThis.fullstacked.onStreamData(
@@ -6905,7 +6906,9 @@ async function BridgeLinuxInit() {
6905
6906
  }
6906
6907
  };
6907
6908
  globalThis.fullstacked.window = globalThis.fullstacked.window || {};
6908
- globalThis.fullstacked.window.getSize = () => (globalThis.fullstacked.fetch || fetch)("/resize").then((r) => r.text());
6909
+ globalThis.fullstacked.window.getSize = () => (globalThis.fullstacked.fetch || fetch)("/resize").then(
6910
+ (r) => r.text()
6911
+ );
6909
6912
  globalThis.fullstacked.window.resize = function(size) {
6910
6913
  (globalThis.fullstacked.fetch || fetch)(`/resize?size=${size}`);
6911
6914
  };
@@ -7053,6 +7056,7 @@ var Fetch = 8;
7053
7056
  var Bundle = 9;
7054
7057
  var Packages = 12;
7055
7058
  var Plugin = 14;
7059
+ var WebSocket2 = 15;
7056
7060
  var CoreResponseError = 0;
7057
7061
  var CoreResponseData = 1;
7058
7062
  var CoreResponseStream = 2;
@@ -7820,6 +7824,237 @@ async function fetchCore(request, init2) {
7820
7824
  }
7821
7825
  var fetch_default = fetchCore;
7822
7826
 
7827
+ // ../../core/internal/bundle/lib/@types/websocket.ts
7828
+ var Connect = 0;
7829
+
7830
+ // ../../core/internal/bundle/lib/websocket/index.ts
7831
+ var GlobalCloseEvent = typeof CloseEvent !== "undefined" ? CloseEvent : class CloseEvent2 extends Event {
7832
+ code;
7833
+ reason;
7834
+ wasClean;
7835
+ constructor(type2, eventInitDict) {
7836
+ super(type2, eventInitDict);
7837
+ this.code = eventInitDict?.code ?? 0;
7838
+ this.reason = eventInitDict?.reason ?? "";
7839
+ this.wasClean = eventInitDict?.wasClean ?? false;
7840
+ }
7841
+ };
7842
+ var WebSocketCore = class _WebSocketCore extends EventTarget {
7843
+ static CONNECTING = 0;
7844
+ static OPEN = 1;
7845
+ static CLOSING = 2;
7846
+ static CLOSED = 3;
7847
+ CONNECTING = 0;
7848
+ OPEN = 1;
7849
+ CLOSING = 2;
7850
+ CLOSED = 3;
7851
+ url;
7852
+ readyState = _WebSocketCore.CONNECTING;
7853
+ bufferedAmount = 0;
7854
+ protocol = "";
7855
+ extensions = "";
7856
+ binaryType = "blob";
7857
+ onopen = null;
7858
+ onerror = null;
7859
+ onclose = null;
7860
+ onmessage = null;
7861
+ #duplex = null;
7862
+ #ee = null;
7863
+ constructor(url2, protocols) {
7864
+ super();
7865
+ let parsedUrl;
7866
+ try {
7867
+ if (url2 instanceof URL) {
7868
+ parsedUrl = url2;
7869
+ } else if (typeof url2 === "string") {
7870
+ if (url2.startsWith("/") && typeof globalThis.location !== "undefined") {
7871
+ const origin = globalThis.location.origin || globalThis.location.href || "http://localhost";
7872
+ parsedUrl = new URL(url2, origin);
7873
+ if (parsedUrl.protocol === "http:") {
7874
+ parsedUrl.protocol = "ws:";
7875
+ } else if (parsedUrl.protocol === "https:") {
7876
+ parsedUrl.protocol = "wss:";
7877
+ }
7878
+ } else {
7879
+ parsedUrl = new URL(url2);
7880
+ }
7881
+ } else {
7882
+ throw new Error("Invalid URL");
7883
+ }
7884
+ } catch {
7885
+ throw new DOMException(
7886
+ `The URL '${url2}' is invalid.`,
7887
+ "SyntaxError"
7888
+ );
7889
+ }
7890
+ if (parsedUrl.protocol !== "ws:" && parsedUrl.protocol !== "wss:") {
7891
+ throw new DOMException(
7892
+ `The URL's scheme must be either 'ws' or 'wss'. '${parsedUrl.protocol}' is not allowed.`,
7893
+ "SyntaxError"
7894
+ );
7895
+ }
7896
+ this.url = parsedUrl.toString();
7897
+ let parsedProtocols = [];
7898
+ if (typeof protocols === "string") {
7899
+ parsedProtocols = [protocols];
7900
+ } else if (Array.isArray(protocols)) {
7901
+ parsedProtocols = [...protocols];
7902
+ }
7903
+ this.#init(parsedProtocols);
7904
+ }
7905
+ async #init(protocols) {
7906
+ try {
7907
+ this.#duplex = await globalThis.fullstacked.bridge({
7908
+ mod: WebSocket2,
7909
+ fn: Connect,
7910
+ data: [this.url, protocols]
7911
+ });
7912
+ this.#ee = this.#duplex.eventEmitter();
7913
+ this.#ee.on("open", (selectedProtocol) => {
7914
+ if (this.readyState === _WebSocketCore.CONNECTING) {
7915
+ this.readyState = _WebSocketCore.OPEN;
7916
+ this.protocol = selectedProtocol || "";
7917
+ const event = new Event("open");
7918
+ this.dispatchEvent(event);
7919
+ this.onopen?.(event);
7920
+ }
7921
+ });
7922
+ this.#ee.on(
7923
+ "message",
7924
+ (data, isBinary) => {
7925
+ if (this.readyState !== _WebSocketCore.OPEN && this.readyState !== _WebSocketCore.CLOSING) {
7926
+ return;
7927
+ }
7928
+ let messageData = data;
7929
+ if (isBinary && data instanceof Uint8Array) {
7930
+ if (this.binaryType === "arraybuffer") {
7931
+ messageData = data.buffer.slice(
7932
+ data.byteOffset,
7933
+ data.byteOffset + data.byteLength
7934
+ );
7935
+ } else {
7936
+ messageData = typeof Blob !== "undefined" ? new Blob([data]) : data.buffer.slice(
7937
+ data.byteOffset,
7938
+ data.byteOffset + data.byteLength
7939
+ );
7940
+ }
7941
+ }
7942
+ const event = new MessageEvent("message", {
7943
+ data: messageData,
7944
+ origin: this.url
7945
+ });
7946
+ this.dispatchEvent(event);
7947
+ this.onmessage?.(event);
7948
+ }
7949
+ );
7950
+ this.#ee.on("error", (errorMsg) => {
7951
+ const event = new Event("error");
7952
+ event.message = errorMsg;
7953
+ this.dispatchEvent(event);
7954
+ this.onerror?.(event);
7955
+ });
7956
+ this.#ee.on(
7957
+ "close",
7958
+ (code3, reason, wasClean) => {
7959
+ if (this.readyState === _WebSocketCore.CLOSED) return;
7960
+ this.readyState = _WebSocketCore.CLOSED;
7961
+ const event = new GlobalCloseEvent("close", {
7962
+ code: code3 || 1e3,
7963
+ reason: reason || "",
7964
+ wasClean: wasClean ?? code3 === 1e3
7965
+ });
7966
+ this.dispatchEvent(event);
7967
+ this.onclose?.(event);
7968
+ }
7969
+ );
7970
+ this.#duplex.on("close", () => {
7971
+ if (this.readyState !== _WebSocketCore.CLOSED) {
7972
+ this.readyState = _WebSocketCore.CLOSED;
7973
+ const event = new GlobalCloseEvent("close", {
7974
+ code: 1006,
7975
+ reason: "",
7976
+ wasClean: false
7977
+ });
7978
+ this.dispatchEvent(event);
7979
+ this.onclose?.(event);
7980
+ }
7981
+ });
7982
+ } catch (err) {
7983
+ queueMicrotask(() => {
7984
+ this.readyState = _WebSocketCore.CLOSED;
7985
+ const errorEvent = new Event("error");
7986
+ errorEvent.message = err?.message || String(err);
7987
+ this.dispatchEvent(errorEvent);
7988
+ this.onerror?.(errorEvent);
7989
+ const closeEvent = new GlobalCloseEvent("close", {
7990
+ code: 1006,
7991
+ reason: err?.message || String(err),
7992
+ wasClean: false
7993
+ });
7994
+ this.dispatchEvent(closeEvent);
7995
+ this.onclose?.(closeEvent);
7996
+ });
7997
+ }
7998
+ }
7999
+ send(data) {
8000
+ if (this.readyState === _WebSocketCore.CONNECTING) {
8001
+ throw new DOMException(
8002
+ "WebSocket is still in CONNECTING state.",
8003
+ "InvalidStateError"
8004
+ );
8005
+ }
8006
+ if (this.readyState !== _WebSocketCore.OPEN) {
8007
+ return;
8008
+ }
8009
+ if (typeof data === "string") {
8010
+ this.#duplex?.writeEvent("send", data, false);
8011
+ } else if (data instanceof Uint8Array) {
8012
+ this.#duplex?.writeEvent("send", data, true);
8013
+ } else if (data instanceof ArrayBuffer) {
8014
+ this.#duplex?.writeEvent("send", new Uint8Array(data), true);
8015
+ } else if (ArrayBuffer.isView(data)) {
8016
+ this.#duplex?.writeEvent(
8017
+ "send",
8018
+ new Uint8Array(data.buffer, data.byteOffset, data.byteLength),
8019
+ true
8020
+ );
8021
+ } else if (typeof Blob !== "undefined" && data instanceof Blob) {
8022
+ data.arrayBuffer().then((buf) => {
8023
+ if (this.readyState === _WebSocketCore.OPEN) {
8024
+ this.#duplex?.writeEvent("send", new Uint8Array(buf), true);
8025
+ }
8026
+ });
8027
+ } else {
8028
+ this.#duplex?.writeEvent("send", String(data), false);
8029
+ }
8030
+ }
8031
+ close(code3, reason) {
8032
+ if (code3 !== void 0) {
8033
+ if (code3 !== 1e3 && (code3 < 3e3 || code3 > 4999)) {
8034
+ throw new DOMException(
8035
+ `The code must be either 1000, or between 3000 and 4999. Received ${code3}`,
8036
+ "InvalidAccessError"
8037
+ );
8038
+ }
8039
+ }
8040
+ if (reason !== void 0) {
8041
+ const byteLength = new TextEncoder().encode(reason).byteLength;
8042
+ if (byteLength > 123) {
8043
+ throw new DOMException(
8044
+ "The reason must not be longer than 123 bytes.",
8045
+ "SyntaxError"
8046
+ );
8047
+ }
8048
+ }
8049
+ if (this.readyState === _WebSocketCore.CLOSING || this.readyState === _WebSocketCore.CLOSED) {
8050
+ return;
8051
+ }
8052
+ this.readyState = _WebSocketCore.CLOSING;
8053
+ this.#duplex?.writeEvent("close", code3 ?? 1e3, reason ?? "");
8054
+ }
8055
+ };
8056
+ var websocket_default = WebSocketCore;
8057
+
7823
8058
  // ../../core/internal/bundle/lib/@types/fs.ts
7824
8059
  var Exists = 0;
7825
8060
  var Stats = 1;
@@ -7855,7 +8090,7 @@ var Exit = 5;
7855
8090
  init_isWorker();
7856
8091
 
7857
8092
  // ../../core/internal/bundle/lib/process/version.json
7858
- var version_default = { major: "1", minor: "0", patch: "0-alpha", branch: "v1", build: "1783", hash: "58f6546ee36a4629ac9a7e4ffba71d768b42fdbb" };
8093
+ var version_default = { major: "1", minor: "0", patch: "0-alpha", branch: "v1", build: "1789", hash: "336ec864b0e31ab815591b388cfb5acd72a40612" };
7859
8094
 
7860
8095
  // ../../core/internal/bundle/lib/timers/index.ts
7861
8096
  var setTimeout2 = globalThis.setTimeout.bind(globalThis);
@@ -7871,12 +8106,12 @@ globalThis.clearImmediate = ((id) => {
7871
8106
 
7872
8107
  // ../../core/internal/bundle/lib/process/index.ts
7873
8108
  var Item = class {
8109
+ fun;
8110
+ array;
7874
8111
  constructor(fun, array) {
7875
8112
  this.fun = fun;
7876
8113
  this.array = array;
7877
8114
  }
7878
- fun;
7879
- array;
7880
8115
  run() {
7881
8116
  this.fun.apply(null, this.array);
7882
8117
  }
@@ -8850,8 +9085,14 @@ async function init() {
8850
9085
  globalThis.fullstacked.platformBridge = platformBridge2;
8851
9086
  globalThis.fullstacked.bridge = bridge;
8852
9087
  globalThis.fullstacked.fetch = fetch.bind(globalThis);
9088
+ if (typeof WebSocket !== "undefined") {
9089
+ globalThis.fullstacked.WebSocket = WebSocket;
9090
+ }
8853
9091
  globalThis.fullstacked.onStreamData = duplex_default;
8854
9092
  globalThis.fetch = fetch_default;
9093
+ if (typeof window !== "undefined" || !globalThis.process?.versions?.node) {
9094
+ globalThis.WebSocket = websocket_default;
9095
+ }
8855
9096
  await Promise.all([import("timers"), import("buffer")]);
8856
9097
  if (!globalThis.process) {
8857
9098
  globalThis.process = (await import("process")).default;
@@ -9374,19 +9615,58 @@ async function bundleAndImportFile(file, startDir, writeErr, extraArgs) {
9374
9615
  }
9375
9616
  }
9376
9617
  async function runFile(file, extraArgs, writeOut, writeErr) {
9377
- const res = await bundleAndImportFile(
9378
- file,
9379
- process.cwd(),
9380
- writeErr,
9381
- extraArgs
9382
- );
9383
- if (!res) return 1;
9618
+ const originalWebSocket = globalThis.WebSocket;
9619
+ const hasOriginalWindow = "window" in globalThis;
9620
+ const hasOriginalBuffer = "Buffer" in globalThis;
9621
+ const originalBuffer = globalThis.Buffer;
9622
+ const hasOriginalFullstacked = "fullstacked" in globalThis;
9623
+ const originalFullstackedWebSocket = globalThis.fullstacked?.WebSocket;
9624
+ if (!globalThis.fullstacked) {
9625
+ globalThis.fullstacked = {};
9626
+ }
9627
+ if (originalWebSocket && !globalThis.fullstacked.WebSocket) {
9628
+ globalThis.fullstacked.WebSocket = originalWebSocket;
9629
+ }
9630
+ globalThis.WebSocket = websocket_default;
9631
+ if (!hasOriginalWindow) {
9632
+ globalThis.window = globalThis;
9633
+ }
9384
9634
  try {
9385
- await waitForInterfaces();
9635
+ const res = await bundleAndImportFile(
9636
+ file,
9637
+ process.cwd(),
9638
+ writeErr,
9639
+ extraArgs
9640
+ );
9641
+ if (!res) return 1;
9642
+ try {
9643
+ await waitForInterfaces();
9644
+ } finally {
9645
+ await res.cleanup();
9646
+ }
9647
+ return 0;
9386
9648
  } finally {
9387
- await res.cleanup();
9649
+ if (originalWebSocket) {
9650
+ globalThis.WebSocket = originalWebSocket;
9651
+ } else {
9652
+ delete globalThis.WebSocket;
9653
+ }
9654
+ if (!hasOriginalWindow) {
9655
+ delete globalThis.window;
9656
+ }
9657
+ if (!hasOriginalBuffer) {
9658
+ delete globalThis.Buffer;
9659
+ } else {
9660
+ globalThis.Buffer = originalBuffer;
9661
+ }
9662
+ if (!hasOriginalFullstacked) {
9663
+ delete globalThis.fullstacked;
9664
+ } else if (originalFullstackedWebSocket) {
9665
+ globalThis.fullstacked.WebSocket = originalFullstackedWebSocket;
9666
+ } else {
9667
+ delete globalThis.fullstacked.WebSocket;
9668
+ }
9388
9669
  }
9389
- return 0;
9390
9670
  }
9391
9671
  async function runDirectory(positionals, pluginsArgs, buildOnly, noOpen, env2, writeOut, writeErr) {
9392
9672
  const targetDirectory = path_default.resolve(positionals.at(-1) || ".");
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "fullstacked",
3
- "version": "1.0.0-alpha.1783",
3
+ "version": "1.0.0-alpha.1789",
4
4
  "bin": {
5
5
  "fullstacked": "index.js"
6
6
  },
7
7
  "type": "module",
8
8
  "scripts": {
9
- "build": "node -r @nitrogql/esbuild-register build",
9
+ "build": "node build.ts",
10
10
  "prepack": "npm run build"
11
11
  },
12
12
  "dependencies": {
@@ -14,18 +14,17 @@
14
14
  "ws": "^8.21.1"
15
15
  },
16
16
  "devDependencies": {
17
- "@nitrogql/esbuild-register": "^1.7.2",
18
17
  "@types/ws": "^8.18.1",
19
18
  "esbuild": "^0.28.1",
20
19
  "node-addon-api": "^8.9.0"
21
20
  },
22
21
  "optionalDependencies": {
23
- "@fullstacked/darwin-arm64": "1.0.0-alpha.1783",
24
- "@fullstacked/darwin-x64": "1.0.0-alpha.1783",
25
- "@fullstacked/linux-arm64": "1.0.0-alpha.1783",
26
- "@fullstacked/linux-x64": "1.0.0-alpha.1783",
27
- "@fullstacked/win32-arm64": "1.0.0-alpha.1783",
28
- "@fullstacked/win32-x64": "1.0.0-alpha.1783"
22
+ "@fullstacked/darwin-arm64": "1.0.0-alpha.1789",
23
+ "@fullstacked/darwin-x64": "1.0.0-alpha.1789",
24
+ "@fullstacked/linux-arm64": "1.0.0-alpha.1789",
25
+ "@fullstacked/linux-x64": "1.0.0-alpha.1789",
26
+ "@fullstacked/win32-arm64": "1.0.0-alpha.1789",
27
+ "@fullstacked/win32-x64": "1.0.0-alpha.1789"
29
28
  },
30
29
  "author": "FullStacked",
31
30
  "license": "MIT",
@@ -14,6 +14,7 @@ export declare const Git: CoreModule;
14
14
  export declare const Packages: CoreModule;
15
15
  export declare const Dgram: CoreModule;
16
16
  export declare const Plugin: CoreModule;
17
+ export declare const WebSocket: CoreModule;
17
18
  export type ModuleSwitch = any;
18
19
  export type CoreCallResponseType = number;
19
20
  export declare const CoreResponseError: CoreCallResponseType;
@@ -53,25 +53,38 @@ export interface PackageMetadata {
53
53
  export interface PackageVersion {
54
54
  name: string;
55
55
  version: string;
56
- dependencies: {
56
+ dependencies?: {
57
+ [key: string]: string;
58
+ };
59
+ devDependencies?: {
57
60
  [key: string]: string;
58
61
  };
59
62
  optionalDependencies?: {
60
63
  [key: string]: string;
61
64
  };
62
- /**
63
- * DevDependencies removed as unused in sub-deps logic
64
- */
65
- dist: PackageDist;
66
- license?: any;
67
- engines?: any;
68
65
  peerDependencies?: {
69
66
  [key: string]: string;
70
67
  };
68
+ peerDependenciesMeta?: {
69
+ [key: string]: {
70
+ optional?: boolean;
71
+ };
72
+ };
71
73
  bundleDependencies?: BundleDependenciesWrapper;
72
74
  bundledDependencies?: BundleDependenciesWrapper;
75
+ dist: PackageDist;
76
+ license?: any;
77
+ funding?: any;
78
+ bin?: any;
79
+ engines?: any;
73
80
  os?: string[];
74
81
  cpu?: string[];
82
+ libc?: string[];
83
+ deprecated?: any;
84
+ hasInstallScript?: boolean;
85
+ scripts?: {
86
+ [key: string]: string;
87
+ };
75
88
  }
76
89
  export type BundleDependenciesWrapper = string[];
77
90
  export interface PackageDist {
@@ -89,41 +102,54 @@ export interface PackageLock {
89
102
  };
90
103
  }
91
104
  export interface LockDependency {
105
+ name?: string;
92
106
  version?: string;
93
107
  resolved?: string;
94
108
  integrity?: string;
95
- dependencies?: {
109
+ dev?: boolean;
110
+ optional?: boolean;
111
+ devOptional?: boolean;
112
+ peer?: boolean;
113
+ inBundle?: boolean;
114
+ hasInstallScript?: boolean;
115
+ hasShrinkwrap?: boolean;
116
+ license?: string;
117
+ funding?: any;
118
+ bin?: {
96
119
  [key: string]: string;
97
120
  };
98
- optionalDependencies?: {
121
+ dependencies?: {
99
122
  [key: string]: string;
100
123
  };
101
- license?: string;
102
- engines?: {
124
+ devDependencies?: {
103
125
  [key: string]: string;
104
126
  };
105
127
  peerDependencies?: {
106
128
  [key: string]: string;
107
129
  };
108
- peer?: boolean;
109
- optional?: boolean;
110
- os?: string[];
111
- cpu?: string[];
112
- }
113
- /**
114
- * Queue for BFS
115
- */
116
- export interface QueueItem {
117
- ParentPath: string;
118
- Deps: {
119
- [key: string]: string;
130
+ peerDependenciesMeta?: {
131
+ [key: string]: any;
120
132
  };
121
- OptionalDeps: {
133
+ optionalDependencies?: {
122
134
  [key: string]: string;
123
135
  };
124
- PeerDeps: {
136
+ bundleDependencies?: string[];
137
+ engines?: {
125
138
  [key: string]: string;
126
139
  };
140
+ os?: string[];
141
+ cpu?: string[];
142
+ libc?: string[];
143
+ deprecated?: string;
144
+ }
145
+ export interface DepItem {
146
+ Name: string;
147
+ Range: string;
148
+ Optional: boolean;
149
+ }
150
+ export interface QueueItem {
151
+ ParentPath: string;
152
+ Items: DepItem[];
127
153
  }
128
154
  export interface ProgressReader {
129
155
  Reader: any;
@@ -0,0 +1,2 @@
1
+ export type WebSocketFn = number;
2
+ export declare const Connect: WebSocketFn;
@@ -1,4 +1,4 @@
1
- import { SerializableData } from "../@types/index.ts";
1
+ import { type SerializableData } from "../@types/index.ts";
2
2
  import { createEventEmitter } from "./eventEmitter.ts";
3
3
  declare function onStreamData(id: number, payload: ArrayBuffer | string): void;
4
4
  type StreamData = string | Buffer | Uint8Array | DataView;
@@ -1,4 +1,4 @@
1
- import { CoreModule, SerializableData } from "../@types/index.ts";
1
+ import { type CoreModule, type SerializableData } from "../@types/index.ts";
2
2
  import type platformBridgeType from "./platform/index.ts";
3
3
  import type { JSPlugin } from "../plugin/index.ts";
4
4
  declare global {
@@ -24,6 +24,7 @@ type FullStacked = {
24
24
  respondGetSize?: (response: any) => void;
25
25
  };
26
26
  fetch: typeof fetch;
27
+ WebSocket: typeof WebSocket;
27
28
  open?: (ctx: number) => void;
28
29
  };
29
30
  type BridgeOpts = {
@@ -1,4 +1,4 @@
1
- import { PlatformBridge } from "./index.ts";
1
+ import type { PlatformBridge } from "./index.ts";
2
2
  declare global {
3
3
  var android: {
4
4
  coreCall?: (payloadBase64: string) => string;
@@ -1,2 +1,2 @@
1
- import { PlatformBridge } from "./index.ts";
1
+ import type { PlatformBridge } from "./index.ts";
2
2
  export declare function BridgeAppleInit(): Promise<PlatformBridge>;
@@ -1,4 +1,4 @@
1
- import { PlatformBridge } from "./index.ts";
1
+ import type { PlatformBridge } from "./index.ts";
2
2
  declare global {
3
3
  var webkit: any;
4
4
  var chrome: any;
@@ -1,2 +1,2 @@
1
- import { PlatformBridge } from "./index.ts";
1
+ import type { PlatformBridge } from "./index.ts";
2
2
  export declare function BridgeWindowsInit(): Promise<PlatformBridge>;
@@ -1,4 +1,4 @@
1
- import { SerializableData, SerializableDataType } from "../@types/index.ts";
1
+ import { type SerializableData, type SerializableDataType } from "../@types/index.ts";
2
2
  export declare function numberToUint4Bytes(num: number): Uint8Array<ArrayBuffer>;
3
3
  export declare function uint4BytesToNumber(bytes: Uint8Array): number;
4
4
  export declare function serializeUndefined(): Uint8Array<ArrayBuffer>;
@@ -1,4 +1,4 @@
1
- import { EsbuildResult } from "../@types/bundle.ts";
1
+ import { type EsbuildResult } from "../@types/bundle.ts";
2
2
  export declare function esbuildVersion(): Promise<string>;
3
3
  export declare function bundle(entryPoint?: string): Promise<EsbuildResult>;
4
4
  export declare function bundleFile(entryPoint: string): Promise<EsbuildResult>;
@@ -1,4 +1,4 @@
1
- import { GoFileInfo } from "../@types/fs";
1
+ import type { GoFileInfo } from "../@types/fs.ts";
2
2
  export type PathLike = string | URL | Buffer;
3
3
  export declare function formatPathLike(path: PathLike): string;
4
4
  export type ReadFileOpts = string | {
@@ -1,5 +1,5 @@
1
1
  import { Writable } from "stream";
2
- import { Dirent, PathLike, ReadFileOpts, StatOpts, Stats as StatsInterface } from "./common.ts";
2
+ import { type Dirent, type PathLike, type ReadFileOpts, type StatOpts, type Stats as StatsInterface } from "./common.ts";
3
3
  export declare function existsSync(path: PathLike): boolean;
4
4
  export declare function statSync(path: PathLike, options?: StatOpts): StatsInterface;
5
5
  type StatCallback = (err: Error, stat: StatsInterface) => void;
@@ -1,4 +1,4 @@
1
- import { Dirent, PathLike, ReadFileOpts, StatOpts, Stats as StatsInterface } from "./common.ts";
1
+ import { type Dirent, type PathLike, type ReadFileOpts, type StatOpts, type Stats as StatsInterface } from "./common.ts";
2
2
  export declare function readFile(path: PathLike): Promise<Buffer<ArrayBuffer>>;
3
3
  export declare function readFile(path: PathLike, options: ReadFileOpts): Promise<string>;
4
4
  export declare function readdir(path: PathLike, options: {
@@ -1,4 +1,4 @@
1
- import { GitAuthor, GitBranch, GitCommit, GitHead, GitProxy, GitStatus, GitTag } from "../@types/git.ts";
1
+ import { type GitAuthor, type GitBranch, type GitCommit, type GitHead, type GitProxy, type GitStatus, type GitTag } from "../@types/git.ts";
2
2
  import type { Duplex } from "../bridge/duplex.ts";
3
3
  export declare function createGitAuthManager(): Promise<{
4
4
  on(): void;
@@ -1,5 +1,5 @@
1
- import { Progress } from "../@types/packages.ts";
2
- import { EventEmitter } from "../bridge/eventEmitter.ts";
1
+ import { type Progress } from "../@types/packages.ts";
2
+ import type { EventEmitter } from "../bridge/eventEmitter.ts";
3
3
  export declare function install(directory: string, saveDev: boolean, ...packages: string[]): Promise<EventEmitter<{
4
4
  progress: Progress[];
5
5
  }>>;
@@ -1,4 +1,4 @@
1
- import { ParsedPath } from "../@types/path.ts";
1
+ import { type ParsedPath } from "../@types/path.ts";
2
2
  export declare let sep: string;
3
3
  export declare function isAbsolute(path: string): boolean;
4
4
  export declare function resolve(...paths: string[]): string;
@@ -1,5 +1,5 @@
1
- import { GitAuth, PluginTypeGitAuth, PluginTypeBuild } from "../@types/index.ts";
2
- import { PluginBuildData, PluginParams } from "../@types/bundle.ts";
1
+ import { type GitAuth, PluginTypeGitAuth, PluginTypeBuild } from "../@types/index.ts";
2
+ import type { PluginBuildData, PluginParams } from "../@types/bundle.ts";
3
3
  type CommonPluginData = {
4
4
  name?: string;
5
5
  };
@@ -1,4 +1,4 @@
1
- import { Tunnel } from "../@types/tunnel.ts";
1
+ import { type Tunnel } from "../@types/tunnel.ts";
2
2
  export declare function register(tunnel: Tunnel): Promise<string>;
3
3
  declare const tunnel: {
4
4
  register: typeof register;
@@ -0,0 +1,25 @@
1
+ export declare class WebSocketCore extends EventTarget {
2
+ #private;
3
+ static readonly CONNECTING = 0;
4
+ static readonly OPEN = 1;
5
+ static readonly CLOSING = 2;
6
+ static readonly CLOSED = 3;
7
+ readonly CONNECTING = 0;
8
+ readonly OPEN = 1;
9
+ readonly CLOSING = 2;
10
+ readonly CLOSED = 3;
11
+ readonly url: string;
12
+ readyState: number;
13
+ bufferedAmount: number;
14
+ protocol: string;
15
+ extensions: string;
16
+ binaryType: "blob" | "arraybuffer";
17
+ onopen: ((this: WebSocketCore, ev: Event) => any) | null;
18
+ onerror: ((this: WebSocketCore, ev: Event) => any) | null;
19
+ onclose: ((this: WebSocketCore, ev: CloseEvent) => any) | null;
20
+ onmessage: ((this: WebSocketCore, ev: MessageEvent) => any) | null;
21
+ constructor(url: string | URL, protocols?: string | string[]);
22
+ send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;
23
+ close(code?: number, reason?: string): void;
24
+ }
25
+ export default WebSocketCore;