teleform
Version:
Format Telegram messages, escape special characters, switch formatting styles, convert special entities to formatted text and vice versa, form Telegram links, use Unicode symbols.
51 lines (50 loc) • 2.64 kB
TypeScript
export class format {
static _entities: string[];
static _underscore_entities: string[];
static _blockquote_entities: string[];
static _to_escape: any[];
static _tags: (type: any, optional: any) => any;
static _limits: {
length: number;
};
static _name: (name: any) => string;
static _link_regexp: RegExp;
static from_entities(...args: any[]): {
[x: number]: string;
};
static to_entities(args: any, length?: boolean, to_text?: string, to_entities?: any[]): {
[x: number]: string | any[];
};
static _args(args: any, entities: any): any[];
static _tags_from_entities(entities: any, tags?: {}): {};
static _text_from_entities(text: any, tags: any): string;
static _text_to_entities(text: any, indent: any, ii?: number, litter?: number, from?: number): any;
static _clip(output: any, length: any): void;
static _toggle(string: any, to: any): any;
static b(string: any, escape?: boolean): any;
static i(string: any, escape?: boolean): any;
static u(string: any, escape?: boolean): any;
static s(string: any, escape?: boolean): any;
static link(string: any, url: any, escape?: boolean): any;
static mention(string: any, uid: any, escape?: boolean): any;
static emoji(string: any, eid: any, escape?: boolean): any;
static quote(string: any, expandable?: boolean, escape?: boolean): any;
static bold(string: any, escape?: boolean): any;
static italic(string: any, escape?: boolean): any;
static underline(string: any, escape?: boolean): any;
static strikethrough(string: any, escape?: boolean): any;
static spoiler(string: any, escape?: boolean): any;
static text_link(string: any, url: any, escape?: boolean): any;
static text_mention(string: any, uid: any, escape?: boolean): any;
static custom_emoji(string: any, eid: any, escape?: boolean): any;
static code(string: any, escape?: boolean): any;
static pre(string: any, language?: null, escape?: boolean): any;
static blockquote(string: any, expandable?: boolean, escape?: boolean): any;
static expandable_blockquote(string: any, escape?: boolean): any;
static escape(string: any, excluded?: any[], escape?: boolean, only?: any[]): any;
static unescape(string: any, excluded?: any[], unescape?: boolean, only?: any[]): any;
static _characters_to_escape(excluded: any, only: any, vector: any): any;
static _escape(escape: any, string: any, to_escape: any, escapist: any): any;
static _subtract(array: any, extra: any): any;
static _substitute(string: any, char: any, withChar: any): any;
}