UNPKG

1.77 kBTypeScriptView Raw
1import { User } from '@telegraf/types';
2import { FmtString } from './core/helpers/formatting';
3export { FmtString };
4type Nestable<Kind extends string> = string | number | boolean | FmtString<Kind>;
5type Nesting<Kind extends string> = [
6 parts: Nestable<Kind> | readonly Nestable<Kind>[],
7 ...items: Nestable<Kind>[]
8];
9type Nests<Is extends string, Kind extends string> = (...args: Nesting<Kind>) => FmtString<Is>;
10export declare const join: Nests<"fmt", string>;
11export declare const fmt: Nests<"fmt", string>;
12export declare const bold: Nests<"bold", "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "fmt">;
13export declare const italic: Nests<"italic", "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "fmt">;
14export declare const spoiler: Nests<"spoiler", "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "fmt">;
15export declare const strikethrough: Nests<"strikethrough", "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "fmt">;
16export declare const underline: Nests<"underline", "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "fmt">;
17export declare const quote: Nests<"blockquote", "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "code" | "fmt">;
18export declare const code: Nests<"code", never>;
19export declare const pre: (language: string) => Nests<"pre", never>;
20export declare const link: (content: Nestable<'fmt' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'spoiler' | 'code'>, url: string) => FmtString<"text_link">;
21export declare const mention: (name: Nestable<'fmt' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'spoiler' | 'code'>, user: number | User) => FmtString<"text_link"> | FmtString<"text_mention">;
22//# sourceMappingURL=format.d.ts.map
\No newline at end of file