@fkn/lib 0.5.4 → 0.6.0

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 (192) hide show
  1. package/account.cjs +1 -1
  2. package/account.js +2 -2
  3. package/api/account.d.ts +7 -0
  4. package/api/broker-bridge.d.ts +12 -0
  5. package/api/connect-store.d.ts +9 -0
  6. package/api/connect.d.ts +2 -0
  7. package/api/data-plane.d.ts +28 -0
  8. package/api/dns/index.d.ts +1 -0
  9. package/api/dns/lookup.d.ts +8 -0
  10. package/api/index.d.ts +78 -0
  11. package/api/install-prompt.d.ts +2 -0
  12. package/api/local-net/index.d.ts +43 -0
  13. package/api/overlay-mount.d.ts +2 -0
  14. package/api/overlay.d.ts +17 -0
  15. package/api/packages/host.d.ts +12 -0
  16. package/api/packages/identity.d.ts +1 -0
  17. package/api/packages/index.d.ts +34 -0
  18. package/api/packages/picker.d.ts +28 -0
  19. package/api/packages/registry.d.ts +20 -0
  20. package/api/packages/store.d.ts +6 -0
  21. package/api/packages/types.d.ts +56 -0
  22. package/api/preconnect.d.ts +1 -0
  23. package/api/proxy/index.d.ts +1 -0
  24. package/api/proxy/proxy-fetch.d.ts +5 -0
  25. package/api/quota.d.ts +10 -0
  26. package/api/rate-token.d.ts +3 -0
  27. package/api/session-limit.d.ts +1 -0
  28. package/api/storage.d.ts +20 -0
  29. package/api/toast.d.ts +1 -0
  30. package/api/token-source.d.ts +4 -0
  31. package/api/ui-events.d.ts +8 -0
  32. package/api/ui-host.d.ts +2 -0
  33. package/api/webvpn/index.d.ts +3 -0
  34. package/api/webvpn/packets/metadata.d.ts +31 -0
  35. package/api/webvpn/packets/tcp-listener.d.ts +39 -0
  36. package/api/webvpn/packets/tcp.d.ts +88 -0
  37. package/api/webvpn/packets/udp.d.ts +183 -0
  38. package/api/webvpn/packets/utils.d.ts +24 -0
  39. package/api/webvpn/tcp-listener.d.ts +11 -0
  40. package/api/webvpn/tcp.d.ts +33 -0
  41. package/api/webvpn/udp.d.ts +33 -0
  42. package/api/webvpn/utils.d.ts +26 -0
  43. package/api/webvpn/webtransport.d.ts +62 -0
  44. package/api/worker/client.d.ts +3 -0
  45. package/api/worker/protocol.d.ts +15 -0
  46. package/{api-CDb2pv7C.cjs → api-DD5v1qP9.cjs} +1 -1
  47. package/{background-TtzKw6g0.js → background-BVBbBOmL.js} +41 -66
  48. package/background-B_VgpARk.cjs +1 -0
  49. package/cloud/dgram.cjs +1 -1
  50. package/cloud/dgram.js +2 -4
  51. package/cloud/dns.cjs +1 -1
  52. package/cloud/dns.js +0 -1
  53. package/cloud/fs/promises.cjs +1 -1
  54. package/cloud/fs/promises.js +0 -3
  55. package/cloud/fs.cjs +1 -1
  56. package/cloud/fs.js +3 -4
  57. package/cloud/http.cjs +1 -1
  58. package/cloud/http.js +0 -3
  59. package/cloud/net.cjs +1 -1
  60. package/cloud/net.js +2 -3
  61. package/cloud-5o7yJHeX.cjs +1 -0
  62. package/cloud-BFyf2uC7.js +112 -0
  63. package/cloud.cjs +1 -1
  64. package/cloud.js +8 -12
  65. package/connect-button-BBEjXzB3.cjs +1 -0
  66. package/connect-button-Ds9KpXHe.js +7 -0
  67. package/desktop.cjs +1 -1
  68. package/desktop.js +1 -1
  69. package/dgram-CE43gJq9.cjs +1 -0
  70. package/{dgram-DS5_yPc5.js → dgram-wtjARbt0.js} +30 -22
  71. package/dgram.cjs +1 -1
  72. package/dgram.js +1 -3
  73. package/dns.cjs +1 -1
  74. package/dns.js +2 -2
  75. package/extension-CPj10qwa.js +67 -0
  76. package/extension-D-NUXxzF.cjs +1 -0
  77. package/extension.cjs +1 -1
  78. package/extension.js +3 -5
  79. package/fs/promises.cjs +1 -1
  80. package/fs/promises.js +1 -4
  81. package/fs-BfmfMBiw.cjs +1 -0
  82. package/{fs-CQ-eWjXw.js → fs-D6nNf1mR.js} +4 -4
  83. package/fs.cjs +1 -1
  84. package/fs.js +1 -4
  85. package/http.cjs +2 -2
  86. package/http.js +7 -7
  87. package/index.cjs +1 -1
  88. package/index.js +23 -38
  89. package/{account.d.ts → lib/account.d.ts} +5 -8
  90. package/lib/api.d.ts +300 -0
  91. package/lib/auto.d.ts +5 -0
  92. package/lib/cloud/dgram.d.ts +2 -0
  93. package/lib/cloud/dns.d.ts +1 -0
  94. package/lib/cloud/frame.d.ts +3 -0
  95. package/lib/cloud/fs-promises.d.ts +5 -0
  96. package/lib/cloud/fs.d.ts +22 -0
  97. package/lib/cloud/http.d.ts +2 -0
  98. package/lib/cloud/net.d.ts +2 -0
  99. package/lib/cloud.d.ts +10 -0
  100. package/lib/connect-button.d.ts +1 -0
  101. package/lib/connect.d.ts +1 -0
  102. package/{desktop.d.ts → lib/desktop.d.ts} +6 -8
  103. package/lib/dns.d.ts +6 -0
  104. package/lib/dom.d.ts +2 -0
  105. package/lib/extension-prompt.d.ts +1 -0
  106. package/lib/extension.d.ts +4 -0
  107. package/lib/fkn-target.d.ts +1 -0
  108. package/lib/frame.d.ts +2 -0
  109. package/lib/fs/content-type.d.ts +1 -0
  110. package/lib/fs/hybrid.d.ts +10 -0
  111. package/lib/fs/index.d.ts +87 -0
  112. package/lib/fs/opfs.d.ts +8 -0
  113. package/lib/fs/promises.d.ts +8 -0
  114. package/lib/fs/types.d.ts +16 -0
  115. package/lib/index.d.ts +18 -0
  116. package/lib/node-fs/index.d.ts +95 -0
  117. package/lib/node-fs/shared.d.ts +39 -0
  118. package/lib/node-fs/store.d.ts +21 -0
  119. package/lib/opfs/index.d.ts +84 -0
  120. package/lib/opfs/promises.d.ts +8 -0
  121. package/lib/overlay.d.ts +14 -0
  122. package/lib/packages.d.ts +69 -0
  123. package/lib/proxy.d.ts +5 -0
  124. package/lib/quota.d.ts +20 -0
  125. package/lib/react.d.ts +7 -0
  126. package/lib/relay.d.ts +5 -0
  127. package/lib/storage.d.ts +22 -0
  128. package/lib/webvpn/dgram.d.ts +86 -0
  129. package/lib/webvpn/http.d.ts +180 -0
  130. package/lib/webvpn/index.d.ts +1 -0
  131. package/lib/webvpn/net.d.ts +132 -0
  132. package/lib/webvpn/utils.d.ts +32 -0
  133. package/net-CpuAhaQC.cjs +1 -0
  134. package/{net-Bl6_W3bd.js → net-DKMWPXb_.js} +3 -3
  135. package/net.cjs +1 -1
  136. package/net.js +2 -3
  137. package/node-fs-C0eKnboT.cjs +1 -0
  138. package/{node-fs-Bd_UUx1m.js → node-fs-Dbf93qP7.js} +40 -17
  139. package/opfs/promises.cjs +1 -1
  140. package/opfs/promises.js +2 -3
  141. package/{opfs-BfcYLPGb.js → opfs-7_GmzQ93.js} +1 -1
  142. package/opfs-uClkgnb5.cjs +1 -0
  143. package/opfs.cjs +1 -1
  144. package/opfs.js +33 -32
  145. package/package.json +31 -21
  146. package/packages.cjs +1 -0
  147. package/packages.js +150 -0
  148. package/{locator-DxAsGV_o.js → proxy-C8SG1Beo.js} +542 -344
  149. package/proxy-bPaU3-Cz.cjs +53 -0
  150. package/react.cjs +1 -0
  151. package/react.js +18 -0
  152. package/{chunk-CPXzm0be.js → rolldown-runtime-DF993M8W.js} +1 -1
  153. package/rolldown-runtime-Doa5O59j.cjs +1 -0
  154. package/sandbox.d.ts +7 -0
  155. package/storage-OkwsFLN1.cjs +1 -0
  156. package/{storage-BcJfnkm3.js → storage-TmeyhZGt.js} +2 -2
  157. package/{utils-BsNRWMfl.cjs → utils-CoimMjf9.cjs} +1 -1
  158. package/background-Dk_vaVP1.cjs +0 -1
  159. package/chunk-B6C_zzib.cjs +0 -1
  160. package/cloud/dgram.d.ts +0 -537
  161. package/cloud/dns.d.ts +0 -12
  162. package/cloud/fs/promises.d.ts +0 -45
  163. package/cloud/fs.d.ts +0 -75
  164. package/cloud/http.d.ts +0 -767
  165. package/cloud/net.d.ts +0 -606
  166. package/cloud-BrY9dKwV.cjs +0 -1
  167. package/cloud-C-LK4DWa.js +0 -33
  168. package/cloud.d.ts +0 -1053
  169. package/dgram-C5rGcbej.cjs +0 -1
  170. package/dgram.d.ts +0 -541
  171. package/dns.d.ts +0 -12
  172. package/extension-9Uv_0HdS.cjs +0 -1
  173. package/extension-Dgz0UTy0.js +0 -245
  174. package/extension.d.ts +0 -852
  175. package/favicon.svg +0 -5
  176. package/fs/promises.d.ts +0 -65
  177. package/fs-Bc6087fG.cjs +0 -1
  178. package/fs.d.ts +0 -138
  179. package/http.d.ts +0 -767
  180. package/index.d.ts +0 -2254
  181. package/locator-Cf7M3QKN.cjs +0 -53
  182. package/net-C5kWnI4C.cjs +0 -1
  183. package/net.d.ts +0 -606
  184. package/node-fs-lrlD_zqB.cjs +0 -1
  185. package/opfs/promises.d.ts +0 -46
  186. package/opfs-Dsi4FkJU.cjs +0 -1
  187. package/opfs.d.ts +0 -83
  188. package/proxy-A9UvWUaF.cjs +0 -1
  189. package/proxy-wiZN4eTR.js +0 -14
  190. package/storage-C2-_-bTO.cjs +0 -1
  191. /package/{api-ByfayMm1.js → api--bnCFd4w.js} +0 -0
  192. /package/{utils-CNydj3OT.js → utils-DPtyxGQu.js} +0 -0
