discord-markdown-parser
Version:
Parse discord-style markdown into an abstract syntax tree.
14 lines (13 loc) • 376 B
TypeScript
export type Capture = (Array<string> & {
index: number;
}) | (Array<string> & {
index?: number;
});
export type State = {
key?: string | number | undefined;
inline?: boolean | null | undefined;
[key: string]: any;
};
export type MatchFunction = {
regex?: RegExp;
} & ((source: string, state: State, prevCapture: string) => Capture | null | undefined);