import type { DirectiveAttrs } from './types.js'; /** One `key`, `key=value` or `key="value"` of an attribute blob, with where * its value sits in the blob. */ export interface AttrToken { key: string; value: string; /** Offsets of the token in the blob. */ start: number; end: number; /** Offsets of the value's text (inside its quotes), when it has one. */ valueStart?: number; valueEnd?: number; /** The value was written between quotes. */ quoted: boolean; /** A key without `=`: a flag with an empty value. */ flag: boolean; /** The key holds letters outside ASCII (`作者=曹雪芹`): read so the blob * parses whole, then dropped; `attributeKeyInvalid` reports it. Set by * {@link parseAttrBlobStrict} only. */ invalidKey?: true; } /** Every token of an attribute blob, read leniently: anything that is not * a token is skipped (see {@link parseDirectiveAttrs}). */ export declare function scanDirectiveAttrs(raw: string): AttrToken[]; /** Parse the attribute blob inside a `:::name{ ... }` directive, a * `:::container{ ... }` fence or an inline `:ref{ ... }`. * Supports `key="quoted"`, `key='quoted'`, `key=“quoted”`, * `key=「quoted」`, `key=bare`, and bare `key`; `=` works as `=`. * Attributes may appear in any order; a repeated key keeps the last value. * * Lives in its own module so the block parser and the inline-formatting * pre-pass can share it without a circular import. */ export declare function parseDirectiveAttrs(raw: string): DirectiveAttrs; /** * The tokens of a blob the attribute grammar reads whole: tokens separated * by whitespace (none needed after a quoted value), nothing else. `undefined` * when anything in it is not a token (`{x, y}`, `{紅樓|hóng lóu}`), so a * heading keeps such braces in its title. A `key=value` whose key is * written outside ASCII (`作者=曹雪芹`) counts as a token, marked * `invalidKey`, so the other keys of the blob are still read; a flag * outside ASCII (`{風月寶鑑}`) is not a token. */ export declare function parseAttrBlobStrict(raw: string): AttrToken[] | undefined; /** A key written with letters outside ASCII (`作者=曹雪芹`): the grammar * does not read it, so the attribute is dropped. Offsets into the blob. */ export interface InvalidAttrKey { key: string; start: number; end: number; } /** * The keys of an attribute blob that hold letters outside ASCII, each * followed by `=` or `=`. Quoted values are skipped, so an `=` inside a * value is never read as a key. */ export declare function invalidAttributeKeys(raw: string): InvalidAttrKey[]; /** Upper bound on `:::space{lines=N}` — a typo like `lines=100` must not * swallow page after page. */ export declare const MAX_SPACE_LINES = 20; /** The body lines a `:::space` directive asks for: its `lines` attribute * (default 1), in any digits (`lines=٢`). `undefined` when the value is * not a positive number up to {@link MAX_SPACE_LINES} — the engine then * falls back to one line and the sandbox flags it. */ export declare function spaceDirectiveLines(attrs: DirectiveAttrs | undefined): number | undefined; //# sourceMappingURL=attrs.d.ts.map