@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,28 +0,0 @@
1
- import { proxyFetch } from './proxy';
2
- import { webVpnTcpSocket, webVpnTcpSocketListener, webVpnUdpSocket } from './webvpn';
3
- import { dnsLookup } from './dns';
4
- import { fetchQuota } from './quota';
5
- import { storageAvailable, storageList, storageQuota, storageReadFile, storageWriteFile, storageDelete } from './storage';
6
- export declare const dataPlane: {
7
- cloud: {
8
- fetch: typeof proxyFetch;
9
- quota: typeof fetchQuota;
10
- dns: {
11
- lookup: typeof dnsLookup;
12
- };
13
- fs: {
14
- available: typeof storageAvailable;
15
- list: typeof storageList;
16
- quota: typeof storageQuota;
17
- readFile: typeof storageReadFile;
18
- writeFile: typeof storageWriteFile;
19
- remove: typeof storageDelete;
20
- };
21
- webvpn: {
22
- tcpSocket: typeof webVpnTcpSocket;
23
- tcpSocketListener: typeof webVpnTcpSocketListener;
24
- udpSocket: typeof webVpnUdpSocket;
25
- };
26
- };
27
- };
28
- export type DataPlane = typeof dataPlane;
@@ -1 +0,0 @@
1
- export * from './lookup';
@@ -1,8 +0,0 @@
1
- export type AddressLookupResult = {
2
- address: string;
3
- family: 0 | 4 | 6;
4
- };
5
- export declare const dnsLookup: <T extends boolean = false>(hostname: string, options?: {
6
- all?: T;
7
- family?: 0 | 4 | 6;
8
- }) => Promise<T extends true ? AddressLookupResult[] : AddressLookupResult | undefined>;
package/api/index.d.ts DELETED
@@ -1,78 +0,0 @@
1
- import { setOverlayHost } from './overlay';
2
- import { showInstallPrompt, hideInstallPrompt } from './install-prompt';
3
- import { promptConnect, disconnect, onConnectChange } from './connect';
4
- import { fetchAccount } from './account';
5
- export { registerSurface, setModal } from './overlay';
6
- declare const resolvers: {
7
- readonly cloud: {
8
- readonly fetch: typeof import("./proxy").proxyFetch;
9
- readonly quota: typeof import("./quota").fetchQuota;
10
- readonly dns: {
11
- readonly lookup: typeof import("./dns").dnsLookup;
12
- };
13
- readonly fs: {
14
- readonly available: typeof import("./storage").storageAvailable;
15
- readonly list: typeof import("./storage").storageList;
16
- readonly quota: typeof import("./storage").storageQuota;
17
- readonly readFile: typeof import("./storage").storageReadFile;
18
- readonly writeFile: typeof import("./storage").storageWriteFile;
19
- readonly remove: typeof import("./storage").storageDelete;
20
- };
21
- readonly webvpn: {
22
- readonly tcpSocket: typeof import("./webvpn").webVpnTcpSocket;
23
- readonly tcpSocketListener: typeof import("./webvpn").webVpnTcpSocketListener;
24
- readonly udpSocket: typeof import("./webvpn").webVpnUdpSocket;
25
- };
26
- };
27
- readonly overlay: {
28
- readonly setHost: typeof setOverlayHost;
29
- };
30
- readonly installPrompt: {
31
- readonly show: typeof showInstallPrompt;
32
- readonly hide: typeof hideInstallPrompt;
33
- };
34
- readonly connect: {
35
- readonly prompt: typeof promptConnect;
36
- };
37
- readonly packages: {
38
- search: (query: import("./packages").PackageQuery) => Promise<{
39
- results: import("./packages").PackageResult[];
40
- } | import("./packages").PackagesFail>;
41
- pick: (query: import("./packages").PackageQuery, options?: import("./packages").PickOptions) => Promise<{
42
- results: import("./packages").PackageResult[];
43
- failed: string[];
44
- } | {
45
- declined: true;
46
- } | import("./packages").PackagesFail>;
47
- install: (uri: string, options?: import("./packages").InstallOptions) => Promise<{
48
- installed: import("./packages").InstalledPackage;
49
- } | {
50
- declined: true;
51
- } | import("./packages").PackagesFail>;
52
- list: () => Promise<{
53
- results: import("./packages").InstalledPackage[];
54
- }>;
55
- uninstall: (uri: string) => Promise<{
56
- ok: true;
57
- } | import("./packages").PackagesFail>;
58
- connect: (uri: string, options?: import("./packages").ConnectOptions) => Promise<{
59
- port: MessagePort;
60
- closed: Promise<void>;
61
- } | import("./packages").PackagesFail>;
62
- };
63
- readonly account: {
64
- readonly info: typeof fetchAccount;
65
- readonly login: typeof promptConnect;
66
- readonly logout: typeof disconnect;
67
- readonly onChange: typeof onConnectChange;
68
- };
69
- readonly proxyFetch: typeof import("./proxy").proxyFetch;
70
- readonly webVpnTcpSocket: typeof import("./webvpn").webVpnTcpSocket;
71
- readonly webVpnTcpSocketListener: typeof import("./webvpn").webVpnTcpSocketListener;
72
- readonly webVpnUdpSocket: typeof import("./webvpn").webVpnUdpSocket;
73
- readonly dnsLookup: typeof import("./dns").dnsLookup;
74
- readonly setOverlayHost: typeof setOverlayHost;
75
- readonly showInstallPrompt: typeof showInstallPrompt;
76
- readonly hideInstallPrompt: typeof hideInstallPrompt;
77
- };
78
- export type Resolvers = typeof resolvers;
@@ -1,2 +0,0 @@
1
- export declare const showInstallPrompt: (reason?: string) => Promise<void>;
2
- export declare const hideInstallPrompt: () => void;
@@ -1,43 +0,0 @@
1
- import type { TcpSocketOption } from '../webvpn/packets/tcp';
2
- import { Address4, Address6 } from 'ip-address';
3
- export declare const isLoopbackAddress: (addressType: 0 | 1, address: Address4 | Address6) => boolean;
4
- export type LocalBindFamily = 'IPv4' | 'IPv6' | 'dual';
5
- export declare const localBindFamily: (addressType: 0 | 1, address: Address4 | Address6) => LocalBindFamily;
6
- export type LocalTcpSocket = {
7
- localAddress: string;
8
- localFamily: 'IPv4' | 'IPv6';
9
- localPort: number;
10
- remoteAddress: string;
11
- remoteFamily: 'IPv4' | 'IPv6';
12
- remotePort: number;
13
- dataReadableStream: ReadableStream<Uint8Array>;
14
- dataWritableStream: WritableStream<Uint8Array>;
15
- end: () => Promise<void>;
16
- destroy: () => Promise<void>;
17
- destroySoon: () => Promise<void>;
18
- resetAndDestroy: () => Promise<void>;
19
- setOption: (option: TcpSocketOption) => Promise<void>;
20
- };
21
- export type LocalUdpDatagram = {
22
- fromPort: number;
23
- ipv6: boolean;
24
- data: ArrayBuffer;
25
- };
26
- type LocalTcpListener = {
27
- port: number;
28
- family: LocalBindFamily;
29
- onConnection: (socket: LocalTcpSocket) => void;
30
- };
31
- type LocalUdpSocket = {
32
- port: number;
33
- family: LocalBindFamily;
34
- deliver: (datagram: LocalUdpDatagram) => void;
35
- };
36
- export declare const registerLocalTcpListener: (listener: LocalTcpListener) => (() => void);
37
- export declare const registerLocalUdpSocket: (socket: LocalUdpSocket) => (() => void);
38
- export declare const lookupLocalUdpSocket: (port: number, ipv6: boolean) => LocalUdpSocket | undefined;
39
- export declare const connectLocalTcp: ({ remotePort, ipv6 }: {
40
- remotePort: number;
41
- ipv6: boolean;
42
- }) => LocalTcpSocket | undefined;
43
- export {};
@@ -1,2 +0,0 @@
1
- import type { VNode } from 'preact';
2
- export declare const mountOverlay: (vnode: VNode) => () => void;
package/api/overlay.d.ts DELETED
@@ -1,17 +0,0 @@
1
- type SurfaceRect = {
2
- x: number;
3
- y: number;
4
- width: number;
5
- height: number;
6
- };
7
- type OverlayState = {
8
- modal: boolean;
9
- rects: SurfaceRect[];
10
- };
11
- type OverlayPush = (state: OverlayState) => unknown;
12
- export declare const setOverlayHost: (push: OverlayPush) => void;
13
- export declare const registerSurface: (element: HTMLElement, { inflate }?: {
14
- inflate?: number | undefined;
15
- }) => () => boolean;
16
- export declare const setModal: (value: boolean) => void;
17
- export {};
@@ -1,12 +0,0 @@
1
- import type { PackagesFail } from './types';
2
- export declare const teardownPackageFrame: (uri: string) => void;
3
- export type PluginIdentity = {
4
- uri: string;
5
- name: string;
6
- version: string;
7
- };
8
- export declare const pluginForFrameWindow: (win: unknown) => PluginIdentity | null;
9
- export declare const connectPackage: (uri: string, protocol: string | null) => Promise<{
10
- port: MessagePort;
11
- closed: Promise<void>;
12
- } | PackagesFail>;
@@ -1 +0,0 @@
1
- export declare const getCallerId: () => string | null;
@@ -1,34 +0,0 @@
1
- import type { ConnectOptions, InstallOptions, InstalledPackage, PackageQuery, PackageResult, PackagesFail, PickOptions } from './types';
2
- export type { PackageQuery, PackageResult, InstalledPackage, PickOptions, InstallOptions, ConnectOptions, PackagesFail, PackagesErrorCode } from './types';
3
- declare const search: (query: PackageQuery) => Promise<{
4
- results: PackageResult[];
5
- } | PackagesFail>;
6
- declare const pick: (query: PackageQuery, options?: PickOptions) => Promise<{
7
- results: PackageResult[];
8
- failed: string[];
9
- } | {
10
- declined: true;
11
- } | PackagesFail>;
12
- declare const install: (uri: string, options?: InstallOptions) => Promise<{
13
- installed: InstalledPackage;
14
- } | {
15
- declined: true;
16
- } | PackagesFail>;
17
- declare const list: () => Promise<{
18
- results: InstalledPackage[];
19
- }>;
20
- declare const uninstall: (uri: string) => Promise<{
21
- ok: true;
22
- } | PackagesFail>;
23
- declare const connect: (uri: string, options?: ConnectOptions) => Promise<{
24
- port: MessagePort;
25
- closed: Promise<void>;
26
- } | PackagesFail>;
27
- export declare const packages: {
28
- search: typeof search;
29
- pick: typeof pick;
30
- install: typeof install;
31
- list: typeof list;
32
- uninstall: typeof uninstall;
33
- connect: typeof connect;
34
- };
@@ -1,28 +0,0 @@
1
- /** @jsxImportSource preact */
2
- import type { PackageResult } from './types';
3
- import { type PackagesFail } from './types';
4
- type FinalizeResult = {
5
- results: PackageResult[];
6
- failed: string[];
7
- };
8
- type PickerProps = {
9
- title?: string;
10
- results: PackageResult[];
11
- multiple: boolean;
12
- finalize: (selected: PackageResult[]) => Promise<FinalizeResult>;
13
- onResolve: (result: FinalizeResult | null) => void;
14
- };
15
- type ConfirmProps = {
16
- name: string;
17
- version: string;
18
- description: string;
19
- publisher: string | null;
20
- onResolve: (accepted: boolean) => void;
21
- };
22
- export declare const pickPackages: (props: Omit<PickerProps, 'onResolve'>) => Promise<FinalizeResult | {
23
- declined: true;
24
- } | PackagesFail>;
25
- export declare const confirmInstall: (props: Omit<ConfirmProps, 'onResolve'>) => Promise<{
26
- accepted: boolean;
27
- } | PackagesFail>;
28
- export {};
@@ -1,20 +0,0 @@
1
- import type { PackageQuery, PackageResult, PackagesFail } from './types';
2
- export declare const isValidVersion: (version: string) => boolean;
3
- export type ParsedNpmUri = {
4
- uri: string;
5
- name: string;
6
- version: string | null;
7
- };
8
- export declare const parseNpmUri: (input: unknown) => ParsedNpmUri | undefined;
9
- export declare const searchPackages: (query: PackageQuery, isInstalled: (uri: string) => boolean) => Promise<{
10
- results: PackageResult[];
11
- } | PackagesFail>;
12
- export type ResolvedPackage = {
13
- name: string;
14
- version: string;
15
- description: string;
16
- publisher: string | null;
17
- };
18
- export declare const resolvePackument: (name: string, version?: string | null) => Promise<{
19
- resolved: ResolvedPackage;
20
- } | PackagesFail>;
@@ -1,6 +0,0 @@
1
- import type { InstalledPackage } from './types';
2
- export declare const listRecords: (installer: string) => InstalledPackage[];
3
- export declare const getRecord: (installer: string, uri: string) => InstalledPackage | undefined;
4
- export declare const putRecord: (installer: string, record: InstalledPackage) => boolean;
5
- export declare const deleteRecord: (installer: string, uri: string) => void;
6
- export declare const onRecordsChange: (listener: () => void) => (() => void);
@@ -1,56 +0,0 @@
1
- export type PackageQuery = {
2
- /** package kind, e.g. 'plugin' - becomes the keyword `fkn-type:<type>` */
3
- type: string;
4
- /** host app scope, e.g. 'stub' - becomes the keyword `fkn-<type>--<id>` */
5
- id?: string;
6
- /** package source; npm is the only origin implemented */
7
- origin?: 'npm';
8
- /** free text mixed into the registry query */
9
- text?: string;
10
- /** result count, clamped to 1..100 */
11
- size?: number;
12
- };
13
- export type PackageResult = {
14
- /** canonical version-free uri, e.g. 'npm:@banou/stub-plugin-foo' */
15
- uri: string;
16
- origin: 'npm';
17
- name: string;
18
- /** latest version per the search index - display only, install re-resolves from the packument */
19
- version: string;
20
- description: string;
21
- keywords: string[];
22
- publisher: string | null;
23
- downloadsMonthly: number | null;
24
- links: {
25
- npm?: string;
26
- homepage?: string;
27
- repository?: string;
28
- };
29
- /** installed by the calling app */
30
- installed: boolean;
31
- };
32
- export type InstalledPackage = {
33
- uri: string;
34
- name: string;
35
- version: string;
36
- installedAt: number;
37
- };
38
- export type PickOptions = {
39
- /** untrusted, rendered as text in the picker header */
40
- title?: string;
41
- multiple?: boolean;
42
- };
43
- export type InstallOptions = {
44
- /** exact version to pin; defaults to the packument's latest dist-tag */
45
- version?: string;
46
- };
47
- export type ConnectOptions = {
48
- /** opaque contract tag delivered to the package's onConnect, e.g. 'stub-source@1' */
49
- protocol?: string;
50
- };
51
- export type PackagesErrorCode = 'invalid' | 'not-installed' | 'unaddressable' | 'timeout' | 'unavailable' | 'denied';
52
- export type PackagesFail = {
53
- error: PackagesErrorCode;
54
- message: string;
55
- };
56
- export declare const packagesFail: (error: PackagesErrorCode, message: string) => PackagesFail;
@@ -1 +0,0 @@
1
- export declare const warmEgressOrigins: () => void;
@@ -1 +0,0 @@
1
- export { proxyFetch } from './proxy-fetch';
@@ -1,5 +0,0 @@
1
- type FetchArgs = Parameters<typeof fetch>;
2
- export declare const proxyFetch: (input: FetchArgs[0], init?: FetchArgs[1] & {
3
- render?: boolean;
4
- }) => Promise<Response>;
5
- export {};
package/api/quota.d.ts DELETED
@@ -1,10 +0,0 @@
1
- export type Quota = {
2
- overQuota: boolean;
3
- remaining: number;
4
- usedBytes: number;
5
- limitBytes: number;
6
- premium: boolean;
7
- bytesPerSecond: number;
8
- };
9
- export declare const fetchQuota: () => Promise<Quota>;
10
- export declare const notifyEgress: () => void;
@@ -1,3 +0,0 @@
1
- export declare const peekRateToken: () => string | null;
2
- export declare const primeRateToken: () => void;
3
- export declare const getRateToken: () => Promise<string | null>;
@@ -1 +0,0 @@
1
- export declare const showSessionLimitNotice: (reason: string) => void;
package/api/storage.d.ts DELETED
@@ -1,20 +0,0 @@
1
- export type StorageEntry = {
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 = ArrayBuffer | Uint8Array | string;
15
- export declare const storageAvailable: () => Promise<boolean>;
16
- export declare const storageList: () => Promise<StorageEntry[]>;
17
- export declare const storageQuota: () => Promise<StorageQuota>;
18
- export declare const storageDelete: (path: string) => Promise<void>;
19
- export declare const storageReadFile: (path: string) => Promise<Uint8Array>;
20
- export declare const storageWriteFile: (path: string, data: WriteData, contentType: string | null) => Promise<void>;
package/api/toast.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const showQuotaToast: () => void;
@@ -1,4 +0,0 @@
1
- export declare const setConnectTokenGetter: (getter: () => Promise<string | null>) => void;
2
- export declare const getConnectToken: () => Promise<string | null>;
3
- export declare const onConnectChange: (listener: () => void) => (() => void);
4
- export declare const emitConnectChange: () => void;
@@ -1,8 +0,0 @@
1
- export type UiEvent = {
2
- type: 'quota-toast';
3
- } | {
4
- type: 'session-limit';
5
- reason: string;
6
- };
7
- export declare const setUiEventHandler: (nextHandler: (event: UiEvent) => void) => void;
8
- export declare const emitUiEvent: (event: UiEvent) => void;
package/api/ui-host.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import type { UiEvent } from './ui-events';
2
- export declare const displayUiEvent: (event: UiEvent) => void;
@@ -1,3 +0,0 @@
1
- export { webVpnTcpSocket } from './tcp';
2
- export { webVpnTcpSocketListener } from './tcp-listener';
3
- export { webVpnUdpSocket } from './udp';
@@ -1,31 +0,0 @@
1
- import type { ServerMetadataTcpSetOptionAckPacket, ServerMetadataTcpSocketConnectedPacket, ServerMetadataTcpSocketShutdownPacket } from './tcp';
2
- import type { ServerMetadataTcpSocketListenerBoundPacket, ServerMetadataTcpSocketListenerUnboundPacket } from './tcp-listener';
3
- import type { ServerMetadataUdpSetOptionAckPacket, ServerMetadataUdpSocketBoundPacket, ServerMetadataUdpSocketConnectedPacket, ServerMetadataUdpSocketUnboundPacket } from './udp';
4
- export declare const parseClientMetadataHeaderPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
5
- readonly _type: 'ClientMetadataHeaderPacket';
6
- readonly offset: number;
7
- readonly agentLength: number;
8
- readonly agent: string;
9
- readonly versionLength: number;
10
- readonly version: string;
11
- };
12
- export type ClientMetadataHeaderPacket = Omit<ReturnType<typeof parseClientMetadataHeaderPacket>, 'offset'>;
13
- export declare const packClientMetadataPremiumTokenPacket: (token: string) => Uint8Array<ArrayBuffer>;
14
- export declare const packClientMetadataHeaderPacket: (packet: Pick<ClientMetadataHeaderPacket, 'agent' | 'version'>) => Uint8Array<ArrayBuffer>;
15
- export declare const parseServerMetadataHeaderPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
16
- readonly _type: 'ServerMetadataHeaderPacket';
17
- readonly offset: number;
18
- readonly agentLength: number;
19
- readonly agent: string;
20
- readonly versionLength: number;
21
- readonly version: string;
22
- };
23
- export type ServerMetadataHeaderPacket = ReturnType<typeof parseServerMetadataHeaderPacket>;
24
- export declare const packServerMetadataHeaderPacket: (packet: Pick<ServerMetadataHeaderPacket, 'agent' | 'version'>) => Uint8Array<ArrayBuffer>;
25
- export declare const parseServerMetadataPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => ServerMetadataPacket;
26
- export type ServerMetadataPacket = ServerMetadataHeaderPacket | ServerMetadataTcpSocketConnectedPacket | ServerMetadataTcpSocketShutdownPacket | ServerMetadataTcpSocketListenerBoundPacket | ServerMetadataTcpSocketListenerUnboundPacket | ServerMetadataUdpSocketBoundPacket | ServerMetadataUdpSocketUnboundPacket | ServerMetadataUdpSocketConnectedPacket | ServerMetadataTcpSetOptionAckPacket | ServerMetadataUdpSetOptionAckPacket;
27
- export declare const parseServerMetadataPackets: (buffer: ArrayBuffer) => {
28
- packets: ServerMetadataPacket[];
29
- remaining: ArrayBuffer;
30
- };
31
- export declare const createServerMetadataPacketTransformStream: () => TransformStream<Uint8Array<ArrayBufferLike>, ServerMetadataPacket>;
@@ -1,39 +0,0 @@
1
- export declare const parseClientMetadataTcpSocketListenerBindPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
2
- readonly offset: number;
3
- readonly id: number;
4
- readonly localAddressType: 0 | 1;
5
- readonly localAddress: import("ip-address").Address4 | import("ip-address").Address6;
6
- readonly localPort: number;
7
- };
8
- export type ClientMetadataTcpSocketListenerBindPacket = ReturnType<typeof parseClientMetadataTcpSocketListenerBindPacket>;
9
- export declare const packClientMetadataTcpSocketListenerBindPacket: (packet: Omit<ClientMetadataTcpSocketListenerBindPacket, '_type' | 'offset'>) => Uint8Array<ArrayBuffer>;
10
- export declare const parseClientMetadataTcpSocketListenerUnbindPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
11
- readonly _type: 'ClientMetadataTcpSocketListenerUnbindPacket';
12
- readonly offset: number;
13
- readonly id: number;
14
- readonly socketId: number;
15
- };
16
- export type ClientMetadataTcpSocketListenerUnbindPacket = ReturnType<typeof parseClientMetadataTcpSocketListenerUnbindPacket>;
17
- export declare const packClientMetadataTcpSocketListenerUnbindPacket: (packet: Omit<ClientMetadataTcpSocketListenerUnbindPacket, '_type' | 'offset'>) => Uint8Array<ArrayBuffer>;
18
- export declare const parseServerMetadataTcpSocketListenerBoundPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
19
- readonly _type: 'ServerMetadataTcpSocketListenerBoundPacket';
20
- readonly offset: number;
21
- readonly id: number;
22
- readonly socketId: number;
23
- readonly localAddressType: 0 | 1;
24
- readonly localAddress: import("ip-address").Address4 | import("ip-address").Address6;
25
- readonly localPort: number;
26
- readonly errorLength: number;
27
- readonly error: string;
28
- };
29
- export type ServerMetadataTcpSocketListenerBoundPacket = ReturnType<typeof parseServerMetadataTcpSocketListenerBoundPacket>;
30
- export declare const packServerMetadataTcpSocketListenerBoundPacket: (packet: Omit<ServerMetadataTcpSocketListenerBoundPacket, '_type' | 'offset' | 'errorLength'>) => Uint8Array<ArrayBuffer>;
31
- export declare const parseServerMetadataTcpSocketListenerUnboundPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
32
- readonly _type: 'ServerMetadataTcpSocketListenerUnboundPacket';
33
- readonly offset: number;
34
- readonly id: number;
35
- readonly socketId: number;
36
- };
37
- export type ServerMetadataTcpSocketListenerUnboundPacket = ReturnType<typeof parseServerMetadataTcpSocketListenerUnboundPacket>;
38
- export declare const packServerMetadataTcpSocketListenerUnboundPacket: (packet: Omit<ServerMetadataTcpSocketListenerUnboundPacket, '_type' | 'offset'>) => Uint8Array<ArrayBuffer>;
39
- export type ServerMetadataTcpSocketListenerPacket = ServerMetadataTcpSocketListenerBoundPacket | ServerMetadataTcpSocketListenerUnboundPacket;
@@ -1,88 +0,0 @@
1
- export declare const parseClientMetadataTcpSocketConnectPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
2
- readonly _type: 'ClientMetadataTcpSocketConnectPacket';
3
- readonly offset: number;
4
- readonly id: number;
5
- readonly remoteAddressType: 0 | 1;
6
- readonly remoteAddress: import("ip-address").Address4 | import("ip-address").Address6;
7
- readonly remotePort: number;
8
- };
9
- export type ClientMetadataTcpSocketConnectPacket = ReturnType<typeof parseClientMetadataTcpSocketConnectPacket>;
10
- export declare const packClientMetadataTcpSocketConnectPacket: (packet: Omit<ClientMetadataTcpSocketConnectPacket, '_type' | 'offset'>) => Uint8Array<ArrayBuffer>;
11
- export declare const parseClientMetadataTcpSocketTcpShutdownPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
12
- readonly _type: 'ClientMetadataTcpSocketTcpShutdownPacket';
13
- readonly offset: number;
14
- readonly id: number;
15
- readonly socketId: number;
16
- };
17
- export type ClientMetadataTcpSocketTcpShutdownPacket = ReturnType<typeof parseClientMetadataTcpSocketTcpShutdownPacket>;
18
- export declare const packClientMetadataTcpSocketTcpShutdownPacket: (packet: Omit<ClientMetadataTcpSocketTcpShutdownPacket, '_type' | 'offset'>) => Uint8Array<ArrayBuffer>;
19
- export declare const parseServerMetadataTcpSocketConnectedPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
20
- readonly _type: 'ServerMetadataTcpSocketConnectedPacket';
21
- readonly offset: number;
22
- readonly id: number;
23
- readonly socketId: number;
24
- readonly localAddressType: 0 | 1;
25
- readonly localAddress: import("ip-address").Address4 | import("ip-address").Address6;
26
- readonly localPort: number;
27
- readonly remoteAddressType: 0 | 1;
28
- readonly remoteAddress: import("ip-address").Address4 | import("ip-address").Address6;
29
- readonly remotePort: number;
30
- readonly errorLength: number;
31
- readonly error: string;
32
- };
33
- export type ServerMetadataTcpSocketConnectedPacket = ReturnType<typeof parseServerMetadataTcpSocketConnectedPacket>;
34
- export declare const packServerMetadataTcpSocketConnectedPacket: (packet: Omit<ServerMetadataTcpSocketConnectedPacket, '_type' | 'offset' | 'errorLength'>) => Uint8Array<ArrayBuffer>;
35
- export declare const parseServerMetadataTcpSocketShutdownPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
36
- readonly _type: 'ServerMetadataTcpSocketShutdownPacket';
37
- readonly offset: number;
38
- readonly id: number;
39
- readonly socketId: number;
40
- };
41
- export type ServerMetadataTcpSocketShutdownPacket = ReturnType<typeof parseServerMetadataTcpSocketShutdownPacket>;
42
- export declare const packServerMetadataTcpSocketShutdownPacket: (packet: Omit<ServerMetadataTcpSocketShutdownPacket, '_type' | 'offset'>) => Uint8Array<ArrayBuffer>;
43
- export type ClientMetadataTcpSocketPacket = ClientMetadataTcpSocketConnectPacket | ClientMetadataTcpSocketTcpShutdownPacket;
44
- export declare const TCP_OPTION_NODELAY: 0;
45
- export declare const TCP_OPTION_TTL: 1;
46
- export declare const TCP_OPTION_KEEPALIVE: 2;
47
- export declare const TCP_OPTION_SEND_BUFFER_SIZE: 3;
48
- export declare const TCP_OPTION_RECV_BUFFER_SIZE: 4;
49
- export type TcpSocketOption = {
50
- type: typeof TCP_OPTION_NODELAY;
51
- value: boolean;
52
- } | {
53
- type: typeof TCP_OPTION_TTL;
54
- value: number;
55
- } | {
56
- type: typeof TCP_OPTION_KEEPALIVE;
57
- enabled: boolean;
58
- initialDelaySeconds: number;
59
- } | {
60
- type: typeof TCP_OPTION_SEND_BUFFER_SIZE;
61
- value: number;
62
- } | {
63
- type: typeof TCP_OPTION_RECV_BUFFER_SIZE;
64
- value: number;
65
- };
66
- export declare const parseClientMetadataTcpSetOptionPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
67
- _type: 'ClientMetadataTcpSetOptionPacket';
68
- offset: number;
69
- id: number;
70
- socketId: number;
71
- option: TcpSocketOption;
72
- };
73
- export type ClientMetadataTcpSetOptionPacket = ReturnType<typeof parseClientMetadataTcpSetOptionPacket>;
74
- export declare const packClientMetadataTcpSetOptionPacket: (packet: {
75
- id: number;
76
- socketId: number;
77
- option: TcpSocketOption;
78
- }) => Uint8Array<ArrayBuffer>;
79
- export declare const parseServerMetadataTcpSetOptionAckPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
80
- _type: 'ServerMetadataTcpSetOptionAckPacket';
81
- offset: number;
82
- id: number;
83
- socketId: number;
84
- errorLength: number;
85
- error: string;
86
- };
87
- export type ServerMetadataTcpSetOptionAckPacket = ReturnType<typeof parseServerMetadataTcpSetOptionAckPacket>;
88
- export declare const packServerMetadataTcpSetOptionAckPacket: (packet: Omit<ServerMetadataTcpSetOptionAckPacket, '_type' | 'offset' | 'errorLength'>) => Uint8Array<ArrayBuffer>;