瀏覽代碼

Chore: improve types

SukkaW 1 年之前
父節點
當前提交
df6bbb68a0
共有 4 個文件被更改,包括 7 次插入4 次删除
  1. 4 1
      Build/download-previous-build.ts
  2. 2 1
      Build/lib/cache-filesystem.ts
  3. 0 1
      Source/domainset/cdn.conf
  4. 1 1
      tsconfig.json

+ 4 - 1
Build/download-previous-build.ts

@@ -65,7 +65,10 @@ export const downloadPreviousBuild = task(import.meta.path, async (span) => {
       const extract = tarStream.extract();
 
       pipeline(
-        Readable.fromWeb(resp.body as any),
+        Readable.fromWeb(
+          // @ts-expect-error -- DOM type is incompatible with Node type
+          resp.body
+        ),
         gunzip,
         extract
       );

+ 2 - 1
Build/lib/cache-filesystem.ts

@@ -85,7 +85,8 @@ export class Cache<S = string> {
     if (type) {
       this.type = type;
     } else {
-      this.type = 'string' as any;
+      // @ts-expect-error -- fallback type
+      this.type = 'string';
     }
 
     const db = new Database(path.join(this.cachePath, 'cache.db'));

+ 0 - 1
Source/domainset/cdn.conf

@@ -2303,7 +2303,6 @@ tiles.stadiamaps.com
 e3.365dm.com
 proxy.beyondwords.io
 .images.arcpublishing.com
-cdn.ziffstatic.com
 static.euronews.com
 static.killedbygoogle.com
 cdn.pagic.org

+ 1 - 1
tsconfig.json

@@ -1,10 +1,10 @@
 {
   "compilerOptions": {
     "target": "esnext",
+    "lib": ["DOM", "DOM.Iterable"],
     "moduleDetection": "force",
     "module": "esnext",
     "moduleResolution": "bundler",
-    "types": ["bun-types"],
     "allowImportingTsExtensions": true,
     "allowJs": true,
     "noEmit": true,