// Chrome扩展API类型声明 declare const chrome: { tabs: { query: (options: { active?: boolean; currentWindow?: boolean }) => Promise>; sendMessage: (tabId: number, message: any) => Promise; }; runtime: { onMessage: { addListener: (callback: (message: any, sender: any, sendResponse: (response?: any) => void) => boolean | void) => void; }; openOptionsPage: () => Promise; }; downloads: { download: (options: { url: string; filename?: string; saveAs?: boolean }) => Promise; onChanged: { addListener: (callback: (downloadDelta: any) => void) => void; }; }; storage: { sync: { get: (keys?: string | string[] | object) => Promise; set: (items: object) => Promise; }; local: { get: (keys?: string | string[] | object) => Promise; set: (items: object) => Promise; }; }; }; // 声明 TurndownService declare class TurndownService { constructor(options?: { headingStyle?: 'atx' | 'setext'; codeBlockStyle?: 'fenced' | 'indented'; bulletListMarker?: '-' | '*' | '+'; emDelimiter?: '*' | '_'; strongDelimiter?: '**' | '__'; linkStyle?: 'inlined' | 'referenced'; preformattedCode?: boolean; }); turndown(html: string): string; addRule(key: string, rule: { filter: string | string[] | ((node: any) => boolean); replacement: (content: string, node: any) => string; }): void; } // 声明 Readability declare class Readability { constructor(doc: Document); parse(): { title: string; content: string; textContent: string; length: number; excerpt: string; byline: string; dir: string; } | null; }