nervur 0.23.0 → 0.24.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 (157) hide show
  1. package/CONTRIBUTING.md +13 -0
  2. package/LICENSE +55 -202
  3. package/NOTICE +3 -8
  4. package/README.md +14 -156
  5. package/RELEASING.md +15 -0
  6. package/SECURITY.md +9 -0
  7. package/bin/nervur.js +6 -0
  8. package/package.json +26 -81
  9. package/AUTHORING.md +0 -935
  10. package/COMMAND.md +0 -179
  11. package/FACES.md +0 -280
  12. package/FACULTIES.md +0 -578
  13. package/GROUNDS.md +0 -315
  14. package/KIT-SPEC.md +0 -304
  15. package/WORLD.md +0 -195
  16. package/dist/app/app-ground.d.ts +0 -18
  17. package/dist/app/app-ground.js +0 -23
  18. package/dist/app/index.d.ts +0 -2
  19. package/dist/app/index.js +0 -5
  20. package/dist/app/native.d.ts +0 -11
  21. package/dist/app/native.js +0 -13
  22. package/dist/being/being.d.ts +0 -306
  23. package/dist/being/being.js +0 -20
  24. package/dist/being/covers.d.ts +0 -9
  25. package/dist/being/covers.js +0 -21
  26. package/dist/being/index.d.ts +0 -4
  27. package/dist/being/index.js +0 -6
  28. package/dist/being/need.d.ts +0 -49
  29. package/dist/being/need.js +0 -33
  30. package/dist/being/schema.d.ts +0 -100
  31. package/dist/being/schema.js +0 -132
  32. package/dist/being/table.d.ts +0 -48
  33. package/dist/being/table.js +0 -344
  34. package/dist/bench/bench-ground.d.ts +0 -73
  35. package/dist/bench/bench-ground.js +0 -153
  36. package/dist/bench/bench.d.ts +0 -101
  37. package/dist/bench/bench.js +0 -368
  38. package/dist/bench/fake-clock.d.ts +0 -17
  39. package/dist/bench/fake-clock.js +0 -34
  40. package/dist/bench/fake-memory.d.ts +0 -16
  41. package/dist/bench/fake-memory.js +0 -46
  42. package/dist/bench/fake-network.d.ts +0 -66
  43. package/dist/bench/fake-network.js +0 -222
  44. package/dist/bench/fake-unlock.d.ts +0 -6
  45. package/dist/bench/fake-unlock.js +0 -10
  46. package/dist/bench/index.d.ts +0 -3
  47. package/dist/bench/index.js +0 -5
  48. package/dist/bench/seeded.d.ts +0 -11
  49. package/dist/bench/seeded.js +0 -37
  50. package/dist/bench/settle.d.ts +0 -2
  51. package/dist/bench/settle.js +0 -49
  52. package/dist/bench/stewards.d.ts +0 -169
  53. package/dist/bench/stewards.js +0 -128
  54. package/dist/bodies/class-list.d.ts +0 -14
  55. package/dist/bodies/class-list.js +0 -33
  56. package/dist/bodies/joined-carry.d.ts +0 -29
  57. package/dist/bodies/joined-carry.js +0 -48
  58. package/dist/bodies/kept.d.ts +0 -44
  59. package/dist/bodies/kept.js +0 -91
  60. package/dist/bodies/noble-crypto.d.ts +0 -22
  61. package/dist/bodies/noble-crypto.js +0 -88
  62. package/dist/bodies/seed-keys.d.ts +0 -10
  63. package/dist/bodies/seed-keys.js +0 -42
  64. package/dist/bodies/strict-tools.d.ts +0 -10
  65. package/dist/bodies/strict-tools.js +0 -306
  66. package/dist/bodies/vouch.d.ts +0 -20
  67. package/dist/bodies/vouch.js +0 -71
  68. package/dist/bodies/web-carry.d.ts +0 -72
  69. package/dist/bodies/web-carry.js +0 -245
  70. package/dist/bodies/web-clock.d.ts +0 -12
  71. package/dist/bodies/web-clock.js +0 -33
  72. package/dist/browser/browser-ground.d.ts +0 -76
  73. package/dist/browser/browser-ground.js +0 -294
  74. package/dist/browser/index.d.ts +0 -4
  75. package/dist/browser/index.js +0 -7
  76. package/dist/browser/indexeddb-memory.d.ts +0 -17
  77. package/dist/browser/indexeddb-memory.js +0 -97
  78. package/dist/browser/locked-unlock.d.ts +0 -24
  79. package/dist/browser/locked-unlock.js +0 -85
  80. package/dist/browser/origin-classes.d.ts +0 -7
  81. package/dist/browser/origin-classes.js +0 -31
  82. package/dist/edge/durable-clock.d.ts +0 -19
  83. package/dist/edge/durable-clock.js +0 -61
  84. package/dist/edge/durable-memory.d.ts +0 -5
  85. package/dist/edge/durable-memory.js +0 -11
  86. package/dist/edge/durable.d.ts +0 -18
  87. package/dist/edge/durable.js +0 -24
  88. package/dist/edge/edge-ground.d.ts +0 -49
  89. package/dist/edge/edge-ground.js +0 -223
  90. package/dist/edge/index.d.ts +0 -7
  91. package/dist/edge/index.js +0 -9
  92. package/dist/edge/native-crypto.d.ts +0 -8
  93. package/dist/edge/native-crypto.js +0 -102
  94. package/dist/edge/secret-unlock.d.ts +0 -7
  95. package/dist/edge/secret-unlock.js +0 -13
  96. package/dist/edge/socket-carry.d.ts +0 -39
  97. package/dist/edge/socket-carry.js +0 -111
  98. package/dist/foundation.d.ts +0 -162
  99. package/dist/foundation.js +0 -4
  100. package/dist/ground/dock.d.ts +0 -1460
  101. package/dist/ground/dock.js +0 -1159
  102. package/dist/ground/ground.d.ts +0 -239
  103. package/dist/ground/ground.js +0 -787
  104. package/dist/ground/views.d.ts +0 -76
  105. package/dist/ground/views.js +0 -208
  106. package/dist/house/crossing.d.ts +0 -50
  107. package/dist/house/crossing.js +0 -153
  108. package/dist/house/house.d.ts +0 -88
  109. package/dist/house/house.js +0 -2069
  110. package/dist/house/rows-shape.d.ts +0 -110
  111. package/dist/house/rows-shape.js +0 -12
  112. package/dist/house/rows.d.ts +0 -27
  113. package/dist/house/rows.js +0 -185
  114. package/dist/index.d.ts +0 -33
  115. package/dist/index.js +0 -29
  116. package/dist/node/bridge.d.ts +0 -20
  117. package/dist/node/bridge.js +0 -284
  118. package/dist/node/cli.d.ts +0 -2
  119. package/dist/node/cli.js +0 -225
  120. package/dist/node/file-memory.d.ts +0 -13
  121. package/dist/node/file-memory.js +0 -86
  122. package/dist/node/folder-classes.d.ts +0 -5
  123. package/dist/node/folder-classes.js +0 -40
  124. package/dist/node/gone.d.ts +0 -2
  125. package/dist/node/gone.js +0 -7
  126. package/dist/node/hand.d.ts +0 -39
  127. package/dist/node/hand.js +0 -107
  128. package/dist/node/http.d.ts +0 -11
  129. package/dist/node/http.js +0 -90
  130. package/dist/node/index.d.ts +0 -11
  131. package/dist/node/index.js +0 -13
  132. package/dist/node/ledger-memory.d.ts +0 -17
  133. package/dist/node/ledger-memory.js +0 -152
  134. package/dist/node/lock.d.ts +0 -10
  135. package/dist/node/lock.js +0 -78
  136. package/dist/node/node-ground.d.ts +0 -26
  137. package/dist/node/node-ground.js +0 -228
  138. package/dist/node/notify.d.ts +0 -1
  139. package/dist/node/notify.js +0 -18
  140. package/dist/node/shell.d.ts +0 -11
  141. package/dist/node/shell.js +0 -35
  142. package/dist/node/sync-folder.d.ts +0 -6
  143. package/dist/node/sync-folder.js +0 -18
  144. package/dist/node/tcp-carry.d.ts +0 -42
  145. package/dist/node/tcp-carry.js +0 -193
  146. package/dist/node/unlock.d.ts +0 -17
  147. package/dist/node/unlock.js +0 -86
  148. package/dist/node/websocket.d.ts +0 -12
  149. package/dist/node/websocket.js +0 -134
  150. package/dist/quo/frame.d.ts +0 -33
  151. package/dist/quo/frame.js +0 -92
  152. package/dist/quo/index.d.ts +0 -1
  153. package/dist/quo/index.js +0 -5
  154. package/dist/quo/room.d.ts +0 -154
  155. package/dist/quo/room.js +0 -362
  156. package/dist/serve/index.d.ts +0 -45
  157. package/dist/serve/index.js +0 -71
