1 | import { MessageEntity, User } from '@telegraf/types';
|
2 | import { Any } from './util';
|
3 | export type Nestable<Kind extends string> = string | number | boolean | FmtString<Kind>;
|
4 | export type MaybeNestableList<Kind extends string> = Nestable<Kind> | readonly Nestable<Kind>[];
|
5 | export interface FmtString<Brand extends string> {
|
6 | text: string;
|
7 | entities?: MessageEntity[];
|
8 | parse_mode?: undefined;
|
9 | __to_nest: Brand;
|
10 | }
|
11 | export declare class FmtString<Brand extends string = string> implements FmtString<Brand> {
|
12 | text: string;
|
13 | constructor(text: string, entities?: MessageEntity[]);
|
14 | static normalise(content: Nestable<string>): FmtString<string>;
|
15 | }
|
16 | /**
|
17 | * Given an `Iterable<FmtString | string | Any>` and a separator, flattens the list into a single FmtString.
|
18 | * Analogous to Array#join -> string, but for FmtString
|
19 | */
|
20 | export declare const join: (fragments: Iterable<FmtString | string | Any>, separator?: string | FmtString) => FmtString<string>;
|
21 | /** Internal constructor for all fmt helpers */
|
22 | export declare function createFmt(kind?: MessageEntity['type'], opts?: object): (parts: MaybeNestableList<string>, ...items: Nestable<string>[]) => FmtString<string>;
|
23 | export declare const linkOrMention: (content: Nestable<string>, data: {
|
24 | type: 'text_link';
|
25 | url: string;
|
26 | } | {
|
27 | type: 'text_mention';
|
28 | user: User;
|
29 | }) => FmtString<string>;
|
30 | //# sourceMappingURL=formatting.d.ts.map |
\ | No newline at end of file |