import { StreamInline, StreamMark } from './types'; /** One styled stretch of text: the marks and link its words share. */ export interface StreamRun { marks: StreamMark[]; href?: string; } export type StreamAtom = Exclude; /** One thing a stream releases: a word, or an atom (a citation, a custom inline). */ export interface StreamUnit { kind: 'word' | 'atom'; /** The word, or for an atom a key that is equal whenever the atom is. */ text: string; /** Whitespace after it, rendered outside the animated element. */ ws: string; /** Index into `runs` for words; -1 for atoms. */ run: number; atom?: StreamAtom; } export interface StreamModel { runs: StreamRun[]; units: StreamUnit[]; } /** Links render only for schemes a page can open safely; anything else stays text. */ export declare function safeHref(href: string | undefined): string | undefined; /** Hosts rebuild their inline arrays on every update, so atoms compare by value. */ export declare function atomKey(atom: StreamAtom): string; /** * The units a stream of `content` releases, in order. Space that opens a run * belongs after the unit before it, so it sits between the two instead of * inside the next word's entrance. */ export declare function buildStreamModel(content: string | StreamInline[] | undefined, locale?: string): StreamModel; /** * The first `count` units of a model as inlines that build back into exactly * those units, whitespace included. A parent that paces several streams on one * clock hands each of them such a prefix. */ export declare function sliceStreamContent(model: StreamModel, count: number): StreamInline[];