/** * Turning a pasted URL into a real embed. * * A model writing a newsletter puts a YouTube link on its own line and expects * a player. Send that through as a paragraph and Substack renders a blue link, * which is the single most visible way an AI-written post looks AI-written. * * Substack's editor does this conversion client-side, so it never happens for * anything written through the API. Doing it here is why a draft from this * server looks like one a person made in the editor. * * Node shapes were read off live drafts. */ import type { PMNode } from "./prosemirror.js"; /** * Pull an 11-character video id out of any YouTube URL shape: watch?v=, * youtu.be, /embed/, /shorts/, /live/. Extra parameters such as &list= and &t= * are ignored rather than breaking the match. */ export declare function extractYouTubeId(url: string): string | null; /** * Map a standalone URL to its embed node, or null when the host is not one * Substack embeds. Callers fall back to a normal link for null. */ export declare function urlToEmbed(url: string): PMNode | null; /** True when a line is nothing but a URL, so it is safe to replace with an embed. */ export declare function isBareUrl(line: string): boolean;