From 07df2ef0979fd0638ca679bdaaa0ab95fd705fdc Mon Sep 17 00:00:00 2001 From: saberzero1 Date: Mon, 16 Mar 2026 18:54:46 +0100 Subject: [PATCH] fix: centralize type declarations and add missing dependency - Update types/globals.d.ts with centralized type declarations - Add @myriaddreamin/rehype-typst as devDependency - Add .prettierignore, update .eslintrc.json with triple-slash-reference override --- .eslintrc.json | 10 +- .prettierignore | 1 + package-lock.json | 228 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 3 +- types/globals.d.ts | 36 +++++++ 5 files changed, 276 insertions(+), 2 deletions(-) create mode 100644 .prettierignore create mode 100644 types/globals.d.ts diff --git a/.eslintrc.json b/.eslintrc.json index a9ba90d..dda1fa0 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -22,5 +22,13 @@ "caughtErrorsIgnorePattern": "^_" } ] - } + }, + "overrides": [ + { + "files": ["types/**/*.d.ts"], + "rules": { + "@typescript-eslint/triple-slash-reference": "off" + } + } + ] } diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..1521c8b --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +dist diff --git a/package-lock.json b/package-lock.json index 50a8a0c..e26b60a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@quartz-community/types": "github:quartz-community/types" }, "devDependencies": { + "@myriaddreamin/rehype-typst": "^0.7.0-rc2", "@types/hast": "^3.0.4", "@types/katex": "^0.16.7", "@types/mdast": "^4.0.4", @@ -836,6 +837,233 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@myriaddreamin/rehype-typst": { + "version": "0.7.0-rc2", + "resolved": "https://registry.npmjs.org/@myriaddreamin/rehype-typst/-/rehype-typst-0.7.0-rc2.tgz", + "integrity": "sha512-LYRHKk6RfB9+ygDpQqYSdOjNR4063ed9ZhKHBJLb7dQ7wv81EJi5wp2sHfvGspe4Xyg/Fj26JXZ286xak2PtVA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@myriaddreamin/typst-ts-node-compiler": "^0.7.0-rc2", + "@types/hast": "^3.0.0", + "@types/katex": "^0.16.0", + "hast-util-from-html-isomorphic": "^2.0.0", + "hast-util-to-text": "^4.0.0", + "https-proxy-agent": "^7.0.2", + "unist-util-visit-parents": "^6.0.0", + "vfile": "^6.0.0" + } + }, + "node_modules/@myriaddreamin/typst-ts-node-compiler": { + "version": "0.7.0-rc2", + "resolved": "https://registry.npmjs.org/@myriaddreamin/typst-ts-node-compiler/-/typst-ts-node-compiler-0.7.0-rc2.tgz", + "integrity": "sha512-a4Vicil6Tu0S87C3+J2EMtFDdQEmT18zYAW6Srmt32lgjrTq3HLy+WN0lA/bgaBgw2wNEkXdogz3yRg49vXs8w==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@myriaddreamin/typst-ts-node-compiler-android-arm-eabi": "0.7.0-rc2", + "@myriaddreamin/typst-ts-node-compiler-android-arm64": "0.7.0-rc2", + "@myriaddreamin/typst-ts-node-compiler-darwin-arm64": "0.7.0-rc2", + "@myriaddreamin/typst-ts-node-compiler-darwin-x64": "0.7.0-rc2", + "@myriaddreamin/typst-ts-node-compiler-linux-arm-gnueabihf": "0.7.0-rc2", + "@myriaddreamin/typst-ts-node-compiler-linux-arm64-gnu": "0.7.0-rc2", + "@myriaddreamin/typst-ts-node-compiler-linux-arm64-musl": "0.7.0-rc2", + "@myriaddreamin/typst-ts-node-compiler-linux-x64-gnu": "0.7.0-rc2", + "@myriaddreamin/typst-ts-node-compiler-linux-x64-musl": "0.7.0-rc2", + "@myriaddreamin/typst-ts-node-compiler-win32-arm64-msvc": "0.7.0-rc2", + "@myriaddreamin/typst-ts-node-compiler-win32-x64-msvc": "0.7.0-rc2" + } + }, + "node_modules/@myriaddreamin/typst-ts-node-compiler-android-arm-eabi": { + "version": "0.7.0-rc2", + "resolved": "https://registry.npmjs.org/@myriaddreamin/typst-ts-node-compiler-android-arm-eabi/-/typst-ts-node-compiler-android-arm-eabi-0.7.0-rc2.tgz", + "integrity": "sha512-OnfUH3XbGel3+QUZc4G3+V1npXYGCDc3b7WhFw88ihCH/Xpw+NNjidLrFkY6kK2a5vVHnY2AEG0hJSwZzvOw0Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@myriaddreamin/typst-ts-node-compiler-android-arm64": { + "version": "0.7.0-rc2", + "resolved": "https://registry.npmjs.org/@myriaddreamin/typst-ts-node-compiler-android-arm64/-/typst-ts-node-compiler-android-arm64-0.7.0-rc2.tgz", + "integrity": "sha512-LR76t0jXcKp0F0vMViinS6+RBxyTFqBUFiUoZcGRPQD/DhLNBReTS7tJ14Jp5Mwuqe76RUshSeQSrKbJUoaQ3A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@myriaddreamin/typst-ts-node-compiler-darwin-arm64": { + "version": "0.7.0-rc2", + "resolved": "https://registry.npmjs.org/@myriaddreamin/typst-ts-node-compiler-darwin-arm64/-/typst-ts-node-compiler-darwin-arm64-0.7.0-rc2.tgz", + "integrity": "sha512-xJndoR6Kn6UUYQDui41R7tx/avpfyY6c8dV5udyHP5FkeUSVgRAoFcjOtlI9Lpc84alFusIPwp4QR6V+xjOAhA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@myriaddreamin/typst-ts-node-compiler-darwin-x64": { + "version": "0.7.0-rc2", + "resolved": "https://registry.npmjs.org/@myriaddreamin/typst-ts-node-compiler-darwin-x64/-/typst-ts-node-compiler-darwin-x64-0.7.0-rc2.tgz", + "integrity": "sha512-kmh37eshR40LVAM6P59uLWEYt5ffyUhKWcBOzsd/1QYNtsH28kLRUOShugAdxQN164Re+47z2nkSgd7HejASFg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@myriaddreamin/typst-ts-node-compiler-linux-arm-gnueabihf": { + "version": "0.7.0-rc2", + "resolved": "https://registry.npmjs.org/@myriaddreamin/typst-ts-node-compiler-linux-arm-gnueabihf/-/typst-ts-node-compiler-linux-arm-gnueabihf-0.7.0-rc2.tgz", + "integrity": "sha512-giroa96wdN0mxARN1NbRrKp9t+qqUNUSBzWBQp1RMPqGNPwtahEqJnpf5zmRSrEJYhEzVZbs9+CwxFjj5lw7VQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@myriaddreamin/typst-ts-node-compiler-linux-arm64-gnu": { + "version": "0.7.0-rc2", + "resolved": "https://registry.npmjs.org/@myriaddreamin/typst-ts-node-compiler-linux-arm64-gnu/-/typst-ts-node-compiler-linux-arm64-gnu-0.7.0-rc2.tgz", + "integrity": "sha512-pDdc6hQrGdqr0BT+nNe0tJmdcmyp9yhn3WDeGlTi4YpYG2IybP7fBVIwDI3Mzr/IdCMtPbQxew4AfmAoJwIz6A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@myriaddreamin/typst-ts-node-compiler-linux-arm64-musl": { + "version": "0.7.0-rc2", + "resolved": "https://registry.npmjs.org/@myriaddreamin/typst-ts-node-compiler-linux-arm64-musl/-/typst-ts-node-compiler-linux-arm64-musl-0.7.0-rc2.tgz", + "integrity": "sha512-wNEYhpjuwnhd7VrArL4EHd652z8YEGxG6C8haUjkVhGseFBetrL51yD1Ymg5fWEa+3+O4oZ1+IUN0Fu4/fKgHw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@myriaddreamin/typst-ts-node-compiler-linux-x64-gnu": { + "version": "0.7.0-rc2", + "resolved": "https://registry.npmjs.org/@myriaddreamin/typst-ts-node-compiler-linux-x64-gnu/-/typst-ts-node-compiler-linux-x64-gnu-0.7.0-rc2.tgz", + "integrity": "sha512-Z4i78r5MtFDYGHqgYrWfAcvqb3xW49WlLI35l1G818lYmkmGZAjAkVKb946ChOx+bBQIuMWefykCABLOlBkgKA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@myriaddreamin/typst-ts-node-compiler-linux-x64-musl": { + "version": "0.7.0-rc2", + "resolved": "https://registry.npmjs.org/@myriaddreamin/typst-ts-node-compiler-linux-x64-musl/-/typst-ts-node-compiler-linux-x64-musl-0.7.0-rc2.tgz", + "integrity": "sha512-PXteqxa3RITEh5v3lQ4c5VGn16KHvUKVXjSZ2BudCe6C0gEuOO16JS9JU8DZVwd0dbtH0Mky6Q5V7tf6erpXGA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@myriaddreamin/typst-ts-node-compiler-win32-arm64-msvc": { + "version": "0.7.0-rc2", + "resolved": "https://registry.npmjs.org/@myriaddreamin/typst-ts-node-compiler-win32-arm64-msvc/-/typst-ts-node-compiler-win32-arm64-msvc-0.7.0-rc2.tgz", + "integrity": "sha512-wN1tjdRxabJzT8WuDVdOs2QKQuMzKht3QWPU/H7OjuDta1WcrYs/3IKnF67HNiphe/33MU8bKeih2GBVU+AuLg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@myriaddreamin/typst-ts-node-compiler-win32-x64-msvc": { + "version": "0.7.0-rc2", + "resolved": "https://registry.npmjs.org/@myriaddreamin/typst-ts-node-compiler-win32-x64-msvc/-/typst-ts-node-compiler-win32-x64-msvc-0.7.0-rc2.tgz", + "integrity": "sha512-6DUe2iepqptLkJsOdUC4yHWM3/USCW82YieA+lPAeky37XSJ5KuLuLL6zOQiQt3IWot7jB+m9oKIvBqJh7yriA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", diff --git a/package.json b/package.json index f77d11f..c90f1e6 100644 --- a/package.json +++ b/package.json @@ -46,8 +46,8 @@ }, "peerDependencies": { "@jackyzha0/quartz": "^4.5.2", - "preact": "^10.0.0", "@myriaddreamin/rehype-typst": "^0.5.0", + "preact": "^10.0.0", "rehype-katex": "^7.0.1", "rehype-mathjax": "^6.0.0", "remark-math": "^6.0.0" @@ -76,6 +76,7 @@ "@quartz-community/types": "github:quartz-community/types" }, "devDependencies": { + "@myriaddreamin/rehype-typst": "^0.7.0-rc2", "@types/hast": "^3.0.4", "@types/katex": "^0.16.7", "@types/mdast": "^4.0.4", diff --git a/types/globals.d.ts b/types/globals.d.ts new file mode 100644 index 0000000..a9e71ae --- /dev/null +++ b/types/globals.d.ts @@ -0,0 +1,36 @@ +declare module "*.scss" { + const content: string; + export default content; +} + +declare module "*.inline.ts" { + const content: string; + export default content; +} + +interface CustomEventMap { + nav: CustomEvent<{ url: string }>; + prenav: CustomEvent; + themechange: CustomEvent<{ theme: "light" | "dark" }>; + readermodechange: CustomEvent<{ mode: "on" | "off" }>; + render: CustomEvent; +} + +interface Document { + addEventListener( + type: K, + listener: (this: Document, ev: CustomEventMap[K]) => void, + ): void; + removeEventListener( + type: K, + listener: (this: Document, ev: CustomEventMap[K]) => void, + ): void; + dispatchEvent(ev: CustomEventMap[K] | UIEvent): void; +} + +interface Window { + addCleanup(fn: (...args: unknown[]) => void): void; + spaNavigate?(url: URL, isBack: boolean): Promise; +} + +declare const fetchData: Promise>;