paratext
API reference

paratext/link

Every export of paratext/link, with its signature and doc comment: LINK, supportsLink, linkFor, link.

paratext/link — OSC 8, and nothing else.

import { LINK, supportsLink, linkFor, … } from 'paratext/link';

Constants

link(text, url) against the real process — the ansi-escapes and terminal-link shape, for a caller with no Runtime of its own. The OSC 8 sequence where the terminal is believed to understand it, Docs (https://x.dev) everywhere else; never raw OSC into a pipe, never a bare Docs with the destination silently dropped.

const link: (text: string, url: string) => string;

OSC 8 — a hyperlink. The widest support in this layer, and unusually semi-detectable: VTE publishes its version and Windows Terminal sets a session variable.

const LINK: Capability;

linkFor

link(text, url) bound to a runtime you supply — the form a host should use. burgee's help renderer already carries a Runtime, and taking it as an argument means the whole path is pure: a test is a two-line literal, and rendering help for somebody else's terminal is the same call.

const linkFor: (runtime: Runtime) => (text: string, url: string) => string;

Whether runtime is believed to render OSC 8.

const supportsLink: (runtime: Runtime) => boolean;

On this page