Help compiling and using the example
I keep getting errors when compiling the example. I ran `tsc index.mts` and get the following errors:
<details>
<summary>Errors</summary>
```
index.mts:7:12 - error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher.
7 const Fs = await FileSystem.open('filesystem')
~~~~~
index.mts:9:1 - error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher.
9 await Fs.writeText('/index.html', '<html>hello world</html>')
~~~~~
index.mts:27:14 - error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher.
27 const html = await Http.fetch('http://localhost:5000/index.html').then((x) => x.text())
~~~~~
node_modules/@sinclair/smoke/async/barrier.d.mts:5:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
5 #private;
~~~~~~~~
node_modules/@sinclair/smoke/async/debounce.d.mts:10:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
10 #private;
~~~~~~~~
node_modules/@sinclair/smoke/async/deferred.d.mts:4:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
4 #private;
~~~~~~~~
node_modules/@sinclair/smoke/async/lock.d.mts:2:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
2 #private;
~~~~~~~~
node_modules/@sinclair/smoke/async/lock.d.mts:4:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
4 [Symbol.dispose](): void;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/async/lock.d.mts:4:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
4 [Symbol.dispose](): void;
~~~~~~
node_modules/@sinclair/smoke/async/mutex.d.mts:3:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
3 #private;
~~~~~~~~
node_modules/@sinclair/smoke/async/semaphore.d.mts:6:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
6 #private;
~~~~~~~~
node_modules/@sinclair/smoke/buffer/buffer.d.mts:14:71 - error TS2304: Cannot find name 'IterableIterator'.
14 export declare function iterator(buffer: Uint8Array, length: number): IterableIterator<Uint8Array>;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/buffer/reader.d.mts:2:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
2 #private;
~~~~~~~~
node_modules/@sinclair/smoke/channel/receiver.d.mts:3:5 - error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.
3 [Symbol.asyncIterator](): AsyncGenerator<T, void, unknown>;
~~~~~~~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/channel/receiver.d.mts:3:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
3 [Symbol.asyncIterator](): AsyncGenerator<T, void, unknown>;
~~~~~~
node_modules/@sinclair/smoke/channel/receiver.d.mts:3:31 - error TS2583: Cannot find name 'AsyncGenerator'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later.
3 [Symbol.asyncIterator](): AsyncGenerator<T, void, unknown>;
~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/channel/transform.d.mts:22:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
22 #private;
~~~~~~~~
node_modules/@sinclair/smoke/channel/transform.d.mts:26:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
26 [Symbol.asyncIterator](): AsyncGenerator<Awaited<Awaited<U> & undefined> | Awaited<Awaited<U> & {}>, void, unknown>;
~~~~~~~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/channel/transform.d.mts:26:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
26 [Symbol.asyncIterator](): AsyncGenerator<Awaited<Awaited<U> & undefined> | Awaited<Awaited<U> & {}>, void, unknown>;
~~~~~~
node_modules/@sinclair/smoke/channel/transform.d.mts:26:31 - error TS2583: Cannot find name 'AsyncGenerator'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later.
26 [Symbol.asyncIterator](): AsyncGenerator<Awaited<Awaited<U> & undefined> | Awaited<Awaited<U> & {}>, void, unknown>;
~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/crypto/crypto.d.mts:1:150 - error TS2583: Cannot find name 'BigInt64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2020' or later.
1 export declare function getRandomValues<T extends Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | BigInt64Array | BigUint64Array>(array: T): T;
~~~~~~~~~~~~~
node_modules/@sinclair/smoke/crypto/crypto.d.mts:1:166 - error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2020' or later.
1 export declare function getRandomValues<T extends Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | BigInt64Array | BigUint64Array>(array: T): T;
~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/dispose/dispose.d.mts:2:5 - error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.
2 [Symbol.dispose](): void;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/dispose/dispose.d.mts:2:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
2 [Symbol.dispose](): void;
~~~~~~
node_modules/@sinclair/smoke/events/event.d.mts:4:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
4 #private;
~~~~~~~~
node_modules/@sinclair/smoke/events/events.d.mts:4:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
4 #private;
~~~~~~~~
node_modules/@sinclair/smoke/events/listener.d.mts:2:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
2 #private;
~~~~~~~~
node_modules/@sinclair/smoke/events/listener.d.mts:4:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
4 [Symbol.dispose](): void;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/events/listener.d.mts:4:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
4 [Symbol.dispose](): void;
~~~~~~
node_modules/@sinclair/smoke/filesystem/events.d.mts:17:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
17 #private;
~~~~~~~~
node_modules/@sinclair/smoke/filesystem/events.d.mts:19:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
19 [Symbol.dispose](): void;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/filesystem/events.d.mts:19:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
19 [Symbol.dispose](): void;
~~~~~~
node_modules/@sinclair/smoke/filesystem/filesystem.d.mts:7:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
7 #private;
~~~~~~~~
node_modules/@sinclair/smoke/filesystem/filesystem.d.mts:11:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
11 [Symbol.dispose](): void;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/filesystem/filesystem.d.mts:11:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
11 [Symbol.dispose](): void;
~~~~~~
node_modules/@sinclair/smoke/http/http.d.mts:5:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
5 #private;
~~~~~~~~
node_modules/@sinclair/smoke/http/listener.d.mts:4:34 - error TS2583: Cannot find name 'WeakMap'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.
4 export declare const UpgradeMap: WeakMap<Request, Function>;
~~~~~~~
node_modules/@sinclair/smoke/http/listener.d.mts:25:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
25 #private;
~~~~~~~~
node_modules/@sinclair/smoke/http/listener.d.mts:27:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
27 [Symbol.dispose](): void;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/http/listener.d.mts:27:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
27 [Symbol.dispose](): void;
~~~~~~
node_modules/@sinclair/smoke/http/websocket/client.d.mts:9:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
9 #private;
~~~~~~~~
node_modules/@sinclair/smoke/http/websocket/server.d.mts:4:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
4 #private;
~~~~~~~~
node_modules/@sinclair/smoke/hubs/private.d.mts:4:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
4 #private;
~~~~~~~~
node_modules/@sinclair/smoke/hubs/public.d.mts:3:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
3 #private;
~~~~~~~~
node_modules/@sinclair/smoke/indexeddb/cursor.d.mts:14:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
14 [Symbol.asyncIterator](): AsyncGenerator<Record<T>, void, unknown>;
~~~~~~~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/indexeddb/cursor.d.mts:14:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
14 [Symbol.asyncIterator](): AsyncGenerator<Record<T>, void, unknown>;
~~~~~~
node_modules/@sinclair/smoke/indexeddb/cursor.d.mts:14:31 - error TS2583: Cannot find name 'AsyncGenerator'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later.
14 [Symbol.asyncIterator](): AsyncGenerator<Record<T>, void, unknown>;
~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/indexeddb/cursor.d.mts:31:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
31 [Symbol.asyncIterator](): AsyncGenerator<RecordWithValue<T>, void, unknown>;
~~~~~~~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/indexeddb/cursor.d.mts:31:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
31 [Symbol.asyncIterator](): AsyncGenerator<RecordWithValue<T>, void, unknown>;
~~~~~~
node_modules/@sinclair/smoke/indexeddb/cursor.d.mts:31:31 - error TS2583: Cannot find name 'AsyncGenerator'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later.
31 [Symbol.asyncIterator](): AsyncGenerator<RecordWithValue<T>, void, unknown>;
~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/media/listener.d.mts:10:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
10 #private;
~~~~~~~~
node_modules/@sinclair/smoke/media/listener.d.mts:12:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
12 [Symbol.dispose](): void;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/media/listener.d.mts:12:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
12 [Symbol.dispose](): void;
~~~~~~
node_modules/@sinclair/smoke/media/media.d.mts:11:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
11 #private;
~~~~~~~~
node_modules/@sinclair/smoke/media/receiver.d.mts:9:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
9 #private;
~~~~~~~~
node_modules/@sinclair/smoke/media/sender.d.mts:10:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
10 #private;
~~~~~~~~
node_modules/@sinclair/smoke/media/types/audio.d.mts:6:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
6 #private;
~~~~~~~~
node_modules/@sinclair/smoke/media/types/audio.d.mts:9:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
9 [Symbol.dispose](): void;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/media/types/audio.d.mts:9:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
9 [Symbol.dispose](): void;
~~~~~~
node_modules/@sinclair/smoke/media/types/pattern.d.mts:7:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
7 #private;
~~~~~~~~
node_modules/@sinclair/smoke/media/types/pattern.d.mts:21:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
21 [Symbol.dispose](): void;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/media/types/pattern.d.mts:21:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
21 [Symbol.dispose](): void;
~~~~~~
node_modules/@sinclair/smoke/media/types/video.d.mts:6:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
6 #private;
~~~~~~~~
node_modules/@sinclair/smoke/media/types/video.d.mts:9:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
9 [Symbol.dispose](): void;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/media/types/video.d.mts:9:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
9 [Symbol.dispose](): void;
~~~~~~
node_modules/@sinclair/smoke/net/listener.d.mts:9:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
9 #private;
~~~~~~~~
node_modules/@sinclair/smoke/net/listener.d.mts:11:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
11 [Symbol.dispose](): void;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/net/listener.d.mts:11:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
11 [Symbol.dispose](): void;
~~~~~~
node_modules/@sinclair/smoke/net/net.d.mts:9:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
9 #private;
~~~~~~~~
node_modules/@sinclair/smoke/net/socket.d.mts:5:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
5 #private;
~~~~~~~~
node_modules/@sinclair/smoke/net/socket.d.mts:9:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
9 [Symbol.asyncIterator](): AsyncIterableIterator<Uint8Array>;
~~~~~~~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/net/socket.d.mts:9:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
9 [Symbol.asyncIterator](): AsyncIterableIterator<Uint8Array>;
~~~~~~
node_modules/@sinclair/smoke/net/socket.d.mts:9:31 - error TS2583: Cannot find name 'AsyncIterableIterator'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later.
9 [Symbol.asyncIterator](): AsyncIterableIterator<Uint8Array>;
~~~~~~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/network.d.mts:12:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
12 #private;
~~~~~~~~
node_modules/@sinclair/smoke/network.d.mts:14:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
14 [Symbol.dispose](): void;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/network.d.mts:14:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
14 [Symbol.dispose](): void;
~~~~~~
node_modules/@sinclair/smoke/stream/frames/duplex.d.mts:4:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
4 #private;
~~~~~~~~
node_modules/@sinclair/smoke/stream/frames/duplex.d.mts:6:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
6 [Symbol.asyncIterator](): AsyncIterableIterator<Uint8Array>;
~~~~~~~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/stream/frames/duplex.d.mts:6:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
6 [Symbol.asyncIterator](): AsyncIterableIterator<Uint8Array>;
~~~~~~
node_modules/@sinclair/smoke/stream/frames/duplex.d.mts:6:31 - error TS2583: Cannot find name 'AsyncIterableIterator'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later.
6 [Symbol.asyncIterator](): AsyncIterableIterator<Uint8Array>;
~~~~~~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/stream/frames/reader.d.mts:6:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
6 #private;
~~~~~~~~
node_modules/@sinclair/smoke/stream/frames/reader.d.mts:8:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
8 [Symbol.asyncIterator](): AsyncIterableIterator<Uint8Array>;
~~~~~~~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/stream/frames/reader.d.mts:8:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
8 [Symbol.asyncIterator](): AsyncIterableIterator<Uint8Array>;
~~~~~~
node_modules/@sinclair/smoke/stream/frames/reader.d.mts:8:31 - error TS2583: Cannot find name 'AsyncIterableIterator'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later.
8 [Symbol.asyncIterator](): AsyncIterableIterator<Uint8Array>;
~~~~~~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/stream/frames/writer.d.mts:3:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
3 #private;
~~~~~~~~
node_modules/@sinclair/smoke/stream/iterator/iterator.d.mts:3:60 - error TS2583: Cannot find name 'AsyncIterableIterator'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later.
3 export declare function toAsyncIterator<T>(read: Read<T>): AsyncIterableIterator<T>;
~~~~~~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/stream/iterator/iterator.d.mts:5:59 - error TS2304: Cannot find name 'IterableIterator'.
5 export declare function toIterator<T>(read: ReadSync<T>): IterableIterator<T>;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/stream/read.d.mts:4:5 - error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.
4 [Symbol.asyncIterator](): AsyncIterableIterator<T>;
~~~~~~~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/stream/read.d.mts:4:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
4 [Symbol.asyncIterator](): AsyncIterableIterator<T>;
~~~~~~
node_modules/@sinclair/smoke/stream/read.d.mts:4:31 - error TS2583: Cannot find name 'AsyncIterableIterator'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later.
4 [Symbol.asyncIterator](): AsyncIterableIterator<T>;
~~~~~~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/stream/read.d.mts:9:5 - error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.
9 [Symbol.iterator](): IterableIterator<T>;
~~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/stream/read.d.mts:9:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
9 [Symbol.iterator](): IterableIterator<T>;
~~~~~~
node_modules/@sinclair/smoke/stream/read.d.mts:9:26 - error TS2304: Cannot find name 'IterableIterator'.
9 [Symbol.iterator](): IterableIterator<T>;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/webrtc/datachannel/listener.d.mts:6:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
6 #private;
~~~~~~~~
node_modules/@sinclair/smoke/webrtc/datachannel/listener.d.mts:9:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
9 [Symbol.dispose](): void;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/webrtc/datachannel/listener.d.mts:9:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
9 [Symbol.dispose](): void;
~~~~~~
node_modules/@sinclair/smoke/webrtc/track/listener.d.mts:6:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
6 #private;
~~~~~~~~
node_modules/@sinclair/smoke/webrtc/track/listener.d.mts:9:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
9 [Symbol.dispose](): void;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/webrtc/track/listener.d.mts:9:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
9 [Symbol.dispose](): void;
~~~~~~
node_modules/@sinclair/smoke/webrtc/webrtc.d.mts:16:19 - error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.
16 datachannels: Set<RTCDataChannel>;
~~~
node_modules/@sinclair/smoke/webrtc/webrtc.d.mts:26:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
26 #private;
~~~~~~~~
node_modules/@sinclair/smoke/webrtc/webrtc.d.mts:38:5 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.
38 [Symbol.dispose](): void;
~~~~~~~~~~~~~~~~
node_modules/@sinclair/smoke/webrtc/webrtc.d.mts:38:6 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
38 [Symbol.dispose](): void;
~~~~~~
Found 103 errors in 44 files.
Errors Files
3 index.mts:7
1 node_modules/@sinclair/smoke/async/barrier.d.mts:5
1 node_modules/@sinclair/smoke/async/debounce.d.mts:10
1 node_modules/@sinclair/smoke/async/deferred.d.mts:4
3 node_modules/@sinclair/smoke/async/lock.d.mts:2
1 node_modules/@sinclair/smoke/async/mutex.d.mts:3
1 node_modules/@sinclair/smoke/async/semaphore.d.mts:6
1 node_modules/@sinclair/smoke/buffer/buffer.d.mts:14
1 node_modules/@sinclair/smoke/buffer/reader.d.mts:2
3 node_modules/@sinclair/smoke/channel/receiver.d.mts:3
4 node_modules/@sinclair/smoke/channel/transform.d.mts:22
2 node_modules/@sinclair/smoke/crypto/crypto.d.mts:1
2 node_modules/@sinclair/smoke/dispose/dispose.d.mts:2
1 node_modules/@sinclair/smoke/events/event.d.mts:4
1 node_modules/@sinclair/smoke/events/events.d.mts:4
3 node_modules/@sinclair/smoke/events/listener.d.mts:2
3 node_modules/@sinclair/smoke/filesystem/events.d.mts:17
3 node_modules/@sinclair/smoke/filesystem/filesystem.d.mts:7
1 node_modules/@sinclair/smoke/http/http.d.mts:5
4 node_modules/@sinclair/smoke/http/listener.d.mts:4
1 node_modules/@sinclair/smoke/http/websocket/client.d.mts:9
1 node_modules/@sinclair/smoke/http/websocket/server.d.mts:4
1 node_modules/@sinclair/smoke/hubs/private.d.mts:4
1 node_modules/@sinclair/smoke/hubs/public.d.mts:3
6 node_modules/@sinclair/smoke/indexeddb/cursor.d.mts:14
3 node_modules/@sinclair/smoke/media/listener.d.mts:10
1 node_modules/@sinclair/smoke/media/media.d.mts:11
1 node_modules/@sinclair/smoke/media/receiver.d.mts:9
1 node_modules/@sinclair/smoke/media/sender.d.mts:10
3 node_modules/@sinclair/smoke/media/types/audio.d.mts:6
3 node_modules/@sinclair/smoke/media/types/pattern.d.mts:7
3 node_modules/@sinclair/smoke/media/types/video.d.mts:6
3 node_modules/@sinclair/smoke/net/listener.d.mts:9
1 node_modules/@sinclair/smoke/net/net.d.mts:9
4 node_modules/@sinclair/smoke/net/socket.d.mts:5
3 node_modules/@sinclair/smoke/network.d.mts:12
4 node_modules/@sinclair/smoke/stream/frames/duplex.d.mts:4
4 node_modules/@sinclair/smoke/stream/frames/reader.d.mts:6
1 node_modules/@sinclair/smoke/stream/frames/writer.d.mts:3
2 node_modules/@sinclair/smoke/stream/iterator/iterator.d.mts:3
6 node_modules/@sinclair/smoke/stream/read.d.mts:4
3 node_modules/@sinclair/smoke/webrtc/datachannel/listener.d.mts:6
3 node_modules/@sinclair/smoke/webrtc/track/listener.d.mts:6
4 node_modules/@sinclair/smoke/webrtc/webrtc.d.mts:16
```
</details>
I tried this tsconfig:
```json
{
"compilerOptions": {
"strict": true,
"module": "ESNext",
"target": "ESNext",
"baseUrl": ".",
"paths": {
"@sinclair/smoke": ["./src/index.mts"]
}
}
}
```
and this
```json
{
"compilerOptions": {
"lib": ["es2015"],
"module": "es2022",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}
```
I don't have any experience with ts and my use case for this is for NAT traversal. Basically I want to run a server on localhost using regular http and expose it via another server running smoke that forwards all requests to the localhost server and sends the results back to the clients. This way I can run a regular server behind nat.
I would greatly appreciate if you could add some more info on how to set up the example for those of us that do not use typescript but still want to use this great project. And maybe also some info on how to set this up with a STUN server or signaling server (not sure which one is needed or both, or if they are the same thing). Thanks.
关闭于 2024-08-04 6 条评论