import { BaseInlineTokenizer, IBaseInlineTokenizerProps, IInlineTokenizer, IMatchInlineHookCreator, IParseInlineHookCreator, IPartialInlineToken, ITokenDelimiter, ITokenizer, checkBalancedBracketsStatus } from "@yozora/core-tokenizer"; import { Link, LinkType } from "@yozora/ast"; import { INodeInterval, INodePoint } from "@yozora/character"; //#region src/types.d.ts type T = LinkType; type INode = Link; declare const uniqueName = "@yozora/tokenizer-link"; interface IToken extends IPartialInlineToken { /** * Link destination interval. */ destinationContent?: INodeInterval; /** * Link title interval. */ titleContent?: INodeInterval; } interface IDelimiter extends ITokenDelimiter { /** * IDelimiter type. */ type: 'opener' | 'closer'; /** * Link destination interval. */ destinationContent?: INodeInterval; /** * Link title interval. */ titleContent?: INodeInterval; } type IThis = ITokenizer; type ITokenizerProps = Partial; //#endregion //#region src/tokenizer.d.ts /** * Lexical Analyzer for InlineLink. * @see https://github.com/syntax-tree/mdast#link * @see https://github.github.com/gfm/#links */ export declare class LinkTokenizer extends BaseInlineTokenizer implements IInlineTokenizer { constructor(props?: ITokenizerProps); readonly match: IMatchInlineHookCreator; readonly parse: IParseInlineHookCreator; } //#endregion //#region src/util/link-destination.d.ts /** * A link destination consists of either * - a sequence of zero or more characters between an opening '<' and a closing '>' * that contains no line breaks or unescaped '<' or '>' characters, or * - a nonempty sequence of characters that does not start with '<', does not include * ASCII space or control characters, and includes parentheses only if * (a) they are backslash-escaped or * (b) they are part of a balanced pair of unescaped parentheses. (Implementations * may impose limits on parentheses nesting to avoid performance issues, but * at least three levels of nesting should be supported.) * @see https://github.github.com/gfm/#link-destination * @return position at next iteration */ export declare function eatLinkDestination(nodePoints: readonly INodePoint[], startIndex: number, endIndex: number): number; //#endregion //#region src/util/link-title.d.ts /** * A link title consists of either * * - a sequence of zero or more characters between straight double-quote * characters '"', including a '"' character only if it is backslash-escaped, or * * - a sequence of zero or more characters between straight single-quote * characters '\'', including a '\'' character only if it is backslash-escaped, or * * - a sequence of zero or more characters between matching parentheses '(...)', * including a '(' or ')' character only if it is backslash-escaped. */ export declare function eatLinkTitle(nodePoints: readonly INodePoint[], startIndex: number, endIndex: number): number; //#endregion export { type IThis as ILinkHookContext, type IToken as ILinkToken, type ITokenizerProps as ILinkTokenizerProps, LinkTokenizer as default, uniqueName as LinkTokenizerName, checkBalancedBracketsStatus }; export {};