/** A value that survives `JSON.parse(JSON.stringify(v))` unchanged. */ export type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue; }; /** * One file's parsed frontmatter. * * **Values are JSON-serializable, always.** Frontmatter crosses the sandbox↔host * postMessage boundary and is written to the `mdx-metadata.json` sidecar, so a * `Date`, a function, or a `undefined`-valued key either throws on the wire or * silently disappears through JSON. The YAML parser is what enforces this in * practice (it yields plain JSON values); the type states the contract so a producer * that builds frontmatter programmatically cannot claim otherwise. * * **Emitter identity semantics.** The metadata store hands out the SAME object * reference for a given file until that file's frontmatter changes, and emits a NEW * object when it does. Consumers may therefore use reference equality as a * change signal (React deps, memo keys) — but must treat the object as **frozen in * spirit**: mutating it edits every other consumer's copy, and the next emission * replaces it wholesale rather than merging. * * An **empty** frontmatter is not stored at all. Both the runtime scan and the CLI * emitter drop a file whose parsed frontmatter has zero keys, so `{}` never appears * as a value — absence and emptiness are the same state, and a consumer that * distinguishes them is relying on something neither side provides. */ export type Frontmatter = Record; /** * True when `value` is a plain object usable as a {@link Frontmatter} envelope: * a non-null, non-array object. Deliberately shallow — this checks the ENVELOPE, * not the values, because the values are open by design. Use * {@link isJsonSerializable} when a producer needs the deeper guarantee. */ export declare function isFrontmatterEnvelope(value: unknown): value is Frontmatter; /** * True when `value` round-trips through JSON unchanged in shape — no functions, no * `undefined`, no `Date`, no cycles, no non-finite numbers. * * For a PRODUCER (the CLI emitter, an authoring tool) to check what it is about to * write. The consume side does not re-run this: it reads JSON, so anything it parsed * is serializable by construction. */ export declare function isJsonSerializable(value: unknown, seen?: Set): boolean;