UNPKG

copy-llms-txt

Version:

A lightweight JavaScript library that lets you copy the content of a webpage as clean markdown with a simple keyboard shortcut.

44 lines (43 loc) 1.09 kB
import { CopyLlmsTxtOptions } from './types'; /** * A library to copy the content of the current page as markdown */ declare class CopyLlmsTxt { private options; private turndownService; private initialized; constructor(); /** * Determine if the current platform is macOS */ private isMac; /** * Initialize the CopyLlmsTxt library * @param options Configuration options (optional) */ init(options?: CopyLlmsTxtOptions): void; /** * Destroy the CopyLlmsTxt instance and remove event listeners */ destroy(): void; /** * Handle keydown events */ private handleKeyDown; /** * Copy the current page content as markdown */ private copyPageContent; private removeNonVisibleElements; private removeElementsBySelector; /** * Clean up the DOM element by removing unwanted elements */ private cleanupDOM; /** * Manually copy the current page content as markdown */ copy(): void; } declare const _default: CopyLlmsTxt; export default _default;