/** * Wayback Machine URL conversion command. * * Rewrites HTTP(S) markdown links to point at the Wayback Machine. This is a pure text * transformation: no network calls are made, and the original URL (scheme, query string, and * fragment included) is preserved verbatim after the archive prefix. * * @category Commands */ /** * Configuration options for Wayback Machine conversion operations. * * @category Commands */ export interface WaybackOptions { /** Perform a dry run without making actual changes */ dryRun?: boolean; /** Enable verbose output with detailed progress information */ verbose?: boolean; /** Output results in JSON format */ json?: boolean; /** Process directories recursively */ recursive?: boolean; } /** A single converted link destination, with its location in the source file. */ export interface WaybackLinkChange { /** Absolute path of the file containing the link */ file: string; /** Line number of the link destination (1-based) */ line: number; /** The destination text before conversion, exactly as it appeared in the file */ from: string; /** The destination text after conversion */ to: string; } /** Per-file outcome of a Wayback conversion pass. */ export interface WaybackFileResult { /** Absolute path of the processed file */ file: string; /** Number of link destinations rewritten to Wayback Machine URLs */ converted: number; /** Number of HTTP(S) destinations already pointing at the Wayback Machine */ alreadyArchived: number; /** Number of links left untouched (internal, anchor, mailto, ftp, and other non-web links) */ untouched: number; /** Whether the file content changed and was written to disk */ modified: boolean; /** Details of each conversion performed in this file */ changes: WaybackLinkChange[]; } /** Aggregate outcome of a Wayback conversion run across all requested files. */ export interface WaybackResult { /** Whether every file was processed without error */ success: boolean; /** Whether this was a dry run (no files written) */ dryRun: boolean; /** Number of files examined */ filesProcessed: number; /** Number of files whose content changed on disk */ filesModified: number; /** Total destinations rewritten to Wayback Machine URLs */ totalConverted: number; /** Total destinations already pointing at the Wayback Machine */ totalAlreadyArchived: number; /** Total links left untouched */ totalUntouched: number; /** Per-file outcomes */ files: WaybackFileResult[]; /** Error messages for files that could not be processed */ errors: string[]; } /** * Convert an HTTP(S) URL to its Wayback Machine any-snapshot form. * * The result is the Wayback Machine origin followed by the any-snapshot wildcard path segment and * then the original URL appended verbatim, so query strings and anchor fragments stay part of the * original URL. A pure text transformation: no network access. * * @category Commands * * @example * ```typescript toWaybackUrl('https://example.com/page?a=1#top'); // https://web.archive.org/web/[wildcard]/https://example.com/page?a=1#top```; * * @param url - The URL to convert * * @returns The Wayback Machine URL, or undefined when the URL is not convertible (not an absolute * HTTP(S) URL, or already pointing at the Wayback Machine) */ export declare function toWaybackUrl(url: string): string | undefined; /** * CLI command handler for Wayback Machine URL conversion. * * Rewrites external HTTP(S) link destinations to the Wayback Machine any-snapshot form. * Destinations already pointing at web.archive.org are preserved, and non-web links (mailto, ftp, * internal, anchors) are left untouched. Makes no network calls: this is a pure text transformation * over the parsed markdown links. * * @category Commands * * @example * ```bash markmv wayback docs/*.md --dry-run --verbose```; * * @param patterns - File patterns to process (supports globs) * @param options - Command options controlling dry-run, verbosity, JSON output, and recursion * * @returns Promise resolving to the aggregate conversion result */ export declare function waybackCommand(patterns: string[], options?: WaybackOptions): Promise; //# sourceMappingURL=wayback.d.ts.map