import * as CodeMirror from "codemirror"; import "codemirror/mode/markdown/markdown"; import "./hypermd.css"; export type TokenFunc = (stream: CodeMirror.StringStream, state: HyperMDState) => string; export interface MarkdownStateLine { stream: CodeMirror.StringStream; header?: boolean; hr?: boolean; fencedCodeEnd?: boolean; } export interface MarkdownState { f: TokenFunc; prevLine: MarkdownStateLine; thisLine: MarkdownStateLine; block: TokenFunc; htmlState: any; indentation: number; localMode: CodeMirror.Mode; localState: any; inline: TokenFunc; text: TokenFunc; formatting: string | string[] | false; linkText: boolean; linkHref: boolean; linkTitle: boolean; image?: boolean; imageMarker?: boolean; imageAltText?: boolean; /** -1 means code-block and +1,2,3... means ``inline ` quoted codes`` */ code: false | number; em: false | string; strong: false | string; header: number; setext: 0 | 1 | 2; hr: boolean; taskList: boolean; list: true | null | false; listStack: number[]; quote: number; indentedCode: boolean; trailingSpace: number; trailingSpaceNewLine: boolean; strikethrough: boolean; emoji: boolean; fencedEndRE: null | RegExp; indentationDiff?: number; } export type InnerModeExitChecker = (stream: CodeMirror.StringStream, state: HyperMDState) => { endPos?: number; skipInnerMode?: boolean; style?: string; }; export interface HyperMDState extends MarkdownState { hmdTable: TableType; hmdTableID: string; hmdTableColumns: string[]; hmdTableCol: number; hmdTableRow: number; hmdOverride: TokenFunc; hmdHashtag: HashtagType; hmdInnerStyle: string; hmdInnerExitChecker: InnerModeExitChecker; hmdInnerMode: CodeMirror.Mode; hmdInnerState: any; hmdLinkType: LinkType; hmdNextMaybe: NextMaybe; hmdNextState: HyperMDState; hmdNextStyle: string; hmdNextPos: number; hmdSuperscript: boolean; hmdSubscript: boolean; hmdCustomLink: boolean; hmdUnderline: boolean; hmdMultilineComment: boolean; } export declare const enum HashtagType { NONE = 0, NORMAL = 1,// hashtag text with no unescaped spaces WITH_SPACE = 2 } export declare const enum TableType { NONE = 0, SIMPLE = 1,// table | column NORMAL = 2 } export declare const enum NextMaybe { NONE = 0, FRONT_MATTER = 1,// only appears once, for each Doc FRONT_MATTER_END = 2 } declare const enum LinkType { NONE = 0, BARELINK = 1,// [link] FOOTREF = 2,// [^ref] NORMAL = 3,// [text](url) or [text][doc] FOOTNOTE = 4,// [footnote]: MAYBE_FOOTNOTE_URL = 5,// things after colon BARELINK2 = 6,// [some-name][] except latter [] FOOTREF2 = 7,// [text][doc] the [doc] part CUSTOMLINK = 8,// [[custom link]] HIGHLIGHT_TEXT = 9,// ==Highlight Text content== SUPERSCRIPT = 10, SUBSCRIPT = 11, UNDERLINE = 12 } export {};