chore: centralize type declarations and standardize tooling config

- Update types/globals.d.ts with centralized type declarations
- Add .prettierignore, update .eslintrc.json with triple-slash-reference override
- Remove duplicate scripts.d.ts/styles.d.ts if present
This commit is contained in:
saberzero1 2026-03-16 18:55:26 +01:00
parent 22727ad092
commit eabc0ed37a
No known key found for this signature in database
6 changed files with 44 additions and 10 deletions

View file

@ -22,5 +22,13 @@
"caughtErrorsIgnorePattern": "^_"
}
]
}
},
"overrides": [
{
"files": ["types/**/*.d.ts"],
"rules": {
"@typescript-eslint/triple-slash-reference": "off"
}
}
]
}

1
.prettierignore Normal file
View file

@ -0,0 +1 @@
dist

View file

@ -53,9 +53,9 @@
},
"peerDependencies": {
"@jackyzha0/quartz": "^4.5.2",
"preact": "^10.0.0",
"gray-matter": "^4.0.3",
"js-yaml": "^4.1.0",
"preact": "^10.0.0",
"remark-frontmatter": "^5.0.0",
"toml": "^3.0.0",
"unified": "^11.0.5",

View file

@ -1,4 +0,0 @@
declare module "*.inline.ts" {
const content: string;
export default content;
}

View file

@ -1,4 +0,0 @@
declare module "*.scss" {
const content: string;
export default content;
}

33
types/globals.d.ts vendored
View file

@ -1,3 +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<undefined>;
themechange: CustomEvent<{ theme: "light" | "dark" }>;
readermodechange: CustomEvent<{ mode: "on" | "off" }>;
render: CustomEvent<object>;
}
interface Document {
addEventListener<K extends keyof CustomEventMap>(
type: K,
listener: (this: Document, ev: CustomEventMap[K]) => void,
): void;
removeEventListener<K extends keyof CustomEventMap>(
type: K,
listener: (this: Document, ev: CustomEventMap[K]) => void,
): void;
dispatchEvent<K extends keyof CustomEventMap>(ev: CustomEventMap[K] | UIEvent): void;
}
interface Window {
addCleanup(fn: (...args: unknown[]) => void): void;
spaNavigate?(url: URL, isBack: boolean): Promise<void>;
}
declare const fetchData: Promise<Record<string, unknown>>;