Commits at 973cf4b3e22728fd0864be5e3509d5567865938c
973cf4b3pwa: ライブラリの型エラーを tsc 実行時に無視する
どうやら TypeScript の型定義と bun の型定義がバトってるみたい。
こんな感じで正直触る気がしないので無視することにした。
```
bunx tsc
../../node_modules/@types/node/buffer.d.ts:632:19 - error TS2430: Interface 'Buffer' incorrectly extends interface 'Uint8Array<ArrayBufferLike>'.
The types of 'slice(...).buffer' are incompatible between these types.
Type 'ArrayBufferLike' is not assignable to type 'ArrayBuffer'.
Type 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength
632 interface Buffer extends Uint8Array {
~~~~~~
../../node_modules/@types/node/fs/promises.d.ts:56:66 - error TS2344: Type 'Buffer' does not satisfy the constraint 'ArrayBufferView'.
Type 'Buffer' is not assignable to type 'Uint8Array<ArrayBufferLike> | DataView<ArrayBufferLike>'.
Type 'Buffer' is not assignable to type 'Uint8Array<ArrayBufferLike>'.
The types of 'slice(...).buffer' are incompatible between these types.
Type 'ArrayBufferLike' is not assignable to type 'ArrayBuffer'.
Type 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength
56 interface FileReadOptions<T extends NodeJS.ArrayBufferView = Buffer> {
~~~~~~
../../node_modules/@types/node/fs/promises.d.ts:238:49 - error TS2344: Type 'Buffer' does not satisfy the constraint 'ArrayBufferView'.
Type 'Buffer' is not assignable to type 'Uint8Array<ArrayBufferLike> | DataView<ArrayBufferLike>'.
Type 'Buffer' is not assignable to type 'Uint8Array<ArrayBufferLike>'.
The types of 'slice(...).buffer' are incompatible between these types.
Type 'ArrayBufferLike' is not assignable to type 'ArrayBuffer'.
Type 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength
238 read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
~~~~~~
../../node_modules/@types/node/globals.d.ts:370:14 - error TS2300: Duplicate identifier 'fetch'.
370 function fetch(
~~~~~
../../node_modules/bun-types/globals.d.ts:1037:6
1037 var fetch: Fetch;
~~~~~
'fetch' was also declared here.
../../node_modules/@types/node/module.d.ts:283:13 - error TS2687: All declarations of 'dirname' must have identical modifiers.
283 dirname: string;
~~~~~~~
../../node_modules/@types/node/module.d.ts:289:13 - error TS2687: All declarations of 'filename' must have identical modifiers.
289 filename: string;
~~~~~~~~
../../node_modules/bun-types/bun.d.ts:117:8 - error TS2420: Class 'ShellError' incorrectly implements interface 'ShellOutput'.
Property 'bytes' is missing in type 'ShellError' but required in type 'ShellOutput'.
117 class ShellError extends Error implements ShellOutput {
~~~~~~~~~~
../../node_modules/bun-types/bun.d.ts:434:3
434 bytes(): Uint8Array;
~~~~~~~~~~~~~~~~~~~~
'bytes' is declared here.
../../node_modules/bun-types/globals.d.ts:1037:6 - error TS2300: Duplicate identifier 'fetch'.
1037 var fetch: Fetch;
~~~~~
../../node_modules/typescript/lib/lib.dom.d.ts:28708:18
28708 declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
~~~~~
'fetch' was also declared here.
../../node_modules/@types/node/globals.d.ts:370:14
370 function fetch(
~~~~~
and here.
../../node_modules/bun-types/globals.d.ts:1947:12 - error TS2687: All declarations of 'dirname' must have identical modifiers.
1947 readonly dirname: string;
~~~~~~~
../../node_modules/bun-types/globals.d.ts:1950:12 - error TS2687: All declarations of 'filename' must have identical modifiers.
1950 readonly filename: string;
~~~~~~~~
../../node_modules/bun-types/overrides.d.ts:3:29 - error TS2305: Module '"bun"' has no exported member 'PathLike'.
3 import type { BunFile, Env, PathLike } from "bun";
~~~~~~~~
../../node_modules/typescript/lib/lib.dom.d.ts:16004:11 - error TS2430: Interface 'MessageEvent<T>' incorrectly extends interface 'Bun.MessageEvent<T>'.
Types of property 'ports' are incompatible.
Type 'readonly MessagePort[]' is not assignable to type 'readonly import("worker_threads").MessagePort[]'.
Type 'MessagePort' is missing the following properties from type 'MessagePort': ref, unref, addListener, emit, and 13 more.
16004 interface MessageEvent<T = any> extends Event {
~~~~~~~~~~~~
../../node_modules/typescript/lib/lib.dom.d.ts:26068:11 - error TS2430: Interface 'WebSocket' incorrectly extends interface 'import("<repo path>/node_modules/@types/ws/index").WebSocket'.
Types of property 'binaryType' are incompatible.
Type 'BinaryType' is not assignable to type '"arraybuffer" | "nodebuffer" | "fragments"'.
Type '"blob"' is not assignable to type '"arraybuffer" | "nodebuffer" | "fragments"'.
26068 interface WebSocket extends EventTarget {
~~~~~~~~~
../../node_modules/typescript/lib/lib.dom.d.ts:28708:18 - error TS2300: Duplicate identifier 'fetch'.
28708 declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
~~~~~
../../node_modules/bun-types/globals.d.ts:1037:6
1037 var fetch: Fetch;
~~~~~
'fetch' was also declared here.
Found 14 errors in 8 files.
Errors Files
1 ../../node_modules/@types/node/buffer.d.ts:632
2 ../../node_modules/@types/node/fs/promises.d.ts:56
1 ../../node_modules/@types/node/globals.d.ts:370
2 ../../node_modules/@types/node/module.d.ts:283
1 ../../node_modules/bun-types/bun.d.ts:117
3 ../../node_modules/bun-types/globals.d.ts:1037
1 ../../node_modules/bun-types/overrides.d.ts:3
3 ../../node_modules/typescript/lib/lib.dom.d.ts:16004
```
Shota FUJI
authored at
Shota FUJI
comitted at
859b35d1pwa: IndexedDB を使ったワークスペースの作成・一覧処理
実際に書く雛形として IndexedDB へのアクセスとテストを書いた。
Shota FUJI
authored at
Shota FUJI
comitted at
31135effPWA での Protobuf 通信基礎
Service で定義されたリクエストとレスポンスを Web Worker 越しにやりとり
する最低限のコード。今後どんなスタイル・ライブラリで書くにせよまず確実
に必要となるであろう部分を書いた。
Shota FUJI
authored at
Shota FUJI
comitted at