Skip to content

API & types

Specifier What it is
emdash-header-footer-code headerFooterCode() descriptor factory and types.
emdash-header-footer-code/plugin createPlugin() runtime and types, for wrapper packages.
emdash-header-footer-code/admin The React admin page, loaded by EmDash.

Returns the EmDash plugin descriptor. Use it in astro.config.mjs.

interface HeaderFooterCodeOptions {
/** Module that exports `createPlugin`. Defaults to "emdash-header-footer-code/plugin". */
entrypoint?: string;
}

The descriptor registers the plugin with id header-footer-code, format native, and one admin page, /snippets, labelled Header & Footer Code.

Exported from emdash-header-footer-code/plugin. Builds the runtime plugin. Call it from a wrapper entrypoint to add transforms.

interface HeaderFooterCodeRuntimeOptions {
/** Appended after the built-in transforms (none in v0.1). */
transforms?: Transform[];
}
Type Root /plugin
Transform ✅ ✅
TransformContext ✅ ✅
TransformResult ✅ ✅
Snippet ✅ ✅
HeaderFooterCodeRuntimeOptions ✅

hooks.page-fragments:register, and nothing else.

The plugin uses two EmDash storage collections, snippets (indexed on createdAt) and changelog (indexed on at), plus one KV state record that holds the revision number and the kill switch.