paratext
API reference

paratext/terminal-link

Every export of paratext/terminal-link, with its signature and doc comment: terminalLinkFor, terminalLink, plus 4 types.

import terminalLink from 'paratext/terminal-link';
import { terminalLinkFor } from 'paratext/terminal-link';

Functions

terminalLinkFor

terminalLink bound to a runtime you supply — the pure form, and what the export wraps.

function terminalLinkFor(runtime: Runtime): (text: string, url: string, options?: LinkOptions) => string;
ParameterType
runtimeRuntime

Returns (text: string, url: string, options?: LinkOptions) => string

Constants

default

The default export, declared as terminalLink.

const terminalLink: TerminalLink;

Interfaces

LinkOptions

interface LinkOptions {
    target?: Target;
    /**
     * What to print when the terminal is not believed to render OSC 8.
     */
    fallback?: boolean | ((text: string, url: string) => string);
}

terminalLink(text, url, options?) against the real process.

interface TerminalLink {
    (text: string, url: string, options?: LinkOptions): string;
    isSupported: boolean;
    stderr: {
        (text: string, url: string, options?: Omit<LinkOptions, 'target'>): string;
        isSupported: boolean;
    };
}

Types

Options

Upstream's name for the options, so import { type Options } from 'terminal-link' migrates.

type Options = LinkOptions;

Target

Which stream a call is bound for. Upstream's target option, spelled the same way.

type Target = 'stdout' | 'stderr';

On this page