import type { ArrayLike } from "./util.js"; /** A (non-reduced) fraction of things. */ export type Fraction = { type: "fraction"; numerator: number; denominator: number; }; export declare function Fraction(numerator: number, denominator: number): Fraction; /** A slug with higlighting of characters at the given indices. */ export type Highlight = { type: "highlight"; slug: string; highlights: number[]; }; export declare function Highlight(slug: string, highlights: ArrayLike): Highlight; /** A list of zero-based indices into a thing. */ export type Indices = { type: "indices"; indices: number[]; }; export declare function Indices(indices: ArrayLike): Indices; /** A space-separated list of items. */ export type Join = { type: "join"; items: Inline[]; }; export declare function Join(items: ArrayLike): Join; /** An ordinal number (like 1st or -2nd). */ export type Ordinal = { type: "ordinal"; rank: number; }; export declare function Ordinal(rank: number): Ordinal; /** * A lone slug, usually printed in monospace, possibly inflected for being * plural. Like "s" or "'s's". * * We have special handling for pluralized slugs because they could have weird * formatting. */ export type Slug = { type: "slug"; count: number; slug: string; }; export declare function Slug(count: number, slug: string): Slug; export declare function Slug(slug: string): Slug; /** A non-slug, plain text string. */ export type Text = { type: "text"; text: string; }; export declare function Text(text: string | number): Text; /** A word like "once", "twice", etc. */ export type Times = { type: "times"; count: number; }; export declare function Times(count: number): Times; /** An inline tag. */ export type Inline = Fraction | Highlight | Indices | Join | Ordinal | Slug | Text | Times; /** A numerical count, plus an inflected noun, like "2 dogs". */ export declare function Count(count: number, one: string, other: string): Join; /** A numerical count, plus a slug, like "1 s" or "2 's's". */ export declare function CountSlug(count: number, slug: string): Join; /** A word inflected for being singular or plural, like "is" or "are". */ export declare function Inflect(count: number, one: string | number | Inline, other: string | number | Inline): Inline; /** A renderer for inline tags. */ export type InlineRenderer = { fraction: (numerator: number, denominator: number, options: Options) => T; highlight: (slug: string, indices: number[], options: Options) => T; indices: (indices: number[], options: Options) => T; join: (items: T[], options: Options) => T; ordinal: (rank: number, options: Options) => T; slug: (count: number, slug: string, options: Options) => T; text: (text: string, options: Options) => T; times: (count: number, options: Options) => T; }; /** Render an inline tag. */ export declare function renderInline(renderer: InlineRenderer | ((inline: Inline, options: Options) => T), inline: Inline, options: Options): T; //# sourceMappingURL=inline.d.ts.map