@fkn/lib 0.6.0 → 0.6.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.
Files changed (120) hide show
  1. package/account.d.ts +15 -0
  2. package/api-BYUraih6.d.ts +524 -0
  3. package/cloud/dgram.d.ts +2 -0
  4. package/cloud/dns.d.ts +3 -0
  5. package/cloud/fs/promises.d.ts +9 -0
  6. package/cloud/fs.d.ts +3 -0
  7. package/cloud/http.d.ts +2 -0
  8. package/cloud/net.d.ts +2 -0
  9. package/cloud-gklfa4ZN.d.ts +41 -0
  10. package/cloud.d.ts +7 -0
  11. package/connect-button-D8KXSL6s.d.ts +4 -0
  12. package/desktop.d.ts +52 -0
  13. package/dgram.d.ts +91 -0
  14. package/dns.d.ts +12 -0
  15. package/extension-3pxUYwrA.d.ts +16 -0
  16. package/extension.d.ts +3 -0
  17. package/fs/promises.d.ts +12 -0
  18. package/fs-K7ROdxDx.d.ts +41 -0
  19. package/fs.d.ts +92 -0
  20. package/http.d.ts +186 -0
  21. package/index-BJztAQIP.d.ts +721 -0
  22. package/index-C6ZoDJg8.d.ts +31 -0
  23. package/index.d.ts +28 -0
  24. package/lookup-BtwWaCZJ.d.ts +7 -0
  25. package/net-BDW1AVX1.d.ts +140 -0
  26. package/net.d.ts +2 -0
  27. package/opfs/promises.d.ts +12 -0
  28. package/opfs.d.ts +90 -0
  29. package/package.json +23 -23
  30. package/packages-D36R2vBv.d.ts +108 -0
  31. package/packages.d.ts +2 -0
  32. package/react.d.ts +14 -0
  33. package/api/account.d.ts +0 -7
  34. package/api/broker-bridge.d.ts +0 -12
  35. package/api/connect-store.d.ts +0 -9
  36. package/api/connect.d.ts +0 -2
  37. package/api/data-plane.d.ts +0 -28
  38. package/api/dns/index.d.ts +0 -1
  39. package/api/dns/lookup.d.ts +0 -8
  40. package/api/index.d.ts +0 -78
  41. package/api/install-prompt.d.ts +0 -2
  42. package/api/local-net/index.d.ts +0 -43
  43. package/api/overlay-mount.d.ts +0 -2
  44. package/api/overlay.d.ts +0 -17
  45. package/api/packages/host.d.ts +0 -12
  46. package/api/packages/identity.d.ts +0 -1
  47. package/api/packages/index.d.ts +0 -34
  48. package/api/packages/picker.d.ts +0 -28
  49. package/api/packages/registry.d.ts +0 -20
  50. package/api/packages/store.d.ts +0 -6
  51. package/api/packages/types.d.ts +0 -56
  52. package/api/preconnect.d.ts +0 -1
  53. package/api/proxy/index.d.ts +0 -1
  54. package/api/proxy/proxy-fetch.d.ts +0 -5
  55. package/api/quota.d.ts +0 -10
  56. package/api/rate-token.d.ts +0 -3
  57. package/api/session-limit.d.ts +0 -1
  58. package/api/storage.d.ts +0 -20
  59. package/api/toast.d.ts +0 -1
  60. package/api/token-source.d.ts +0 -4
  61. package/api/ui-events.d.ts +0 -8
  62. package/api/ui-host.d.ts +0 -2
  63. package/api/webvpn/index.d.ts +0 -3
  64. package/api/webvpn/packets/metadata.d.ts +0 -31
  65. package/api/webvpn/packets/tcp-listener.d.ts +0 -39
  66. package/api/webvpn/packets/tcp.d.ts +0 -88
  67. package/api/webvpn/packets/udp.d.ts +0 -183
  68. package/api/webvpn/packets/utils.d.ts +0 -24
  69. package/api/webvpn/tcp-listener.d.ts +0 -11
  70. package/api/webvpn/tcp.d.ts +0 -33
  71. package/api/webvpn/udp.d.ts +0 -33
  72. package/api/webvpn/utils.d.ts +0 -26
  73. package/api/webvpn/webtransport.d.ts +0 -62
  74. package/api/worker/client.d.ts +0 -3
  75. package/api/worker/protocol.d.ts +0 -15
  76. package/lib/account.d.ts +0 -14
  77. package/lib/api.d.ts +0 -300
  78. package/lib/auto.d.ts +0 -5
  79. package/lib/cloud/dgram.d.ts +0 -2
  80. package/lib/cloud/dns.d.ts +0 -1
  81. package/lib/cloud/frame.d.ts +0 -3
  82. package/lib/cloud/fs-promises.d.ts +0 -5
  83. package/lib/cloud/fs.d.ts +0 -22
  84. package/lib/cloud/http.d.ts +0 -2
  85. package/lib/cloud/net.d.ts +0 -2
  86. package/lib/cloud.d.ts +0 -10
  87. package/lib/connect-button.d.ts +0 -1
  88. package/lib/connect.d.ts +0 -1
  89. package/lib/desktop.d.ts +0 -47
  90. package/lib/dns.d.ts +0 -6
  91. package/lib/dom.d.ts +0 -2
  92. package/lib/extension-prompt.d.ts +0 -1
  93. package/lib/extension.d.ts +0 -4
  94. package/lib/fkn-target.d.ts +0 -1
  95. package/lib/frame.d.ts +0 -2
  96. package/lib/fs/content-type.d.ts +0 -1
  97. package/lib/fs/hybrid.d.ts +0 -10
  98. package/lib/fs/index.d.ts +0 -87
  99. package/lib/fs/opfs.d.ts +0 -8
  100. package/lib/fs/promises.d.ts +0 -8
  101. package/lib/fs/types.d.ts +0 -16
  102. package/lib/index.d.ts +0 -18
  103. package/lib/node-fs/index.d.ts +0 -95
  104. package/lib/node-fs/shared.d.ts +0 -39
  105. package/lib/node-fs/store.d.ts +0 -21
  106. package/lib/opfs/index.d.ts +0 -84
  107. package/lib/opfs/promises.d.ts +0 -8
  108. package/lib/overlay.d.ts +0 -14
  109. package/lib/packages.d.ts +0 -69
  110. package/lib/proxy.d.ts +0 -5
  111. package/lib/quota.d.ts +0 -20
  112. package/lib/react.d.ts +0 -7
  113. package/lib/relay.d.ts +0 -5
  114. package/lib/storage.d.ts +0 -22
  115. package/lib/webvpn/dgram.d.ts +0 -86
  116. package/lib/webvpn/http.d.ts +0 -180
  117. package/lib/webvpn/index.d.ts +0 -1
  118. package/lib/webvpn/net.d.ts +0 -132
  119. package/lib/webvpn/utils.d.ts +0 -32
  120. package/sandbox.d.ts +0 -7