package/lib/api.d.ts ADDED
@@ -0,0 +1,300 @@
1
+ export type { Resolvers } from '../api';
2
+ export declare const hasTransport: boolean;
3
+ export declare const apiPromise: Promise<{
4
+ readonly cloud: {
5
+ readonly fetch: (input: string | Request | URL, init?: (RequestInit & {
6
+ render?: boolean;
7
+ }) | undefined) => Promise<Response>;
8
+ readonly quota: () => Promise<{
9
+ overQuota: boolean;
10
+ remaining: number;
11
+ usedBytes: number;
12
+ limitBytes: number;
13
+ premium: boolean;
14
+ bytesPerSecond: number;
15
+ }>;
16
+ readonly dns: {
17
+ readonly lookup: (hostname: string, options?: {
18
+ all?: boolean | undefined;
19
+ family?: 0 | 4 | 6;
20
+ } | undefined) => Promise<{
21
+ address: string;
22
+ family: 0 | 4 | 6;
23
+ }[] | {
24
+ address: string;
25
+ family: 0 | 4 | 6;
26
+ } | undefined>;
27
+ };
28
+ readonly fs: {
29
+ readonly available: () => Promise<boolean>;
30
+ readonly list: () => Promise<{
31
+ path: string;
32
+ size: number;
33
+ contentType: string | null;
34
+ updatedAt: string;
35
+ }[]>;
36
+ readonly quota: () => Promise<{
37
+ usedBytes: number;
38
+ limitBytes: number;
39
+ remaining: number;
40
+ objects: number;
41
+ maxObjects: number;
42
+ }>;
43
+ readonly readFile: (path: string) => Promise<Uint8Array<ArrayBufferLike>>;
44
+ readonly writeFile: (path: string, data: import("../api/storage").WriteData, contentType: string | null) => Promise<void>;
45
+ readonly remove: (path: string) => Promise<void>;
46
+ };
47
+ readonly webvpn: {
48
+ readonly tcpSocket: (args_0: {
49
+ remoteAddress: string;
50
+ remotePort: number;
51
+ }) => Promise<{
52
+ localAddress: string;
53
+ localFamily: 'IPv4' | 'IPv6';
54
+ localPort: number;
55
+ remoteAddress: string;
56
+ remoteFamily: 'IPv4' | 'IPv6';
57
+ remotePort: number;
58
+ dataReadableStream: ReadableStream<Uint8Array>;
59
+ dataWritableStream: WritableStream<Uint8Array>;
60
+ end: () => Promise<void>;
61
+ destroy: () => Promise<void>;
62
+ destroySoon: () => Promise<void>;
63
+ resetAndDestroy: () => Promise<void>;
64
+ setOption: (option: import("../api/webvpn/tcp").TcpSocketOption) => Promise<void>;
65
+ }>;
66
+ readonly tcpSocketListener: (args_0: {
67
+ localAddress: string;
68
+ localPort: number;
69
+ onConnection: (connection: import("../api/webvpn/tcp").TcpSocketResult) => void;
70
+ }) => Promise<{
71
+ localAddress: string;
72
+ localFamily: "IPv4" | "IPv6";
73
+ localPort: number;
74
+ close: () => Promise<void>;
75
+ }>;
76
+ readonly udpSocket: (args_0: {
77
+ type: 'udp4' | 'udp6';
78
+ port: number;
79
+ address: string;
80
+ dataPort?: boolean;
81
+ }) => Promise<{
82
+ socketId: number;
83
+ dataPort: MessagePort | undefined;
84
+ localAddress: string;
85
+ localFamily: "IPv4" | "IPv6";
86
+ localPort: number;
87
+ dataReadableStream: ReadableStream<{
88
+ data: ArrayBuffer;
89
+ size: number;
90
+ family: 'IPv4' | 'IPv6';
91
+ address: string;
92
+ port: number;
93
+ }>;
94
+ connect: (args_0: {
95
+ remoteAddress: string;
96
+ remotePort: number;
97
+ }) => Promise<void>;
98
+ send: (args_0: {
99
+ message: ArrayBuffer;
100
+ address?: string;
101
+ port?: number;
102
+ }) => Promise<void>;
103
+ close: () => Promise<void>;
104
+ setOption: (option: import("../api/webvpn/udp").UdpSocketOption) => Promise<void>;
105
+ }>;
106
+ };
107
+ };
108
+ readonly overlay: {
109
+ readonly setHost: (push: (state: {
110
+ modal: boolean;
111
+ rects: {
112
+ x: number;
113
+ y: number;
114
+ width: number;
115
+ height: number;
116
+ }[];
117
+ }) => unknown) => Promise<void>;
118
+ };
119
+ readonly installPrompt: {
120
+ readonly show: (reason?: string | undefined) => Promise<void>;
121
+ readonly hide: () => Promise<void>;
122
+ };
123
+ readonly connect: {
124
+ readonly prompt: (consumerOrigin: string) => Promise<boolean>;
125
+ };
126
+ readonly packages: {
127
+ search: (query: import("./packages").PackageQuery) => Promise<{
128
+ error: import("./packages").PackagesErrorCode;
129
+ message: string;
130
+ } | {
131
+ results: {
132
+ uri: string;
133
+ origin: 'npm';
134
+ name: string;
135
+ version: string;
136
+ description: string;
137
+ keywords: string[];
138
+ publisher: string | null;
139
+ downloadsMonthly: number | null;
140
+ links: {
141
+ npm?: string;
142
+ homepage?: string;
143
+ repository?: string;
144
+ };
145
+ installed: boolean;
146
+ }[];
147
+ }>;
148
+ pick: (query: import("./packages").PackageQuery, options?: import("./packages").PickOptions | undefined) => Promise<{
149
+ error: import("./packages").PackagesErrorCode;
150
+ message: string;
151
+ } | {
152
+ results: {
153
+ uri: string;
154
+ origin: 'npm';
155
+ name: string;
156
+ version: string;
157
+ description: string;
158
+ keywords: string[];
159
+ publisher: string | null;
160
+ downloadsMonthly: number | null;
161
+ links: {
162
+ npm?: string;
163
+ homepage?: string;
164
+ repository?: string;
165
+ };
166
+ installed: boolean;
167
+ }[];
168
+ failed: string[];
169
+ } | {
170
+ declined: true;
171
+ }>;
172
+ install: (uri: string, options?: import("./packages").InstallOptions | undefined) => Promise<{
173
+ error: import("./packages").PackagesErrorCode;
174
+ message: string;
175
+ } | {
176
+ installed: {
177
+ uri: string;
178
+ name: string;
179
+ version: string;
180
+ installedAt: number;
181
+ };
182
+ } | {
183
+ declined: true;
184
+ }>;
185
+ list: () => Promise<{
186
+ results: {
187
+ uri: string;
188
+ name: string;
189
+ version: string;
190
+ installedAt: number;
191
+ }[];
192
+ }>;
193
+ uninstall: (uri: string) => Promise<{
194
+ error: import("./packages").PackagesErrorCode;
195
+ message: string;
196
+ } | {
197
+ ok: true;
198
+ }>;
199
+ connect: (uri: string, options?: import("./packages").ConnectOptions | undefined) => Promise<{
200
+ error: import("./packages").PackagesErrorCode;
201
+ message: string;
202
+ } | {
203
+ port: MessagePort;
204
+ closed: Promise<void>;
205
+ }>;
206
+ };
207
+ readonly account: {
208
+ readonly info: () => Promise<{
209
+ name: string;
210
+ image: string | null;
211
+ premium: boolean;
212
+ premiumUntil: string | null;
213
+ } | null>;
214
+ readonly login: (consumerOrigin: string) => Promise<boolean>;
215
+ readonly logout: () => Promise<void>;
216
+ readonly onChange: (listener: () => void) => Promise<() => Promise<void>>;
217
+ };
218
+ readonly proxyFetch: (input: string | Request | URL, init?: (RequestInit & {
219
+ render?: boolean;
220
+ }) | undefined) => Promise<Response>;
221
+ readonly webVpnTcpSocket: (args_0: {
222
+ remoteAddress: string;
223
+ remotePort: number;
224
+ }) => Promise<{
225
+ localAddress: string;
226
+ localFamily: 'IPv4' | 'IPv6';
227
+ localPort: number;
228
+ remoteAddress: string;
229
+ remoteFamily: 'IPv4' | 'IPv6';
230
+ remotePort: number;
231
+ dataReadableStream: ReadableStream<Uint8Array>;
232
+ dataWritableStream: WritableStream<Uint8Array>;
233
+ end: () => Promise<void>;
234
+ destroy: () => Promise<void>;
235
+ destroySoon: () => Promise<void>;
236
+ resetAndDestroy: () => Promise<void>;
237
+ setOption: (option: import("../api/webvpn/tcp").TcpSocketOption) => Promise<void>;
238
+ }>;
239
+ readonly webVpnTcpSocketListener: (args_0: {
240
+ localAddress: string;
241
+ localPort: number;
242
+ onConnection: (connection: import("../api/webvpn/tcp").TcpSocketResult) => void;
243
+ }) => Promise<{
244
+ localAddress: string;
245
+ localFamily: "IPv4" | "IPv6";
246
+ localPort: number;
247
+ close: () => Promise<void>;
248
+ }>;
249
+ readonly webVpnUdpSocket: (args_0: {
250
+ type: 'udp4' | 'udp6';
251
+ port: number;
252
+ address: string;
253
+ dataPort?: boolean;
254
+ }) => Promise<{
255
+ socketId: number;
256
+ dataPort: MessagePort | undefined;
257
+ localAddress: string;
258
+ localFamily: "IPv4" | "IPv6";
259
+ localPort: number;
260
+ dataReadableStream: ReadableStream<{
261
+ data: ArrayBuffer;
262
+ size: number;
263
+ family: 'IPv4' | 'IPv6';
264
+ address: string;
265
+ port: number;
266
+ }>;
267
+ connect: (args_0: {
268
+ remoteAddress: string;
269
+ remotePort: number;
270
+ }) => Promise<void>;
271
+ send: (args_0: {
272
+ message: ArrayBuffer;
273
+ address?: string;
274
+ port?: number;
275
+ }) => Promise<void>;
276
+ close: () => Promise<void>;
277
+ setOption: (option: import("../api/webvpn/udp").UdpSocketOption) => Promise<void>;
278
+ }>;
279
+ readonly dnsLookup: (hostname: string, options?: {
280
+ all?: boolean | undefined;
281
+ family?: 0 | 4 | 6;
282
+ } | undefined) => Promise<{
283
+ address: string;
284
+ family: 0 | 4 | 6;
285
+ }[] | {
286
+ address: string;
287
+ family: 0 | 4 | 6;
288
+ } | undefined>;
289
+ readonly setOverlayHost: (push: (state: {
290
+ modal: boolean;
291
+ rects: {
292
+ x: number;
293
+ y: number;
294
+ width: number;
295
+ height: number;
296
+ }[];
297
+ }) => unknown) => Promise<void>;
298
+ readonly showInstallPrompt: (reason?: string | undefined) => Promise<void>;
299
+ readonly hideInstallPrompt: () => Promise<void>;
300
+ }>;
package/lib/auto.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export declare const isExtensionAvailable: () => boolean;
2
+ export declare const fetch: (input: RequestInfo | URL, init?: RequestInit & {
3
+ reason?: string;
4
+ render?: boolean;
5
+ }) => Promise<Response>;
@@ -0,0 +1,2 @@
1
+ export * from '../webvpn/dgram';
2
+ export { default } from '../webvpn/dgram';
@@ -0,0 +1 @@
1
+ export * from '../dns';
@@ -0,0 +1,3 @@
1
+ import type { AttachFrameOptions, Frame } from '@mfkn/web-extension';
2
+ export declare const attachFrame: ({ iframe, domains, syncCookies, lockdown }: AttachFrameOptions) => Promise<Frame>;
3
+ export declare const available: () => boolean;
@@ -0,0 +1,5 @@
1
+ export declare const readFile: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").ReadOptions) => Promise<Buffer | string>, writeFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => Promise<void>, unlink: (path: import("node:fs").PathLike) => Promise<void>, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>, readdir: (path: import("node:fs").PathLike) => Promise<string[]>, mkdir: (_path?: import("node:fs").PathLike, _options?: import("../node-fs/shared").MakeOptions) => Promise<void>, rm: (path: import("node:fs").PathLike, options?: {
2
+ recursive?: boolean;
3
+ }) => Promise<void>, rmdir: (path: import("node:fs").PathLike, options?: {
4
+ recursive?: boolean;
5
+ }) => Promise<void>, stat: (path: import("node:fs").PathLike) => Promise<import("./fs").Stats>, lstat: (path: import("node:fs").PathLike) => Promise<import("./fs").Stats>, access: (path: import("node:fs").PathLike) => Promise<void>;
@@ -0,0 +1,22 @@
1
+ export type { Stats } from '../node-fs';
2
+ export { quota } from '../storage';
3
+ export type { FileEntry, StorageQuota } from '../storage';
4
+ export declare const available: () => Promise<boolean>, readFile: (path: import("node:fs").PathLike, a: import("../node-fs/shared").ReadOptions | import("../node-fs/shared").Callback<Buffer | string>, b?: import("../node-fs/shared").Callback<Buffer | string>) => void, writeFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, a: import("../node-fs/shared").WriteOptions | import("../node-fs/shared").Callback<void>, b?: import("../node-fs/shared").Callback<void>) => void, unlink: (path: import("node:fs").PathLike, callback: import("../node-fs/shared").Callback<void>) => void, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike, callback: import("../node-fs/shared").Callback<void>) => void, readdir: (path: import("node:fs").PathLike, a: unknown, b?: import("../node-fs/shared").Callback<string[]>) => void, mkdir: (path: import("node:fs").PathLike, a: import("../node-fs/shared").MakeOptions | import("../node-fs/shared").Callback<void>, b?: import("../node-fs/shared").Callback<void>) => void, rm: (path: import("node:fs").PathLike, a: {
5
+ recursive?: boolean;
6
+ } | import("../node-fs/shared").Callback<void>, b?: import("../node-fs/shared").Callback<void>) => void, stat: (path: import("node:fs").PathLike, callback: import("../node-fs/shared").Callback<import("./fs").Stats>) => void, promises: {
7
+ readFile: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").ReadOptions) => Promise<Buffer | string>;
8
+ writeFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => Promise<void>;
9
+ unlink: (path: import("node:fs").PathLike) => Promise<void>;
10
+ rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>;
11
+ readdir: (path: import("node:fs").PathLike) => Promise<string[]>;
12
+ mkdir: (_path?: import("node:fs").PathLike, _options?: import("../node-fs/shared").MakeOptions) => Promise<void>;
13
+ rm: (path: import("node:fs").PathLike, options?: {
14
+ recursive?: boolean;
15
+ }) => Promise<void>;
16
+ rmdir: (path: import("node:fs").PathLike, options?: {
17
+ recursive?: boolean;
18
+ }) => Promise<void>;
19
+ stat: (path: import("node:fs").PathLike) => Promise<import("./fs").Stats>;
20
+ lstat: (path: import("node:fs").PathLike) => Promise<import("./fs").Stats>;
21
+ access: (path: import("node:fs").PathLike) => Promise<void>;
22
+ };
@@ -0,0 +1,2 @@
1
+ export * from '../webvpn/http';
2
+ export { default } from '../webvpn/http';
@@ -0,0 +1,2 @@
1
+ export * from '../webvpn/net';
2
+ export { default } from '../webvpn/net';
package/lib/cloud.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ export { cloudFetch as fetch } from './proxy';
2
+ export { attachFrame } from './cloud/frame';
3
+ export { quota } from './quota';
4
+ export type { QuotaStatus } from './quota';
5
+ export * as dns from './dns';
6
+ export * as fs from './cloud/fs';
7
+ export * as net from './webvpn/net';
8
+ export * as dgram from './webvpn/dgram';
9
+ export * as http from './webvpn/http';
10
+ export declare const available: () => boolean;
@@ -0,0 +1 @@
1
+ export declare const connectButtonUrl: (origin?: string) => string;
@@ -0,0 +1 @@
1
+ export declare const connect: () => Promise<boolean>;
@@ -1,17 +1,17 @@
1
- declare const available: () => boolean;
2
- declare const fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
3
- declare const dns: {
1
+ export declare const available: () => boolean;
2
+ export declare const fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
3
+ export declare const dns: {
4
4
  lookup: (..._args: unknown[]) => never;
5
5
  };
6
- declare const net: {
6
+ export declare const net: {
7
7
  connect: (..._args: unknown[]) => never;
8
8
  createConnection: (..._args: unknown[]) => never;
9
9
  createServer: (..._args: unknown[]) => never;
10
10
  };
11
- declare const dgram: {
11
+ export declare const dgram: {
12
12
  createSocket: (..._args: unknown[]) => never;
13
13
  };
14
- declare const fs: {
14
+ export declare const fs: {
15
15
  available: () => Promise<boolean>;
16
16
  readFile: (..._args: unknown[]) => never;
17
17
  readFileSync: (..._args: unknown[]) => never;
@@ -45,5 +45,3 @@ declare const fs: {
45
45
  stat: (..._args: unknown[]) => never;
46
46
  };
47
47
  };
48
-
49
- export { available, dgram, dns, fetch, fs, net };
package/lib/dns.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import type { AddressLookupResult } from '../api/dns';
2
+ export type { AddressLookupResult } from '../api/dns';
3
+ export declare const lookup: <T extends boolean = false>(hostname: string, options?: {
4
+ all?: T;
5
+ family?: 0 | 4 | 6;
6
+ }) => Promise<T extends true ? AddressLookupResult[] : AddressLookupResult | undefined>;
package/lib/dom.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare const iframe: HTMLIFrameElement | null;
2
+ export declare const targetWindow: Window | null;
@@ -0,0 +1 @@
1
+ export declare const promptInstall: (reason?: string) => Promise<boolean>;
@@ -0,0 +1,4 @@
1
+ export * from '@mfkn/web-extension';
2
+ export { extension as events } from '@mfkn/web-extension';
3
+ export { promptInstall } from './extension-prompt';
4
+ export { isExtensionAvailable as available } from './auto';
@@ -0,0 +1 @@
1
+ export declare const assertNotFknTarget: (input: RequestInfo | URL) => void;
package/lib/frame.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import type { AttachFrameOptions, Frame } from '@mfkn/web-extension';
2
+ export declare const attachFrame: (options: AttachFrameOptions) => Promise<Frame>;
@@ -0,0 +1 @@
1
+ export declare const resolveContentType: (path: string, override?: string) => string | undefined;
@@ -0,0 +1,10 @@
1
+ import type { FileEntry, WriteData } from './types';
2
+ export type { FileEntry, FileSystem, WriteData } from './types';
3
+ export declare const available: () => Promise<boolean>;
4
+ export declare const list: () => Promise<FileEntry[]>;
5
+ export declare const readFile: (path: string) => Promise<Blob>;
6
+ export declare const writeFile: (path: string, data: WriteData, opts?: {
7
+ contentType?: string;
8
+ }) => Promise<void>;
9
+ export declare const remove: (path: string) => Promise<void>;
10
+ export declare const pull: (path: string) => Promise<Blob>;
@@ -0,0 +1,87 @@
1
+ import * as hybrid from './hybrid';
2
+ export type { Stats } from '../node-fs';
3
+ export declare const available: () => Promise<boolean>, readFileSync: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").ReadOptions) => Buffer | string, writeFileSync: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => void, appendFileSync: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => void, existsSync: (path: import("node:fs").PathLike) => boolean, statSync: (path: import("node:fs").PathLike) => import(".").Stats, lstatSync: (path: import("node:fs").PathLike) => import(".").Stats, readdirSync: (path: import("node:fs").PathLike) => string[], mkdirSync: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").MakeOptions) => void, rmSync: (path: import("node:fs").PathLike, options?: {
4
+ recursive?: boolean;
5
+ force?: boolean;
6
+ }) => void, rmdirSync: (path: import("node:fs").PathLike, options?: {
7
+ recursive?: boolean;
8
+ }) => void, unlinkSync: (path: import("node:fs").PathLike) => void, renameSync: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => void, readFile: (path: import("node:fs").PathLike, a: import("../node-fs/shared").ReadOptions | import("../node-fs/shared").Callback<Buffer | string>, b?: import("../node-fs/shared").Callback<Buffer | string>) => void, writeFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, a: import("../node-fs/shared").WriteOptions | import("../node-fs/shared").Callback<void>, b?: import("../node-fs/shared").Callback<void>) => void, appendFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, a: import("../node-fs/shared").WriteOptions | import("../node-fs/shared").Callback<void>, b?: import("../node-fs/shared").Callback<void>) => void, stat: (path: import("node:fs").PathLike, callback: import("../node-fs/shared").Callback<import(".").Stats>) => void, readdir: (path: import("node:fs").PathLike, a: unknown, b?: import("../node-fs/shared").Callback<string[]>) => void, mkdir: (path: import("node:fs").PathLike, a: import("../node-fs/shared").MakeOptions | import("../node-fs/shared").Callback<void>, b?: import("../node-fs/shared").Callback<void>) => void, rm: (path: import("node:fs").PathLike, a: {
9
+ recursive?: boolean;
10
+ force?: boolean;
11
+ } | import("../node-fs/shared").Callback<void>, b?: import("../node-fs/shared").Callback<void>) => void, unlink: (path: import("node:fs").PathLike, callback: import("../node-fs/shared").Callback<void>) => void, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike, callback: import("../node-fs/shared").Callback<void>) => void, exists: (path: import("node:fs").PathLike, callback: (exists: boolean) => void) => void, promises: {
12
+ readFile: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").ReadOptions) => Promise<Buffer | string>;
13
+ writeFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => Promise<void>;
14
+ appendFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => Promise<void>;
15
+ stat: (path: import("node:fs").PathLike) => Promise<import(".").Stats>;
16
+ lstat: (path: import("node:fs").PathLike) => Promise<import(".").Stats>;
17
+ readdir: (path: import("node:fs").PathLike) => Promise<string[]>;
18
+ mkdir: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").MakeOptions) => Promise<void>;
19
+ rm: (path: import("node:fs").PathLike, options?: {
20
+ recursive?: boolean;
21
+ force?: boolean;
22
+ }) => Promise<void>;
23
+ rmdir: (path: import("node:fs").PathLike, options?: {
24
+ recursive?: boolean;
25
+ }) => Promise<void>;
26
+ unlink: (path: import("node:fs").PathLike) => Promise<void>;
27
+ rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>;
28
+ access: (path: import("node:fs").PathLike) => Promise<void>;
29
+ }, mount: () => Promise<void>, flush: () => Promise<void>, remount: () => Promise<void>;
30
+ export declare const pull: typeof hybrid.pull;
31
+ declare const _default: {
32
+ available: () => Promise<boolean>;
33
+ readFileSync: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").ReadOptions) => Buffer | string;
34
+ writeFileSync: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => void;
35
+ appendFileSync: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => void;
36
+ existsSync: (path: import("node:fs").PathLike) => boolean;
37
+ statSync: (path: import("node:fs").PathLike) => import(".").Stats;
38
+ lstatSync: (path: import("node:fs").PathLike) => import(".").Stats;
39
+ readdirSync: (path: import("node:fs").PathLike) => string[];
40
+ mkdirSync: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").MakeOptions) => void;
41
+ rmSync: (path: import("node:fs").PathLike, options?: {
42
+ recursive?: boolean;
43
+ force?: boolean;
44
+ }) => void;
45
+ rmdirSync: (path: import("node:fs").PathLike, options?: {
46
+ recursive?: boolean;
47
+ }) => void;
48
+ unlinkSync: (path: import("node:fs").PathLike) => void;
49
+ renameSync: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => void;
50
+ readFile: (path: import("node:fs").PathLike, a: import("../node-fs/shared").ReadOptions | import("../node-fs/shared").Callback<Buffer | string>, b?: import("../node-fs/shared").Callback<Buffer | string>) => void;
51
+ writeFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, a: import("../node-fs/shared").WriteOptions | import("../node-fs/shared").Callback<void>, b?: import("../node-fs/shared").Callback<void>) => void;
52
+ appendFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, a: import("../node-fs/shared").WriteOptions | import("../node-fs/shared").Callback<void>, b?: import("../node-fs/shared").Callback<void>) => void;
53
+ stat: (path: import("node:fs").PathLike, callback: import("../node-fs/shared").Callback<import(".").Stats>) => void;
54
+ readdir: (path: import("node:fs").PathLike, a: unknown, b?: import("../node-fs/shared").Callback<string[]>) => void;
55
+ mkdir: (path: import("node:fs").PathLike, a: import("../node-fs/shared").MakeOptions | import("../node-fs/shared").Callback<void>, b?: import("../node-fs/shared").Callback<void>) => void;
56
+ rm: (path: import("node:fs").PathLike, a: {
57
+ recursive?: boolean;
58
+ force?: boolean;
59
+ } | import("../node-fs/shared").Callback<void>, b?: import("../node-fs/shared").Callback<void>) => void;
60
+ unlink: (path: import("node:fs").PathLike, callback: import("../node-fs/shared").Callback<void>) => void;
61
+ rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike, callback: import("../node-fs/shared").Callback<void>) => void;
62
+ exists: (path: import("node:fs").PathLike, callback: (exists: boolean) => void) => void;
63
+ promises: {
64
+ readFile: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").ReadOptions) => Promise<Buffer | string>;
65
+ writeFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => Promise<void>;
66
+ appendFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => Promise<void>;
67
+ stat: (path: import("node:fs").PathLike) => Promise<import(".").Stats>;
68
+ lstat: (path: import("node:fs").PathLike) => Promise<import(".").Stats>;
69
+ readdir: (path: import("node:fs").PathLike) => Promise<string[]>;
70
+ mkdir: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").MakeOptions) => Promise<void>;
71
+ rm: (path: import("node:fs").PathLike, options?: {
72
+ recursive?: boolean;
73
+ force?: boolean;
74
+ }) => Promise<void>;
75
+ rmdir: (path: import("node:fs").PathLike, options?: {
76
+ recursive?: boolean;
77
+ }) => Promise<void>;
78
+ unlink: (path: import("node:fs").PathLike) => Promise<void>;
79
+ rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>;
80
+ access: (path: import("node:fs").PathLike) => Promise<void>;
81
+ };
82
+ mount: () => Promise<void>;
83
+ flush: () => Promise<void>;
84
+ remount: () => Promise<void>;
85
+ pull: typeof hybrid.pull;
86
+ };
87
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import type { FileEntry, WriteData } from './types';
2
+ export declare const available: () => Promise<boolean>;
3
+ export declare const writeFile: (path: string, data: WriteData, opts?: {
4
+ contentType?: string;
5
+ }) => Promise<void>;
6
+ export declare const readFile: (path: string) => Promise<Blob>;
7
+ export declare const remove: (path: string) => Promise<void>;
8
+ export declare const list: () => Promise<FileEntry[]>;
@@ -0,0 +1,8 @@
1
+ import { promises } from './index';
2
+ export declare const readFile: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").ReadOptions) => Promise<Buffer | string>, writeFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => Promise<void>, appendFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => Promise<void>, unlink: (path: import("node:fs").PathLike) => Promise<void>, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>, readdir: (path: import("node:fs").PathLike) => Promise<string[]>, mkdir: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").MakeOptions) => Promise<void>, rm: (path: import("node:fs").PathLike, options?: {
3
+ recursive?: boolean;
4
+ force?: boolean;
5
+ }) => Promise<void>, rmdir: (path: import("node:fs").PathLike, options?: {
6
+ recursive?: boolean;
7
+ }) => Promise<void>, stat: (path: import("node:fs").PathLike) => Promise<import("./index").Stats>, lstat: (path: import("node:fs").PathLike) => Promise<import("./index").Stats>, access: (path: import("node:fs").PathLike) => Promise<void>;
8
+ export default promises;
@@ -0,0 +1,16 @@
1
+ export type FileEntry = {
2
+ path: string;
3
+ size: number;
4
+ contentType: string | null;
5
+ updatedAt: string | null;
6
+ };
7
+ export type WriteData = Blob | ArrayBuffer | Uint8Array | string;
8
+ export type FileSystem = {
9
+ available: () => Promise<boolean>;
10
+ list: () => Promise<FileEntry[]>;
11
+ readFile: (path: string) => Promise<Blob>;
12
+ writeFile: (path: string, data: WriteData, opts?: {
13
+ contentType?: string;
14
+ }) => Promise<void>;
15
+ remove: (path: string) => Promise<void>;
16
+ };
package/lib/index.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ export * from '@mfkn/web-extension';
2
+ export * as cloud from './cloud';
3
+ export * as extension from './extension';
4
+ export * as desktop from './desktop';
5
+ export { fetch } from './auto';
6
+ export * as dns from './dns';
7
+ export * as fs from './fs';
8
+ export * as opfs from './opfs';
9
+ export * as net from './webvpn/net';
10
+ export * as dgram from './webvpn/dgram';
11
+ export * as http from './webvpn/http';
12
+ export { attachFrame } from './frame';
13
+ export { relayWorker } from './relay';
14
+ export * as packages from './packages';
15
+ export { promptInstall } from './extension-prompt';
16
+ export { connect } from './connect';
17
+ export * as account from './account';
18
+ export { connectButtonUrl } from './connect-button';