/** The only AuthoringPlan wire format accepted by this preview release. */ declare const AUTHORING_PLAN_VERSION$1: 1; type JsonPrimitive = string | number | boolean | null; type JsonValue = JsonPrimitive | JsonValue[] | { [key: string]: JsonValue; }; type AuthoringFieldMode = 'fixed' | 'editable' | 'override'; type AuthoringStyleStrategy = 'native' | 'scoped-css' | 'mixed'; type AuthoringStyleOutcomeKind = 'native' | 'token' | 'scoped-css' | 'dropped'; type AuthoringAssetStatus = 'ready' | 'missing' | 'external'; type AuthoringFileOperation = 'create' | 'replace'; type AuthoringLockMode = 'insert' | 'all' | 'contentOnly' | 'none'; /** The authored material that was actually analysed to produce a registered-block plan. */ type AuthoringSourceFormat = 'html' | 'directory'; interface AuthoringSource { /** The source entry as supplied to the authoring run (or a stable stdin/inline label). */ entry: string; /** SHA-256 of the exact source bytes analysed by Block Runner. */ sha256: string; format: AuthoringSourceFormat; } /** A source position retained in the analysis ledger. */ interface AuthoringCoverageLocation { path?: string; selector?: string; htmlLine?: number; htmlColumn?: number; offset?: number; } type AuthoringCoverageStyleOutcome = 'native' | 'preset' | 'literal' | 'scoped-css' | 'warned' | 'blocked'; /** One source declaration and its final destination disposition. */ interface AuthoringCoverageStyle { declarationId?: string; ruleId?: string; property: string; value: string; outcome: AuthoringCoverageStyleOutcome; /** Whether the declaration came from parity CSS or explicit editor-only CSS. */ scope: 'shared' | 'editor'; reason?: string; atRules: string[]; source?: AuthoringCoverageLocation; /** Hash-bound component-local selector used by the generated stylesheet, when rewritten. */ transportSelector?: string; /** * Required when a source declaration is carried by a particular native block rather than * residual CSS. This prevents another node with the same property/value from satisfying * source coverage by accident. */ node?: string; /** The WP 7.1 responsive style state that carries this native declaration, when applicable. */ responsive?: 'mobile' | 'tablet'; /** Exact target theme preset provenance for a preset outcome. */ preset?: { category: 'color' | 'spacing' | 'font-size' | 'font-family'; slug: string; }; /** Native destinations emitted in addition to, never instead of, the source declaration. */ nativeTargets?: Array<{ node: string; role: 'button-link' | 'button-wrapper-reset' | 'image' | 'caption' | 'grid-container'; selector: string; important?: boolean; intrinsic?: { width: string; height: string; aspectRatio: string; }; }>; } type AuthoringCoverageAssetOutcome = 'prepared' | 'copied' | 'uploaded' | 'reused' | 'external' | 'unresolved' | 'blocked'; /** One concrete source asset reference and its final package/destination disposition. */ interface AuthoringCoverageAsset { reference: string; rewritten?: string; kind: 'image' | 'font' | 'stylesheet' | 'media' | 'other'; outcome: AuthoringCoverageAssetOutcome; reason?: string; /** Hash of the local bytes when this reference resolved to a prepared package asset. */ sha256?: string; destination?: string; source?: AuthoringCoverageLocation; } /** Hashes and complete ledgers produced by the deterministic HTML analysis pass. */ interface AuthoringCoverage { /** Effective stylesheet bytes scanned by the authoring pass. */ stylesheet?: { entry: string; sha256: string; }; /** Explicit editor-only stylesheet bytes scanned by the authoring pass. */ editorStylesheet?: { entry: string; sha256: string; }; /** Destination style inputs actually consulted while deciding ownership. */ styleContext?: AuthoringStyleContext; /** Explicit source-bound decision to contain foundation rules inside this component. */ foundation?: 'component'; /** One entry per source declaration observed by the authoring pass. */ styles: AuthoringCoverageStyle[]; /** One entry per concrete asset reference observed by the authoring pass. */ assets: AuthoringCoverageAsset[]; } /** A hash-bound description of the target style environment, never a request to edit it. */ interface AuthoringStyleContext { theme?: { slug?: string; version?: string; settingsSha256?: string; }; viewports?: Partial>; unresolvedVariables?: string[]; limitations?: string[]; } /** * The registered block this plan is intended to create. `directory` is a safe relative suggested * package location used when preview has no explicit `--output-dir`; an explicit CLI destination * always takes precedence so its previewed path can be passed unchanged to `author write`. */ interface AuthoringTarget { /** WordPress block name, for example `my-plugin/feature-grid`. */ name: string; title: string; description?: string; category?: string; icon?: string; textDomain?: string; wordpress?: string; directory?: string; /** * Additional declarative block.json metadata. It is hash-bound and rendered in preview. * Static capability checks happen at compilation, where unsafe code-loading forms can be * rejected without narrowing this transport to a particular vendor schema revision. */ metadata?: { [key: string]: JsonValue; }; } interface AuthoringNodeLock { move?: boolean; remove?: boolean; } /** A native block and its native children; this is never HTML. */ interface AuthoringStructureNode { /** Optional stable reference used by a field's `node` property. */ id?: string; block: string; label?: string; attributes?: { [key: string]: JsonValue; }; lock?: AuthoringNodeLock; children?: AuthoringStructureNode[]; } /** A reviewed source-content change made while binding an authoring proposal. */ interface AuthoringSourceDecision { action: 'add' | 'replace' | 'omit'; sourceRef: string; node?: string; attribute?: string; original?: JsonValue; value?: JsonValue; reason: string; source?: AuthoringCoverageLocation; } /** A value an editor can, cannot, or may override in a pattern. */ interface AuthoringField { id: string; label: string; mode: AuthoringFieldMode; type?: string; node?: string; attribute?: string; default?: JsonValue; description?: string; } /** Locking that applies to the authored block as a whole. */ interface AuthoringLocking { mode: AuthoringLockMode; move?: boolean; remove?: boolean; insert?: boolean; } /** The disposition of one source style after native-style mapping. */ interface AuthoringStyleOutcome { property: string; outcome: AuthoringStyleOutcomeKind; value?: string; token?: string; reason?: string; } interface AuthoringStyles { strategy: AuthoringStyleStrategy; outcomes: AuthoringStyleOutcome[]; /** Explicit compiler policy for component-contained foundation selectors. */ foundation?: 'component'; /** Component-local selectors before the compiler adds its owned block root. */ rules?: AuthoringCssRule[]; /** Supplemental editor affordances, subject to the same scoping and asset checks. */ editorRules?: AuthoringCssRule[]; /** * Hash-confirmed, licensed faces shared by the editor and frontend. Each face points at the * corresponding `assets[]` entry; source paths and hashes stay in that one asset record. Font * faces are deliberately not an editor-only field: `style.scss` is loaded in both contexts, * while `editor.scss` is supplemental and must not duplicate a face. */ fonts?: AuthoringFontFace[]; } /** A checked @font-face descriptor whose source is resolved from a confirmed asset ID. */ interface AuthoringFontFace { assetId: string; family: string; fontStyle?: string; fontWeight?: string; fontStretch?: string; fontDisplay?: string; unicodeRange?: string; } /** The explicit ownership/license decision attached to one bundled font asset. */ interface AuthoringFontLicense { ownership: string; license: string; notice?: string; } interface AuthoringCssDeclaration { property: string; value: string; important?: boolean; } /** Structured CSS only: no imports, Sass, executable fragments, or unscoped output. */ type AuthoringCssRule = { kind: 'style'; selector: string; declarations: AuthoringCssDeclaration[]; /** Compiler-owned supplemental transport; source rules deliberately omit this field. */ generated?: 'native-adapter-target' | 'native-adapter-wrapper-reset'; } | { kind: 'conditional'; name: 'media' | 'supports' | 'container'; prelude: string; rules: AuthoringCssRule[]; }; interface AuthoringPatternOverride { field: string; label?: string; description?: string; } interface AuthoringPattern { ready: boolean; overrides: AuthoringPatternOverride[]; } interface AuthoringAsset { id: string; source: string; kind?: string; /** A path below the generated package, when the asset is copied into it. */ destination?: string; status?: AuthoringAssetStatus; required?: boolean; /** SHA-256 of a local source file, required before it may be copied. */ sha256?: string; /** Explicit ownership and license record required for a bundled WOFF/WOFF2 asset. */ fontLicense?: AuthoringFontLicense; /** Explicit native media attributes which use this bundled image. */ uses?: Array<{ node: string; attribute: 'url'; }>; } /** * A prospective generated file for low-level destination writers. The registered-block compiler * deliberately rejects `content`: declarative AuthoringPlans may only select its own output paths. */ interface AuthoringFile { /** Portable, relative POSIX path below the output directory. */ path: string; kind?: string; content?: string; /** Replacing a collision requires this separate, hash-bound approval decision. */ operation?: AuthoringFileOperation; } /** * A complete, declarative input to registered-block authoring. * * The contract keeps human decisions separate from generated source: the structure and editor * model are explicit, while registered-block compilation treats files as compiler-owned output * paths and collision policy rather than executable source. */ interface AuthoringPlan$1 { version: typeof AUTHORING_PLAN_VERSION$1; generatorVersion: string; target: AuthoringTarget; /** Present on plans produced by HTML analysis; absent on a hand-authored plan. */ source?: AuthoringSource; /** Complete, hash-bound dispositions from the HTML analysis pass. */ coverage?: AuthoringCoverage; structure: AuthoringStructureNode[]; /** Present only for proposal-derived plans; legacy plan serialization is unchanged. */ sourceDecisions?: AuthoringSourceDecision[]; /** Explicit direct-child insertion policy; defaults to the initial template's direct children. */ allowedBlocks?: string[]; fields: AuthoringField[]; locking: AuthoringLocking; styles: AuthoringStyles; pattern: AuthoringPattern; assets: AuthoringAsset[]; files: AuthoringFile[]; warnings: string[]; } declare class AuthoringPlanValidationError$1 extends Error { constructor(message: string); } /** * Parse (when necessary), validate, and normalize an untrusted AuthoringPlan. * * Normalization fills the deliberately boring defaults, rejects unknown fields, and returns a * fresh JSON-only value. It is also the single gate used by hashing and rendering, so a preview * cannot accidentally describe a different object from the one that is confirmed later. */ declare function validateAuthoringPlan$1(input: unknown): AuthoringPlan$1; /** * Validate and return a recursively key-sorted plan object. Array order is deliberately retained: * it describes native child order and is therefore material. Use `serializeAuthoringPlan` when a * wire representation is required. */ declare function canonicalizeAuthoringPlan$1(input: unknown): AuthoringPlan$1; /** Stable canonical JSON, with recursively sorted object keys and preserved array order. */ declare function serializeAuthoringPlan$1(input: unknown): string; /** SHA-256 of canonical JSON, as lower-case hexadecimal (without a display-only prefix). */ declare function hashAuthoringPlan$1(input: unknown): string; /** * Plan paths are portable paths inside an output root. They cannot select a parent, an absolute * location, a Windows drive/UNC path, or an empty component that normalisation could reinterpret. */ declare function isSafeAuthoringRelativePath$1(value: string, options?: { allowDot?: boolean; }): boolean; /** Pinned local registry and the deliberately narrow static-authoring policy. */ declare const AUTHORING_NATIVE_POLICY_VERSION: "1"; interface AuthoringRegistryIdentity { /** Target WordPress schema/registry contract; package versions below are the observed evidence. */ wordpress: '7.1'; blockLibrary: string; blocks: string; policy: typeof AUTHORING_NATIVE_POLICY_VERSION; } /** * Source-style graph utilities for generated blocks. * * Tailwind is compiled only by the project's explicitly supplied, pinned compiler. A Tailwind * class is not CSS, and guessing its declaration from a token would make the generated block * depend on an unknown version, configuration, plugin set, source set, and browser target. The * compiler receives the complete materialized graph and its result is the only Tailwind CSS this * module will author. * * The scanner is deliberately small and conservative. It preserves the conditional constructs that * can safely remain in a block stylesheet (`@media`, `@supports`, and `@container`) and records all * other global or unsupported constructs rather than silently flattening or dropping them. */ type BuildGraphField = 'cssEntries' | 'imports' | 'directives' | 'sources' | 'safelist' | 'plugins' | 'environment' | 'browserTarget' | 'compiler'; /** * The inputs that determine a Tailwind (or Tailwind-like) generated stylesheet. Empty arrays are * meaningful: they say that the author explicitly has no imports, safelist, or plugins. Omitted * fields are not meaningful and therefore cannot support a fidelity claim. */ interface CssBuildGraph extends TailwindBuildGraph { cssEntries?: readonly string[]; imports?: readonly string[]; directives?: readonly string[]; sources?: readonly string[]; safelist?: readonly string[]; plugins?: readonly string[]; environment?: Readonly>; browserTarget?: string | readonly string[]; } interface BuildGraphIssue { field: BuildGraphField; status: 'warning' | 'blocked'; reason: string; } interface BuildGraphValidation { /** All required graph inputs were supplied and entry/source values are non-empty. */ complete: boolean; /** Tailwind mode was explicitly declared by the caller or by supplying a graph. */ tailwindDetected: boolean; /** The supplied CSS is a compiled, self-contained stylesheet rather than Tailwind source. */ compiled: boolean; /** A pinned compiler actually generated and, when supplied, matched this CSS. */ provenanceVerified: boolean; /** `--tw-*` variables referenced by the CSS but not defined anywhere in that CSS. */ unresolvedVariables: string[]; /** Tailwind fidelity is blocked for an incomplete graph or an uncompiled/incomplete CSS result. */ blocked: boolean; missing: BuildGraphField[]; issues: BuildGraphIssue[]; } interface BuildGraphValidationOptions { /** Compiled or source CSS to inspect for Tailwind directives/variables. */ css?: string; /** Explicitly declare Tailwind mode when the compiled CSS has no recognizable source token. */ tailwindDetected?: boolean; /** Set only after `compileTailwindBuildGraph()` produced the CSS being validated. */ provenanceVerified?: boolean; } /** * Validate the source inputs needed to make a Tailwind fidelity statement. Tailwind mode is not * considered usable until a caller has also run `compileTailwindBuildGraph()` and marked the exact * output as verified. Keeping this synchronous utility strict prevents a complete-looking graph * plus independently supplied CSS from being mistaken for compiler provenance. */ declare function validateCssBuildGraph$1(graph: CssBuildGraph | undefined, options?: BuildGraphValidationOptions): BuildGraphValidation; /** True only for Tailwind *source* that still needs a compiler, never for compiled declarations. */ declare function hasTailwindSignal$1(css: string): boolean; interface TailwindCompilationOptions { /** Design HTML path, used as the base for graph paths when available. */ sourcePath?: string; /** CSS supplied as purported compiler output. It must exactly match when present. */ expectedCss?: string; } interface TailwindCompilation { css?: string; issues: BuildGraphIssue[]; /** True only when the compiler ran and its output matched the supplied output (if any). */ verified: boolean; } /** * Materialize and compile the declared Tailwind graph. This intentionally has no fallback that * infers a utility from class names or accepts a prebuilt stylesheet on trust: the supplied * compiler is the project's pin for Tailwind, plugins, custom variants, and browser targeting. */ declare function compileTailwindBuildGraph$1(graph: CssBuildGraph, options?: TailwindCompilationOptions): Promise; interface CssPosition { offset: number; line: number; column: number; } interface CssSourceRange { start: CssPosition; end: CssPosition; } interface CssDeclaration { id: string; property: string; value: string; important: boolean; source: CssSourceRange; /** Exact raw value span, excluding declaration whitespace but retaining `!important`. */ valueSource: CssSourceRange; } interface CssStyleRule { id: string; kind: 'style'; selector: string; declarations: CssDeclaration[]; source: CssSourceRange; /** Present for CSS nesting. Nested selectors are parsed and ledgered, then conservatively blocked. */ nestedIn?: string; /** Internal provenance for rules inserted by the native markup adapter. */ generated?: 'native-adapter-target' | 'native-adapter-wrapper-reset'; } interface CssConditionalRule { id: string; kind: 'conditional'; name: 'media' | 'supports' | 'container'; prelude: string; rules: CssRule[]; source: CssSourceRange; } interface CssBlockedRule { id: string; kind: 'blocked'; name: string; prelude: string; declarations: CssDeclaration[]; rules: CssRule[]; reason: string; source: CssSourceRange; } type CssRule = CssStyleRule | CssConditionalRule | CssBlockedRule; type StyleLedgerOutcome = 'pending' | 'native' | 'preset' | 'literal' | 'scoped-css' | 'warned' | 'blocked'; /** One and only one of these entries is created for every parsed source declaration. */ interface SourceStyleLedgerEntry { declarationId: string; ruleId: string; property: string; value: string; important: boolean; source: CssSourceRange; atRules: string[]; outcome: StyleLedgerOutcome; reason?: string; } interface CssRuleRecord { ruleId: string; kind: CssRule['kind']; prelude: string; source: CssSourceRange; outcome: 'pending' | 'scoped-css' | 'blocked'; reason?: string; } interface CssStylesheet { rules: CssRule[]; ledger: SourceStyleLedgerEntry[]; ruleRecords: CssRuleRecord[]; } /** * Scan a stylesheet without flattening its conditional structure. CSS comments, quotes, url(), * attribute selectors, and escaped quotes are respected while finding braces and declarations. * Malformed tail content becomes a blocked rule record instead of disappearing. */ declare function scanStylesheet$1(css: string): CssStylesheet; interface DeclarationDisposition { outcome: Exclude | 'scoped-css'; reason?: string; } interface ScopeStylesheetOptions { /** The deterministic generated-block root, e.g. `.wp-block-acme-hero`. */ root: string; /** * Called only for a safe, local style rule. Returning native/preset/literal leaves that * declaration out of parity CSS; returning nothing keeps it as scoped CSS. */ disposition?: (declaration: CssDeclaration, rule: CssStyleRule, context: { conditional: boolean; }) => DeclarationDisposition | undefined; /** Rewrite source selector atoms before the root prefix is applied. */ selectorTransform?: (selector: string, rule: CssStyleRule) => string; /** Explicitly contain safe foundation selectors within the generated component. */ foundation?: 'component'; } interface ScopedStylesheet { root: string; rules: CssRule[]; /** The same retained rules before adding the root, for the confirmed-plan compiler. */ localRules: CssRule[]; ledger: SourceStyleLedgerEntry[]; ruleRecords: CssRuleRecord[]; css: string; } /** * Scope safe local selectors under a generated block root. Foundation rules and selectors that can * name or depend on the document outside that root are not rewritten: their declarations and rule * records are explicitly blocked. This is intentionally stricter than merely prefixing every * selector, because that would turn Preflight into a misleading claim of semantic equivalence. */ declare function scopeStylesheet$1(stylesheet: CssStylesheet, options: ScopeStylesheetOptions): ScopedStylesheet; /** Render the original rule order in a normalized, deterministic format. */ declare function renderResidualCss$1(stylesheet: Pick): string; /** * Scope a safe selector list without changing the authored selector's cascade weight. * * The generated block root must contain every match, but its class is an implementation detail: * placing it directly in the selector would add one class of specificity and make otherwise * deliberately weak rules (notably `:where(...)`) win against their source peers. `:where()` * supplies the containment boundary with zero specificity. */ declare function scopeLocalSelectorList$1(selectorList: string, root: string, options?: { foundation?: 'component'; }): { ok: true; selector: string; foundation?: 'component' | 'document-base'; } | { ok: false; reason: string; }; /** The only outcomes an authored CSS asset can have in a generated bundle. */ type AssetOutcome$1 = 'prepared' | 'copied' | 'external' | 'unresolved' | 'blocked'; interface PreparedCssAsset { source: string; destination: string; content: Buffer; sha256: string; /** The source URL's transport class. A font is never treated as an image/media asset. */ kind: CssAssetKind; } /** The use is deliberately descriptive; it never implies a WordPress attachment ID. */ type CssAssetKind = 'asset' | 'font'; /** * The minimum affirmative decision needed to redistribute a font in a generated block. * * A boolean such as `allowFontLicense: true` cannot establish which file was reviewed or who * owns its redistribution rights. The reference, exact source path, and byte hash bind the * decision to one concrete file; `ownership` and `license` make the human decision auditable. */ interface FontLicenseDecision { /** Exact CSS URL spelling this decision covers (before any package-relative rewrite). */ reference: string; /** Exact local file that was reviewed, normally an absolute path below the source root. */ source: string; /** SHA-256 of the reviewed file bytes. */ sha256: string; /** Human-readable rights-holder or ownership decision; it is intentionally not inferred. */ ownership: string; /** SPDX identifier, license URL, or other human-readable license record. */ license: string; /** Optional supplied redistribution notice, copied into the generated source record verbatim after safe escaping. */ notice?: string; } interface FontAssetWarning { reference?: string; family?: string; reason: string; source?: CssAssetLocation; } interface CssAssetLocation { /** The supplied CSS source path, when one was available. */ path?: string; /** Zero-based offset in `sourceCss`. */ offset: number; /** One-based line and column, useful for a conversion report. */ line: number; column: number; } /** * A literal `url(...)` reference found in CSS. `start`/`end` delimit the complete function, * whereas `url` is the unquoted, CSS-unescaped reference inside it. */ interface CssUrlReference { raw: string; url: string; start: number; end: number; location: CssAssetLocation; kind: CssAssetKind; /** `url` is a CSS url() function; `string` is a direct image-set() source string. */ syntax?: 'url' | 'string'; } /** One explicit ledger entry for one authored `url(...)` reference. */ interface CssAssetLedgerEntry extends CssUrlReference { outcome: AssetOutcome$1; reason: string; /** The filesystem source used for a copied asset. Never set for a remote asset. */ sourceAssetPath?: string; /** The copied destination. Never set for an unresolved, external, or blocked asset. */ destinationAssetPath?: string; /** The URL substituted into the returned CSS. Omitted when the source CSS is left untouched. */ rewrittenUrl?: string; } /** * Inputs for CSS asset processing. `sourcePath` names the authored stylesheet (or the HTML file * containing an inline stylesheet); relative URLs are resolved from its directory. The result CSS * is intended to live beside `destinationAssetDir`, so the default rewritten URLs are * `.//`. */ interface RewriteCssAssetsOptions { /** Collect bytes without touching the destination; the owner writes only after confirmation. */ prepareAsset?: (asset: PreparedCssAsset) => void; sourcePath?: string; /** * Boundary for relative local URLs. Defaults to the directory containing `sourcePath`; a CSS * reference may name a file below this directory, but never a parent or sibling. Supplying an * asset root is useful when a stylesheet lives in a nested `css/` directory beside `assets/`. */ assetRoot?: string; sourceCss: string; destinationAssetDir: string; /** * Public URL prefix for copied files, for example `/wp-content/blocks/acme/assets/`. * Defaults to `.//`. */ assetUrlPrefix?: string; /** * Legacy switch retained for source compatibility. It is deliberately insufficient on its own: * fontLicenses must identify the exact local file and ownership decision. */ /** @deprecated Use fontLicenses with a reference, source, hash, ownership, and license. */ allowFontLicense?: boolean; /** Explicit, reference-bound local font decisions. Remote/data fonts can never be authorized. */ fontLicenses?: readonly FontLicenseDecision[]; } interface RewriteCssAssetsResult { /** CSS with only successfully copied local references rewritten. */ css: string; /** Alias for consumers that prefer an explicit result name. */ rewrittenCss: string; /** A complete, one-entry-per-`url()` asset ledger. */ assets: CssAssetLedgerEntry[]; /** Alias for `assets`, to make the accounting purpose clear at call sites. */ ledger: CssAssetLedgerEntry[]; /** Font references that were not copied because no complete licensed-file decision was supplied. */ warnings: FontAssetWarning[]; } /** * Find literal CSS `url(...)` functions without treating strings and comments as references. * This is a lexer, not a CSS formatter: the original CSS is retained byte-for-byte unless a local * asset is successfully copied and needs its URL rewritten. */ declare function scanCssUrlReferences$1(sourceCss: string, sourcePath?: string, stylesheet?: CssStylesheet): CssUrlReference[]; /** * Pure classification for a CSS reference. Local files remain `unresolved` here because copying * is intentionally the responsibility of `rewriteCssAssets`; nothing is fetched or written by * classification alone. */ declare function classifyCssUrlReference$1(reference: CssUrlReference, options: Pick): CssAssetLedgerEntry; /** * Copy safe local URL targets to `destinationAssetDir` and replace exactly those `url(...)` * tokens in the returned CSS. HTTP(S) and protocol-relative URLs are deliberately never fetched; * they are ledgered as external and left as authored. */ declare function rewriteCssAssets$1(options: RewriteCssAssetsOptions): Promise; interface GeneratedAssetFile { path: string; kind: 'asset'; /** Image/font is kept separate from the manifest's generic file kind for the generator seam. */ assetKind?: Exclude | 'image'; content: Buffer; hash: string; operation: 'create' | 'replace'; } /** * The owned source-template contract. Changing it changes every generated package and must be an * intentional, reviewed release decision. */ declare const REGISTERED_BLOCK_TEMPLATE_VERSION$1: "0.9-static-v11"; type GeneratedSourceKind = 'json' | 'javascript' | 'scss' | 'php' | 'text'; declare const GENERATED_REGISTERED_BLOCK_PATHS$1: readonly ["block.json", "index.js", "edit.js", "save.js", "style.scss", "editor.scss", "block.php"]; declare const ASSET_URL_MODULE: "asset-urls.mjs"; declare const FONT_LICENSES_FILE: "font-licenses.txt"; type GeneratedSourcePath = typeof GENERATED_REGISTERED_BLOCK_PATHS$1[number] | typeof ASSET_URL_MODULE | typeof FONT_LICENSES_FILE; interface GeneratedSourceFile { path: GeneratedSourcePath; kind: GeneratedSourceKind; content: string; hash: string; operation: AuthoringFileOperation; } interface GeneratedSourceManifestEntry { path: string; kind: GeneratedSourceKind | 'asset'; contentHash: string; operation: AuthoringFileOperation; templateVersion: typeof REGISTERED_BLOCK_TEMPLATE_VERSION$1; sourcePlanHash: string; } interface GeneratedSourceManifest { templateVersion: typeof REGISTERED_BLOCK_TEMPLATE_VERSION$1; sourcePlanHash: string; /** Pin used for this headless capability check; it is not evidence for every WordPress site. */ registry: AuthoringRegistryIdentity; files: GeneratedSourceManifestEntry[]; } interface GeneratedRegisteredBlock { assets: GeneratedAssetFile[]; /** The exact native template emitted into edit.js, also used by runtime proof. */ template: TemplateNode[]; templateVersion: typeof REGISTERED_BLOCK_TEMPLATE_VERSION$1; sourcePlanHash: string; files: GeneratedSourceFile[]; manifest: GeneratedSourceManifest; } declare class AuthoringGenerationError$1 extends Error { readonly reason: string; readonly source: { path: string; }; constructor(reason: string, sourcePath: string); } type TemplateNode = [string, Record, TemplateNode[]?]; /** * Compile a confirmed declarative plan into the static source files a WordPress block build * expects. This intentionally does not call convert/finalize: that path handles post content, * while this one has a stricter code-generation boundary and its own parsers. */ interface RegisteredBlockOutputPlan { files: ReadonlyArray<{ path: string; operation: AuthoringFileOperation; }>; } /** * Derive the exact output map from a reviewed plan without materializing generated source. * Preview uses this to bind its destination fingerprint before confirmation. */ declare function planRegisteredBlockOutput$1(input: AuthoringPlan$1): RegisteredBlockOutputPlan; /** * Compile a confirmed declarative plan into the static source files a WordPress block build * expects. This intentionally does not call convert/finalize: that path handles post content, * while this one has a stricter code-generation boundary and its own parsers. */ declare function compileRegisteredBlock$1(input: AuthoringPlan$1): GeneratedRegisteredBlock; /** Typed JSON emitter for the API-v3 metadata document. */ declare function emitBlockJson$1(plan: Pick, allowedBlocks?: string[]): string; /** Typed JavaScript emitter. The client registers using metadata, never a generated duplicate. */ declare function emitIndexJs$1(): string; /** Typed JSX emitter for a static InnerBlocks editor surface. */ declare function emitEditJs$1(template: TemplateNode[], allowedBlocks: string[], lock: AuthoringPlan$1['locking']['mode'], assets?: readonly GeneratedAssetFile[]): string; /** Typed JSX emitter for static saved markup: native inner blocks own all planned content. */ declare function emitSaveJs$1(): string; /** * Render the versioned, root-owned style subset from declarative plan outcomes. * * Native outcomes belong to the native blocks in the structure and dropped outcomes deliberately * produce no CSS. Token values are derived as WordPress preset references; scoped CSS outcomes * can only use an allowlisted declaration and a value that cannot introduce CSS structure. */ declare function emitScss$1(outcomes: readonly AuthoringStyleOutcome[], rootClass: string, unconstrainedRoot?: boolean): string; /** Typed PHP emitter. It registers the package directory, letting WordPress load block.json metadata. */ declare function emitPhp$1(): string; /** Parse every generated source type before any caller can write it to disk. */ declare function validateGeneratedSources$1(files: readonly GeneratedSourceFile[]): void; /** Validate metadata with the pinned WordPress API-v3 JSON schema through AJV, never a Zod subset. */ declare function validateBlockMetadata$1(metadata: unknown): void; interface Declaration { /** Lowercased longhand property name. */ property: string; /** Trimmed value, `!important` removed. */ value: string; /** The shorthand this was expanded from, when it was. Reported so warnings name what the author wrote. */ shorthand?: string; /** Whether the author marked it `!important`. Drives last-wins precedence, then discarded. */ important?: boolean; /** * Where it was authored — a class selector like `.hero` for a `