@@ -1,95 +0,0 @@
1
- import type { PathLike } from 'fs';
2
- import type { FileSystem } from '../fs/types';
3
- import type { Callback, MakeOptions, ReadOptions, Stats, WriteData, WriteOptions } from './shared';
4
- export type { Stats } from './shared';
5
- declare const createMemfs: (backing: FileSystem) => {
6
- available: () => Promise<boolean>;
7
- readFileSync: (path: PathLike, options?: ReadOptions) => Buffer | string;
8
- writeFileSync: (path: PathLike, data: WriteData, options?: WriteOptions) => void;
9
- appendFileSync: (path: PathLike, data: WriteData, options?: WriteOptions) => void;
10
- existsSync: (path: PathLike) => boolean;
11
- statSync: (path: PathLike) => Stats;
12
- lstatSync: (path: PathLike) => Stats;
13
- readdirSync: (path: PathLike) => string[];
14
- mkdirSync: (path: PathLike, options?: MakeOptions) => void;
15
- rmSync: (path: PathLike, options?: {
16
- recursive?: boolean;
17
- force?: boolean;
18
- }) => void;
19
- rmdirSync: (path: PathLike, options?: {
20
- recursive?: boolean;
21
- }) => void;
22
- unlinkSync: (path: PathLike) => void;
23
- renameSync: (from: PathLike, to: PathLike) => void;
24
- readFile: (path: PathLike, a: ReadOptions | Callback<Buffer | string>, b?: Callback<Buffer | string>) => void;
25
- writeFile: (path: PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void;
26
- appendFile: (path: PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void;
27
- stat: (path: PathLike, callback: Callback<Stats>) => void;
28
- readdir: (path: PathLike, a: unknown, b?: Callback<string[]>) => void;
29
- mkdir: (path: PathLike, a: MakeOptions | Callback<void>, b?: Callback<void>) => void;
30
- rm: (path: PathLike, a: {
31
- recursive?: boolean;
32
- force?: boolean;
33
- } | Callback<void>, b?: Callback<void>) => void;
34
- unlink: (path: PathLike, callback: Callback<void>) => void;
35
- rename: (from: PathLike, to: PathLike, callback: Callback<void>) => void;
36
- exists: (path: PathLike, callback: (exists: boolean) => void) => void;
37
- promises: {
38
- readFile: (path: PathLike, options?: ReadOptions) => Promise<Buffer | string>;
39
- writeFile: (path: PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
40
- appendFile: (path: PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
41
- stat: (path: PathLike) => Promise<Stats>;
42
- lstat: (path: PathLike) => Promise<Stats>;
43
- readdir: (path: PathLike) => Promise<string[]>;
44
- mkdir: (path: PathLike, options?: MakeOptions) => Promise<void>;
45
- rm: (path: PathLike, options?: {
46
- recursive?: boolean;
47
- force?: boolean;
48
- }) => Promise<void>;
49
- rmdir: (path: PathLike, options?: {
50
- recursive?: boolean;
51
- }) => Promise<void>;
52
- unlink: (path: PathLike) => Promise<void>;
53
- rename: (from: PathLike, to: PathLike) => Promise<void>;
54
- access: (path: PathLike) => Promise<void>;
55
- };
56
- mount: () => Promise<void>;
57
- flush: () => Promise<void>;
58
- remount: () => Promise<void>;
59
- };
60
- declare const createCloud: (backing: FileSystem) => {
61
- available: () => Promise<boolean>;
62
- promises: {
63
- readFile: (path: PathLike, options?: ReadOptions) => Promise<Buffer | string>;
64
- writeFile: (path: PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
65
- unlink: (path: PathLike) => Promise<void>;
66
- rename: (from: PathLike, to: PathLike) => Promise<void>;
67
- readdir: (path: PathLike) => Promise<string[]>;
68
- mkdir: (_path?: PathLike, _options?: MakeOptions) => Promise<void>;
69
- rm: (path: PathLike, options?: {
70
- recursive?: boolean;
71
- }) => Promise<void>;
72
- rmdir: (path: PathLike, options?: {
73
- recursive?: boolean;
74
- }) => Promise<void>;
75
- stat: (path: PathLike) => Promise<Stats>;
76
- lstat: (path: PathLike) => Promise<Stats>;
77
- access: (path: PathLike) => Promise<void>;
78
- };
79
- readFile: (path: PathLike, a: ReadOptions | Callback<Buffer | string>, b?: Callback<Buffer | string>) => void;
80
- writeFile: (path: PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void;
81
- unlink: (path: PathLike, callback: Callback<void>) => void;
82
- rename: (from: PathLike, to: PathLike, callback: Callback<void>) => void;
83
- readdir: (path: PathLike, a: unknown, b?: Callback<string[]>) => void;
84
- mkdir: (path: PathLike, a: MakeOptions | Callback<void>, b?: Callback<void>) => void;
85
- rm: (path: PathLike, a: {
86
- recursive?: boolean;
87
- } | Callback<void>, b?: Callback<void>) => void;
88
- stat: (path: PathLike, callback: Callback<Stats>) => void;
89
- };
90
- export declare function createNodeFs(backing: FileSystem, opts: {
91
- memfs: true;
92
- }): ReturnType<typeof createMemfs>;
93
- export declare function createNodeFs(backing: FileSystem, opts: {
94
- memfs: false;
95
- }): ReturnType<typeof createCloud>;
@@ -1,39 +0,0 @@
1
- import type { PathLike } from 'fs';
2
- import { Buffer } from 'buffer';
3
- export type ReadOptions = BufferEncoding | {
4
- encoding?: BufferEncoding | null;
5
- flag?: string;
6
- } | null | undefined;
7
- export type WriteOptions = BufferEncoding | {
8
- encoding?: BufferEncoding | null;
9
- mode?: number;
10
- flag?: string;
11
- contentType?: string;
12
- } | null | undefined;
13
- export type WriteData = string | Uint8Array | ArrayBuffer | DataView;
14
- export type MakeOptions = {
15
- recursive?: boolean;
16
- } | number | null | undefined;
17
- export type Callback<R> = (error: NodeJS.ErrnoException | null, result?: R) => void;
18
- export type Stats = {
19
- size: number;
20
- mtimeMs: number;
21
- mtime: Date;
22
- atimeMs: number;
23
- ctimeMs: number;
24
- mode: number;
25
- isFile: () => boolean;
26
- isDirectory: () => boolean;
27
- isSymbolicLink: () => boolean;
28
- };
29
- export declare const fileStats: (size: number, mtimeMs: number) => Stats;
30
- export declare const dirStats: (mtimeMs?: number) => Stats;
31
- export declare const error: (code: string, path: string, syscall: string) => NodeJS.ErrnoException;
32
- export declare const normalize: (path: string) => string;
33
- export declare const parentOf: (path: string) => string;
34
- export declare const pathStr: (path: PathLike) => string;
35
- export declare const encodingOf: (options: ReadOptions | WriteOptions) => BufferEncoding | undefined;
36
- export declare const contentTypeOf: (options: WriteOptions) => string | undefined;
37
- export declare const recursiveOf: (options: MakeOptions) => boolean;
38
- export declare const decode: (bytes: Uint8Array, options: ReadOptions) => Buffer | string;
39
- export declare const toBytes: (data: WriteData, options?: WriteOptions) => Uint8Array;
@@ -1,21 +0,0 @@
1
- import type { FileSystem } from '../fs/types';
2
- import type { Stats } from './shared';
3
- export type RemoveOptions = {
4
- op: 'rm' | 'rmdir' | 'unlink';
5
- recursive?: boolean;
6
- force?: boolean;
7
- };
8
- export type Store = ReturnType<typeof createStore>;
9
- export declare const createStore: (backing: FileSystem) => {
10
- mount: () => Promise<void>;
11
- remount: () => Promise<void>;
12
- flush: () => Promise<void>;
13
- exists: (path: string) => boolean;
14
- stat: (path: string) => Stats;
15
- readFile: (path: string) => Uint8Array;
16
- writeFile: (path: string, data: Uint8Array, append: boolean, contentType?: string) => void;
17
- mkdir: (path: string, recursive: boolean) => void;
18
- readdir: (path: string) => string[];
19
- remove: (path: string, { op, recursive, force }: RemoveOptions) => void;
20
- rename: (from: string, to: string) => void;
21
- };
@@ -1,84 +0,0 @@
1
- export type { Stats } from '../node-fs';
2
- declare const fs: {
3
- available: () => Promise<boolean>;
4
- readFileSync: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").ReadOptions) => Buffer | string;
5
- writeFileSync: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => void;
6
- appendFileSync: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => void;
7
- existsSync: (path: import("node:fs").PathLike) => boolean;
8
- statSync: (path: import("node:fs").PathLike) => import(".").Stats;
9
- lstatSync: (path: import("node:fs").PathLike) => import(".").Stats;
10
- readdirSync: (path: import("node:fs").PathLike) => string[];
11
- mkdirSync: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").MakeOptions) => void;
12
- rmSync: (path: import("node:fs").PathLike, options?: {
13
- recursive?: boolean;
14
- force?: boolean;
15
- }) => void;
16
- rmdirSync: (path: import("node:fs").PathLike, options?: {
17
- recursive?: boolean;
18
- }) => void;
19
- unlinkSync: (path: import("node:fs").PathLike) => void;
20
- renameSync: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => void;
21
- 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;
22
- 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;
23
- 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;
24
- stat: (path: import("node:fs").PathLike, callback: import("../node-fs/shared").Callback<import(".").Stats>) => void;
25
- readdir: (path: import("node:fs").PathLike, a: unknown, b?: import("../node-fs/shared").Callback<string[]>) => void;
26
- 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;
27
- rm: (path: import("node:fs").PathLike, a: {
28
- recursive?: boolean;
29
- force?: boolean;
30
- } | import("../node-fs/shared").Callback<void>, b?: import("../node-fs/shared").Callback<void>) => void;
31
- unlink: (path: import("node:fs").PathLike, callback: import("../node-fs/shared").Callback<void>) => void;
32
- rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike, callback: import("../node-fs/shared").Callback<void>) => void;
33
- exists: (path: import("node:fs").PathLike, callback: (exists: boolean) => void) => void;
34
- promises: {
35
- readFile: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").ReadOptions) => Promise<Buffer | string>;
36
- writeFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => Promise<void>;
37
- appendFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => Promise<void>;
38
- stat: (path: import("node:fs").PathLike) => Promise<import(".").Stats>;
39
- lstat: (path: import("node:fs").PathLike) => Promise<import(".").Stats>;
40
- readdir: (path: import("node:fs").PathLike) => Promise<string[]>;
41
- mkdir: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").MakeOptions) => Promise<void>;
42
- rm: (path: import("node:fs").PathLike, options?: {
43
- recursive?: boolean;
44
- force?: boolean;
45
- }) => Promise<void>;
46
- rmdir: (path: import("node:fs").PathLike, options?: {
47
- recursive?: boolean;
48
- }) => Promise<void>;
49
- unlink: (path: import("node:fs").PathLike) => Promise<void>;
50
- rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>;
51
- access: (path: import("node:fs").PathLike) => Promise<void>;
52
- };
53
- mount: () => Promise<void>;
54
- flush: () => Promise<void>;
55
- remount: () => Promise<void>;
56
- };
57
- 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?: {
58
- recursive?: boolean;
59
- force?: boolean;
60
- }) => void, rmdirSync: (path: import("node:fs").PathLike, options?: {
61
- recursive?: boolean;
62
- }) => 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: {
63
- recursive?: boolean;
64
- force?: boolean;
65
- } | 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: {
66
- readFile: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").ReadOptions) => Promise<Buffer | string>;
67
- writeFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => Promise<void>;
68
- appendFile: (path: import("node:fs").PathLike, data: import("../node-fs/shared").WriteData, options?: import("../node-fs/shared").WriteOptions) => Promise<void>;
69
- stat: (path: import("node:fs").PathLike) => Promise<import(".").Stats>;
70
- lstat: (path: import("node:fs").PathLike) => Promise<import(".").Stats>;
71
- readdir: (path: import("node:fs").PathLike) => Promise<string[]>;
72
- mkdir: (path: import("node:fs").PathLike, options?: import("../node-fs/shared").MakeOptions) => Promise<void>;
73
- rm: (path: import("node:fs").PathLike, options?: {
74
- recursive?: boolean;
75
- force?: boolean;
76
- }) => Promise<void>;
77
- rmdir: (path: import("node:fs").PathLike, options?: {
78
- recursive?: boolean;
79
- }) => Promise<void>;
80
- unlink: (path: import("node:fs").PathLike) => Promise<void>;
81
- rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>;
82
- access: (path: import("node:fs").PathLike) => Promise<void>;
83
- }, mount: () => Promise<void>, flush: () => Promise<void>, remount: () => Promise<void>;
84
- export default fs;
@@ -1,8 +0,0 @@
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;
package/lib/overlay.d.ts DELETED
@@ -1,14 +0,0 @@
1
- type SurfaceRect = {
2
- x: number;
3
- y: number;
4
- width: number;
5
- height: number;
6
- };
7
- export type OverlayState = {
8
- modal: boolean;
9
- rects: SurfaceRect[];
10
- };
11
- export declare const isOverlayMounted: () => boolean;
12
- export declare const mountOverlay: (iframe: HTMLIFrameElement) => void;
13
- export declare const setOverlayState: (state: unknown) => void;
14
- export {};
package/lib/packages.d.ts DELETED
@@ -1,69 +0,0 @@
1
- import type { Remote } from 'osra';
2
- import type { ConnectOptions, InstallOptions, InstalledPackage, PackageQuery, PackageResult, PackagesErrorCode, PickOptions } from '../api/packages';
3
- export type { PackageQuery, PackageResult, InstalledPackage, PickOptions, InstallOptions, ConnectOptions, PackagesErrorCode, } from '../api/packages';
4
- export type PackagesError = Error & {
5
- code: PackagesErrorCode;
6
- };
7
- /** Search npm for FKN packages, e.g. `search({ type: 'plugin', id: 'stub' })`. */
8
- export declare const search: (query: PackageQuery) => Promise<PackageResult[]>;
9
- /** FKN-rendered picker over the same search; resolves the user's selection, already installed. [] on cancel. */
10
- export declare const pick: (query: PackageQuery, options?: PickOptions) => Promise<PackageResult[]>;
11
- /** Install a package for this app behind an FKN-rendered confirm. Resolves null when the user declines. */
12
- export declare const install: (uri: string, options?: InstallOptions) => Promise<InstalledPackage | null>;
13
- /** The packages installed by this app. */
14
- export declare const list: () => Promise<InstalledPackage[]>;
15
- /** Uninstall a package from this app; its frames and connections are torn down. */
16
- export declare const uninstall: (uri: string) => Promise<void>;
17
- export type PackageConnection<T = unknown> = {
18
- /** the package's exposed payload */
19
- remote: Remote<T>;
20
- /** settles when the package side of the connection dies (uninstall, reload, crash) - reconnect by calling connect() again */
21
- closed: Promise<void>;
22
- /** the raw channel under `remote`, for direct messaging (osra envelopes ride it too - filter by your own message shape) */
23
- port: MessagePort;
24
- };
25
- export type AppConnectOptions = ConnectOptions & {
26
- /** exposed to the package as ITS `remote` */
27
- payload?: unknown;
28
- signal?: AbortSignal;
29
- /** skip the osra handshake and hand back the untouched port - e.g. to transfer it into a worker and attach() there */
30
- raw?: boolean;
31
- };
32
- export type RawPackageConnection = Omit<PackageConnection<never>, 'remote'>;
33
- type Connect = {
34
- <T = unknown>(uri: string, options?: AppConnectOptions & {
35
- raw?: false;
36
- }): Promise<PackageConnection<T>>;
37
- (uri: string, options: AppConnectOptions & {
38
- raw: true;
39
- }): Promise<RawPackageConnection>;
40
- };
41
- /** Connect to an installed package. Throws a PackagesError with code 'not-installed' when it is not. */
42
- export declare const connect: Connect;
43
- /** Run this end of an already-brokered connection port, e.g. after transferring it into a worker. */
44
- export declare const attach: <T = unknown>(port: MessagePort, payload?: unknown, options?: {
45
- signal?: AbortSignal;
46
- }) => Promise<Remote<T>>;
47
- export type IncomingConnectionInfo = {
48
- /** the connecting app's identity: its package uri when it runs on a sandbox origin, else its page origin */
49
- from: string;
50
- /** the contract tag the app passed to connect(), e.g. 'stub-source@1' */
51
- protocol: string | null;
52
- /** this package's canonical uri per the connecting app's install record, e.g. 'npm:@banou/stub-source-example' */
53
- uri: string;
54
- /** this package's npm name */
55
- name: string;
56
- /** the exact version this frame runs - the pin is encoded into the sandbox origin, immutable per version */
57
- version: string;
58
- };
59
- export type IncomingConnection<T = unknown> = IncomingConnectionInfo & PackageConnection<T>;
60
- /** produces the payload exposed to a connecting app - called once per incoming connection */
61
- export type ConnectPayload = (info: IncomingConnectionInfo) => unknown;
62
- /**
63
- * Serve connections from apps that installed this package. The first argument is called once per
64
- * incoming connection with the connection info and returns the payload exposed to that app (its
65
- * `remote`). The latest registration receives new connections; existing connections are unaffected.
66
- */
67
- export declare const onConnect: <T = unknown>(createPayload: ConnectPayload, handler?: (connection: IncomingConnection<T>) => void) => {
68
- unsubscribe: () => void;
69
- };
package/lib/proxy.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import type { Resolvers } from './api';
2
- type ProxyFetch = Resolvers['cloud']['fetch'];
3
- type FetchParameters = Parameters<ProxyFetch>;
4
- export declare const cloudFetch: (input: FetchParameters[0], init?: FetchParameters[1]) => Promise<Response>;
5
- export {};
package/lib/quota.d.ts DELETED
@@ -1,20 +0,0 @@
1
- export type QuotaStatus = {
2
- /** the user has a paid subscription, throttle never applies */
3
- premium: boolean;
4
- /** today's free-tier volume is spent (true even for premium, see `throttled`) */
5
- overQuota: boolean;
6
- /** transfers are actually being rate-limited right now (overQuota and not premium) */
7
- throttled: boolean;
8
- /** bytes egressed through FKN relays today (per anonymized IP), saturates at limitBytes:
9
- * consumption past the free-tier volume is private and never reported */
10
- usedBytes: number;
11
- /** free-tier daily volume before throttling kicks in */
12
- limitBytes: number;
13
- /** bytes of free-tier volume left today */
14
- remainingBytes: number;
15
- /** current effective egress rate cap, bytes per second */
16
- bytesPerSecond: number;
17
- /** current effective egress rate cap, bits per second (for display) */
18
- bitsPerSecond: number;
19
- };
20
- export declare const quota: () => Promise<QuotaStatus>;
package/lib/react.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import type { CSSProperties, ReactElement } from 'react';
2
- export { connectButtonUrl } from './connect-button';
3
- export type ConnectButtonProps = {
4
- className?: string;
5
- style?: CSSProperties;
6
- };
7
- export declare const ConnectButton: ({ className, style }?: ConnectButtonProps) => ReactElement;
package/lib/relay.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export declare const relayWorker: (worker: Worker, options?: {
2
- unregisterSignal?: AbortSignal;
3
- originA?: string;
4
- originB?: string;
5
- }) => void;
package/lib/storage.d.ts DELETED
@@ -1,22 +0,0 @@
1
- export type FileEntry = {
2
- path: string;
3
- size: number;
4
- contentType: string | null;
5
- updatedAt: string;
6
- };
7
- export type StorageQuota = {
8
- usedBytes: number;
9
- limitBytes: number;
10
- remaining: number;
11
- objects: number;
12
- maxObjects: number;
13
- };
14
- export type WriteData = Blob | ArrayBuffer | Uint8Array | string;
15
- export declare const available: () => Promise<boolean>;
16
- export declare const list: () => Promise<FileEntry[]>;
17
- export declare const quota: () => Promise<StorageQuota>;
18
- export declare const readFile: (path: string) => Promise<Blob>;
19
- export declare const writeFile: (path: string, data: WriteData, opts?: {
20
- contentType?: string;
21
- }) => Promise<void>;
22
- export declare const remove: (path: string) => Promise<void>;
@@ -1,86 +0,0 @@
1
- import type { BindOptions, Socket as DgramSocket, RemoteInfo, SocketOptions, SocketType } from 'dgram';
2
- import type { AddressInfo } from 'net';
3
- import type { Resolvers } from '../api';
4
- import { EventEmitter } from 'events';
5
- import { Buffer } from 'buffer';
6
- import type { UdpSocketOption } from '../../api/webvpn/packets/udp';
7
- type WebVpnUdpSocket = Resolvers['cloud']['webvpn']['udpSocket'];
8
- interface EventEmitterOptions {
9
- /**
10
- * Enables automatic capturing of promise rejection.
11
- */
12
- captureRejections?: boolean | undefined;
13
- }
14
- export declare class Socket extends EventEmitter implements DgramSocket {
15
- _type: 'udp4' | 'udp6';
16
- _localAddress?: {
17
- address: string;
18
- family: string;
19
- port: number;
20
- };
21
- _remoteAddress?: {
22
- address: string;
23
- family: string;
24
- port: number;
25
- };
26
- _webVPNUdpSocketPromise?: Promise<Awaited<ReturnType<WebVpnUdpSocket>> | undefined>;
27
- _dataPort?: MessagePort;
28
- _socketId?: number;
29
- _sendQueue: Uint8Array[];
30
- _sendQueueBytes: number;
31
- _sendFlushScheduled: boolean;
32
- _peerTailCache: Map<string, Uint8Array<ArrayBufferLike>>;
33
- constructor(options: SocketOptions & EventEmitterOptions & {
34
- connection?: ReturnType<WebVpnUdpSocket>;
35
- });
36
- _lastRecvBufferSize: number;
37
- _lastSendBufferSize: number;
38
- _lastTtl: number;
39
- _lastMulticastTtl: number;
40
- _lastMulticastLoopback: boolean;
41
- _setUdpOption(option: UdpSocketOption): void;
42
- _onDataPortBatch(buffer: ArrayBuffer): void;
43
- _peerTail(address: string | undefined, port: number | undefined): Uint8Array;
44
- _portSend(message: Uint8Array, address: string | undefined, port: number | undefined): void;
45
- addMembership(multicastAddress: string, multicastInterface?: string | undefined): void;
46
- address(): AddressInfo;
47
- bind(port?: number | undefined, address?: string | undefined, callback?: (() => void) | undefined): this;
48
- bind(port?: number | undefined, callback?: (() => void) | undefined): this;
49
- bind(callback?: (() => void) | undefined): this;
50
- bind(options: BindOptions, callback?: (() => void) | undefined): this;
51
- close(callback?: (() => void) | undefined): this;
52
- connect(port: number, address?: string, callback?: () => void): void;
53
- connect(port: number, callback: () => void): void;
54
- disconnect(): void;
55
- dropMembership(multicastAddress: string, multicastInterface?: string | undefined): void;
56
- getRecvBufferSize(): number;
57
- getSendBufferSize(): number;
58
- getSendQueueSize(): number;
59
- getSendQueueCount(): number;
60
- ref(): this;
61
- remoteAddress(): AddressInfo;
62
- send(msg: string | readonly any[] | Uint8Array, port?: number | undefined, address?: string | undefined, callback?: ((error: Error | null, bytes: number) => void) | undefined): void;
63
- send(msg: string | readonly any[] | Uint8Array, port?: number | undefined, callback?: ((error: Error | null, bytes: number) => void) | undefined): void;
64
- send(msg: string | readonly any[] | Uint8Array, callback?: ((error: Error | null, bytes: number) => void) | undefined): void;
65
- send(msg: string | Uint8Array, offset: number, length: number, port?: number | undefined, address?: string | undefined, callback?: ((error: Error | null, bytes: number) => void) | undefined): void;
66
- send(msg: string | Uint8Array, offset: number, length: number, port?: number | undefined, callback?: ((error: Error | null, bytes: number) => void) | undefined): void;
67
- send(msg: string | Uint8Array, offset: number, length: number, callback?: ((error: Error | null, bytes: number) => void) | undefined): void;
68
- send(msg: unknown, offset?: unknown, length?: unknown, port?: unknown, address?: unknown, callback?: unknown): void;
69
- setBroadcast(flag: boolean): void;
70
- setMulticastInterface(multicastInterface: string): void;
71
- setMulticastLoopback(flag: boolean): boolean;
72
- setMulticastTTL(ttl: number): number;
73
- setRecvBufferSize(size: number): void;
74
- setSendBufferSize(size: number): void;
75
- setTTL(ttl: number): number;
76
- unref(): this;
77
- addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string | undefined): void;
78
- dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string | undefined): void;
79
- [Symbol.asyncDispose](): Promise<void>;
80
- }
81
- export declare const createSocket: (options: SocketType | SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void) => Socket;
82
- declare const _default: {
83
- Socket: typeof Socket;
84
- createSocket: typeof createSocket;
85
- };
86
- export default _default;