import type { ContentBlock } from '../parse/types.js'; import type { PostextConfig } from '../types.js'; import type { DesignContextKind } from './placeholders.js'; import { type ConfigDesignSlotKind } from './slots.js'; /** * Decoration drawn when the page fence says so (#1087). A design element of * a running head or of a page template's decoration may carry `when: 'x'` * (drawn only on a composed page whose `::::page{…}` fence sets `x`) or * `unless: 'x'` (not drawn there). One shell then serves the front matter, * which prints no folio, and the body, which does: the Markdown says what a * page is, the config keeps the drawing. */ /** Where a design slot reads the condition: running heads and a composed * page's decoration. A heading's, a part's or a box's design ignores it. */ export declare const FENCE_CONDITION_CONTEXTS: ReadonlySet; /** The configuration slots whose elements read the condition (see * {@link FENCE_CONDITION_CONTEXTS}). */ export declare const FENCE_CONDITION_SLOTS: ReadonlySet; /** Whether a fence's attributes set `key`: written as a flag * (`{frontmatter}`) or with any value but `false`. */ export declare function fenceSetsAttribute(attrs: Readonly> | undefined, key: string): boolean; /** Whether an element with `when` / `unless` is drawn on a page whose fence * has `attrs` (none: a page that is not composed). An element with * neither is always drawn. */ export declare function fenceConditionMet(el: { when?: string; unless?: string; }, attrs: Readonly> | undefined): boolean; /** A condition written in the configuration. */ export interface FenceConditionUse { /** The element's key: `pageTemplates[0].decoration.elements[2].when`. */ path: string; condition: 'when' | 'unless'; attribute: string; } /** Every `when` / `unless` the configuration writes on an element of a slot * that reads it, in `configDesignSlots` order. Pure. */ export declare function fenceConditionUses(config: PostextConfig | undefined): FenceConditionUse[]; /** The conditions on an attribute no page of the book sets * (`conditionNeverMet`, an information note of `postext check`): a `when` * element never drawn, an `unless` one always drawn. `attributes` are the * attributes the book's page fences set (see {@link fenceSetsAttribute}). */ export declare function fenceConditionsNeverMet(config: PostextConfig | undefined, attributes: Iterable): FenceConditionUse[]; /** The attributes a fence sets, for {@link fenceConditionsNeverMet}. */ export declare function fenceAttributesSet(attrs: Readonly> | undefined): string[]; /** An `{attr.}` placeholder written in the configuration (#1152). */ export interface AttrPlaceholderUse { /** Where: `pageTemplates[0].footer.elements[1].content`. */ path: string; attribute: string; } /** Every `{attr.}` the design slots of the configuration write, in any * text of an element (its content, a picture's `resourceId`…), in * `configDesignSlots` order. Pure. */ export declare function attrPlaceholderUses(config: PostextConfig | undefined): AttrPlaceholderUse[]; /** The attribute keys the Markdown sets for `{attr.}`: a heading's * attribute block, a container's or a composed page's fence. */ export declare function markdownAttributesSet(blocks: readonly ContentBlock[]): string[]; /** The `{attr.}` placeholders no heading or fence of the book sets * (`conditionNeverMet`, a note of `postext check`): each always reads * `''`, so the folio, running foot or picture it names is empty. */ export declare function attrPlaceholdersNeverSet(config: PostextConfig | undefined, attributes: Iterable): AttrPlaceholderUse[]; //# sourceMappingURL=fenceCondition.d.ts.map