@@ -1,306 +0,0 @@
1
- const encoder = new TextEncoder();
2
- const decoder = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true });
3
- const HEX = /^(?:[0-9a-f]{2})*$/;
4
- const NUMBER = /-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?/y;
5
- const ESCAPES = { '"': '"', '\\': '\\', '/': '/', b: '\b', f: '\f', n: '\n', r: '\r', t: '\t' };
6
- const define = (target, key, value) => Object.defineProperty(target, key, { value, enumerable: true, writable: true, configurable: true });
7
- // An iterative reader, so no nesting a sender writes can exhaust the stack.
8
- const read = (text) => {
9
- const length = text.length;
10
- let at = 0;
11
- let duplicate = false;
12
- let nestedDuplicate = false;
13
- let fields = null;
14
- const stack = [];
15
- const space = () => {
16
- while (at < length) {
17
- const code = text.charCodeAt(at);
18
- if (code !== 0x20 && code !== 0x09 && code !== 0x0a && code !== 0x0d)
19
- return;
20
- at++;
21
- }
22
- };
23
- const string = () => {
24
- if (text[at] !== '"')
25
- return null;
26
- at++;
27
- let out = '';
28
- let from = at;
29
- while (at < length) {
30
- const code = text.charCodeAt(at);
31
- if (code === 0x22) {
32
- out += text.slice(from, at);
33
- at++;
34
- return out;
35
- }
36
- if (code < 0x20)
37
- return null;
38
- if (code === 0x5c) {
39
- out += text.slice(from, at);
40
- const escape = text[at + 1];
41
- if (escape === 'u') {
42
- const digits = text.slice(at + 2, at + 6);
43
- if (!/^[0-9a-fA-F]{4}$/.test(digits))
44
- return null;
45
- out += String.fromCharCode(Number.parseInt(digits, 16));
46
- at += 6;
47
- }
48
- else {
49
- const plain = escape === undefined ? undefined : ESCAPES[escape];
50
- if (plain === undefined)
51
- return null;
52
- out += plain;
53
- at += 2;
54
- }
55
- from = at;
56
- continue;
57
- }
58
- at++;
59
- }
60
- return null;
61
- };
62
- const key = (frame) => {
63
- const name = string();
64
- if (name === null)
65
- return false;
66
- space();
67
- if (text[at] !== ':')
68
- return false;
69
- at++;
70
- space();
71
- if (frame.keys.has(name)) {
72
- if (stack[0] === frame)
73
- duplicate = true;
74
- else
75
- nestedDuplicate = true;
76
- }
77
- frame.keys.add(name);
78
- frame.key = name;
79
- frame.start = at;
80
- return true;
81
- };
82
- for (;;) {
83
- space();
84
- let value;
85
- const char = text[at];
86
- if (char === '{') {
87
- at++;
88
- space();
89
- const frame = { object: true, value: {}, keys: new Set(), key: '', start: 0 };
90
- if (text[at] === '}') {
91
- at++;
92
- value = frame.value;
93
- }
94
- else {
95
- stack.push(frame);
96
- if (stack.length === 1)
97
- fields = Object.create(null);
98
- if (!key(frame))
99
- return null;
100
- continue;
101
- }
102
- }
103
- else if (char === '[') {
104
- at++;
105
- space();
106
- if (text[at] === ']') {
107
- at++;
108
- value = [];
109
- }
110
- else {
111
- stack.push({ object: false, value: [] });
112
- continue;
113
- }
114
- }
115
- else if (char === '"') {
116
- value = string();
117
- if (value === null)
118
- return null;
119
- }
120
- else if (text.startsWith('true', at)) {
121
- at += 4;
122
- value = true;
123
- }
124
- else if (text.startsWith('false', at)) {
125
- at += 5;
126
- value = false;
127
- }
128
- else if (text.startsWith('null', at)) {
129
- at += 4;
130
- value = null;
131
- }
132
- else {
133
- NUMBER.lastIndex = at;
134
- const number = NUMBER.exec(text);
135
- if (number === null)
136
- return null;
137
- at += number[0].length;
138
- value = Number(number[0]);
139
- }
140
- // The value is whole: set it in its container, and close what it ends.
141
- for (;;) {
142
- const top = stack.at(-1);
143
- if (top === undefined) {
144
- space();
145
- if (at !== length)
146
- return null;
147
- if (!(typeof value === 'object' && value !== null && !Array.isArray(value)))
148
- fields = null;
149
- return { value, fields, duplicate, nestedDuplicate };
150
- }
151
- if (top.object) {
152
- if (stack.length === 1 && fields !== null)
153
- fields[top.key] = text.slice(top.start, at);
154
- define(top.value, top.key, value);
155
- space();
156
- if (text[at] === ',') {
157
- at++;
158
- space();
159
- if (!key(top))
160
- return null;
161
- break;
162
- }
163
- if (text[at] !== '}')
164
- return null;
165
- }
166
- else {
167
- top.value.push(value);
168
- space();
169
- if (text[at] === ',') {
170
- at++;
171
- break;
172
- }
173
- if (text[at] !== ']')
174
- return null;
175
- }
176
- at++;
177
- stack.pop();
178
- value = top.value;
179
- }
180
- }
181
- };
182
- const canonical = (value) => {
183
- if (value === null || typeof value === 'boolean' || typeof value === 'string')
184
- return JSON.stringify(value);
185
- if (typeof value === 'number') {
186
- if (!Number.isFinite(value))
187
- throw new TypeError('a number that is not finite has no JSON');
188
- return JSON.stringify(value);
189
- }
190
- if (Array.isArray(value))
191
- return `[${value.map(canonical).join(',')}]`;
192
- if (typeof value === 'object' && Object.getPrototypeOf(value) === Object.prototype) {
193
- const keys = Object.keys(value).sort();
194
- return `{${keys.map((key) => `${JSON.stringify(key)}:${canonical(value[key])}`).join(',')}}`;
195
- }
196
- throw new TypeError('the value is not JSON');
197
- };
198
- export class StrictTools {
199
- utf8(text) {
200
- return encoder.encode(text);
201
- }
202
- text(bytes) {
203
- try {
204
- return decoder.decode(bytes);
205
- }
206
- catch {
207
- return null;
208
- }
209
- }
210
- hex(bytes) {
211
- let out = '';
212
- for (const byte of bytes)
213
- out += byte.toString(16).padStart(2, '0');
214
- return out;
215
- }
216
- bytes(hex) {
217
- if (typeof hex !== 'string' || !HEX.test(hex))
218
- return null;
219
- const out = new Uint8Array(hex.length / 2);
220
- for (let at = 0; at < out.length; at++)
221
- out[at] = Number.parseInt(hex.slice(at * 2, at * 2 + 2), 16);
222
- return out;
223
- }
224
- parse(text) {
225
- return read(text);
226
- }
227
- canonical(value) {
228
- return canonical(value);
229
- }
230
- check(schema, value) {
231
- return check(schema, value, 'the value');
232
- }
233
- }
234
- const typeOf = (value) => {
235
- if (value === null)
236
- return 'null';
237
- if (Array.isArray(value))
238
- return 'array';
239
- if (typeof value === 'number')
240
- return Number.isInteger(value) ? 'integer' : 'number';
241
- return typeof value;
242
- };
243
- // The closed subset, read as JSON Schema 2020-12 reads it.
244
- const check = (schema, value, at) => {
245
- if (typeof schema !== 'object' || schema === null)
246
- return `${at} meets no schema`;
247
- const type = schema.type;
248
- if (type !== undefined) {
249
- const actual = typeOf(value);
250
- const fits = actual === type || (type === 'number' && actual === 'integer');
251
- if (!fits)
252
- return `${at} is not ${type === 'integer' || type === 'array' || type === 'object' ? 'an' : 'a'} ${type}`;
253
- }
254
- if ('const' in schema && schema.const !== value)
255
- return `${at} is not ${JSON.stringify(schema.const)}`;
256
- if (Array.isArray(schema.enum) && !schema.enum.includes(value))
257
- return `${at} is none of ${JSON.stringify(schema.enum)}`;
258
- if (typeof value === 'string') {
259
- const length = [...value].length;
260
- if (typeof schema.minLength === 'number' && length < schema.minLength)
261
- return `${at} is shorter than ${schema.minLength}`;
262
- if (typeof schema.maxLength === 'number' && length > schema.maxLength)
263
- return `${at} is longer than ${schema.maxLength}`;
264
- if (typeof schema.pattern === 'string' && !new RegExp(schema.pattern, 'u').test(value))
265
- return `${at} does not match ${schema.pattern}`;
266
- if (schema.contentEncoding === 'base16' && !HEX.test(value))
267
- return `${at} is not lowercase hex`;
268
- }
269
- if (typeof value === 'number') {
270
- if (typeof schema.minimum === 'number' && value < schema.minimum)
271
- return `${at} is below ${schema.minimum}`;
272
- if (typeof schema.maximum === 'number' && value > schema.maximum)
273
- return `${at} is above ${schema.maximum}`;
274
- }
275
- if (Array.isArray(value) && schema.items !== undefined) {
276
- for (let index = 0; index < value.length; index++) {
277
- const found = check(schema.items, value[index], `${at}[${index}]`);
278
- if (found !== null)
279
- return found;
280
- }
281
- }
282
- if (typeOf(value) === 'object') {
283
- const object = value;
284
- const properties = (schema.properties ?? {});
285
- for (const key of (schema.required ?? []))
286
- if (!Object.hasOwn(object, key))
287
- return `${at}.${key} is missing`;
288
- for (const [key, field] of Object.entries(object)) {
289
- const inner = Object.hasOwn(properties, key) ? properties[key] : undefined;
290
- if (inner === undefined) {
291
- if (schema.additionalProperties === false)
292
- return `${at}.${key} is not allowed`;
293
- continue;
294
- }
295
- const found = check(inner, field, `${at}.${key}`);
296
- if (found !== null)
297
- return found;
298
- }
299
- }
300
- if (Array.isArray(schema.anyOf)) {
301
- const reasons = schema.anyOf.map((branch) => check(branch, value, at));
302
- if (!reasons.includes(null))
303
- return reasons[0] ?? `${at} meets no branch`;
304
- }
305
- return null;
306
- };
@@ -1,20 +0,0 @@
1
- /** A GET, as a terrain speaks it. */
2
- export type Fetcher = (url: string, init: {
3
- method: 'GET';
4
- redirect: 'error';
5
- signal: AbortSignal;
6
- }) => Promise<Response>;
7
- /**
8
- * The domains that vouch for `ward`: the host of each address in `at`
9
- * whose scheme is one of `schemes`, in their order, asked through
10
- * `fetcher`. A private or loopback host is asked only where
11
- * `allowPrivate` is set, as a carry dials one.
12
- */
13
- export declare const vouchesOf: ({ fetcher, ward, at, schemes, allowPrivate, wait, }: {
14
- fetcher: Fetcher;
15
- ward: string;
16
- at: readonly string[];
17
- schemes: readonly string[];
18
- allowPrivate?: boolean;
19
- wait?: number;
20
- }) => Promise<string[]>;
@@ -1,71 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- // A domain's vouch for a ward, as quo/DOMAIN.md writes it: one GET to
3
- // `https://<domain>/.well-known/quo`, never redirected, a status of 200,
4
- // and a body that is one object whose `wards` lists the ward pk. Anything
5
- // else vouches for nothing. Every carry body answers `vouched` through
6
- // this, with the fetch its terrain speaks, so a body written by hand reads
7
- // a vouch as the library's do.
8
- import { privateHost } from '../quo/frame.js';
9
- import { StrictTools } from './strict-tools.js';
10
- /** The largest body a vouch may have. */
11
- const LARGEST = 1_048_576;
12
- const WARD = /^[0-9a-f]{128}$/;
13
- const tools = new StrictTools();
14
- // The host of each address whose scheme is one of `schemes`, in their order, each once.
15
- const domainsOf = (at, schemes) => {
16
- const hosts = [];
17
- for (const address of at) {
18
- let url;
19
- try {
20
- url = new URL(address);
21
- }
22
- catch {
23
- continue;
24
- }
25
- if (!schemes.includes(url.protocol.slice(0, -1).toLowerCase()))
26
- continue;
27
- const host = url.hostname.toLowerCase();
28
- if (host !== '' && !hosts.includes(host))
29
- hosts.push(host);
30
- }
31
- return hosts;
32
- };
33
- // Whether one domain's file lists the ward.
34
- const vouches = async (fetcher, domain, ward, wait) => {
35
- const abort = new AbortController();
36
- const timer = setTimeout(() => abort.abort(), wait);
37
- try {
38
- const response = await fetcher(`https://${domain}/.well-known/quo`, { method: 'GET', redirect: 'error', signal: abort.signal });
39
- if (response.status !== 200)
40
- return false;
41
- const bytes = new Uint8Array(await response.arrayBuffer());
42
- if (bytes.length > LARGEST)
43
- return false;
44
- const text = tools.text(bytes);
45
- const parsed = text === null ? null : tools.parse(text);
46
- // Two own keys of one name make no vouch, as they make no payload.
47
- if (parsed === null || parsed.duplicate)
48
- return false;
49
- const value = parsed.value;
50
- if (value === null || typeof value !== 'object' || Array.isArray(value) || !Array.isArray(value.wards))
51
- return false;
52
- return value.wards.some((item) => typeof item === 'string' && WARD.test(item) && item === ward);
53
- }
54
- catch {
55
- return false;
56
- }
57
- finally {
58
- clearTimeout(timer);
59
- }
60
- };
61
- /**
62
- * The domains that vouch for `ward`: the host of each address in `at`
63
- * whose scheme is one of `schemes`, in their order, asked through
64
- * `fetcher`. A private or loopback host is asked only where
65
- * `allowPrivate` is set, as a carry dials one.
66
- */
67
- export const vouchesOf = async ({ fetcher, ward, at, schemes, allowPrivate = false, wait = 30_000, }) => {
68
- const asked = domainsOf(at, schemes).filter((domain) => allowPrivate || !privateHost(domain));
69
- const found = await Promise.all(asked.map((domain) => vouches(fetcher, domain, ward, wait)));
70
- return asked.filter((_, index) => found[index]);
71
- };
@@ -1,72 +0,0 @@
1
- import type { Carry, Sent } from '../foundation.ts';
2
- /** A WebSocket the ground's listener opened: bytes out, and closing. */
3
- export interface HeldSocket {
4
- send(data: Uint8Array): void;
5
- close(): void;
6
- }
7
- /** What a handler does with a WebSocket once it is open. */
8
- export interface Held {
9
- /** Settles once what the message asked is answered, so a ground woken per event holds its wake until then. */
10
- message(data: Uint8Array | string): void | Promise<void>;
11
- close(): void;
12
- }
13
- /**
14
- * Whatever speaks HTTP on a ground. `fetch` answers a request, or `null`
15
- * where it is not this handler's. `upgrade` takes a WebSocket: the
16
- * subprotocol it selects, and what it does once the socket is open.
17
- */
18
- export interface Handler {
19
- fetch(request: Request): Promise<Response | null>;
20
- upgrade?(request: Request): {
21
- protocol: string;
22
- open(socket: HeldSocket): Held;
23
- } | null;
24
- }
25
- type Door = (box: Uint8Array) => Promise<Uint8Array | null>;
26
- export declare class WebCarry implements Carry, Handler {
27
- #private;
28
- /**
29
- * `path` is where it listens under the ground's listener, `/quo` where
30
- * omitted. `addresses` are written into invitations, or read each time
31
- * where the listener's port is known only once it listens. `origins` are
32
- * the pages of other origins it answers, by the CORS protocol.
33
- */
34
- constructor({ path, addresses, origins, allowPrivate, wait, }?: {
35
- path?: string;
36
- addresses?: readonly string[] | (() => readonly string[]);
37
- origins?: readonly string[];
38
- allowPrivate?: boolean;
39
- wait?: number;
40
- });
41
- /** A ward's door, answered on the post and on held lines alike. */
42
- listen({ ward, door }: {
43
- ward: string;
44
- door: Door;
45
- }): void;
46
- /** A ward this handler answers no more. */
47
- unlisten({ ward }: {
48
- ward: string;
49
- }): void;
50
- at(_options?: {
51
- toward?: string;
52
- }): readonly string[];
53
- /** The hosts of its `https` and `wss` addresses that vouch for the ward, each read over TLS. */
54
- vouched({ ward, at }: {
55
- ward: string;
56
- at: readonly string[];
57
- }): Promise<readonly string[]>;
58
- fetch(request: Request): Promise<Response | null>;
59
- upgrade(request: Request): {
60
- protocol: string;
61
- open(socket: HeldSocket): Held;
62
- } | null;
63
- send({ ward, at, box, wait }: {
64
- ward: string;
65
- at: readonly string[];
66
- box: Uint8Array;
67
- wait?: number;
68
- }): Promise<Sent>;
69
- /** Closes every held line it dialled. */
70
- close(): Promise<void>;
71
- }
72
- export {};