EnglishSwitch to English
打开导航

API 参考

v1.0.0-alpha.14 · 仓库基线 的创作面只覆盖 6 个面向使用者的包。已退役的 alpha 包与内部子路径都不是创作面。

01 / 接口规则

创作从产品包开始。

当前文档、starter 与 dogfood 都使用这 6 个受支持的接口。Loader、action 与表单语义已在 0.42.0 冻结(ADR-0122);框架 session、active cache 与 streaming 不在当前契约内,且尚未分配版本。

02 / 受支持的产品面

6 个包,一条应用路径。

每个包对应一个明确的使用者决策;被吸收的实现包保持私有。

@openelement/protocol@openelement/protocol

跨系统契约:编译器、运行时与构建共享的 Part Program IR、错误方言与准入描述符(#1557)。

零依赖、仅装契约:章程禁止逻辑在此生长。通常通过转售这些契约的包间接消费。仓库基线——等待 alpha.11 列车的首次发布。
root./app-model./client-assets./data+18 more
核心
@openelement/element@openelement/element

受支持的 Custom Element 创作面,覆盖 JSX、DSD、hydration、signals 与样式——#1557 拆分后的纯运行时包。

独立的元素创作从这里开始。以 `@element` 装饰的 `OpenElement` 类和 `@property` 状态创作编译元素;`StyleSheet` 与 signal 辅助函数同出包根。@experimental 新增:`element`/`property` 装饰器内在量(#1209)与危险键守卫 `isDangerousKey`、`injectPropsSafe`、`DANGEROUS_KEYS`(#1214)。
root./authoring./base./build-utils+7 more
核心
@openelement/compiler@openelement/compiler

构建期 TSX-to-Part-Program 编译器及其 Vite 插件边界;唯一携带 TypeScript 依赖的包(#1557)。

仅构建期工具——绝不进入浏览器/运行期依赖图。通常通过 `@openelement/router` 构建驱动;独立插件在 `@openelement/compiler/vite`。仓库基线——等待 alpha.11 列车的首次发布。
root./vite
构建
@openelement/router@openelement/router

应用与构建面:页面、路由、island、请求/渲染语义、Vite 集成、静态生成与 Nitro 输出。

用 `definePage` 与 `defineIslandConfig` 进行应用创作。构建使用 `@openelement/router/vite` 的 `openPipeline()`/`openElement()` 或生成的构建任务。插件顺序、manifest 与内容扫描属于 router 的实现细节。
root./cli/build./cli/start./document+9 more
核心
@openelement/create@openelement/create

安装即用的 starter,零上下文的使用者入口。

生成的项目暴露 `dev`、`check`、`test`、`build`、`start` 与 `preview`。starter 只导入产品包。
root./install-command
构建
@openelement/ui@openelement/ui

可选原语,仅在已证明行为可复用时保留。

使用 OpenElement 不依赖 UI 包。网站特有的品牌、hero、lab 与布局工件不属于 UI 包的契约。
root./instance-state./manifest./open-button+6 more
可选

※ 内部子路径(router 请求管线、element hydration 模块)仍可被工具导入,但不携带兼容性承诺。公开类型面是显式的——v1.0.0-alpha.14 线上没有 export-star 缝隙。

由 pnpm --dir tools/repo run interface:snapshot 从仓库真值生成,并对照每个包的 exports map 做机器校验。

03 / 导出参考

每一个记录在案的导出,都有锚点。

以下条目由参考生成器从各包的 exports map 枚举——名称、类别、稳定性级别、JSDoc 摘要、声明的签名与选项表均为生成事实,绝不手工复制。锚点与该导出生成的搜索记录一一对应。

Action@openelement/protocol · roottypepublic

Route action: handles form submissions for a page route.

Action<T, Env, Platform, Route>

packages/protocol/src/data.ts:64
ACTION_FETCH_HEADER@openelement/protocol · rootconstpublic

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"

packages/protocol/src/data.ts:125
ActionContext@openelement/protocol · rootinterfacepublic

Context passed to a route action function (extends loader context).

ActionContext<Env, Platform, Route>

formData: FormData (必填); request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:47
ActionResult@openelement/protocol · roottypepublic

Wire shape returned to the JavaScript form-enhancement path. The no-JS path never sees this: it gets the equivalent semantics as plain HTTP (303 on success, 422 with the re-rendered form on validation failure, redirect/error as status codes). Success carries no data envelope. The application-loop contract makes a successful non-GET action answer 303 (PRG) — the framework never answers 200 with a rendered page, or with a success document, for a successful mutation — so the fetch channel answers `{ type: 'redirect' }` naming the PRG target and the authored return value is discarded by design. Success data travels the PRG target instead (query state the loader re-runs with, which the props projector then maps; see the router guide's "Form actions" section). The union previously declared a `{ type: 'success' }` member that no code path ever emitted — removed so the type matches the wire. Error outcomes (CSRF 403, unknown action 404, unparseable body 400, unexpected 500) are NOT part of this union: since #863 they answer RFC 9457 Problem Details with the PROBLEM_JSON_MEDIA_TYPE content type — see ProblemDetails.

ActionResult<Failure>

packages/protocol/src/data.ts:92
ApiRouteDecl@openelement/protocol · rootinterfacepublic

One API route declaration in the generated entry descriptor.

ApiRouteDecl

kind: "api" (必填); path: string (必填); varName: string (必填); filePath: string (必填); importPath: string (必填)

packages/protocol/src/ssg.ts:151
AppShellConfig@openelement/protocol · roottypepublic

Application shell declaration: `false` disables the shell entirely, `'default'` uses the built-in shell, and the object form names a tag with the module path that defines it (`import`, resolved like a {@link FrameworkOptions.middleware.use } entry) plus the compiled shell properties the router injects per route.

AppShellConfig

packages/protocol/src/framework.ts:96
AppShellDecl@openelement/protocol · rootinterfacepublic

The app shell module a build resolves: tag, import path, and serialized props.

AppShellDecl

tagName: string (必填); importPath: string (必填); props: Record<string, unknown> (必填)

packages/protocol/src/ssg.ts:248
AppShellPlan@openelement/protocol · rootinterfacepublic

The resolved app shells a build ships: the default shell plus named layouts.

AppShellPlan

default: ResolvedAppShell (必填); layouts: Record<string, ResolvedAppShell> (必填)

packages/protocol/src/ssg.ts:258
AuthoringErrorCode@openelement/protocol · rootconstpublic

Attribute/authoring-surface failures (phase `validation`).

{ readonly INVALID_TAG_NAME: "OE_INVALID_TAG_NAME"; readonly UNSAFE_META_ATTRIBUTE: "OE_UNSAFE_META_ATTRIBUTE"; readonly INVALID_STRUCTURED_DATA: "OE_INVALID_STRUCTURED_DATA"; readonly UNTRUSTED_HTML_SINK: "OE_UNTRUSTED…

packages/protocol/src/errors.ts:276
BuildArtifacts@openelement/protocol · rootinterfacepublic

Result returned by the OpenElement build pipeline.

BuildArtifacts

pages: BuildPageArtifact[] (必填) — Generated HTML pages.; manifest: BuildManifestArtifact (必填) — Build manifest.; clientAssets: BuildClientAsset[] (必填) — Client-side assets (island bundles, CSS, etc).; warnings: string[] (必填) — Non-fatal warnings.; errors: string[] (必填) — Fatal errors.; success: boolean (必填) — Whether the build succeeded.

packages/protocol/src/ssg.ts:512
BuildClientAsset@openelement/protocol · rootinterfacepublic

A single client asset emitted by the build pipeline.

BuildClientAsset

fileName: string (必填); source: string | Uint8Array<ArrayBufferLike> (必填); sizeBytes.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; sizeBytes.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; sizeBytes.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; sizeBytes.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; sizeBytes.valueOf: () => number (必填) — Returns the primitive value of the specified object.; sizeBytes.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/ssg.ts:505
BuildI18nOptions@openelement/protocol · rootinterfacepublic

i18n configuration for the build pipeline.

BuildI18nOptions

locales: string[] (必填); defaultLocale?: string (可选)

packages/protocol/src/ssg.ts:458
BuildIslandInput@openelement/protocol · rootinterfacepublic

A single island input to the build pipeline.

BuildIslandInput

tagName: string (必填); modulePath: string (必填); isPackage?: boolean (可选); hydrate?: IslandDeliveryStrategy (可选); ssr?: boolean (可选); dsd?: boolean (可选); source?: "local" | "package" | "nested" (可选); reason?: string (可选)

packages/protocol/src/ssg.ts:436
BuildManifestArtifact@openelement/protocol · rootinterfacepublic

Manifest produced by the build pipeline.

BuildManifestArtifact

routes: { kind: "page" | "api"; path: string; tagName?: string; isDynamic: boolean; }[] (必填); islands: BuildIslandInput[] (必填); requestTimeRoutes?: string[] (可选) — Paths served at request time (renderIntent mode 'dynamic'). Absent for pure-static builds.

packages/protocol/src/ssg.ts:494
BuildOutputOptions@openelement/protocol · rootinterfacepublic

Output configuration for the build pipeline.

BuildOutputOptions

root?: string (可选) — Project root directory.; outDir?: string (可选) — Output directory relative to root.; base?: string (可选) — Base URL path.

packages/protocol/src/ssg.ts:448
BuildPackageIslandOptions@openelement/protocol · rootinterfacepublic

Package island configuration for the build pipeline.

BuildPackageIslandOptions

packages?: string[] (可选) — Package names that may expose island declarations.

packages/protocol/src/ssg.ts:464
BuildPageArtifact@openelement/protocol · rootinterfacepublic

A single generated HTML page artifact.

BuildPageArtifact

path: string (必填); html: string (必填); errors: { message: string; route?: string; }[] (必填) — Errors collected while rendering this page.

packages/protocol/src/ssg.ts:486
BuildPlan@openelement/protocol · rootinterfacepublic

Framework-agnostic plan consumed by the OpenElement build pipeline.

BuildPlan

options.renderer?: "native" | "lit" (可选) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderDsd); 'lit' renders LitElement pages through; options.routesDir?: string (可选) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; options.islandsDir?: string (可选) — Directory island modules are discovered in. Defaults to `app/islands`.; options.componentsDir?: string (可选) — Directory non-route components live in. Defaults to `app/components`.; options.packageIslands?: string[] (可选) — Extra package names whose island modules the build admits, e.g. `['@openelement/ui']`.; options.appShell?: AppShellConfig (可选) — Application shell declaration; `false` disables the shell, `'default'` uses the built-in one.; options.layouts?: LayoutsConfig (可选) — Per-layout shell declarations keyed by layout name.; options.mode?: "ssg" (可选) — Build mode. 'ssg' (default) generates static HTML.; options.headExtras?: string (可选) — @dangerous injected as-is, only use with controlled content; options.html?: { lang?: string; title?: string; } (可选) — Document `<html>` attributes: the `lang` the document declares and the default `<title>`.; options.inject?: { stylesheets?: Array<string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | bool… (可选) — Document head/body injection channels: external stylesheets, scripts, and trusted raw head fragments.; options.ssr?: { noExternal?: (string | RegExp)[]; } (可选) — SSR bundling switches; `noExternal` forces the named packages through the SSR bundle instead of an external import.; options.island?: { upgradeStrategy?: HydrationStrategy; } (可选) — Island defaults applied to every island the build discovers.; options.build?: { outDir?: string; manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; }; } (可选) — Build output switches: the output directory and the advisory manifest budgets.; options.viewTransition?: boolean (可选) — Enable the View Transitions API for client navigations. Defaults to true.; options.speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (可选) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; options.middleware?: { cors?: boolean; corsOrigin?: string | string[]; corsOriginModule?: string; requestId?: boolean; logger?: boolean; securityHeaders?: boolean; csp?: { policy?:… (可选) — Request-time middleware switches, composed outside the framework handler.; routes: BuildRouteInput[] (必填) — Discovered page and API routes.; islands: BuildIslandInput[] (必填) — Discovered local and package islands.; output.root?: string (可选) — Project root directory.; output.outDir?: string (可选) — Output directory relative to root.; output.base?: string (可选) — Base URL path.; i18n?: BuildI18nOptions (可选) — i18n expansion options.; packageIslands.packages?: string[] (可选) — Package names that may expose island declarations.

packages/protocol/src/ssg.ts:470
BuildRouteInput@openelement/protocol · rootinterfacepublic

A single route input to the build pipeline.

BuildRouteInput

kind: "page" | "api" (必填) — Route kind: page or API.; path: string (必填) — Route path (e.g. '/about', '/blog/:slug').; filePath: string (必填) — Absolute or relative file path of the route module.; importPath: string (必填) — Import specifier used by generated entry code.; tagName?: string (可选) — Resolved tag name for page routes.; paramNames?: string[] (可选) — Dynamic segment names.; staticParams?: Record<string, string>[] (可选) — Static generation params produced by getStaticPaths().

packages/protocol/src/ssg.ts:418
camelToKebab@openelement/protocol · rootfunctionpublic

The one camelCase → kebab-case casing rule for custom-element attribute names, so `<x-el itemCount={5}>` round-trips as `item-count` on every boundary that derives an attribute name from a prop name: the compiler's property metadata, the SSR serializer, and the client attribute handling.

(str: string): string

packages/protocol/src/forbidden-sinks.ts:95
CemCompatibilityReport@openelement/protocol · rootinterfacepublic

The compatibility classification report for one custom element manifest.

CemCompatibilityReport

totalClassified.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; totalClassified.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; totalClassified.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; totalClassified.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; totalClassified.valueOf: () => number (必填) — Returns the primitive value of the specified object.; totalClassified.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; ssrCapableCount: number (必填); clientOnlyCount: number (必填); rejectedCount: number (必填); experimentalDomCount: number (必填); classifications: CompatibilityClassification[] (必填); summary: string (必填)

packages/protocol/src/manifest.ts:86
CemPropertyMetadata@openelement/protocol · rootinterfacepublic

One property entry of the compiled custom-elements-manifest metadata.

CemPropertyMetadata

name: string (必填); fieldName: string (必填); type: PropertyValueType (必填); attribute: string | null (必填); reflect: boolean (必填)

packages/protocol/src/part-program.ts:395
ClaimErrorCode@openelement/protocol · rootconstpublic

Claim failures: the existing DOM does not match the program that would own it. The value shipped in 1.0.0-alpha.3 and is kept verbatim; consumers match on it, and `PartProgramClaimError` is its only raiser.

{ readonly STRUCTURE_MISMATCH: "OPEN_ELEMENT_COMPILED_CLAIM_MISMATCH"; readonly PRE_UPGRADE_EVENTS_INVALID: "OE_CLAIM_PRE_UPGRADE_EVENTS_INVALID"; readonly DYNAMIC_NODE_IN_STATIC_REGION: "OE_CLAIM_DYNAMIC_NODE_IN_STATIC…

packages/protocol/src/errors.ts:240
ClientAssetManifest@openelement/protocol · rootinterfacepublic

The Phase 2 client build's delivery manifest, keyed by island identity.

ClientAssetManifest

entry: string (必填) — The island client entry URL ('' when no client bundle shipped).; islands: Record<string, ClientIslandAsset> (必填) — Compile-time island identity (delivery tag) -> emitted asset.; shared: string[] (必填) — Shared chunk URLs emitted by the client build (JS, neither entry nor island-dedicated).; styles: string[] (必填) — Preloadable island style asset URLs, sorted, base-prefixed. Shadow-component CSS cannot be applied as a document-level stylesheet — it cannot reach shadow trees — so the document channel's only role for these URLs is preload; the sheets themselves are adopted through the sheet adapters.

packages/protocol/src/client-assets.ts:36
ClientIslandAsset@openelement/protocol · rootinterfacepublic

The client asset one compile-time island identity resolves to.

ClientIslandAsset

file: string (必填) — Emitted asset URL (site-root relative, base-prefixed) of the chunk that carries the island module — its dedicated chunk, a shared chunk, or the client entry when the island has no chunk of its own.; strategy: IslandDeliveryStrategy (必填) — Delivery strategy resolved from the island declaration at build time.; preload?: boolean (可选) — True when the island's delivery strategy hydrates at load time, so the asset is a modulepreload candidate.

packages/protocol/src/client-assets.ts:19
ClientIslandEntry@openelement/protocol · rootinterfacepublic

Client island entry shape passed to entry generator.

ClientIslandEntry

tagName: string (必填); modulePath: string (必填); isPackage?: boolean (可选); exportName?: string (可选) — Optional named export to register as the custom element constructor. When set (package islands whose chunk dropped `export default` per #638), the client island factory reads `mod[exportName]` instead of `mod.default`. When absent, the factory falls back to `mod.default` (local/route islands).; strategy: IslandDeliveryStrategy (必填); strategySource?: "default" | "manifest" | "component" | "route" (可选); ssr?: boolean (可选); dsd?: boolean (可选); reason?: string (可选)

packages/protocol/src/ssg.ts:90
CompatibilityClassification@openelement/protocol · rootinterfacepublic

The per-tag verdict the compatibility scanner records: the tier a discovered tag was classified as, the human-readable `reason`, where the tag was found (`source`), and the SSR/DSD/hydration facts the verdict was derived from.

CompatibilityClassification

tagName: string (必填); tier: CompatibilityTier (必填); reason: string (必填); source: "local" | "package" | "nested" (必填); modulePath?: string (可选); ssr?: boolean (可选); dsd?: boolean (可选); hydrate?: string (可选)

packages/protocol/src/framework.ts:326
CompatibilityTier@openelement/protocol · roottypepublic

How far a discovered tag may participate in the build: 'ssr-capable' renders and hydrates, 'client-only' ships to the browser without server output, 'experimental-dom' is admitted with a downgraded guarantee, and 'rejected' fails the build.

CompatibilityTier

packages/protocol/src/framework.ts:319
COMPILED_MODULE_ABI_VERSION@openelement/protocol · rootconstpublic

Version of the compiled-module ABI: the statics a generated module carries (`__partProgram`, `__compiledProperties`, `__elementMetadata`, `__observedAttributes`, `__computedFields`) and the runtime facade binds. Bump when the generated-module contract changes shape; generated artifacts stamp both this and PART_PROGRAM_VERSION so consumers can tell format drift from release drift. v2: platform lifecycle callback bodies are emitted inside a boundary-capture wrapper calling the base class's `_captureError` — a generated module now requires a runtime facade carrying that protected method (the v1 shape emitted the bodies verbatim).

2

packages/protocol/src/part-program.ts:37
CompiledCemMetadata@openelement/protocol · rootinterfacepublic

The compiled custom-elements-manifest metadata block of one component.

CompiledCemMetadata

tagName: string (必填); className: string (必填); declaration: { name: string; module: string; } (必填); attributes: { name: string; fieldName: string; type: PropertyValueType; reflect: boolean; }[] (必填); members: CemPropertyMetadata[] (必填)

packages/protocol/src/part-program.ts:404
CompiledElementMetadata@openelement/protocol · rootinterfacepublic

The compiled element metadata the program carries for tooling consumers.

CompiledElementMetadata

tag: string (必填); className: string (必填); sourceFile: string (必填); properties: CompiledPropertyMetadata[] (必填); observedAttributes: string[] (必填); cem: CompiledCemMetadata (必填)

packages/protocol/src/part-program.ts:413
CompiledPropertyMetadata@openelement/protocol · rootinterfacepublic

One compiled

CompiledPropertyMetadata

name: string (必填); attribute: string | null (必填); type: PropertyValueType (必填); converter: PropertyValueType (必填); reflect: boolean (必填); default: SerializableValue (必填); computed?: boolean (可选) — True for computed fields (`= computed(() => ...)` in the source): their signal is derived from other property signals by the generated `__computedFields` factory, never seeded from attributes/props. Always paired with `attribute: null` and `reflect: false`.; deps?: string[] (可选) — Source signal names a computed field reads (declaration order).

packages/protocol/src/part-program.ts:376
CompilerErrorCode@openelement/protocol · rootconstpublic

Compiler (build-time) failures. The per-diagnostic `OEC####` codes stay on each diagnostic; these classify the family so a build failure is catchable as one thing.

{ readonly DIAGNOSTICS: "OE_COMPILER_DIAGNOSTICS"; readonly INVALID_SOURCE: "OE_COMPILER_INVALID_SOURCE"; }

packages/protocol/src/errors.ts:268
ComponentLayer@openelement/protocol · roottypepublic

The delivery layer a component belongs to: fully static DSD markup ('dsd-static'), DSD markup with a client island ('dsd-interactive'), a client-only island with no SSR output ('pure-island'), or a light-DOM element ('light-dom'). Recorded per component in the build manifest and consumed by the hydration scheduler.

ComponentLayer

packages/protocol/src/framework.ts:23
conditionLiteralAllowed@openelement/protocol · rootfunctionpublic

Operator/literal compatibility for when-Region tests (issue #1372). Both wire validators (this module and the server serializer's shared validator) close the space through this one predicate: - ordering operators require a finite numeric literal; - `equals`/`not-equals` admit a finite number, string, or boolean; - `truthy` admits exactly `true` or `false` (the recorded expectation).

(op: unknown, value: unknown): boolean

packages/protocol/src/part-program.ts:274
ConditionOperator@openelement/protocol · roottypepublic

The comparison operators a program condition supports.

ConditionOperator

packages/protocol/src/part-program.ts:250
ContextErrorCode@openelement/protocol · rootconstpublic

Community-context service lifecycle failures (phase `csr`).

{ readonly SERVICE_DISPOSED: "OE_CONTEXT_SERVICE_DISPOSED"; }

packages/protocol/src/errors.ts:222
CorsOriginConfig@openelement/protocol · roottypepublic

The CORS origin policy an API route declares.

CorsOriginConfig

packages/protocol/src/ssg.ts:118
CspConfig@openelement/protocol · rootinterfacepublic

The content-security-policy directives a route or document declares.

CspConfig

policy?: string (可选); nonce?: boolean (可选); reportOnly?: boolean (可选)

packages/protocol/src/ssg.ts:121
DATA_OE_LIGHT@openelement/protocol · rootconstpublic

Internal SSR provenance marker on light-mode host tags (#1148). Present only when the host's light subtree was server-rendered under the in-place activation contract: the client binds the existing DOM instead of clearing it, and a parent's activation walk prunes the nested host's subtree. Client rendering never writes it and it is never removed. The writer (internal/compiled/server) and readers (internal/compiled/runtime) import this constant; nothing writes the literal.

"data-oe-light"

packages/protocol/src/part-program.ts:473
DEFAULT_RENDER_ERROR_CODE@openelement/protocol · rootconstpublic

Default code for {@linkcode RenderError }. Deliberately NOT a member of {@linkcode ErrorCode}: that object is the scan target of the documentation site's error catalog, which requires every member to carry a phase/severity family rule. `RENDER_ERROR` is the pre-dialect value `RenderError` has always defaulted to — kept verbatim so callers that observe it keep working, and kept out of the catalogue because it is not a failure this package classifies, only a constructor default a caller may override.

"RENDER_ERROR"

packages/protocol/src/errors.ts:47
DocumentConfig@openelement/protocol · rootinterfacepublic

The document-level facts a build bakes into the generated entry.

DocumentConfig

lang: string (必填); title: string (必填); headExtras: string (必填); allowHeadExtrasScripts: boolean (必填)

packages/protocol/src/ssg.ts:240
DsdRenderMetrics@openelement/protocol · rootinterfacepublic

Per-render declarative-shadow-dom metrics the server records.

DsdRenderMetrics

tagName: string (必填); renderTimeMs.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; renderTimeMs.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; renderTimeMs.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; renderTimeMs.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; renderTimeMs.valueOf: () => number (必填) — Returns the primitive value of the specified object.; renderTimeMs.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; templateSize: number (必填); layer: ComponentLayer (必填); hasError: boolean (必填); nestingDepth: number (必填)

packages/protocol/src/render.ts:42
EachKeyErrorCode@openelement/protocol · rootconstpublic

Keyed-list identity failures. Shared by the server serializer and the client runtime (see `internal/compiled/each-key.ts`), so both executors reject the same data with the same code.

{ readonly ITEM_NOT_A_RECORD: "OE_EACH_ITEM_NOT_A_RECORD"; readonly KEY_NOT_ROUND_TRIPPABLE: "OE_EACH_KEY_NOT_ROUND_TRIPPABLE"; readonly DUPLICATE_KEY: "OE_EACH_KEY_DUPLICATE"; }

packages/protocol/src/errors.ts:159
EMPTY_CLIENT_ASSET_MANIFEST@openelement/protocol · rootconstpublic

The manifest a project without a client bundle carries.

ClientAssetManifest

packages/protocol/src/client-assets.ts:54
ENTRY_REGISTRATION_OWNERS@openelement/protocol · rootconstpublic

Property on the stub holding the generated entry's registration-ownership map (tag -> class it registered): a route module that self-registers its tag wins over the entry's registration, and on dev re-evaluation a fresh self-registered class must still win (#952).

"__openEntryDefined"

packages/protocol/src/registry-markers.ts:30
EntryDescriptor@openelement/protocol · rootinterfacepublic

The full build-time description of one generated entry: routes, islands, renderers, middleware, document, and app-shell plans.

EntryDescriptor

isSSG: boolean (必填); renderer?: "native" | "lit" (可选) — Page renderer selection (#1339). Absent/'native' keeps the compiled renderDsd page path byte-identical; 'lit' forks page tag resolution, page SSR and the client entry onto; imports: ImportDecl[] (必填); middleware: MiddlewareDecl[] (必填); fetchMiddleware?: string[] (可选) — `middleware.use` fetch middleware module paths (#858), in user-configured order. The entry renderer emits one `import * as __mw_N from '<path>'` per entry and composes each module's default export around the exported handler in onion order. Absent/empty when the app configures no fetch middleware, keeping the generated entry byte-identical to pre-#858 output.; apiRoutes: ApiRouteDecl[] (必填); pageRoutes: PageRouteDecl[] (必填); staticComponents: StaticComponentDecl[] (必填); islands: IslandDecl[] (必填); hasEnhancedForms?: boolean (可选) — True when any page route carries data-open-enhance forms (#569). Drives the dev island client script injection (#951): an island-free app with enhanced forms still needs the client entry in dev HTML.; ssrAdmissionPlan: SsrAdmissionPlan (必填); cemClassifications?: CompatibilityClassification[] (可选); renderers: RendererDecl[] (必填); middlewareScopes: MiddlewareScopeDecl[] (必填); document: DocumentConfig (必填); appShell: AppShellPlan (必填); upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (可选); i18n?: { locales: string[]; defaultLocale: string; } (可选) — Declared project locales. Absent for a single-locale site: the generated entry then emits no locale prefixes and the default-locale fallback, which is byte-identical to pre-i18n output.

packages/protocol/src/ssg.ts:264
ERROR_PREFIX@openelement/protocol · rootconstpublic

Error message prefix for all openElement errors.

"[openElement]"

packages/protocol/src/errors.ts:50
ErrorCode@openelement/protocol · rootconstpublic

Well-known error code constants for reference. String values are always accepted.

{ readonly SSR_RENDER_ERROR: "SSR_RENDER_ERROR"; readonly BOUNDARY_CAUGHT: "BOUNDARY_CAUGHT"; readonly UNKNOWN: "UNKNOWN"; }

packages/protocol/src/errors.ts:31
ErrorPhase@openelement/protocol · roottypepublic

The pipeline phase an error was raised in.

ErrorPhase

packages/protocol/src/errors.ts:80
ErrorSeverity@openelement/protocol · roottypepublic

How severe a framework error is.

ErrorSeverity

packages/protocol/src/errors.ts:78
ErrorTelemetryHook@openelement/protocol · roottypepublic

Callback receiving every reported {@linkcode OpenElementError} for telemetry.

ErrorTelemetryHook

packages/protocol/src/errors.ts:132
FacadeErrorCode@openelement/protocol · rootconstpublic

SSR/bootstrap failures raised by the public entries (phase `ssr` / `csr`).

{ readonly PROGRAM_MISSING: "OE_PROGRAM_MISSING"; readonly COMPOSITION_DEPTH: "OE_SSR_COMPOSITION_DEPTH"; readonly COMPUTED_FACTORY_MISSING: "OE_COMPUTED_FACTORY_MISSING"; readonly COMPUTED_READONLY: "OE_COMPUTED_READON…

packages/protocol/src/errors.ts:290
FORBIDDEN_ATTRIBUTE_NAMES@openelement/protocol · rootconstpublic

Forbidden sink names — the ONE canonical deny list for every Part Program boundary: the compiler semantic core, the protocol validator (internal/protocol/part-program.ts), and the compiled server/claim validator (internal/compiled/server/shared.ts). This module is import-free and host-free by design (same base-of-graph contract as void-tags.ts): all consumers import it, so a new forbidden sink cannot be enforced on one boundary and missed on another. This module owns the named-sink deny lists and the attribute-name policy built on them (the one shared safe-attribute-name predicate and the one camelCase→kebab-case casing rule); consumers delegate so the boundary cannot diverge. The lists are fail closed and case-insensitive (attribute and property names are compared lowercase, matching the HTML parser's name folding): - `FORBIDDEN_ATTRIBUTE_NAMES`: attribute names that must never be a static attribute or an `attr`/`bool` sink. `srcdoc` smuggles a full HTML document past attribute escaping; `innerHTML` is admissible only through the dedicated trusted-HTML `html` Part, never as a plain attribute name. - `FORBIDDEN_PROPERTY_NAMES`: `prop` sink names that would re-prototype or re-construct the target element (prototype-pollution primitives). - `RAW_TEXT_TAGS`: raw-text elements are outside the compiled grammar — their content cannot be escaped by the serializer.

ReadonlySet<string>

packages/protocol/src/forbidden-sinks.ts:28
FORBIDDEN_PROPERTY_NAMES@openelement/protocol · rootconstpublic

Property names the compiler refuses as

ReadonlySet<string>

packages/protocol/src/forbidden-sinks.ts:31
ForbiddenSinkKind@openelement/protocol · roottypepublic

Sink categories the canonical deny list classifies.

ForbiddenSinkKind

packages/protocol/src/forbidden-sinks.ts:41
forbiddenSinkReason@openelement/protocol · rootfunctionpublic

Return a human-readable reason when `name` is a forbidden sink of `kind`, or null when the name is admissible. Unknown kinds fail closed with a reason instead of being waved through.

(kind: ForbiddenSinkKind, name: string): string | null

packages/protocol/src/forbidden-sinks.ts:48
frameworkError@openelement/protocol · rootfunctionpublic

One framework failure: {@linkcode OpenElementError} with the caller's code and the phase/severity/recoverability that phase implies. Every throw site in this package goes through this factory (or the `*ErrorCode` tables above) so a code, a phase and a recoverability answer cannot drift per site.

(code: string, message: string, options?: Omit<OpenElementErrorOptions, "code">): OpenElementError

packages/protocol/src/errors.ts:321
FrameworkOptions@openelement/protocol · rootinterfacepublic

The adapter-facing framework options: where routes, islands and components live, which renderer serializes pages, the application shell and layout declarations, the document `<html>`/head injection channels, and the request-time middleware switches. Every field is optional; the adapter applies its documented default. This is the type an application config file's default export is checked against, so the rendered option table and the actual config surface cannot drift.

FrameworkOptions

renderer?: "native" | "lit" (可选) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderDsd); 'lit' renders LitElement pages through; routesDir?: string (可选) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; islandsDir?: string (可选) — Directory island modules are discovered in. Defaults to `app/islands`.; componentsDir?: string (可选) — Directory non-route components live in. Defaults to `app/components`.; packageIslands?: string[] (可选) — Extra package names whose island modules the build admits, e.g. `['@openelement/ui']`.; appShell?: AppShellConfig (可选) — Application shell declaration; `false` disables the shell, `'default'` uses the built-in one.; layouts?: LayoutsConfig (可选) — Per-layout shell declarations keyed by layout name.; mode?: "ssg" (可选) — Build mode. 'ssg' (default) generates static HTML.; headExtras?: string (可选) — @dangerous injected as-is, only use with controlled content; html.lang?: string (可选); html.title?: string (可选); inject.stylesheets?: (string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[] (可选) — Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.; inject.scripts?: (string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str… (可选) — Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.; inject.headFragments?: string[] (可选) — @dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.; ssr.noExternal?: (string | RegExp)[] (可选); island.upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (可选); build.outDir?: string (可选) — Output directory for the build artifacts. Defaults to `dist`.; build.manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; } (可选) — Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.; viewTransition?: boolean (可选) — Enable the View Transitions API for client navigations. Defaults to true.; speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (可选) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; middleware.cors?: boolean (可选) — Enable the built-in CORS middleware.; middleware.corsOrigin?: string | string[] (可选) — Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.; middleware.corsOriginModule?: string (可选) — Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `appShell.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.; middleware.requestId?: boolean (可选) — Emit and honor a per-request id header.; middleware.logger?: boolean (可选) — Log each request through the built-in logger.; middleware.securityHeaders?: boolean (可选) — Attach the built-in security response headers.; middleware.csp?: { policy?: string; nonce?: boolean; reportOnly?: boolean; } (可选) — Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.; middleware.use?: string[] (可选) — Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `appShell.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configur…

packages/protocol/src/framework.ts:170
HYDRATION_STRATEGIES@openelement/protocol · rootconstpublic

Runtime list of supported hydration strategies; the single source of truth for the `HydrationStrategy` union. Consumed by island/registry validation and re-exported from the element root for app and build adapters.

readonly ["load", "idle", "visible", "only", "none"]

packages/protocol/src/framework.ts:28
HydrationHint@openelement/protocol · rootinterfacepublic

The hydration delivery hint a component or route carries.

HydrationHint

tagName: string (必填); layer: ComponentLayer (必填); hydrate?: "load" | "idle" | "visible" | "only" | "none" (可选)

packages/protocol/src/render.ts:22
HydrationStrategy@openelement/protocol · roottypepublic

Island hydration trigger: 'load' | 'idle' | 'visible' | 'only'.

"load" | "idle" | "visible" | "only" | "none"

packages/protocol/src/framework.ts:30
IDLE_FALLBACK_TIMEOUT_MS@openelement/protocol · rootconstpublic

Idle-hydration scheduling fallback (milliseconds) when neither `requestIdleCallback` nor `requestAnimationFrame` is available.

50

packages/protocol/src/policy.ts:70
ImportDecl@openelement/protocol · rootinterfacepublic

One module import the generated entry emits.

ImportDecl

from: string (必填); names: string[] (必填); alias?: string (可选)

packages/protocol/src/ssg.ts:111
isAttributeName@openelement/protocol · rootfunctionpublic

The wire-validator face of the one canonical attribute-name predicate (delegates to `./forbidden-sinks.ts`); exported for parity tests.

(value: unknown): value is string

packages/protocol/src/part-program.ts:515
ISLAND_ADMISSION@openelement/protocol · rootconstpublic

The static-sidecar descriptor router injects into the element compiler.

StaticSidecarDescriptor

packages/protocol/src/island-admission.ts:18
IslandDecl@openelement/protocol · rootinterfacepublic

One island the build admits: tag, module path, and delivery facts.

IslandDecl

tagName: string (必填); modulePath: string (必填); isPackage?: boolean (可选); exportName?: string (可选) — Optional named export to register as the custom element constructor. Set for package islands from the manifest declaration's `className` (the CEM-derived export class name), so the client island factory can read `mod[exportName]` after #638 removed `export default` from UI component chunks. Absent for local/route islands (which use default).; hydrate?: IslandDeliveryStrategy (可选); ssr?: boolean (可选); dsd?: boolean (可选); authoring?: "basic-element" | "third-party-wc" (可选); source?: "local" | "package" | "nested" (可选); reason?: string (可选)

packages/protocol/src/ssg.ts:174
IslandDeliveryStrategy@openelement/protocol · roottypepublic

Adapter-owned browser delivery strategy, including media-query admission.

IslandDeliveryStrategy

packages/protocol/src/ssg.ts:31
IslandOptions@openelement/protocol · rootinterfacepublic

Per-island delivery options (hydration strategy, SSR/DSD participation).

IslandOptions

hydrate?: "load" | "idle" | "visible" | "only" | "none" (可选) — Hydration strategy: - 'load': load immediately when module is imported - 'idle': defer to requestIdleCallback (default) - 'visible': use IntersectionObserver to defer until element is visible - 'only': client-only render, no DSD/SSR output Named `hydrate` to match `defineIslandConfig()` in the Router package — one option name across both packages.; dsd?: boolean (可选) — Whether to use DSD for SSR rendering of this island. Honored by the build-side island scan (via `defineIslandConfig`), not by `defineIsland()` itself: passing it in `IslandOptions` has no runtime effect.; ssr?: boolean (可选) — Whether this island may be admitted into server rendering. Like `dsd`, decided by the build-side island scan; inert when passed to `defineIsland()`.

packages/protocol/src/island.ts:8
IslandTransformOptions@openelement/protocol · rootinterfacepublic

Options for the build-time island source transform.

IslandTransformOptions

islandsDir: string (必填) — Directory containing island files (e.g. "app/islands"); filePath: string (必填) — Absolute or relative file path of the source being processed

packages/protocol/src/island.ts:42
IslandTransformResult@openelement/protocol · rootinterfacepublic

The island transform output: rewritten source plus extracted facts.

IslandTransformResult

code: string (必填) — Transformed source code with markers; islands: { tagName: string; filePath: string; }[] (必填) — Detected island entries; map?: string (可选) — Optional source map

packages/protocol/src/island.ts:50
isSafeAttributeName@openelement/protocol · rootfunctionpublic

The one safe-attribute-name predicate (#1033, #602). Attribute *names* are not escaped on any render path, so a name must be valid HTML attribute-name grammar (blocks quote/space injection), must not be an event handler (`on*`, case-insensitive), and must not be a forbidden sink (`innerhtml`/ `srcdoc` — case-insensitive). Every boundary that admits an attribute name — the compiler semantic core, the Part Program validator, the compiled server validator, and the SSR head/meta name checks — delegates here, so the rules cannot diverge per path.

(name: string): boolean

packages/protocol/src/forbidden-sinks.ts:81
ItemEventBinding@openelement/protocol · rootinterfacepublic

An event binding scoped to each item of an `each` region. The runtime attaches this listener to every item root node created by the region, making per-item handlers (onClick={this.select(row.id)}) expressible without fixed-path event parts.

ItemEventBinding

event: string (必填) — DOM event name ('click', 'input', …).; handler: string (必填) — Handler method name on the compiled class.; action: ProgramEventAction (必填) — The action to dispatch, same union as fixed event parts.; selector?: string (可选) — Optional child selector within the item template (e.g. '.probe-button'). When omitted, the listener attaches to the item root.

packages/protocol/src/part-program.ts:309
KernelErrorCode@openelement/protocol · rootconstpublic

Element-lifecycle failures: the kernel was driven outside its contract (phase `csr`).

{ readonly DISPOSED: "OE_KERNEL_DISPOSED"; readonly TAG_MISMATCH: "OE_KERNEL_TAG_MISMATCH"; readonly CLAIM_EXECUTOR_MISSING: "OE_KERNEL_CLAIM_EXECUTOR_MISSING"; readonly ROOT_NOT_OWNED: "OE_KERNEL_ROOT_NOT_OWNED"; reado…

packages/protocol/src/errors.ts:208
Loader@openelement/protocol · roottypepublic

Route loader: fetches data for a page route.

Loader<T, Env, Platform, Route>

packages/protocol/src/data.ts:56
LoaderContext@openelement/protocol · rootinterfacepublic

Context passed to a request-time ('dynamic') route loader.

LoaderContext<Env, Platform, Route>

request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:40
LocalePath@openelement/protocol · rootinterfacepublic

Locale-aware resolved path contract.

LocalePath

locale: string (必填); path: string (必填); localizedPath: string (必填); isDefaultLocalePath: boolean (必填)

packages/protocol/src/framework.ts:82
MAX_ACTION_BODY_BYTES@openelement/protocol · rootconstpublic

Request-body bound (bytes) the generated entry applies to action POST routes; larger uploads belong on API routes with explicit limits.

number

packages/protocol/src/policy.ts:57
MAX_COMPOSITION_DEPTH@openelement/protocol · rootconstpublic

Nested element expansion depth bound for `renderDsd`: cyclic component composition fails closed instead of recursing without end.

8

packages/protocol/src/policy.ts:51
Middleware@openelement/protocol · roottypepublic

Fetch middleware contract (#858): WinterCG shape, dialect-free — no Hono/h3 context object. Composed at the handler boundary in onion order (`use[0]` is outermost: it sees the request first and the response last), so it runs with identical semantics in the dev server, the `start` CLI, the e2e fixture server, and the Nitro production entry. A middleware may short-circuit by returning a Response without calling `next()`, or post-process the Response that `next()` returns. Module contract: a Middleware is the DEFAULT EXPORT of a module referenced from `middleware.use` by path (e.g. './app/middleware/auth.ts'). The generated server entry imports the module, so the middleware may close over module scope and import local helpers and third-party packages — it is a real module in the server module graph, never serialized source.

Middleware

packages/protocol/src/framework.ts:158
MiddlewareDecl@openelement/protocol · rootinterfacepublic

One middleware module the generated entry composes.

MiddlewareDecl

kind: "requestId" | "logger" | "cors" | "securityHeaders" | "csp" (必填); comment?: string (可选); config.corsOrigin?: CorsOriginConfig (可选); config.corsOriginModule?: string (可选) — Normalized import path of a module default-exporting `(origin: string) => string | undefined`. The generated entry imports the module and passes its default export to `cors({ origin })` — the callback is referenced, never serialized.; config.warnOnDefaultCors?: boolean (可选) — #1411: emit the default-CORS production advisory. Absent means "warn" (production builds); the dev server sets false so the first run is warning-free.; config.csp?: CspConfig (可选)

packages/protocol/src/ssg.ts:128
MiddlewareScopeDecl@openelement/protocol · rootinterfacepublic

The scope one middleware applies to (all routes or a named route set).

MiddlewareScopeDecl

varName: string (必填); scope: string (必填); importPath: string (必填)

packages/protocol/src/ssg.ts:233
OpenElementAttribute@openelement/protocol · rootinterfacepublic

One documented attribute of a custom element declaration.

OpenElementAttribute

name: string (必填); type?: string (可选); default?: string (可选); description?: string (可选); reflects?: boolean (可选); fieldName?: string (可选)

packages/protocol/src/manifest.ts:15
OpenElementBlogOptions@openelement/protocol · rootinterfacepublic

Blog options stored in the build context by

OpenElementBlogOptions

contentDir?: string (可选); basePath?: string (可选)

packages/protocol/src/framework.ts:37
OpenElementBuildContextLike@openelement/protocol · rootinterfacepublic

Minimal build context interface that sub-plugins can use.

OpenElementBuildContextLike

plugins: { [key: string]: unknown; blogOptions: OpenElementBlogOptions | null; navSections: OpenElementNavSection[]; headerNav: OpenElementHeaderNavLink[]; sitemapOptio… (必填); registerPlugin: (name: string, instance: unknown) => void (必填) — Register plugin data by name. Protocol level uses loose typing; concrete implementations should tighten the generic constraint.

packages/protocol/src/framework.ts:62
OpenElementCssPart@openelement/protocol · rootinterfacepublic

One documented CSS part of a custom element declaration.

OpenElementCssPart

name: string (必填); description?: string (可选)

packages/protocol/src/manifest.ts:38
OpenElementDeclaration@openelement/protocol · rootinterfacepublic

One custom element declaration in a package manifest: tag, members and delivery metadata.

OpenElementDeclaration

tagName: string (必填); className?: string (可选); superclassName?: string (可选); attributes?: OpenElementAttribute[] (可选); events?: OpenElementEvent[] (可选); slots?: OpenElementSlot[] (可选); cssParts?: OpenElementCssPart[] (可选); openElement.ssr?: boolean (可选); openElement.dsd?: boolean (可选); openElement.layer?: ComponentLayer (可选); openElement.hydrate?: "load" | "idle" | "visible" | "only" | "none" (可选); openElement.status?: "stable" | "experimental" (可选) — Stability marker from the owning package's manifest policy.; openElement.module?: string (可选); openElement.export?: string (可选); description?: string (可选)

packages/protocol/src/manifest.ts:56
OpenElementError@openelement/protocol · rootclasspublic

Framework error carrying a stable code, severity, phase and recoverability contract.

class OpenElementError extends Error

packages/protocol/src/errors.ts:100
OpenElementErrorOptions@openelement/protocol · rootinterfacepublic

Constructor options for {@linkcode OpenElementError}; every field is defaulted.

OpenElementErrorOptions

cause?: Error (可选); code?: string (可选); statusCode.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; statusCode.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; statusCode.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; statusCode.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; statusCode.valueOf: () => number (必填) — Returns the primitive value of the specified object.; statusCode.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; severity?: ErrorSeverity (可选); phase?: ErrorPhase (可选); recoverable?: boolean (可选)

packages/protocol/src/errors.ts:90
OpenElementEvent@openelement/protocol · rootinterfacepublic

One documented custom event of a custom element declaration.

OpenElementEvent

name: string (必填); type?: string (可选); description?: string (可选)

packages/protocol/src/manifest.ts:25
OpenElementExtensions@openelement/protocol · rootinterfacepublic

The openElement-specific extension block of a package manifest declaration.

OpenElementExtensions

ssr?: boolean (可选); dsd?: boolean (可选); layer?: ComponentLayer (可选); hydrate?: "load" | "idle" | "visible" | "only" | "none" (可选); status?: "stable" | "experimental" (可选) — Stability marker from the owning package's manifest policy.; module?: string (可选); export?: string (可选)

packages/protocol/src/manifest.ts:44
OpenElementI18nContextOptions@openelement/protocol · rootinterfacepublic

i18n options stored in the build context by

OpenElementI18nContextOptions

packages/protocol/src/framework.ts:55
OpenElementNavSection@openelement/protocol · rootinterfacepublic

Navigation section from

OpenElementNavSection

section: string (必填); items: { path: string; label: string; order?: number; }[] (必填)

packages/protocol/src/framework.ts:43
OpenElementPackageManifest@openelement/protocol · rootinterfacepublic

Package manifest of component declarations (not a Custom Elements Manifest).

OpenElementPackageManifest

schemaVersion: string (必填); packageName: string (必填); version: string (必填); description?: string (可选); author?: string (可选); license?: string (可选); homepage?: string (可选); repository?: string (可选); declarations: OpenElementDeclaration[] (必填)

packages/protocol/src/manifest.ts:69
OpenElementRequestHandler@openelement/protocol · roottypepublic

The host-neutral request handler every runtime adapter and generated server entry exposes: a WinterCG `(request, context?) => Response` with no server engine dialect baked in.

OpenElementRequestHandler<Env>

packages/protocol/src/runtime.ts:27
OpenElementRouteKind@openelement/protocol · roottypepublic

Host-agnostic route and asset contracts shared by app and build drivers.

OpenElementRouteKind

packages/protocol/src/app-model.ts:2
OpenElementRouteNode@openelement/protocol · rootinterfacepublic

One node of the host-agnostic route tree: the matched URL `path` and route kind, the source and module paths the drivers resolve, the optional registered tag and param names, and the nested `children`.

OpenElementRouteNode

kind: OpenElementRouteKind (必填); path: string (必填); filePath?: string (可选); importPath?: string (可选); tagName?: string (可选); paramNames?: string[] (可选); children?: OpenElementRouteNode[] (可选); meta?: Record<string, unknown> (可选)

packages/protocol/src/app-model.ts:9
OpenElementSlot@openelement/protocol · rootinterfacepublic

One documented slot of a custom element declaration.

OpenElementSlot

name: string (必填); description?: string (可选)

packages/protocol/src/manifest.ts:32
PageRouteDecl@openelement/protocol · rootinterfacepublic

One page route declaration in the generated entry descriptor.

PageRouteDecl

kind: "page" (必填); path: string (必填); varName: string (必填); filePath: string (必填); defaultTagName: string (必填); tagName: string (必填); importPath: string (必填); isDynamic?: boolean (可选); paramNames?: string[] (可选); streamManifest?: StreamRouteManifest (可选)

packages/protocol/src/ssg.ts:160
PART_PROGRAM_VERSION@openelement/protocol · rootconstpublic

The Part Program IR version this package defines (currently v1).

1

packages/protocol/src/part-program.ts:22
partAnchorEndMarker@openelement/protocol · rootfunctionpublic

The comment marker closing a part anchor in serialized program markup.

(index: number): string

toString: (radix?: number) => string (必填) — Returns a string representation of an object.; toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; valueOf: () => number (必填) — Returns the primitive value of the specified object.; toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/part-program.ts:451
partAnchorMarker@openelement/protocol · rootfunctionpublic

Anchor marker payloads shared by seed runtime consumers.

(index: number): string

toString: (radix?: number) => string (必填) — Returns a string representation of an object.; toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; valueOf: () => number (必填) — Returns the primitive value of the specified object.; toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/part-program.ts:446
PartProgram@openelement/protocol · roottypepublic

The serializable Part Program v1: one compiled component as data.

PartProgramV1

version: 1 (必填); tag: string (必填); root: ProgramRoot (必填); template: ProgramTreeNode[] (必填); parts: ProgramPart[] (必填); regions: ProgramRegionRecord[] (必填); dependencies: ProgramDependencyRecord[] (必填); locations: ProgramLocationRecord[] (必填); sourceMap: ProgramSourceMap (必填) — Compile-time provenance. The canonical in-memory artifact always carries it; the serialized module payload omits it (no runtime consumer reads it), so the validator accepts programs with or without it but still verifies it strictly when present.; metadata: CompiledElementMetadata (必填)

packages/protocol/src/part-program.ts:443
PartProgramV1@openelement/protocol · rootinterfacepublic

The one deterministic program consumed by all execution modes.

PartProgramV1

version: 1 (必填); tag: string (必填); root: ProgramRoot (必填); template: ProgramTreeNode[] (必填); parts: ProgramPart[] (必填); regions: ProgramRegionRecord[] (必填); dependencies: ProgramDependencyRecord[] (必填); locations: ProgramLocationRecord[] (必填); sourceMap: ProgramSourceMap (必填) — Compile-time provenance. The canonical in-memory artifact always carries it; the serialized module payload omits it (no runtime consumer reads it), so the validator accepts programs with or without it but still verifies it strictly when present.; metadata: CompiledElementMetadata (必填)

packages/protocol/src/part-program.ts:423
PROBLEM_JSON_MEDIA_TYPE@openelement/protocol · rootconstpublic

Media type of the RFC 9457 action error channel (#863).

"application/problem+json"

packages/protocol/src/data.ts:117
ProblemDetails@openelement/protocol · rootinterfacepublic

RFC 9457 Problem Details document (#863): the action error channel answers `application/problem+json` instead of the bespoke `{ type: 'error', error: { message } }` JSON, so HTTP tooling recognizes failures natively. With `type: 'about:blank'`, `title` is the HTTP reason phrase and `detail` carries the specific explanation. The wire shape is alpha-unfrozen; the 1.0 acceptance freezes it in this problem+json form.

ProblemDetails

type: string (必填) — URI reference identifying the problem type; 'about:blank' when none applies.; title: string (必填) — Short human-readable summary (the HTTP reason phrase for 'about:blank').; status.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (必填) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; detail?: string (可选) — Human-readable explanation specific to this occurrence.

packages/protocol/src/data.ts:105
ProgramAttrPart@openelement/protocol · rootinterfacepublic

String attribute sink bound to a Signal.

ProgramAttrPart

k: "attr" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); name: string (必填); path: number[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:168
ProgramBoolPart@openelement/protocol · rootinterfacepublic

Boolean attribute sink bound to a Signal.

ProgramBoolPart

k: "bool" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); name: string (必填); path: number[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:178
ProgramClassPart@openelement/protocol · rootinterfacepublic

Specialized fixed sinks make ownership explicit for class and style text.

ProgramClassPart

k: "class" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); path: number[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:188
ProgramCondition@openelement/protocol · rootinterfacepublic

One condition clause of a when part.

ProgramCondition

signal: string (必填); op: ConditionOperator (必填); value: string | number | boolean (必填)

packages/protocol/src/part-program.ts:260
ProgramDependencyRecord@openelement/protocol · rootinterfacepublic

One module dependency the compiled module graph records.

ProgramDependencyRecord

signal: string (必填); owner: { kind: "part" | "region"; index: number; } (必填); location: string (必填)

packages/protocol/src/part-program.ts:366
ProgramEachPart@openelement/protocol · rootinterfacepublic

A list part: repeats its template node per item of a bound signal.

ProgramEachPart

k: "each" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); key: string (必填); field?: string (可选) — Restatement of the item field for single-field templates; omitted when the item template binds multiple fields (each `ival`/`iattrs` slot then carries its own field).; item: ProgramTreeNode[] (必填); itemEvents?: ItemEventBinding[] (可选) — Per-item event bindings (#1556 IR v2): listeners attached to each item.; location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:324
ProgramElementNode@openelement/protocol · rootinterfacepublic

A static element node of the program tree.

ProgramElementNode

k: "el" (必填); id: string (必填); tag: string (必填); attrs: [string, string][] (必填); iattrs?: [string, string][] (可选) — Per-item attribute slots ([name, itemField]) — valid only inside an `each` item template. At mount/claim time the value resolves from the current item: `true` emits a bare attribute, `false`/`null`/`undefined` omit it, anything else serializes with String().; children: ProgramTreeNode[] (必填)

packages/protocol/src/part-program.ts:104
ProgramErrorCode@openelement/protocol · rootconstpublic

Program-shape failures: a Part Program (or one of its records) is malformed, or carries a value the wire format cannot express. Phase `validation`: these reject data before any DOM work starts.

{ readonly INVALID_PROGRAM: "OE_PROGRAM_INVALID"; readonly NOT_SERIALIZABLE: "OE_PROGRAM_NOT_SERIALIZABLE"; readonly INVALID_SLOT: "OE_PROGRAM_INVALID_SLOT"; readonly INVALID_SOURCE_SEGMENT: "OE_PROGRAM_INVALID_SOURCE_S…

packages/protocol/src/errors.ts:141
ProgramEventAction@openelement/protocol · roottypepublic

The action one event part dispatches.

ProgramEventAction

packages/protocol/src/part-program.ts:231
ProgramEventPart@openelement/protocol · rootinterfacepublic

An event binding part: listener wiring between DOM event and action.

ProgramEventPart

k: "event" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; event: string (必填); handler: string (必填); action: ProgramEventAction (必填); path: number[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:239
ProgramHtmlPart@openelement/protocol · rootinterfacepublic

Trusted-HTML content sink (alpha.9). The signal value must carry the runtime TrustedHtml capability; its HTML replaces the target element's content. The target's subtree is opaque to the claim path. The compiler emits this only for an explicit `innerHTML={this.<field>}` sink on an otherwise childless element — there is no implicit or discovery path to raw HTML.

ProgramHtmlPart

k: "html" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); path: number[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:213
ProgramItemValueNode@openelement/protocol · rootinterfacepublic

Item-value text slot; valid only inside an `each` item template. `field` names the item field rendered by this slot — multi-field item templates carry one slot per field, and the compiler always emits it.

ProgramItemValueNode

k: "ival" (必填); field: string (必填)

packages/protocol/src/part-program.ts:137
ProgramLocation@openelement/protocol · rootinterfacepublic

Exact compiler-owned location for one dynamic sink or range anchor.

ProgramLocation

id: string (必填); kind: "anchor" | "sink" (必填); path: number[] (必填); node?: string (可选)

packages/protocol/src/part-program.ts:90
ProgramLocationRecord@openelement/protocol · roottypepublic

A location record also makes the identity auditable without inspecting parts.

ProgramLocationRecord

packages/protocol/src/part-program.ts:98
ProgramPart@openelement/protocol · roottypepublic

The discriminated union of dynamic parts a program instantiates.

ProgramPart

packages/protocol/src/part-program.ts:342
ProgramPartAnchorNode@openelement/protocol · rootinterfacepublic

The anchor node marking where a part binds in the tree.

ProgramPartAnchorNode

k: "part" (必填); id: string (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/part-program.ts:126
ProgramPosition@openelement/protocol · rootinterfacepublic

Where a part sits relative to its anchor.

ProgramPosition

offset.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; offset.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; offset.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; offset.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; offset.valueOf: () => number (必填) — Returns the primitive value of the specified object.; offset.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; line: number (必填); column: number (必填)

packages/protocol/src/part-program.ts:59
ProgramPropPart@openelement/protocol · rootinterfacepublic

DOM property sink bound to a Signal; `path` is retained for seed consumers.

ProgramPropPart

k: "prop" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); name: string (必填); path: number[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:158
ProgramRefPart@openelement/protocol · rootinterfacepublic

A named ref slot is serializable; the generated class supplies the ref value.

ProgramRefPart

k: "ref" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; ref: string (必填); path: number[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:222
ProgramRegionRecord@openelement/protocol · rootinterfacepublic

One region the program tracks: the boundaries of a dynamic subtree.

ProgramRegionRecord

id: string (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; kind: "when" | "each" (必填); anchor: string (必填); end: string (必填); source: string (必填)

packages/protocol/src/part-program.ts:356
ProgramRoot@openelement/protocol · rootinterfacepublic

The root of one program tree: element, part anchor, or text.

ProgramRoot

id: "root" (必填); kind: RootMode (必填); nodes: string[] (必填)

packages/protocol/src/part-program.ts:43
ProgramSourceKind@openelement/protocol · roottypepublic

The kind of source record a program source map entry carries.

ProgramSourceKind

packages/protocol/src/part-program.ts:73
ProgramSourceMap@openelement/protocol · rootinterfacepublic

The program source map: authored spans projected onto emitted records.

ProgramSourceMap

version: 1 (必填); file: string (必填); records: ProgramSourceRecord[] (必填)

packages/protocol/src/part-program.ts:83
ProgramSourceRange@openelement/protocol · rootinterfacepublic

A half-open [start, end) range into the authored source text.

ProgramSourceRange

file: string (必填); start: ProgramPosition (必填); end: ProgramPosition (必填)

packages/protocol/src/part-program.ts:66
ProgramSourceRecord@openelement/protocol · rootinterfacepublic

One source-map record: the authored origin of one emitted node or part.

ProgramSourceRecord

id: string (必填); kind: ProgramSourceKind (必填); source: ProgramSourceRange (必填)

packages/protocol/src/part-program.ts:76
ProgramStylePart@openelement/protocol · rootinterfacepublic

A style binding part.

ProgramStylePart

k: "style" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); path: number[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:197
ProgramTextNode@openelement/protocol · rootinterfacepublic

A static text node of the program tree.

ProgramTextNode

k: "text" (必填); value: string (必填)

packages/protocol/src/part-program.ts:120
ProgramTextPart@openelement/protocol · rootinterfacepublic

A text interpolation part bound to one signal.

ProgramTextPart

k: "text" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:150
ProgramTreeNode@openelement/protocol · roottypepublic

The discriminated union of static tree nodes.

ProgramTreeNode

packages/protocol/src/part-program.ts:143
ProgramWhenPart@openelement/protocol · rootinterfacepublic

A conditional part: swaps template branches on a condition.

ProgramWhenPart

k: "when" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); test: ProgramCondition (必填); on: ProgramTreeNode[] (必填); off: ProgramTreeNode[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:293
PropertyValueType@openelement/protocol · roottypepublic

The serialized value-type tag of a compiled property default.

PropertyValueType

packages/protocol/src/part-program.ts:373
raiseFrameworkError@openelement/protocol · rootfunctionpublic

Raise one framework failure and never return: the throwing companion of {@linkcode frameworkError}. The per-module `fail(code, message)` micro-factories bind their failure surface's fixed {@linkcode ErrorPhase} here — one implementation, the phase as a parameter — so a code and a phase cannot drift apart per throw site.

(phase: ErrorPhase, code: string, message: string): never

packages/protocol/src/errors.ts:342
RAW_TEXT_TAGS@openelement/protocol · rootconstpublic

Elements whose text content must never be interpolated as markup.

ReadonlySet<string>

packages/protocol/src/forbidden-sinks.ts:38
ReadonlySignal@openelement/protocol · rootinterfacepublic

Read-only signal protocol used by computed values.

ReadonlySignal<T>

value: T (必填); subscribe: (fn: (value: T) => void) => Unsubscribe (必填); __@SIGNAL_BRAND@849.valueOf: () => boolean (必填) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:26
RendererDecl@openelement/protocol · rootinterfacepublic

One page renderer module registration.

RendererDecl

varName: string (必填); scope: string (必填); importPath: string (必填); depth.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; depth.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; depth.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; depth.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; depth.valueOf: () => number (必填) — Returns the primitive value of the specified object.; depth.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/ssg.ts:225
RenderError@openelement/protocol · rootinterfacepublic

One render failure record the SSR pipeline reports.

RenderError

code: string (必填); severity: "error" | "warning" (必填); phase: string (必填); tagName: string (必填); message: string (必填); recoverable: boolean (必填)

packages/protocol/src/render.ts:12
RenderOutput@openelement/protocol · rootinterfacepublic

The public result of one `renderDsd()` call: the serialized DSD `html`, the render errors collected while composing it (empty on success), the render metrics for the root component, and the hydration hints the client scheduler reads to upgrade islands.

RenderOutput

html: string (必填); errors: RenderError[] (必填); metrics: DsdRenderMetrics (必填); hydrationHints: HydrationHint[] (必填)

packages/protocol/src/render.ts:34
ResolvedAppShell@openelement/protocol · roottypepublic

The resolved shell for one plan slot: disabled (false) or a full declaration.

ResolvedAppShell

packages/protocol/src/ssg.ts:255
RootMode@openelement/protocol · roottypepublic

How the compiled component attaches its root: light DOM or a shadow root.

RootMode

packages/protocol/src/part-program.ts:40
RouteEntry@openelement/protocol · rootinterfacepublic

One route admitted by the scanner: URL `path`, source `filePath`, the route `type`, the generated variable name (`varName`) the entry binds it to, and the optional registration tag. {@link RouteEntry.definePage} and {@link RouteEntry.hasEnhancedForms} carry the two source-derived admission facts the generated entries branch on.

RouteEntry

path: string (必填); filePath: string (必填); type: "page" | "api" | "island" | "special" (必填); varName: string (必填); tagName?: string (可选); definePage?: boolean (可选) — True when the route module's default export is a definePage() definition (#960 — registration decoupling). The generated entry registers the page class under the path-derived fallback tag and IGNORES the tagName export for registration: on a definePage route the export only names a content element. Plain element routes keep tagName as their registration tag.; source?: string (可选) — Source text captured during scanning when includeSource is enabled.; hasEnhancedForms?: boolean (可选) — True when the page route source carries data-open-enhance (#569): the client entry must ship the form-enhancement layer even when the app has zero islands.; special?: SpecialFileType (可选); params?: string[] (可选)

packages/protocol/src/framework.ts:113
RouteInfoEntry@openelement/protocol · rootinterfacepublic

A single route metadata entry emitted as `routeInfo` by the generated SSG entry module (see entry-render-ssg.ts).

RouteInfoEntry

path: string (必填); filePath?: string (可选) — Route module file path. Read by the render pipeline: ssg-render.ts copies it into server-manifest.json for request-time (renderIntent 'dynamic') routes.; tagName: string (必填); module?: unknown (可选) — The route module namespace object (typed per-module at codegen time).; isDynamic: boolean (必填); paramNames: string[] (必填); rendering?: string (可选) — Rendering mode declared via renderIntent.mode ("static" when unset; the "auto" alias is rejected, #609).; hasAction?: boolean (可选) — True when the route module exports an action (request-time form POST).; streamManifest?: StreamRouteManifest (可选); params?: Record<string, string> (可选)

packages/protocol/src/ssg.ts:339
ROUTER_MODULE_VOCABULARY@openelement/protocol · rootconstpublic

The module vocabulary router injects into `analyzeModuleSemantics`.

readonly ModuleVocabularyDescriptor[]

packages/protocol/src/module-vocabulary.ts:17
RUNTIME_MESSAGES_ENABLED@openelement/protocol · rootconstpublic

Whether the authored error prose is kept: `true` everywhere except a production client build, the one context that defines `OE_RUNTIME_MESSAGES` to `false`. Stripping is a payload decision, so it belongs to the browser bundle only — server-side failures keep their prose.

boolean

packages/protocol/src/errors.ts:72
RuntimeAdapter@openelement/protocol · rootinterfacepublic

A host runtime adapter: exposes the fetch handler a server engine dispatches to.

RuntimeAdapter<Env>

name: string (必填); fetch: OpenElementRequestHandler<Env> (必填); prerender?: (() => AsyncIterable<RuntimePrerenderResult> | Iterable<RuntimePrerenderResult>) (可选)

packages/protocol/src/runtime.ts:32
RuntimeAdapterOptions@openelement/protocol · rootinterfacepublic

Options one runtime adapter is constructed with.

RuntimeAdapterOptions<Env>

name: string (必填); fetch: OpenElementRequestHandler<Env> (必填); prerender?: (() => AsyncIterable<RuntimePrerenderResult> | Iterable<RuntimePrerenderResult>) (可选)

packages/protocol/src/runtime.ts:39
RuntimeContext@openelement/protocol · rootinterfacepublic

runtime.ts - Runtime adapter protocol. Replacement boundary for Nitro, Workers, Node, Deno, or future fetch-compatible runtimes. Preserves openElement semantics while leaving concrete server engines outside this package.

RuntimeContext<Env>

env?: Env (可选); platform?: unknown (可选); params?: Record<string, string> (可选)

packages/protocol/src/runtime.ts:9
RuntimeErrorCode@openelement/protocol · rootconstpublic

Runtime execution failures raised while a compiled program is serialized, built into fresh DOM, or re-read on a signal write (phase `render`).

{ readonly LIST_VALUE_NOT_ARRAY: "OE_RUNTIME_LIST_VALUE_NOT_ARRAY"; readonly HOST_SIGNAL_MISSING: "OE_RUNTIME_HOST_SIGNAL_MISSING"; readonly HOST_HANDLER_MISSING: "OE_RUNTIME_HOST_HANDLER_MISSING"; readonly HOST_REF_MIS…

packages/protocol/src/errors.ts:172
SafeHtml@openelement/protocol · roottypepublic

Branded type: a string that has been HTML-escaped (safe for text content)

SafeHtml

packages/protocol/src/framework.ts:9
SerializableValue@openelement/protocol · roottypepublic

The JSON-serializable value shape a compiled property default admits.

SerializableValue

packages/protocol/src/part-program.ts:50
serializeClientAssetsModule@openelement/protocol · rootfunctionpublic

Serialize the manifest as the generated dist/server/client-assets.js module: pure structured data, no injection logic — consumers derive what they need from these values.

(manifest: ClientAssetManifest): string

entry: string (必填) — The island client entry URL ('' when no client bundle shipped).; islands: Record<string, ClientIslandAsset> (必填) — Compile-time island identity (delivery tag) -> emitted asset.; shared: string[] (必填) — Shared chunk URLs emitted by the client build (JS, neither entry nor island-dedicated).; styles: string[] (必填) — Preloadable island style asset URLs, sorted, base-prefixed. Shadow-component CSS cannot be applied as a document-level stylesheet — it cannot reach shadow trees — so the document channel's only role for these URLs is preload; the sheets themselves are adopted through the sheet adapters.

packages/protocol/src/client-assets.ts:66
ServerErrorCode@openelement/protocol · rootconstpublic

Compiled server/claim validation failures. The value shipped in 1.0.0-alpha.3 and is kept verbatim; `CompiledProgramValidationError` is its only raiser.

{ readonly PROGRAM_INVALID: "OPEN_ELEMENT_COMPILED_PROGRAM_INVALID"; readonly SINK_REFUSED: "OE_SERVER_SINK_REFUSED"; }

packages/protocol/src/errors.ts:256
ServerRouteContext@openelement/protocol · rootinterfacepublic

Canonical request-time/SSG server route context.

ServerRouteContext<Env, Platform, Route>

request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:25
ServerRouteMetadata@openelement/protocol · rootinterfacepublic

Context passed to a request-time ('dynamic') route loader. This is the server contract: the loader runs on the server with the Web-standard request, matched route params, the host environment and the platform object, and signals validation failure via fail()/redirect().

ServerRouteMetadata

path: string (必填); filePath: string (必填)

packages/protocol/src/data.ts:19
Signal@openelement/protocol · roottypepublic

Alias for APIs that accept either writable or read-only signals.

Signal<T>

packages/protocol/src/signal.ts:31
SIGNAL_BRAND@openelement/protocol · rootconstpublic

Runtime/type brand for signals created by the configured reactive engine.

typeof SIGNAL_BRAND

packages/protocol/src/signal.ts:11
SignalEngine@openelement/protocol · rootinterfacepublic

Signal engine protocol used by the framework's built-in adapter. This is a deliberate internal seam, not a public compatibility contract: the framework layer talks to signals only through this narrow interface so its call sites stay implementation-agnostic. The package ships and verifies exactly one engine implementation (`preact-engine`, backed by `@preact/signals-core`). Preact's own API is not Element public API, and arbitrary third-party engines are not promised; any future engine would be added behind this protocol rather than inline (charter decision — see #723).

SignalEngine

signal: <T>(initialValue: T) => WritableSignal<T> (必填); computed: <T>(fn: () => T) => ReadonlySignal<T> (必填); effect: (fn: () => void | Unsubscribe) => Unsubscribe (必填)

packages/protocol/src/signal.ts:46
SignalLike@openelement/protocol · rootinterfacepublic

Minimal signal-like object accepted by renderers and bindings.

SignalLike<T>

value: T (必填); subscribe: (fn: (value: T) => void) => Unsubscribe (必填); __@SIGNAL_BRAND@849.valueOf: () => boolean (必填) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:14
SpecialFileType@openelement/protocol · roottypepublic

Special file kinds the route scanner recognizes by filename: `renderer` and `middleware`.

SpecialFileType

packages/protocol/src/framework.ts:79
SpeculationRulesOptions@openelement/protocol · rootinterfacepublic

Speculation Rules configuration for SSG post-processing

SpeculationRulesOptions

prerender?: string[] (可选) — URL patterns to prerender (fully render in background before navigation).; prefetch?: string[] (可选) — URL patterns to prefetch (fetch HTML + resources without rendering).; exclude?: string[] (可选) — URL patterns to exclude from both prefetch and prerender.; eagerness?: "immediate" | "moderate" | "conservative" (可选) — Eagerness level for prerender rules.

packages/protocol/src/ssg.ts:392
SsgBehaviorOptions@openelement/protocol · rootinterfacepublic

User-facing SSG build behavior switches (OpenElementOptions['ssg']).

SsgBehaviorOptions

dynamicRouteFailure?: "fail" | "warn" (可选) — Policy for dynamic-route render failures during SSG. See {@link SsgRenderOptions.dynamicRouteFailure}.

packages/protocol/src/ssg.ts:63
SsgPageOutput@openelement/protocol · rootinterfacepublic

Per-page render diagnostics returned by renderRoute()

SsgPageOutput

html: string (必填) — Rendered HTML string; status.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (必填) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; redirect?: { location: string; status: number; } (可选) — Redirect outcome (3xx). When set, `html` holds an interim status page and the result must not be persisted as a normal 200 page.; notFound?: boolean (可选) — True when the route signalled not-found (404).; errors: RenderError[] (必填) — Render errors collected during rendering; componentCount: number (必填) — Number of DSD components rendered on this page; renderTimeMs: number (必填) — Total render time for all components on this page (ms)

packages/protocol/src/ssg.ts:312
SsgRenderEvidence@openelement/protocol · rootinterfacepublic

The per-build render evidence record the SSG engine emits for audit.

SsgRenderEvidence

i18nOptions?: { [key: string]: unknown; locales: string[]; defaultLocale?: string; } | null (可选); admissionDecisions?: SsrAdmissionDecision[] (可选) — SSR admission decisions from the plan that rendered the pages.; manifestBudget.islandKB?: number (可选); manifestBudget.totalJsKB?: number (可选); manifestBudget.pageKB?: number (可选); onPrintBuildManifest?: ((input: { root: string; outDir: string; phase: 3; headExtras?: string; budget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; }; }) => void | Prom… (可选)

packages/protocol/src/ssg.ts:370
SsgRenderOptions@openelement/protocol · rootinterfacepublic

Options passed to the shared SSG render pipeline.

SsgRenderOptions

root: string (必填); outDir: string (必填); base?: string (可选); headExtras?: string (可选); html.lang?: string (可选); html.title?: string (可选); middleware.csp?: { policy?: string; reportOnly?: boolean; nonce?: boolean; } (可选); upgradeStrategy?: string (可选); viewTransition?: boolean (可选); speculation?: boolean | Record<string, unknown> (可选); islandTagNames?: string[] (可选); routesDir?: string (可选); dynamicRouteFailure?: "fail" | "warn" (可选) — Policy for dynamic-route render failures (HTTP status >= 500, non-empty render errors, or a renderRoute throw) during SSG. - 'fail' (default): abort the build - a failed page must never ship as a normal 200 page. - 'warn': log the failure and skip the page (the page is not written and is not registered in the ISR manifest).

packages/protocol/src/ssg.ts:36
SsgRenderSummary@openelement/protocol · rootinterfacepublic

Summary of an SSG render run, returned by ssgRender().

SsgRenderSummary

staticNon200: { path: string; status: number; }[] (必填) — Static routes whose handler returned a non-200 status. hono/ssg drops these responses (defaultPlugin), so they are not written to disk; they are listed here and in the build log instead of disappearing silently.; warnings: string[] (必填) — Non-fatal warnings collected during the SSG run (sitemap generation failures, etc.). Surfaced here so the build summary / release evidence carries them instead of letting them disappear silently.

packages/protocol/src/ssg.ts:72
SSR_REGISTRY_ORIGINAL_DEFINE@openelement/protocol · rootconstpublic

Property on the SSR registry holding the TRUE original `define` method, captured before the generated entry installs its idempotent wrapper. The registry outlives vite dev SSR module re-evaluations, so without this the second evaluation would capture the already-wrapped `define` as its "original" and every forced re-registration would silently early-return through the previous wrapper (#1339 lit dev feedback).

"__openElementOrigDefine"

packages/protocol/src/registry-markers.ts:40
SSR_REGISTRY_STUB_MARKER@openelement/protocol · rootconstpublic

Marker property set to `true` on the SSR customElements stub. Readers must treat the marked registry as re-definable.

"__openElementSsrStub"

packages/protocol/src/registry-markers.ts:22
SsrAdmissionDecision@openelement/protocol · rootinterfacepublic

The build's admission verdict for one discovered tag: where the declaration lives (`modulePath`), how it was discovered (`source`), which render path it is admitted to, and the reason recorded for the manifest.

SsrAdmissionDecision

tagName: string (必填); modulePath: string (必填) — Module path of the island declaration. Empty for 'foreign' decisions: a foreign tag is consumed in JSX but declares no module the build owns.; source: "local" | "package" | "nested" | "foreign" (必填) — 'foreign' (#979): a third-party WC tag discovered by the foreign-tag scanner in page/island JSX — recorded for visibility only; SSR still treats it as an opaque passthrough (renderPath 'client-only').; renderPath: "client-only" | "rejected" | "ssr+client" (必填); reason: string (必填)

packages/protocol/src/render.ts:56
SsrAdmissionPlan@openelement/protocol · rootinterfacepublic

The build-time SSR admission decisions per component tag.

SsrAdmissionPlan

renderableTags: string[] (必填); clientOnlyTags: string[] (必填); rejectedTags: string[] (必填); reasons: Record<string, string> (必填); decisions: SsrAdmissionDecision[] (必填); cemClassifications?: CompatibilityClassification[] (可选); foreignTags?: string[] (可选) — #979: foreign custom-element tags discovered in page / island JSX that are neither local islands, package-manifest islands, nor openElement-authored elements. Visibility only — each tag also carries a source:'foreign' decision (renderPath 'client-only') and the SSR/behavior is unchanged (opaque passthrough).

packages/protocol/src/ssg.ts:207
SsrBundle@openelement/protocol · rootinterfacepublic

The server bundle facts the SSG engine consumes for stream rendering.

SsrBundle

packages/protocol/src/ssg.ts:361
STATIC_STYLES_MARKER@openelement/protocol · rootconstpublic

The one `<style>` element the server serializer emits as the first DSD template child when the class carries static styles (renderDsd parity — pages never upgrade, so their styles must ship in the payload). The claim path skips exactly this marked node; a marked node on a style-less class is claim drift and fails closed.

"data-oe-static-styles"

packages/protocol/src/part-program.ts:462
StaticComponentDecl@openelement/protocol · rootinterfacepublic

Build-host-only compiled component reached through a route's local import graph. These components participate in recursive SSR/SSG expansion but are not client islands and therefore add no hydration or browser entry.

StaticComponentDecl

tagName: string (必填); modulePath: string (必填); compilerInteractionEvents: string[] (必填) — Compiler-owned interaction events; empty means no inferred browser entry.

packages/protocol/src/ssg.ts:199
StrategySource@openelement/protocol · roottypepublic

Where an island's resolved hydration strategy came from.

StrategySource

packages/protocol/src/framework.ts:32
STREAM_FRAME_FORBIDDEN_TAGS@openelement/protocol · rootconstpublic

Tags a deferred frame cannot safely install into an owned Part range: the browser installer rejects any frame whose markup carries one of these.

readonly ["script", "style", "template", "iframe", "object", "embed", "base", "meta", "link"]

packages/protocol/src/stream-frame-policy.ts:26
STREAM_FRAME_UNSAFE_URL@openelement/protocol · rootconstpublic

Schemes that make a URL attribute unsafe in a streamed frame.

RegExp

packages/protocol/src/stream-frame-policy.ts:60
STREAM_FRAME_URL_ATTRIBUTES@openelement/protocol · rootconstpublic

URL-carrying attributes the frame check screens for script-bearing scheme obfuscation; only these attribute names are value-screened.

readonly ["href", "src", "action", "formaction", "xlink:href"]

packages/protocol/src/stream-frame-policy.ts:42
STREAM_FRAME_URL_CONTROL_MAX@openelement/protocol · rootconstpublic

Control characters at or below this code point are stripped before the URL-scheme test, so tab/newline/control obfuscation cannot smuggle a scheme past admission.

32

packages/protocol/src/stream-frame-policy.ts:55
STREAM_MAX_FIELDS@openelement/protocol · rootconstpublic

Deferred fields (declared streamed properties) one stream route's manifest may carry. The build scan, the server executor, and the browser seed contract enforce the same bound.

32

packages/protocol/src/policy.ts:24
STREAM_MAX_OWNERS@openelement/protocol · rootconstpublic

Part/Region owners one stream route's manifest may address in total across all deferred fields.

64

packages/protocol/src/policy.ts:30
STREAM_MAX_PAYLOAD_LENGTH@openelement/protocol · rootconstpublic

Serialized stream payload bound, as a string length in UTF-16 code units: one seed attribute or one deferred frame's markup may not exceed it. The server checks the JSON text and the rendered range before emitting; the browser checks the attribute before parsing.

number

packages/protocol/src/policy.ts:45
STREAM_MAX_SEED_PROPERTIES@openelement/protocol · rootconstpublic

Typed properties one streamed seed may carry: the browser seed contract rejects the WHOLE seed above this count, so an oversized component would silently fail to hydrate instead of failing loud at the server.

64

packages/protocol/src/policy.ts:37
STREAM_TIMEOUT_MS@openelement/protocol · rootconstpublic

Deferred-field resolution budget (milliseconds) for one streamed response: fields still pending when it expires are failed in place and the stream ends with the shell and whatever resolved.

30000

packages/protocol/src/policy.ts:64
StreamRouteManifest@openelement/protocol · rootinterfacepublic

Build-only route projection bound to a specific compiled page program.

StreamRouteManifest

program: { version: number; tag: string; sha256: string; } (必填); fields: { field: string; signal: string; owners: Array<{ kind: "part" | "region"; index: number; location: string; source: PartProgramV1["sourceMap"]["records"][number… (必填)

packages/protocol/src/ssg.ts:13
StyleErrorCode@openelement/protocol · rootconstpublic

Compiled-style application failures (phase `csr`).

{ readonly ADOPTED_STYLES_UNSUPPORTED: "OE_STYLES_ADOPTED_SHEETS_UNSUPPORTED"; readonly LIGHT_SINK_WITHOUT_DOCUMENT: "OE_STYLES_LIGHT_SINK_WITHOUT_DOCUMENT"; }

packages/protocol/src/errors.ts:228
StyleSheetLike@openelement/protocol · rootinterfacepublic

Minimal stylesheet contract (replaceSync + cssRules) satisfied by native and shim sheets.

StyleSheetLike

replaceSync: (text: string) => void (必填); cssRules: StyleSheetRule[] (必填)

packages/protocol/src/style-sheet.ts:14
StyleSheetRule@openelement/protocol · rootinterfacepublic

Cross-environment CSSStyleSheet abstraction. In browsers this delegates to the native CSSStyleSheet API. In SSR runtimes it falls back to a minimal in-memory implementation that exposes the subset used by OpenElement and renderDsd().

StyleSheetRule

cssText: string (必填)

packages/protocol/src/style-sheet.ts:9
UnsafeHtml@openelement/protocol · roottypepublic

Branded type: a string that is intentionally raw/untrusted HTML

UnsafeHtml

packages/protocol/src/framework.ts:12
unsafeStreamFrameAttribute@openelement/protocol · rootfunctionpublic

Whether a static attribute (name/value as authored into the Part Program) makes a streamed frame unsafely installable: event-handler, seed-spoofing, and srcdoc names fail outright, and URL-carrying names fail when the entity-decoded, control-stripped value carries a script scheme.

(name: string, value: string): boolean

packages/protocol/src/stream-frame-policy.ts:113
Unsubscribe@openelement/protocol · roottypepublic

Unsubscribe function returned by subscriptions and effects.

Unsubscribe

packages/protocol/src/signal.ts:8
validatePartProgram@openelement/protocol · rootfunctionpublic

Validate an unknown value as a Part Program v1. The validator is intentionally strict: unknown instruction kinds, missing ownership records and unsafe paths fail before a runtime can guess at their meaning.

(raw: unknown): asserts raw is PartProgram

packages/protocol/src/part-program.ts:876
VOID_TAGS@openelement/protocol · rootconstpublic

HTML void elements — the ONE canonical tag set for every serializer, validator, and compiler in the workspace (issue #1220, M4). This module is import-free and host-free by design: it sits at the base of the module graph so the DOM runtime (internal/core/html-escape.ts), the Part Program exchange artifact (internal/protocol/part-program.ts), and the compiler semantic core can all consume the same definition without an import cycle or a second source of truth. Content is the full HTML Standard void-element list, `param` included. Do not redefine this set anywhere else; internal/core/html-escape.ts and internal/protocol/part-program.ts re-export it, and __tests__/void-tags-convergence.test.ts enforces the single owner.

ReadonlySet<string>

packages/protocol/src/void-tags.ts:16
WritableSignal@openelement/protocol · rootinterfacepublic

Writable signal protocol used by openElement integrations.

WritableSignal<T>

value: T (必填); subscribe: (fn: (value: T) => void) => Unsubscribe (必填); __@SIGNAL_BRAND@849.valueOf: () => boolean (必填) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:21
OpenElementRouteKind@openelement/protocol · ./app-modeltypepublic

Host-agnostic route and asset contracts shared by app and build drivers.

OpenElementRouteKind

packages/protocol/src/app-model.ts:2
OpenElementRouteNode@openelement/protocol · ./app-modelinterfacepublic

One node of the host-agnostic route tree: the matched URL `path` and route kind, the source and module paths the drivers resolve, the optional registered tag and param names, and the nested `children`.

OpenElementRouteNode

kind: OpenElementRouteKind (必填); path: string (必填); filePath?: string (可选); importPath?: string (可选); tagName?: string (可选); paramNames?: string[] (可选); children?: OpenElementRouteNode[] (可选); meta?: Record<string, unknown> (可选)

packages/protocol/src/app-model.ts:9
ClientAssetManifest@openelement/protocol · ./client-assetsinterfacepublic

The Phase 2 client build's delivery manifest, keyed by island identity.

ClientAssetManifest

entry: string (必填) — The island client entry URL ('' when no client bundle shipped).; islands: Record<string, ClientIslandAsset> (必填) — Compile-time island identity (delivery tag) -> emitted asset.; shared: string[] (必填) — Shared chunk URLs emitted by the client build (JS, neither entry nor island-dedicated).; styles: string[] (必填) — Preloadable island style asset URLs, sorted, base-prefixed. Shadow-component CSS cannot be applied as a document-level stylesheet — it cannot reach shadow trees — so the document channel's only role for these URLs is preload; the sheets themselves are adopted through the sheet adapters.

packages/protocol/src/client-assets.ts:36
ClientIslandAsset@openelement/protocol · ./client-assetsinterfacepublic

The client asset one compile-time island identity resolves to.

ClientIslandAsset

file: string (必填) — Emitted asset URL (site-root relative, base-prefixed) of the chunk that carries the island module — its dedicated chunk, a shared chunk, or the client entry when the island has no chunk of its own.; strategy: IslandDeliveryStrategy (必填) — Delivery strategy resolved from the island declaration at build time.; preload?: boolean (可选) — True when the island's delivery strategy hydrates at load time, so the asset is a modulepreload candidate.

packages/protocol/src/client-assets.ts:19
EMPTY_CLIENT_ASSET_MANIFEST@openelement/protocol · ./client-assetsconstpublic

The manifest a project without a client bundle carries.

ClientAssetManifest

packages/protocol/src/client-assets.ts:54
serializeClientAssetsModule@openelement/protocol · ./client-assetsfunctionpublic

Serialize the manifest as the generated dist/server/client-assets.js module: pure structured data, no injection logic — consumers derive what they need from these values.

(manifest: ClientAssetManifest): string

entry: string (必填) — The island client entry URL ('' when no client bundle shipped).; islands: Record<string, ClientIslandAsset> (必填) — Compile-time island identity (delivery tag) -> emitted asset.; shared: string[] (必填) — Shared chunk URLs emitted by the client build (JS, neither entry nor island-dedicated).; styles: string[] (必填) — Preloadable island style asset URLs, sorted, base-prefixed. Shadow-component CSS cannot be applied as a document-level stylesheet — it cannot reach shadow trees — so the document channel's only role for these URLs is preload; the sheets themselves are adopted through the sheet adapters.

packages/protocol/src/client-assets.ts:66
Action@openelement/protocol · ./datatypepublic

Route action: handles form submissions for a page route.

Action<T, Env, Platform, Route>

packages/protocol/src/data.ts:64
ACTION_FETCH_HEADER@openelement/protocol · ./dataconstpublic

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"

packages/protocol/src/data.ts:125
ActionContext@openelement/protocol · ./datainterfacepublic

Context passed to a route action function (extends loader context).

ActionContext<Env, Platform, Route>

formData: FormData (必填); request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:47
ActionResult@openelement/protocol · ./datatypepublic

Wire shape returned to the JavaScript form-enhancement path. The no-JS path never sees this: it gets the equivalent semantics as plain HTTP (303 on success, 422 with the re-rendered form on validation failure, redirect/error as status codes). Success carries no data envelope. The application-loop contract makes a successful non-GET action answer 303 (PRG) — the framework never answers 200 with a rendered page, or with a success document, for a successful mutation — so the fetch channel answers `{ type: 'redirect' }` naming the PRG target and the authored return value is discarded by design. Success data travels the PRG target instead (query state the loader re-runs with, which the props projector then maps; see the router guide's "Form actions" section). The union previously declared a `{ type: 'success' }` member that no code path ever emitted — removed so the type matches the wire. Error outcomes (CSRF 403, unknown action 404, unparseable body 400, unexpected 500) are NOT part of this union: since #863 they answer RFC 9457 Problem Details with the PROBLEM_JSON_MEDIA_TYPE content type — see ProblemDetails.

ActionResult<Failure>

packages/protocol/src/data.ts:92
Loader@openelement/protocol · ./datatypepublic

Route loader: fetches data for a page route.

Loader<T, Env, Platform, Route>

packages/protocol/src/data.ts:56
LoaderContext@openelement/protocol · ./datainterfacepublic

Context passed to a request-time ('dynamic') route loader.

LoaderContext<Env, Platform, Route>

request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:40
PROBLEM_JSON_MEDIA_TYPE@openelement/protocol · ./dataconstpublic

Media type of the RFC 9457 action error channel (#863).

"application/problem+json"

packages/protocol/src/data.ts:117
ProblemDetails@openelement/protocol · ./datainterfacepublic

RFC 9457 Problem Details document (#863): the action error channel answers `application/problem+json` instead of the bespoke `{ type: 'error', error: { message } }` JSON, so HTTP tooling recognizes failures natively. With `type: 'about:blank'`, `title` is the HTTP reason phrase and `detail` carries the specific explanation. The wire shape is alpha-unfrozen; the 1.0 acceptance freezes it in this problem+json form.

ProblemDetails

type: string (必填) — URI reference identifying the problem type; 'about:blank' when none applies.; title: string (必填) — Short human-readable summary (the HTTP reason phrase for 'about:blank').; status.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (必填) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; detail?: string (可选) — Human-readable explanation specific to this occurrence.

packages/protocol/src/data.ts:105
ServerRouteContext@openelement/protocol · ./datainterfacepublic

Canonical request-time/SSG server route context.

ServerRouteContext<Env, Platform, Route>

request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:25
ServerRouteMetadata@openelement/protocol · ./datainterfacepublic

Context passed to a request-time ('dynamic') route loader. This is the server contract: the loader runs on the server with the Web-standard request, matched route params, the host environment and the platform object, and signals validation failure via fail()/redirect().

ServerRouteMetadata

path: string (必填); filePath: string (必填)

packages/protocol/src/data.ts:19
AuthoringErrorCode@openelement/protocol · ./errorsconstpublic

Attribute/authoring-surface failures (phase `validation`).

{ readonly INVALID_TAG_NAME: "OE_INVALID_TAG_NAME"; readonly UNSAFE_META_ATTRIBUTE: "OE_UNSAFE_META_ATTRIBUTE"; readonly INVALID_STRUCTURED_DATA: "OE_INVALID_STRUCTURED_DATA"; readonly UNTRUSTED_HTML_SINK: "OE_UNTRUSTED…

packages/protocol/src/errors.ts:276
ClaimErrorCode@openelement/protocol · ./errorsconstpublic

Claim failures: the existing DOM does not match the program that would own it. The value shipped in 1.0.0-alpha.3 and is kept verbatim; consumers match on it, and `PartProgramClaimError` is its only raiser.

{ readonly STRUCTURE_MISMATCH: "OPEN_ELEMENT_COMPILED_CLAIM_MISMATCH"; readonly PRE_UPGRADE_EVENTS_INVALID: "OE_CLAIM_PRE_UPGRADE_EVENTS_INVALID"; readonly DYNAMIC_NODE_IN_STATIC_REGION: "OE_CLAIM_DYNAMIC_NODE_IN_STATIC…

packages/protocol/src/errors.ts:240
CompilerErrorCode@openelement/protocol · ./errorsconstpublic

Compiler (build-time) failures. The per-diagnostic `OEC####` codes stay on each diagnostic; these classify the family so a build failure is catchable as one thing.

{ readonly DIAGNOSTICS: "OE_COMPILER_DIAGNOSTICS"; readonly INVALID_SOURCE: "OE_COMPILER_INVALID_SOURCE"; }

packages/protocol/src/errors.ts:268
ContextErrorCode@openelement/protocol · ./errorsconstpublic

Community-context service lifecycle failures (phase `csr`).

{ readonly SERVICE_DISPOSED: "OE_CONTEXT_SERVICE_DISPOSED"; }

packages/protocol/src/errors.ts:222
DEFAULT_RENDER_ERROR_CODE@openelement/protocol · ./errorsconstpublic

Default code for {@linkcode RenderError }. Deliberately NOT a member of {@linkcode ErrorCode}: that object is the scan target of the documentation site's error catalog, which requires every member to carry a phase/severity family rule. `RENDER_ERROR` is the pre-dialect value `RenderError` has always defaulted to — kept verbatim so callers that observe it keep working, and kept out of the catalogue because it is not a failure this package classifies, only a constructor default a caller may override.

"RENDER_ERROR"

packages/protocol/src/errors.ts:47
EachKeyErrorCode@openelement/protocol · ./errorsconstpublic

Keyed-list identity failures. Shared by the server serializer and the client runtime (see `internal/compiled/each-key.ts`), so both executors reject the same data with the same code.

{ readonly ITEM_NOT_A_RECORD: "OE_EACH_ITEM_NOT_A_RECORD"; readonly KEY_NOT_ROUND_TRIPPABLE: "OE_EACH_KEY_NOT_ROUND_TRIPPABLE"; readonly DUPLICATE_KEY: "OE_EACH_KEY_DUPLICATE"; }

packages/protocol/src/errors.ts:159
ERROR_PREFIX@openelement/protocol · ./errorsconstpublic

Error message prefix for all openElement errors.

"[openElement]"

packages/protocol/src/errors.ts:50
ErrorCode@openelement/protocol · ./errorsconstpublic

Well-known error code constants for reference. String values are always accepted.

{ readonly SSR_RENDER_ERROR: "SSR_RENDER_ERROR"; readonly BOUNDARY_CAUGHT: "BOUNDARY_CAUGHT"; readonly UNKNOWN: "UNKNOWN"; }

packages/protocol/src/errors.ts:31
ErrorPhase@openelement/protocol · ./errorstypepublic

The pipeline phase an error was raised in.

ErrorPhase

packages/protocol/src/errors.ts:80
ErrorSeverity@openelement/protocol · ./errorstypepublic

How severe a framework error is.

ErrorSeverity

packages/protocol/src/errors.ts:78
ErrorTelemetryHook@openelement/protocol · ./errorstypepublic

Callback receiving every reported {@linkcode OpenElementError} for telemetry.

ErrorTelemetryHook

packages/protocol/src/errors.ts:132
FacadeErrorCode@openelement/protocol · ./errorsconstpublic

SSR/bootstrap failures raised by the public entries (phase `ssr` / `csr`).

{ readonly PROGRAM_MISSING: "OE_PROGRAM_MISSING"; readonly COMPOSITION_DEPTH: "OE_SSR_COMPOSITION_DEPTH"; readonly COMPUTED_FACTORY_MISSING: "OE_COMPUTED_FACTORY_MISSING"; readonly COMPUTED_READONLY: "OE_COMPUTED_READON…

packages/protocol/src/errors.ts:290
frameworkError@openelement/protocol · ./errorsfunctionpublic

One framework failure: {@linkcode OpenElementError} with the caller's code and the phase/severity/recoverability that phase implies. Every throw site in this package goes through this factory (or the `*ErrorCode` tables above) so a code, a phase and a recoverability answer cannot drift per site.

(code: string, message: string, options?: Omit<OpenElementErrorOptions, "code">): OpenElementError

packages/protocol/src/errors.ts:321
KernelErrorCode@openelement/protocol · ./errorsconstpublic

Element-lifecycle failures: the kernel was driven outside its contract (phase `csr`).

{ readonly DISPOSED: "OE_KERNEL_DISPOSED"; readonly TAG_MISMATCH: "OE_KERNEL_TAG_MISMATCH"; readonly CLAIM_EXECUTOR_MISSING: "OE_KERNEL_CLAIM_EXECUTOR_MISSING"; readonly ROOT_NOT_OWNED: "OE_KERNEL_ROOT_NOT_OWNED"; reado…

packages/protocol/src/errors.ts:208
OpenElementError@openelement/protocol · ./errorsclasspublic

Framework error carrying a stable code, severity, phase and recoverability contract.

class OpenElementError extends Error

packages/protocol/src/errors.ts:100
OpenElementErrorOptions@openelement/protocol · ./errorsinterfacepublic

Constructor options for {@linkcode OpenElementError}; every field is defaulted.

OpenElementErrorOptions

cause?: Error (可选); code?: string (可选); statusCode.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; statusCode.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; statusCode.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; statusCode.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; statusCode.valueOf: () => number (必填) — Returns the primitive value of the specified object.; statusCode.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; severity?: ErrorSeverity (可选); phase?: ErrorPhase (可选); recoverable?: boolean (可选)

packages/protocol/src/errors.ts:90
ProgramErrorCode@openelement/protocol · ./errorsconstpublic

Program-shape failures: a Part Program (or one of its records) is malformed, or carries a value the wire format cannot express. Phase `validation`: these reject data before any DOM work starts.

{ readonly INVALID_PROGRAM: "OE_PROGRAM_INVALID"; readonly NOT_SERIALIZABLE: "OE_PROGRAM_NOT_SERIALIZABLE"; readonly INVALID_SLOT: "OE_PROGRAM_INVALID_SLOT"; readonly INVALID_SOURCE_SEGMENT: "OE_PROGRAM_INVALID_SOURCE_S…

packages/protocol/src/errors.ts:141
raiseFrameworkError@openelement/protocol · ./errorsfunctionpublic

Raise one framework failure and never return: the throwing companion of {@linkcode frameworkError}. The per-module `fail(code, message)` micro-factories bind their failure surface's fixed {@linkcode ErrorPhase} here — one implementation, the phase as a parameter — so a code and a phase cannot drift apart per throw site.

(phase: ErrorPhase, code: string, message: string): never

packages/protocol/src/errors.ts:342
RUNTIME_MESSAGES_ENABLED@openelement/protocol · ./errorsconstpublic

Whether the authored error prose is kept: `true` everywhere except a production client build, the one context that defines `OE_RUNTIME_MESSAGES` to `false`. Stripping is a payload decision, so it belongs to the browser bundle only — server-side failures keep their prose.

boolean

packages/protocol/src/errors.ts:72
RuntimeErrorCode@openelement/protocol · ./errorsconstpublic

Runtime execution failures raised while a compiled program is serialized, built into fresh DOM, or re-read on a signal write (phase `render`).

{ readonly LIST_VALUE_NOT_ARRAY: "OE_RUNTIME_LIST_VALUE_NOT_ARRAY"; readonly HOST_SIGNAL_MISSING: "OE_RUNTIME_HOST_SIGNAL_MISSING"; readonly HOST_HANDLER_MISSING: "OE_RUNTIME_HOST_HANDLER_MISSING"; readonly HOST_REF_MIS…

packages/protocol/src/errors.ts:172
ServerErrorCode@openelement/protocol · ./errorsconstpublic

Compiled server/claim validation failures. The value shipped in 1.0.0-alpha.3 and is kept verbatim; `CompiledProgramValidationError` is its only raiser.

{ readonly PROGRAM_INVALID: "OPEN_ELEMENT_COMPILED_PROGRAM_INVALID"; readonly SINK_REFUSED: "OE_SERVER_SINK_REFUSED"; }

packages/protocol/src/errors.ts:256
StyleErrorCode@openelement/protocol · ./errorsconstpublic

Compiled-style application failures (phase `csr`).

{ readonly ADOPTED_STYLES_UNSUPPORTED: "OE_STYLES_ADOPTED_SHEETS_UNSUPPORTED"; readonly LIGHT_SINK_WITHOUT_DOCUMENT: "OE_STYLES_LIGHT_SINK_WITHOUT_DOCUMENT"; }

packages/protocol/src/errors.ts:228
camelToKebab@openelement/protocol · ./forbidden-sinksfunctionpublic

The one camelCase → kebab-case casing rule for custom-element attribute names, so `<x-el itemCount={5}>` round-trips as `item-count` on every boundary that derives an attribute name from a prop name: the compiler's property metadata, the SSR serializer, and the client attribute handling.

(str: string): string

packages/protocol/src/forbidden-sinks.ts:95
FORBIDDEN_ATTRIBUTE_NAMES@openelement/protocol · ./forbidden-sinksconstpublic

Forbidden sink names — the ONE canonical deny list for every Part Program boundary: the compiler semantic core, the protocol validator (internal/protocol/part-program.ts), and the compiled server/claim validator (internal/compiled/server/shared.ts). This module is import-free and host-free by design (same base-of-graph contract as void-tags.ts): all consumers import it, so a new forbidden sink cannot be enforced on one boundary and missed on another. This module owns the named-sink deny lists and the attribute-name policy built on them (the one shared safe-attribute-name predicate and the one camelCase→kebab-case casing rule); consumers delegate so the boundary cannot diverge. The lists are fail closed and case-insensitive (attribute and property names are compared lowercase, matching the HTML parser's name folding): - `FORBIDDEN_ATTRIBUTE_NAMES`: attribute names that must never be a static attribute or an `attr`/`bool` sink. `srcdoc` smuggles a full HTML document past attribute escaping; `innerHTML` is admissible only through the dedicated trusted-HTML `html` Part, never as a plain attribute name. - `FORBIDDEN_PROPERTY_NAMES`: `prop` sink names that would re-prototype or re-construct the target element (prototype-pollution primitives). - `RAW_TEXT_TAGS`: raw-text elements are outside the compiled grammar — their content cannot be escaped by the serializer.

ReadonlySet<string>

packages/protocol/src/forbidden-sinks.ts:28
FORBIDDEN_PROPERTY_NAMES@openelement/protocol · ./forbidden-sinksconstpublic

Property names the compiler refuses as

ReadonlySet<string>

packages/protocol/src/forbidden-sinks.ts:31
ForbiddenSinkKind@openelement/protocol · ./forbidden-sinkstypepublic

Sink categories the canonical deny list classifies.

ForbiddenSinkKind

packages/protocol/src/forbidden-sinks.ts:41
forbiddenSinkReason@openelement/protocol · ./forbidden-sinksfunctionpublic

Return a human-readable reason when `name` is a forbidden sink of `kind`, or null when the name is admissible. Unknown kinds fail closed with a reason instead of being waved through.

(kind: ForbiddenSinkKind, name: string): string | null

packages/protocol/src/forbidden-sinks.ts:48
isSafeAttributeName@openelement/protocol · ./forbidden-sinksfunctionpublic

The one safe-attribute-name predicate (#1033, #602). Attribute *names* are not escaped on any render path, so a name must be valid HTML attribute-name grammar (blocks quote/space injection), must not be an event handler (`on*`, case-insensitive), and must not be a forbidden sink (`innerhtml`/ `srcdoc` — case-insensitive). Every boundary that admits an attribute name — the compiler semantic core, the Part Program validator, the compiled server validator, and the SSR head/meta name checks — delegates here, so the rules cannot diverge per path.

(name: string): boolean

packages/protocol/src/forbidden-sinks.ts:81
RAW_TEXT_TAGS@openelement/protocol · ./forbidden-sinksconstpublic

Elements whose text content must never be interpolated as markup.

ReadonlySet<string>

packages/protocol/src/forbidden-sinks.ts:38
AppShellConfig@openelement/protocol · ./frameworktypepublic

Application shell declaration: `false` disables the shell entirely, `'default'` uses the built-in shell, and the object form names a tag with the module path that defines it (`import`, resolved like a {@link FrameworkOptions.middleware.use } entry) plus the compiled shell properties the router injects per route.

AppShellConfig

packages/protocol/src/framework.ts:96
CompatibilityClassification@openelement/protocol · ./frameworkinterfacepublic

The per-tag verdict the compatibility scanner records: the tier a discovered tag was classified as, the human-readable `reason`, where the tag was found (`source`), and the SSR/DSD/hydration facts the verdict was derived from.

CompatibilityClassification

tagName: string (必填); tier: CompatibilityTier (必填); reason: string (必填); source: "local" | "package" | "nested" (必填); modulePath?: string (可选); ssr?: boolean (可选); dsd?: boolean (可选); hydrate?: string (可选)

packages/protocol/src/framework.ts:326
CompatibilityTier@openelement/protocol · ./frameworktypepublic

How far a discovered tag may participate in the build: 'ssr-capable' renders and hydrates, 'client-only' ships to the browser without server output, 'experimental-dom' is admitted with a downgraded guarantee, and 'rejected' fails the build.

CompatibilityTier

packages/protocol/src/framework.ts:319
ComponentLayer@openelement/protocol · ./frameworktypepublic

The delivery layer a component belongs to: fully static DSD markup ('dsd-static'), DSD markup with a client island ('dsd-interactive'), a client-only island with no SSR output ('pure-island'), or a light-DOM element ('light-dom'). Recorded per component in the build manifest and consumed by the hydration scheduler.

ComponentLayer

packages/protocol/src/framework.ts:23
FrameworkOptions@openelement/protocol · ./frameworkinterfacepublic

The adapter-facing framework options: where routes, islands and components live, which renderer serializes pages, the application shell and layout declarations, the document `<html>`/head injection channels, and the request-time middleware switches. Every field is optional; the adapter applies its documented default. This is the type an application config file's default export is checked against, so the rendered option table and the actual config surface cannot drift.

FrameworkOptions

renderer?: "native" | "lit" (可选) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderDsd); 'lit' renders LitElement pages through; routesDir?: string (可选) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; islandsDir?: string (可选) — Directory island modules are discovered in. Defaults to `app/islands`.; componentsDir?: string (可选) — Directory non-route components live in. Defaults to `app/components`.; packageIslands?: string[] (可选) — Extra package names whose island modules the build admits, e.g. `['@openelement/ui']`.; appShell?: AppShellConfig (可选) — Application shell declaration; `false` disables the shell, `'default'` uses the built-in one.; layouts?: LayoutsConfig (可选) — Per-layout shell declarations keyed by layout name.; mode?: "ssg" (可选) — Build mode. 'ssg' (default) generates static HTML.; headExtras?: string (可选) — @dangerous injected as-is, only use with controlled content; html.lang?: string (可选); html.title?: string (可选); inject.stylesheets?: (string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[] (可选) — Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.; inject.scripts?: (string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str… (可选) — Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.; inject.headFragments?: string[] (可选) — @dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.; ssr.noExternal?: (string | RegExp)[] (可选); island.upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (可选); build.outDir?: string (可选) — Output directory for the build artifacts. Defaults to `dist`.; build.manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; } (可选) — Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.; viewTransition?: boolean (可选) — Enable the View Transitions API for client navigations. Defaults to true.; speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (可选) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; middleware.cors?: boolean (可选) — Enable the built-in CORS middleware.; middleware.corsOrigin?: string | string[] (可选) — Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.; middleware.corsOriginModule?: string (可选) — Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `appShell.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.; middleware.requestId?: boolean (可选) — Emit and honor a per-request id header.; middleware.logger?: boolean (可选) — Log each request through the built-in logger.; middleware.securityHeaders?: boolean (可选) — Attach the built-in security response headers.; middleware.csp?: { policy?: string; nonce?: boolean; reportOnly?: boolean; } (可选) — Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.; middleware.use?: string[] (可选) — Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `appShell.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configur…

packages/protocol/src/framework.ts:170
HYDRATION_STRATEGIES@openelement/protocol · ./frameworkconstpublic

Runtime list of supported hydration strategies; the single source of truth for the `HydrationStrategy` union. Consumed by island/registry validation and re-exported from the element root for app and build adapters.

readonly ["load", "idle", "visible", "only", "none"]

packages/protocol/src/framework.ts:28
HydrationStrategy@openelement/protocol · ./frameworktypepublic

Island hydration trigger: 'load' | 'idle' | 'visible' | 'only'.

"load" | "idle" | "visible" | "only" | "none"

packages/protocol/src/framework.ts:30
LocalePath@openelement/protocol · ./frameworkinterfacepublic

Locale-aware resolved path contract.

LocalePath

locale: string (必填); path: string (必填); localizedPath: string (必填); isDefaultLocalePath: boolean (必填)

packages/protocol/src/framework.ts:82
Middleware@openelement/protocol · ./frameworktypepublic

Fetch middleware contract (#858): WinterCG shape, dialect-free — no Hono/h3 context object. Composed at the handler boundary in onion order (`use[0]` is outermost: it sees the request first and the response last), so it runs with identical semantics in the dev server, the `start` CLI, the e2e fixture server, and the Nitro production entry. A middleware may short-circuit by returning a Response without calling `next()`, or post-process the Response that `next()` returns. Module contract: a Middleware is the DEFAULT EXPORT of a module referenced from `middleware.use` by path (e.g. './app/middleware/auth.ts'). The generated server entry imports the module, so the middleware may close over module scope and import local helpers and third-party packages — it is a real module in the server module graph, never serialized source.

Middleware

packages/protocol/src/framework.ts:158
OpenElementBlogOptions@openelement/protocol · ./frameworkinterfacepublic

Blog options stored in the build context by

OpenElementBlogOptions

contentDir?: string (可选); basePath?: string (可选)

packages/protocol/src/framework.ts:37
OpenElementBuildContextLike@openelement/protocol · ./frameworkinterfacepublic

Minimal build context interface that sub-plugins can use.

OpenElementBuildContextLike

plugins: { [key: string]: unknown; blogOptions: OpenElementBlogOptions | null; navSections: OpenElementNavSection[]; headerNav: OpenElementHeaderNavLink[]; sitemapOptio… (必填); registerPlugin: (name: string, instance: unknown) => void (必填) — Register plugin data by name. Protocol level uses loose typing; concrete implementations should tighten the generic constraint.

packages/protocol/src/framework.ts:62
OpenElementI18nContextOptions@openelement/protocol · ./frameworkinterfacepublic

i18n options stored in the build context by

OpenElementI18nContextOptions

packages/protocol/src/framework.ts:55
OpenElementNavSection@openelement/protocol · ./frameworkinterfacepublic

Navigation section from

OpenElementNavSection

section: string (必填); items: { path: string; label: string; order?: number; }[] (必填)

packages/protocol/src/framework.ts:43
RouteEntry@openelement/protocol · ./frameworkinterfacepublic

One route admitted by the scanner: URL `path`, source `filePath`, the route `type`, the generated variable name (`varName`) the entry binds it to, and the optional registration tag. {@link RouteEntry.definePage} and {@link RouteEntry.hasEnhancedForms} carry the two source-derived admission facts the generated entries branch on.

RouteEntry

path: string (必填); filePath: string (必填); type: "page" | "api" | "island" | "special" (必填); varName: string (必填); tagName?: string (可选); definePage?: boolean (可选) — True when the route module's default export is a definePage() definition (#960 — registration decoupling). The generated entry registers the page class under the path-derived fallback tag and IGNORES the tagName export for registration: on a definePage route the export only names a content element. Plain element routes keep tagName as their registration tag.; source?: string (可选) — Source text captured during scanning when includeSource is enabled.; hasEnhancedForms?: boolean (可选) — True when the page route source carries data-open-enhance (#569): the client entry must ship the form-enhancement layer even when the app has zero islands.; special?: SpecialFileType (可选); params?: string[] (可选)

packages/protocol/src/framework.ts:113
SafeHtml@openelement/protocol · ./frameworktypepublic

Branded type: a string that has been HTML-escaped (safe for text content)

SafeHtml

packages/protocol/src/framework.ts:9
SpecialFileType@openelement/protocol · ./frameworktypepublic

Special file kinds the route scanner recognizes by filename: `renderer` and `middleware`.

SpecialFileType

packages/protocol/src/framework.ts:79
StrategySource@openelement/protocol · ./frameworktypepublic

Where an island's resolved hydration strategy came from.

StrategySource

packages/protocol/src/framework.ts:32
UnsafeHtml@openelement/protocol · ./frameworktypepublic

Branded type: a string that is intentionally raw/untrusted HTML

UnsafeHtml

packages/protocol/src/framework.ts:12
IslandOptions@openelement/protocol · ./islandinterfacepublic

Per-island delivery options (hydration strategy, SSR/DSD participation).

IslandOptions

hydrate?: "load" | "idle" | "visible" | "only" | "none" (可选) — Hydration strategy: - 'load': load immediately when module is imported - 'idle': defer to requestIdleCallback (default) - 'visible': use IntersectionObserver to defer until element is visible - 'only': client-only render, no DSD/SSR output Named `hydrate` to match `defineIslandConfig()` in the Router package — one option name across both packages.; dsd?: boolean (可选) — Whether to use DSD for SSR rendering of this island. Honored by the build-side island scan (via `defineIslandConfig`), not by `defineIsland()` itself: passing it in `IslandOptions` has no runtime effect.; ssr?: boolean (可选) — Whether this island may be admitted into server rendering. Like `dsd`, decided by the build-side island scan; inert when passed to `defineIsland()`.

packages/protocol/src/island.ts:8
IslandTransformOptions@openelement/protocol · ./islandinterfacepublic

Options for the build-time island source transform.

IslandTransformOptions

islandsDir: string (必填) — Directory containing island files (e.g. "app/islands"); filePath: string (必填) — Absolute or relative file path of the source being processed

packages/protocol/src/island.ts:42
IslandTransformResult@openelement/protocol · ./islandinterfacepublic

The island transform output: rewritten source plus extracted facts.

IslandTransformResult

code: string (必填) — Transformed source code with markers; islands: { tagName: string; filePath: string; }[] (必填) — Detected island entries; map?: string (可选) — Optional source map

packages/protocol/src/island.ts:50
ISLAND_ADMISSION@openelement/protocol · ./island-admissionconstpublic

The static-sidecar descriptor router injects into the element compiler.

StaticSidecarDescriptor

packages/protocol/src/island-admission.ts:18
CemCompatibilityReport@openelement/protocol · ./manifestinterfacepublic

The compatibility classification report for one custom element manifest.

CemCompatibilityReport

totalClassified.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; totalClassified.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; totalClassified.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; totalClassified.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; totalClassified.valueOf: () => number (必填) — Returns the primitive value of the specified object.; totalClassified.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; ssrCapableCount: number (必填); clientOnlyCount: number (必填); rejectedCount: number (必填); experimentalDomCount: number (必填); classifications: CompatibilityClassification[] (必填); summary: string (必填)

packages/protocol/src/manifest.ts:86
CompatibilityClassification@openelement/protocol · ./manifestinterfacepublic

The per-tag verdict the compatibility scanner records: the tier a discovered tag was classified as, the human-readable `reason`, where the tag was found (`source`), and the SSR/DSD/hydration facts the verdict was derived from.

CompatibilityClassification

tagName: string (必填); tier: CompatibilityTier (必填); reason: string (必填); source: "local" | "package" | "nested" (必填); modulePath?: string (可选); ssr?: boolean (可选); dsd?: boolean (可选); hydrate?: string (可选)

packages/protocol/src/framework.ts:326
CompatibilityTier@openelement/protocol · ./manifesttypepublic

How far a discovered tag may participate in the build: 'ssr-capable' renders and hydrates, 'client-only' ships to the browser without server output, 'experimental-dom' is admitted with a downgraded guarantee, and 'rejected' fails the build.

CompatibilityTier

packages/protocol/src/framework.ts:319
OpenElementAttribute@openelement/protocol · ./manifestinterfacepublic

One documented attribute of a custom element declaration.

OpenElementAttribute

name: string (必填); type?: string (可选); default?: string (可选); description?: string (可选); reflects?: boolean (可选); fieldName?: string (可选)

packages/protocol/src/manifest.ts:15
OpenElementCssPart@openelement/protocol · ./manifestinterfacepublic

One documented CSS part of a custom element declaration.

OpenElementCssPart

name: string (必填); description?: string (可选)

packages/protocol/src/manifest.ts:38
OpenElementDeclaration@openelement/protocol · ./manifestinterfacepublic

One custom element declaration in a package manifest: tag, members and delivery metadata.

OpenElementDeclaration

tagName: string (必填); className?: string (可选); superclassName?: string (可选); attributes?: OpenElementAttribute[] (可选); events?: OpenElementEvent[] (可选); slots?: OpenElementSlot[] (可选); cssParts?: OpenElementCssPart[] (可选); openElement.ssr?: boolean (可选); openElement.dsd?: boolean (可选); openElement.layer?: ComponentLayer (可选); openElement.hydrate?: "load" | "idle" | "visible" | "only" | "none" (可选); openElement.status?: "stable" | "experimental" (可选) — Stability marker from the owning package's manifest policy.; openElement.module?: string (可选); openElement.export?: string (可选); description?: string (可选)

packages/protocol/src/manifest.ts:56
OpenElementEvent@openelement/protocol · ./manifestinterfacepublic

One documented custom event of a custom element declaration.

OpenElementEvent

name: string (必填); type?: string (可选); description?: string (可选)

packages/protocol/src/manifest.ts:25
OpenElementExtensions@openelement/protocol · ./manifestinterfacepublic

The openElement-specific extension block of a package manifest declaration.

OpenElementExtensions

ssr?: boolean (可选); dsd?: boolean (可选); layer?: ComponentLayer (可选); hydrate?: "load" | "idle" | "visible" | "only" | "none" (可选); status?: "stable" | "experimental" (可选) — Stability marker from the owning package's manifest policy.; module?: string (可选); export?: string (可选)

packages/protocol/src/manifest.ts:44
OpenElementPackageManifest@openelement/protocol · ./manifestinterfacepublic

Package manifest of component declarations (not a Custom Elements Manifest).

OpenElementPackageManifest

schemaVersion: string (必填); packageName: string (必填); version: string (必填); description?: string (可选); author?: string (可选); license?: string (可选); homepage?: string (可选); repository?: string (可选); declarations: OpenElementDeclaration[] (必填)

packages/protocol/src/manifest.ts:69
OpenElementSlot@openelement/protocol · ./manifestinterfacepublic

One documented slot of a custom element declaration.

OpenElementSlot

name: string (必填); description?: string (可选)

packages/protocol/src/manifest.ts:32
ModuleVocabularyDescriptor@openelement/protocol · ./module-descriptorsinterfacepublic

One module-scan vocabulary entry the host admits: a binding identity (module specifier + exported name, aliases followed) plus the fact a canonical call of that binding contributes. Plain data — the scan consumes the descriptors without learning the caller's package vocabulary, the same direction as the compiler's {@link StaticSidecarDescriptor} admission (#1473 item 3).

ModuleVocabularyDescriptor

moduleSpecifier: string (必填) — Canonical module specifier the factory must be imported from.; exportName: string (必填) — Exported name of the factory binding.; kind: "page-definition" | "element-registration" (必填) — What a canonical call of the binding contributes to the scan.

packages/protocol/src/module-descriptors.ts:33
StaticSidecarDescriptor@openelement/protocol · ./module-descriptorsinterfacepublic

One static-sidecar descriptor the host injects into the element compiler: the admission granted is a colocated static policy statement (#1473 item 3, the static-sidecar admission pattern).

StaticSidecarDescriptor

moduleSpecifier: string (必填) — Canonical module specifier the sidecar export must be imported from.; exportName: string (必填) — Exported name of the sidecar factory binding.; kind: "static-sidecar" (必填) — The admission granted: a colocated static policy statement.

packages/protocol/src/module-descriptors.ts:16
ROUTER_MODULE_VOCABULARY@openelement/protocol · ./module-vocabularyconstpublic

The module vocabulary router injects into `analyzeModuleSemantics`.

readonly ModuleVocabularyDescriptor[]

packages/protocol/src/module-vocabulary.ts:17
CemPropertyMetadata@openelement/protocol · ./part-programinterfacepublic

One property entry of the compiled custom-elements-manifest metadata.

CemPropertyMetadata

name: string (必填); fieldName: string (必填); type: PropertyValueType (必填); attribute: string | null (必填); reflect: boolean (必填)

packages/protocol/src/part-program.ts:395
COMPILED_MODULE_ABI_VERSION@openelement/protocol · ./part-programconstpublic

Version of the compiled-module ABI: the statics a generated module carries (`__partProgram`, `__compiledProperties`, `__elementMetadata`, `__observedAttributes`, `__computedFields`) and the runtime facade binds. Bump when the generated-module contract changes shape; generated artifacts stamp both this and PART_PROGRAM_VERSION so consumers can tell format drift from release drift. v2: platform lifecycle callback bodies are emitted inside a boundary-capture wrapper calling the base class's `_captureError` — a generated module now requires a runtime facade carrying that protected method (the v1 shape emitted the bodies verbatim).

2

packages/protocol/src/part-program.ts:37
CompiledCemMetadata@openelement/protocol · ./part-programinterfacepublic

The compiled custom-elements-manifest metadata block of one component.

CompiledCemMetadata

tagName: string (必填); className: string (必填); declaration: { name: string; module: string; } (必填); attributes: { name: string; fieldName: string; type: PropertyValueType; reflect: boolean; }[] (必填); members: CemPropertyMetadata[] (必填)

packages/protocol/src/part-program.ts:404
CompiledElementMetadata@openelement/protocol · ./part-programinterfacepublic

The compiled element metadata the program carries for tooling consumers.

CompiledElementMetadata

tag: string (必填); className: string (必填); sourceFile: string (必填); properties: CompiledPropertyMetadata[] (必填); observedAttributes: string[] (必填); cem: CompiledCemMetadata (必填)

packages/protocol/src/part-program.ts:413
CompiledPropertyMetadata@openelement/protocol · ./part-programinterfacepublic

One compiled

CompiledPropertyMetadata

name: string (必填); attribute: string | null (必填); type: PropertyValueType (必填); converter: PropertyValueType (必填); reflect: boolean (必填); default: SerializableValue (必填); computed?: boolean (可选) — True for computed fields (`= computed(() => ...)` in the source): their signal is derived from other property signals by the generated `__computedFields` factory, never seeded from attributes/props. Always paired with `attribute: null` and `reflect: false`.; deps?: string[] (可选) — Source signal names a computed field reads (declaration order).

packages/protocol/src/part-program.ts:376
conditionLiteralAllowed@openelement/protocol · ./part-programfunctionpublic

Operator/literal compatibility for when-Region tests (issue #1372). Both wire validators (this module and the server serializer's shared validator) close the space through this one predicate: - ordering operators require a finite numeric literal; - `equals`/`not-equals` admit a finite number, string, or boolean; - `truthy` admits exactly `true` or `false` (the recorded expectation).

(op: unknown, value: unknown): boolean

packages/protocol/src/part-program.ts:274
ConditionOperator@openelement/protocol · ./part-programtypepublic

The comparison operators a program condition supports.

ConditionOperator

packages/protocol/src/part-program.ts:250
DATA_OE_LIGHT@openelement/protocol · ./part-programconstpublic

Internal SSR provenance marker on light-mode host tags (#1148). Present only when the host's light subtree was server-rendered under the in-place activation contract: the client binds the existing DOM instead of clearing it, and a parent's activation walk prunes the nested host's subtree. Client rendering never writes it and it is never removed. The writer (internal/compiled/server) and readers (internal/compiled/runtime) import this constant; nothing writes the literal.

"data-oe-light"

packages/protocol/src/part-program.ts:473
isAttributeName@openelement/protocol · ./part-programfunctionpublic

The wire-validator face of the one canonical attribute-name predicate (delegates to `./forbidden-sinks.ts`); exported for parity tests.

(value: unknown): value is string

packages/protocol/src/part-program.ts:515
ItemEventBinding@openelement/protocol · ./part-programinterfacepublic

An event binding scoped to each item of an `each` region. The runtime attaches this listener to every item root node created by the region, making per-item handlers (onClick={this.select(row.id)}) expressible without fixed-path event parts.

ItemEventBinding

event: string (必填) — DOM event name ('click', 'input', …).; handler: string (必填) — Handler method name on the compiled class.; action: ProgramEventAction (必填) — The action to dispatch, same union as fixed event parts.; selector?: string (可选) — Optional child selector within the item template (e.g. '.probe-button'). When omitted, the listener attaches to the item root.

packages/protocol/src/part-program.ts:309
PART_PROGRAM_VERSION@openelement/protocol · ./part-programconstpublic

The Part Program IR version this package defines (currently v1).

1

packages/protocol/src/part-program.ts:22
partAnchorEndMarker@openelement/protocol · ./part-programfunctionpublic

The comment marker closing a part anchor in serialized program markup.

(index: number): string

toString: (radix?: number) => string (必填) — Returns a string representation of an object.; toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; valueOf: () => number (必填) — Returns the primitive value of the specified object.; toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/part-program.ts:451
partAnchorMarker@openelement/protocol · ./part-programfunctionpublic

Anchor marker payloads shared by seed runtime consumers.

(index: number): string

toString: (radix?: number) => string (必填) — Returns a string representation of an object.; toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; valueOf: () => number (必填) — Returns the primitive value of the specified object.; toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/part-program.ts:446
PartProgram@openelement/protocol · ./part-programtypepublic

The serializable Part Program v1: one compiled component as data.

PartProgramV1

version: 1 (必填); tag: string (必填); root: ProgramRoot (必填); template: ProgramTreeNode[] (必填); parts: ProgramPart[] (必填); regions: ProgramRegionRecord[] (必填); dependencies: ProgramDependencyRecord[] (必填); locations: ProgramLocationRecord[] (必填); sourceMap: ProgramSourceMap (必填) — Compile-time provenance. The canonical in-memory artifact always carries it; the serialized module payload omits it (no runtime consumer reads it), so the validator accepts programs with or without it but still verifies it strictly when present.; metadata: CompiledElementMetadata (必填)

packages/protocol/src/part-program.ts:443
PartProgramV1@openelement/protocol · ./part-programinterfacepublic

The one deterministic program consumed by all execution modes.

PartProgramV1

version: 1 (必填); tag: string (必填); root: ProgramRoot (必填); template: ProgramTreeNode[] (必填); parts: ProgramPart[] (必填); regions: ProgramRegionRecord[] (必填); dependencies: ProgramDependencyRecord[] (必填); locations: ProgramLocationRecord[] (必填); sourceMap: ProgramSourceMap (必填) — Compile-time provenance. The canonical in-memory artifact always carries it; the serialized module payload omits it (no runtime consumer reads it), so the validator accepts programs with or without it but still verifies it strictly when present.; metadata: CompiledElementMetadata (必填)

packages/protocol/src/part-program.ts:423
ProgramAttrPart@openelement/protocol · ./part-programinterfacepublic

String attribute sink bound to a Signal.

ProgramAttrPart

k: "attr" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); name: string (必填); path: number[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:168
ProgramBoolPart@openelement/protocol · ./part-programinterfacepublic

Boolean attribute sink bound to a Signal.

ProgramBoolPart

k: "bool" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); name: string (必填); path: number[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:178
ProgramClassPart@openelement/protocol · ./part-programinterfacepublic

Specialized fixed sinks make ownership explicit for class and style text.

ProgramClassPart

k: "class" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); path: number[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:188
ProgramCondition@openelement/protocol · ./part-programinterfacepublic

One condition clause of a when part.

ProgramCondition

signal: string (必填); op: ConditionOperator (必填); value: string | number | boolean (必填)

packages/protocol/src/part-program.ts:260
ProgramDependencyRecord@openelement/protocol · ./part-programinterfacepublic

One module dependency the compiled module graph records.

ProgramDependencyRecord

signal: string (必填); owner: { kind: "part" | "region"; index: number; } (必填); location: string (必填)

packages/protocol/src/part-program.ts:366
ProgramEachPart@openelement/protocol · ./part-programinterfacepublic

A list part: repeats its template node per item of a bound signal.

ProgramEachPart

k: "each" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); key: string (必填); field?: string (可选) — Restatement of the item field for single-field templates; omitted when the item template binds multiple fields (each `ival`/`iattrs` slot then carries its own field).; item: ProgramTreeNode[] (必填); itemEvents?: ItemEventBinding[] (可选) — Per-item event bindings (#1556 IR v2): listeners attached to each item.; location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:324
ProgramElementNode@openelement/protocol · ./part-programinterfacepublic

A static element node of the program tree.

ProgramElementNode

k: "el" (必填); id: string (必填); tag: string (必填); attrs: [string, string][] (必填); iattrs?: [string, string][] (可选) — Per-item attribute slots ([name, itemField]) — valid only inside an `each` item template. At mount/claim time the value resolves from the current item: `true` emits a bare attribute, `false`/`null`/`undefined` omit it, anything else serializes with String().; children: ProgramTreeNode[] (必填)

packages/protocol/src/part-program.ts:104
ProgramEventAction@openelement/protocol · ./part-programtypepublic

The action one event part dispatches.

ProgramEventAction

packages/protocol/src/part-program.ts:231
ProgramEventPart@openelement/protocol · ./part-programinterfacepublic

An event binding part: listener wiring between DOM event and action.

ProgramEventPart

k: "event" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; event: string (必填); handler: string (必填); action: ProgramEventAction (必填); path: number[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:239
ProgramHtmlPart@openelement/protocol · ./part-programinterfacepublic

Trusted-HTML content sink (alpha.9). The signal value must carry the runtime TrustedHtml capability; its HTML replaces the target element's content. The target's subtree is opaque to the claim path. The compiler emits this only for an explicit `innerHTML={this.<field>}` sink on an otherwise childless element — there is no implicit or discovery path to raw HTML.

ProgramHtmlPart

k: "html" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); path: number[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:213
ProgramItemValueNode@openelement/protocol · ./part-programinterfacepublic

Item-value text slot; valid only inside an `each` item template. `field` names the item field rendered by this slot — multi-field item templates carry one slot per field, and the compiler always emits it.

ProgramItemValueNode

k: "ival" (必填); field: string (必填)

packages/protocol/src/part-program.ts:137
ProgramLocation@openelement/protocol · ./part-programinterfacepublic

Exact compiler-owned location for one dynamic sink or range anchor.

ProgramLocation

id: string (必填); kind: "anchor" | "sink" (必填); path: number[] (必填); node?: string (可选)

packages/protocol/src/part-program.ts:90
ProgramLocationRecord@openelement/protocol · ./part-programtypepublic

A location record also makes the identity auditable without inspecting parts.

ProgramLocationRecord

packages/protocol/src/part-program.ts:98
ProgramPart@openelement/protocol · ./part-programtypepublic

The discriminated union of dynamic parts a program instantiates.

ProgramPart

packages/protocol/src/part-program.ts:342
ProgramPartAnchorNode@openelement/protocol · ./part-programinterfacepublic

The anchor node marking where a part binds in the tree.

ProgramPartAnchorNode

k: "part" (必填); id: string (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/part-program.ts:126
ProgramPosition@openelement/protocol · ./part-programinterfacepublic

Where a part sits relative to its anchor.

ProgramPosition

offset.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; offset.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; offset.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; offset.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; offset.valueOf: () => number (必填) — Returns the primitive value of the specified object.; offset.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; line: number (必填); column: number (必填)

packages/protocol/src/part-program.ts:59
ProgramPropPart@openelement/protocol · ./part-programinterfacepublic

DOM property sink bound to a Signal; `path` is retained for seed consumers.

ProgramPropPart

k: "prop" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); name: string (必填); path: number[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:158
ProgramRefPart@openelement/protocol · ./part-programinterfacepublic

A named ref slot is serializable; the generated class supplies the ref value.

ProgramRefPart

k: "ref" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; ref: string (必填); path: number[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:222
ProgramRegionRecord@openelement/protocol · ./part-programinterfacepublic

One region the program tracks: the boundaries of a dynamic subtree.

ProgramRegionRecord

id: string (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; kind: "when" | "each" (必填); anchor: string (必填); end: string (必填); source: string (必填)

packages/protocol/src/part-program.ts:356
ProgramRoot@openelement/protocol · ./part-programinterfacepublic

The root of one program tree: element, part anchor, or text.

ProgramRoot

id: "root" (必填); kind: RootMode (必填); nodes: string[] (必填)

packages/protocol/src/part-program.ts:43
ProgramSourceKind@openelement/protocol · ./part-programtypepublic

The kind of source record a program source map entry carries.

ProgramSourceKind

packages/protocol/src/part-program.ts:73
ProgramSourceMap@openelement/protocol · ./part-programinterfacepublic

The program source map: authored spans projected onto emitted records.

ProgramSourceMap

version: 1 (必填); file: string (必填); records: ProgramSourceRecord[] (必填)

packages/protocol/src/part-program.ts:83
ProgramSourceRange@openelement/protocol · ./part-programinterfacepublic

A half-open [start, end) range into the authored source text.

ProgramSourceRange

file: string (必填); start: ProgramPosition (必填); end: ProgramPosition (必填)

packages/protocol/src/part-program.ts:66
ProgramSourceRecord@openelement/protocol · ./part-programinterfacepublic

One source-map record: the authored origin of one emitted node or part.

ProgramSourceRecord

id: string (必填); kind: ProgramSourceKind (必填); source: ProgramSourceRange (必填)

packages/protocol/src/part-program.ts:76
ProgramStylePart@openelement/protocol · ./part-programinterfacepublic

A style binding part.

ProgramStylePart

k: "style" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); path: number[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:197
ProgramTextNode@openelement/protocol · ./part-programinterfacepublic

A static text node of the program tree.

ProgramTextNode

k: "text" (必填); value: string (必填)

packages/protocol/src/part-program.ts:120
ProgramTextPart@openelement/protocol · ./part-programinterfacepublic

A text interpolation part bound to one signal.

ProgramTextPart

k: "text" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:150
ProgramTreeNode@openelement/protocol · ./part-programtypepublic

The discriminated union of static tree nodes.

ProgramTreeNode

packages/protocol/src/part-program.ts:143
ProgramWhenPart@openelement/protocol · ./part-programinterfacepublic

A conditional part: swaps template branches on a condition.

ProgramWhenPart

k: "when" (必填); index.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (必填) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; signal: string (必填); test: ProgramCondition (必填); on: ProgramTreeNode[] (必填); off: ProgramTreeNode[] (必填); location: ProgramLocation (必填)

packages/protocol/src/part-program.ts:293
PropertyValueType@openelement/protocol · ./part-programtypepublic

The serialized value-type tag of a compiled property default.

PropertyValueType

packages/protocol/src/part-program.ts:373
RootMode@openelement/protocol · ./part-programtypepublic

How the compiled component attaches its root: light DOM or a shadow root.

RootMode

packages/protocol/src/part-program.ts:40
SerializableValue@openelement/protocol · ./part-programtypepublic

The JSON-serializable value shape a compiled property default admits.

SerializableValue

packages/protocol/src/part-program.ts:50
STATIC_STYLES_MARKER@openelement/protocol · ./part-programconstpublic

The one `<style>` element the server serializer emits as the first DSD template child when the class carries static styles (renderDsd parity — pages never upgrade, so their styles must ship in the payload). The claim path skips exactly this marked node; a marked node on a style-less class is claim drift and fails closed.

"data-oe-static-styles"

packages/protocol/src/part-program.ts:462
validatePartProgram@openelement/protocol · ./part-programfunctionpublic

Validate an unknown value as a Part Program v1. The validator is intentionally strict: unknown instruction kinds, missing ownership records and unsafe paths fail before a runtime can guess at their meaning.

(raw: unknown): asserts raw is PartProgram

packages/protocol/src/part-program.ts:876
VOID_TAGS@openelement/protocol · ./part-programconstpublic

HTML void elements — the ONE canonical tag set for every serializer, validator, and compiler in the workspace (issue #1220, M4). This module is import-free and host-free by design: it sits at the base of the module graph so the DOM runtime (internal/core/html-escape.ts), the Part Program exchange artifact (internal/protocol/part-program.ts), and the compiler semantic core can all consume the same definition without an import cycle or a second source of truth. Content is the full HTML Standard void-element list, `param` included. Do not redefine this set anywhere else; internal/core/html-escape.ts and internal/protocol/part-program.ts re-export it, and __tests__/void-tags-convergence.test.ts enforces the single owner.

ReadonlySet<string>

packages/protocol/src/void-tags.ts:16
IDLE_FALLBACK_TIMEOUT_MS@openelement/protocol · ./policyconstpublic

Idle-hydration scheduling fallback (milliseconds) when neither `requestIdleCallback` nor `requestAnimationFrame` is available.

50

packages/protocol/src/policy.ts:70
MAX_ACTION_BODY_BYTES@openelement/protocol · ./policyconstpublic

Request-body bound (bytes) the generated entry applies to action POST routes; larger uploads belong on API routes with explicit limits.

number

packages/protocol/src/policy.ts:57
MAX_COMPOSITION_DEPTH@openelement/protocol · ./policyconstpublic

Nested element expansion depth bound for `renderDsd`: cyclic component composition fails closed instead of recursing without end.

8

packages/protocol/src/policy.ts:51
STREAM_MAX_FIELDS@openelement/protocol · ./policyconstpublic

Deferred fields (declared streamed properties) one stream route's manifest may carry. The build scan, the server executor, and the browser seed contract enforce the same bound.

32

packages/protocol/src/policy.ts:24
STREAM_MAX_OWNERS@openelement/protocol · ./policyconstpublic

Part/Region owners one stream route's manifest may address in total across all deferred fields.

64

packages/protocol/src/policy.ts:30
STREAM_MAX_PAYLOAD_LENGTH@openelement/protocol · ./policyconstpublic

Serialized stream payload bound, as a string length in UTF-16 code units: one seed attribute or one deferred frame's markup may not exceed it. The server checks the JSON text and the rendered range before emitting; the browser checks the attribute before parsing.

number

packages/protocol/src/policy.ts:45
STREAM_MAX_SEED_PROPERTIES@openelement/protocol · ./policyconstpublic

Typed properties one streamed seed may carry: the browser seed contract rejects the WHOLE seed above this count, so an oversized component would silently fail to hydrate instead of failing loud at the server.

64

packages/protocol/src/policy.ts:37
STREAM_TIMEOUT_MS@openelement/protocol · ./policyconstpublic

Deferred-field resolution budget (milliseconds) for one streamed response: fields still pending when it expires are failed in place and the stream ends with the shell and whatever resolved.

30000

packages/protocol/src/policy.ts:64
ENTRY_REGISTRATION_OWNERS@openelement/protocol · ./registry-markersconstpublic

Property on the stub holding the generated entry's registration-ownership map (tag -> class it registered): a route module that self-registers its tag wins over the entry's registration, and on dev re-evaluation a fresh self-registered class must still win (#952).

"__openEntryDefined"

packages/protocol/src/registry-markers.ts:30
SSR_REGISTRY_ORIGINAL_DEFINE@openelement/protocol · ./registry-markersconstpublic

Property on the SSR registry holding the TRUE original `define` method, captured before the generated entry installs its idempotent wrapper. The registry outlives vite dev SSR module re-evaluations, so without this the second evaluation would capture the already-wrapped `define` as its "original" and every forced re-registration would silently early-return through the previous wrapper (#1339 lit dev feedback).

"__openElementOrigDefine"

packages/protocol/src/registry-markers.ts:40
SSR_REGISTRY_STUB_MARKER@openelement/protocol · ./registry-markersconstpublic

Marker property set to `true` on the SSR customElements stub. Readers must treat the marked registry as re-definable.

"__openElementSsrStub"

packages/protocol/src/registry-markers.ts:22
DsdRenderMetrics@openelement/protocol · ./renderinterfacepublic

Per-render declarative-shadow-dom metrics the server records.

DsdRenderMetrics

tagName: string (必填); renderTimeMs.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; renderTimeMs.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; renderTimeMs.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; renderTimeMs.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; renderTimeMs.valueOf: () => number (必填) — Returns the primitive value of the specified object.; renderTimeMs.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; templateSize: number (必填); layer: ComponentLayer (必填); hasError: boolean (必填); nestingDepth: number (必填)

packages/protocol/src/render.ts:42
HydrationHint@openelement/protocol · ./renderinterfacepublic

The hydration delivery hint a component or route carries.

HydrationHint

tagName: string (必填); layer: ComponentLayer (必填); hydrate?: "load" | "idle" | "visible" | "only" | "none" (可选)

packages/protocol/src/render.ts:22
RenderError@openelement/protocol · ./renderinterfacepublic

One render failure record the SSR pipeline reports.

RenderError

code: string (必填); severity: "error" | "warning" (必填); phase: string (必填); tagName: string (必填); message: string (必填); recoverable: boolean (必填)

packages/protocol/src/render.ts:12
RenderOutput@openelement/protocol · ./renderinterfacepublic

The public result of one `renderDsd()` call: the serialized DSD `html`, the render errors collected while composing it (empty on success), the render metrics for the root component, and the hydration hints the client scheduler reads to upgrade islands.

RenderOutput

html: string (必填); errors: RenderError[] (必填); metrics: DsdRenderMetrics (必填); hydrationHints: HydrationHint[] (必填)

packages/protocol/src/render.ts:34
SsrAdmissionDecision@openelement/protocol · ./renderinterfacepublic

The build's admission verdict for one discovered tag: where the declaration lives (`modulePath`), how it was discovered (`source`), which render path it is admitted to, and the reason recorded for the manifest.

SsrAdmissionDecision

tagName: string (必填); modulePath: string (必填) — Module path of the island declaration. Empty for 'foreign' decisions: a foreign tag is consumed in JSX but declares no module the build owns.; source: "local" | "package" | "nested" | "foreign" (必填) — 'foreign' (#979): a third-party WC tag discovered by the foreign-tag scanner in page/island JSX — recorded for visibility only; SSR still treats it as an opaque passthrough (renderPath 'client-only').; renderPath: "ssr+client" | "client-only" | "rejected" (必填); reason: string (必填)

packages/protocol/src/render.ts:56
OpenElementRequestHandler@openelement/protocol · ./runtimetypepublic

The host-neutral request handler every runtime adapter and generated server entry exposes: a WinterCG `(request, context?) => Response` with no server engine dialect baked in.

OpenElementRequestHandler<Env>

packages/protocol/src/runtime.ts:27
RuntimeAdapter@openelement/protocol · ./runtimeinterfacepublic

A host runtime adapter: exposes the fetch handler a server engine dispatches to.

RuntimeAdapter<Env>

name: string (必填); fetch: OpenElementRequestHandler<Env> (必填); prerender?: (() => AsyncIterable<RuntimePrerenderResult> | Iterable<RuntimePrerenderResult>) (可选)

packages/protocol/src/runtime.ts:32
RuntimeAdapterOptions@openelement/protocol · ./runtimeinterfacepublic

Options one runtime adapter is constructed with.

RuntimeAdapterOptions<Env>

name: string (必填); fetch: OpenElementRequestHandler<Env> (必填); prerender?: (() => AsyncIterable<RuntimePrerenderResult> | Iterable<RuntimePrerenderResult>) (可选)

packages/protocol/src/runtime.ts:39
RuntimeContext@openelement/protocol · ./runtimeinterfacepublic

runtime.ts - Runtime adapter protocol. Replacement boundary for Nitro, Workers, Node, Deno, or future fetch-compatible runtimes. Preserves openElement semantics while leaving concrete server engines outside this package.

RuntimeContext<Env>

env?: Env (可选); platform?: unknown (可选); params?: Record<string, string> (可选)

packages/protocol/src/runtime.ts:9
ReadonlySignal@openelement/protocol · ./signalinterfacepublic

Read-only signal protocol used by computed values.

ReadonlySignal<T>

value: T (必填); subscribe: (fn: (value: T) => void) => Unsubscribe (必填); __@SIGNAL_BRAND@2892.valueOf: () => boolean (必填) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:26
Signal@openelement/protocol · ./signaltypepublic

Alias for APIs that accept either writable or read-only signals.

Signal<T>

packages/protocol/src/signal.ts:31
SIGNAL_BRAND@openelement/protocol · ./signalconstpublic

Runtime/type brand for signals created by the configured reactive engine.

typeof SIGNAL_BRAND

packages/protocol/src/signal.ts:11
SignalEngine@openelement/protocol · ./signalinterfacepublic

Signal engine protocol used by the framework's built-in adapter. This is a deliberate internal seam, not a public compatibility contract: the framework layer talks to signals only through this narrow interface so its call sites stay implementation-agnostic. The package ships and verifies exactly one engine implementation (`preact-engine`, backed by `@preact/signals-core`). Preact's own API is not Element public API, and arbitrary third-party engines are not promised; any future engine would be added behind this protocol rather than inline (charter decision — see #723).

SignalEngine

signal: <T>(initialValue: T) => WritableSignal<T> (必填); computed: <T>(fn: () => T) => ReadonlySignal<T> (必填); effect: (fn: () => void | Unsubscribe) => Unsubscribe (必填)

packages/protocol/src/signal.ts:46
SignalLike@openelement/protocol · ./signalinterfacepublic

Minimal signal-like object accepted by renderers and bindings.

SignalLike<T>

value: T (必填); subscribe: (fn: (value: T) => void) => Unsubscribe (必填); __@SIGNAL_BRAND@2892.valueOf: () => boolean (必填) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:14
Unsubscribe@openelement/protocol · ./signaltypepublic

Unsubscribe function returned by subscriptions and effects.

Unsubscribe

packages/protocol/src/signal.ts:8
WritableSignal@openelement/protocol · ./signalinterfacepublic

Writable signal protocol used by openElement integrations.

WritableSignal<T>

value: T (必填); subscribe: (fn: (value: T) => void) => Unsubscribe (必填); __@SIGNAL_BRAND@2892.valueOf: () => boolean (必填) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:21
ApiRouteDecl@openelement/protocol · ./ssginterfacepublic

One API route declaration in the generated entry descriptor.

ApiRouteDecl

kind: "api" (必填); path: string (必填); varName: string (必填); filePath: string (必填); importPath: string (必填)

packages/protocol/src/ssg.ts:151
AppShellDecl@openelement/protocol · ./ssginterfacepublic

The app shell module a build resolves: tag, import path, and serialized props.

AppShellDecl

tagName: string (必填); importPath: string (必填); props: Record<string, unknown> (必填)

packages/protocol/src/ssg.ts:248
AppShellPlan@openelement/protocol · ./ssginterfacepublic

The resolved app shells a build ships: the default shell plus named layouts.

AppShellPlan

default: ResolvedAppShell (必填); layouts: Record<string, ResolvedAppShell> (必填)

packages/protocol/src/ssg.ts:258
BuildArtifacts@openelement/protocol · ./ssginterfacepublic

Result returned by the OpenElement build pipeline.

BuildArtifacts

pages: BuildPageArtifact[] (必填) — Generated HTML pages.; manifest: BuildManifestArtifact (必填) — Build manifest.; clientAssets: BuildClientAsset[] (必填) — Client-side assets (island bundles, CSS, etc).; warnings: string[] (必填) — Non-fatal warnings.; errors: string[] (必填) — Fatal errors.; success: boolean (必填) — Whether the build succeeded.

packages/protocol/src/ssg.ts:512
BuildClientAsset@openelement/protocol · ./ssginterfacepublic

A single client asset emitted by the build pipeline.

BuildClientAsset

fileName: string (必填); source: string | Uint8Array<ArrayBufferLike> (必填); sizeBytes.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; sizeBytes.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; sizeBytes.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; sizeBytes.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; sizeBytes.valueOf: () => number (必填) — Returns the primitive value of the specified object.; sizeBytes.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/ssg.ts:505
BuildI18nOptions@openelement/protocol · ./ssginterfacepublic

i18n configuration for the build pipeline.

BuildI18nOptions

locales: string[] (必填); defaultLocale?: string (可选)

packages/protocol/src/ssg.ts:458
BuildIslandInput@openelement/protocol · ./ssginterfacepublic

A single island input to the build pipeline.

BuildIslandInput

tagName: string (必填); modulePath: string (必填); isPackage?: boolean (可选); hydrate?: IslandDeliveryStrategy (可选); ssr?: boolean (可选); dsd?: boolean (可选); source?: "local" | "package" | "nested" (可选); reason?: string (可选)

packages/protocol/src/ssg.ts:436
BuildManifestArtifact@openelement/protocol · ./ssginterfacepublic

Manifest produced by the build pipeline.

BuildManifestArtifact

routes: { kind: "page" | "api"; path: string; tagName?: string; isDynamic: boolean; }[] (必填); islands: BuildIslandInput[] (必填); requestTimeRoutes?: string[] (可选) — Paths served at request time (renderIntent mode 'dynamic'). Absent for pure-static builds.

packages/protocol/src/ssg.ts:494
BuildOutputOptions@openelement/protocol · ./ssginterfacepublic

Output configuration for the build pipeline.

BuildOutputOptions

root?: string (可选) — Project root directory.; outDir?: string (可选) — Output directory relative to root.; base?: string (可选) — Base URL path.

packages/protocol/src/ssg.ts:448
BuildPackageIslandOptions@openelement/protocol · ./ssginterfacepublic

Package island configuration for the build pipeline.

BuildPackageIslandOptions

packages?: string[] (可选) — Package names that may expose island declarations.

packages/protocol/src/ssg.ts:464
BuildPageArtifact@openelement/protocol · ./ssginterfacepublic

A single generated HTML page artifact.

BuildPageArtifact

path: string (必填); html: string (必填); errors: { message: string; route?: string; }[] (必填) — Errors collected while rendering this page.

packages/protocol/src/ssg.ts:486
BuildPlan@openelement/protocol · ./ssginterfacepublic

Framework-agnostic plan consumed by the OpenElement build pipeline.

BuildPlan

options.renderer?: "native" | "lit" (可选) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderDsd); 'lit' renders LitElement pages through; options.routesDir?: string (可选) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; options.islandsDir?: string (可选) — Directory island modules are discovered in. Defaults to `app/islands`.; options.componentsDir?: string (可选) — Directory non-route components live in. Defaults to `app/components`.; options.packageIslands?: string[] (可选) — Extra package names whose island modules the build admits, e.g. `['@openelement/ui']`.; options.appShell?: AppShellConfig (可选) — Application shell declaration; `false` disables the shell, `'default'` uses the built-in one.; options.layouts?: LayoutsConfig (可选) — Per-layout shell declarations keyed by layout name.; options.mode?: "ssg" (可选) — Build mode. 'ssg' (default) generates static HTML.; options.headExtras?: string (可选) — @dangerous injected as-is, only use with controlled content; options.html?: { lang?: string; title?: string; } (可选) — Document `<html>` attributes: the `lang` the document declares and the default `<title>`.; options.inject?: { stylesheets?: Array<string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | bool… (可选) — Document head/body injection channels: external stylesheets, scripts, and trusted raw head fragments.; options.ssr?: { noExternal?: (string | RegExp)[]; } (可选) — SSR bundling switches; `noExternal` forces the named packages through the SSR bundle instead of an external import.; options.island?: { upgradeStrategy?: HydrationStrategy; } (可选) — Island defaults applied to every island the build discovers.; options.build?: { outDir?: string; manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; }; } (可选) — Build output switches: the output directory and the advisory manifest budgets.; options.viewTransition?: boolean (可选) — Enable the View Transitions API for client navigations. Defaults to true.; options.speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (可选) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; options.middleware?: { cors?: boolean; corsOrigin?: string | string[]; corsOriginModule?: string; requestId?: boolean; logger?: boolean; securityHeaders?: boolean; csp?: { policy?:… (可选) — Request-time middleware switches, composed outside the framework handler.; routes: BuildRouteInput[] (必填) — Discovered page and API routes.; islands: BuildIslandInput[] (必填) — Discovered local and package islands.; output.root?: string (可选) — Project root directory.; output.outDir?: string (可选) — Output directory relative to root.; output.base?: string (可选) — Base URL path.; i18n?: BuildI18nOptions (可选) — i18n expansion options.; packageIslands.packages?: string[] (可选) — Package names that may expose island declarations.

packages/protocol/src/ssg.ts:470
BuildRouteInput@openelement/protocol · ./ssginterfacepublic

A single route input to the build pipeline.

BuildRouteInput

kind: "api" | "page" (必填) — Route kind: page or API.; path: string (必填) — Route path (e.g. '/about', '/blog/:slug').; filePath: string (必填) — Absolute or relative file path of the route module.; importPath: string (必填) — Import specifier used by generated entry code.; tagName?: string (可选) — Resolved tag name for page routes.; paramNames?: string[] (可选) — Dynamic segment names.; staticParams?: Record<string, string>[] (可选) — Static generation params produced by getStaticPaths().

packages/protocol/src/ssg.ts:418
ClientIslandEntry@openelement/protocol · ./ssginterfacepublic

Client island entry shape passed to entry generator.

ClientIslandEntry

tagName: string (必填); modulePath: string (必填); isPackage?: boolean (可选); exportName?: string (可选) — Optional named export to register as the custom element constructor. When set (package islands whose chunk dropped `export default` per #638), the client island factory reads `mod[exportName]` instead of `mod.default`. When absent, the factory falls back to `mod.default` (local/route islands).; strategy: IslandDeliveryStrategy (必填); strategySource?: "default" | "manifest" | "component" | "route" (可选); ssr?: boolean (可选); dsd?: boolean (可选); reason?: string (可选)

packages/protocol/src/ssg.ts:90
CorsOriginConfig@openelement/protocol · ./ssgtypepublic

The CORS origin policy an API route declares.

CorsOriginConfig

packages/protocol/src/ssg.ts:118
CspConfig@openelement/protocol · ./ssginterfacepublic

The content-security-policy directives a route or document declares.

CspConfig

policy?: string (可选); nonce?: boolean (可选); reportOnly?: boolean (可选)

packages/protocol/src/ssg.ts:121
DocumentConfig@openelement/protocol · ./ssginterfacepublic

The document-level facts a build bakes into the generated entry.

DocumentConfig

lang: string (必填); title: string (必填); headExtras: string (必填); allowHeadExtrasScripts: boolean (必填)

packages/protocol/src/ssg.ts:240
EntryDescriptor@openelement/protocol · ./ssginterfacepublic

The full build-time description of one generated entry: routes, islands, renderers, middleware, document, and app-shell plans.

EntryDescriptor

isSSG: boolean (必填); renderer?: "native" | "lit" (可选) — Page renderer selection (#1339). Absent/'native' keeps the compiled renderDsd page path byte-identical; 'lit' forks page tag resolution, page SSR and the client entry onto; imports: ImportDecl[] (必填); middleware: MiddlewareDecl[] (必填); fetchMiddleware?: string[] (可选) — `middleware.use` fetch middleware module paths (#858), in user-configured order. The entry renderer emits one `import * as __mw_N from '<path>'` per entry and composes each module's default export around the exported handler in onion order. Absent/empty when the app configures no fetch middleware, keeping the generated entry byte-identical to pre-#858 output.; apiRoutes: ApiRouteDecl[] (必填); pageRoutes: PageRouteDecl[] (必填); staticComponents: StaticComponentDecl[] (必填); islands: IslandDecl[] (必填); hasEnhancedForms?: boolean (可选) — True when any page route carries data-open-enhance forms (#569). Drives the dev island client script injection (#951): an island-free app with enhanced forms still needs the client entry in dev HTML.; ssrAdmissionPlan: SsrAdmissionPlan (必填); cemClassifications?: CompatibilityClassification[] (可选); renderers: RendererDecl[] (必填); middlewareScopes: MiddlewareScopeDecl[] (必填); document: DocumentConfig (必填); appShell: AppShellPlan (必填); upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (可选); i18n?: { locales: string[]; defaultLocale: string; } (可选) — Declared project locales. Absent for a single-locale site: the generated entry then emits no locale prefixes and the default-locale fallback, which is byte-identical to pre-i18n output.

packages/protocol/src/ssg.ts:264
ImportDecl@openelement/protocol · ./ssginterfacepublic

One module import the generated entry emits.

ImportDecl

from: string (必填); names: string[] (必填); alias?: string (可选)

packages/protocol/src/ssg.ts:111
IslandDecl@openelement/protocol · ./ssginterfacepublic

One island the build admits: tag, module path, and delivery facts.

IslandDecl

tagName: string (必填); modulePath: string (必填); isPackage?: boolean (可选); exportName?: string (可选) — Optional named export to register as the custom element constructor. Set for package islands from the manifest declaration's `className` (the CEM-derived export class name), so the client island factory can read `mod[exportName]` after #638 removed `export default` from UI component chunks. Absent for local/route islands (which use default).; hydrate?: IslandDeliveryStrategy (可选); ssr?: boolean (可选); dsd?: boolean (可选); authoring?: "basic-element" | "third-party-wc" (可选); source?: "local" | "package" | "nested" (可选); reason?: string (可选)

packages/protocol/src/ssg.ts:174
IslandDeliveryStrategy@openelement/protocol · ./ssgtypepublic

Adapter-owned browser delivery strategy, including media-query admission.

IslandDeliveryStrategy

packages/protocol/src/ssg.ts:31
MiddlewareDecl@openelement/protocol · ./ssginterfacepublic

One middleware module the generated entry composes.

MiddlewareDecl

kind: "requestId" | "logger" | "cors" | "securityHeaders" | "csp" (必填); comment?: string (可选); config.corsOrigin?: CorsOriginConfig (可选); config.corsOriginModule?: string (可选) — Normalized import path of a module default-exporting `(origin: string) => string | undefined`. The generated entry imports the module and passes its default export to `cors({ origin })` — the callback is referenced, never serialized.; config.warnOnDefaultCors?: boolean (可选) — #1411: emit the default-CORS production advisory. Absent means "warn" (production builds); the dev server sets false so the first run is warning-free.; config.csp?: CspConfig (可选)

packages/protocol/src/ssg.ts:128
MiddlewareScopeDecl@openelement/protocol · ./ssginterfacepublic

The scope one middleware applies to (all routes or a named route set).

MiddlewareScopeDecl

varName: string (必填); scope: string (必填); importPath: string (必填)

packages/protocol/src/ssg.ts:233
PageRouteDecl@openelement/protocol · ./ssginterfacepublic

One page route declaration in the generated entry descriptor.

PageRouteDecl

kind: "page" (必填); path: string (必填); varName: string (必填); filePath: string (必填); defaultTagName: string (必填); tagName: string (必填); importPath: string (必填); isDynamic?: boolean (可选); paramNames?: string[] (可选); streamManifest?: StreamRouteManifest (可选)

packages/protocol/src/ssg.ts:160
RendererDecl@openelement/protocol · ./ssginterfacepublic

One page renderer module registration.

RendererDecl

varName: string (必填); scope: string (必填); importPath: string (必填); depth.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; depth.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; depth.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; depth.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; depth.valueOf: () => number (必填) — Returns the primitive value of the specified object.; depth.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/ssg.ts:225
ResolvedAppShell@openelement/protocol · ./ssgtypepublic

The resolved shell for one plan slot: disabled (false) or a full declaration.

ResolvedAppShell

packages/protocol/src/ssg.ts:255
RouteInfoEntry@openelement/protocol · ./ssginterfacepublic

A single route metadata entry emitted as `routeInfo` by the generated SSG entry module (see entry-render-ssg.ts).

RouteInfoEntry

path: string (必填); filePath?: string (可选) — Route module file path. Read by the render pipeline: ssg-render.ts copies it into server-manifest.json for request-time (renderIntent 'dynamic') routes.; tagName: string (必填); module?: unknown (可选) — The route module namespace object (typed per-module at codegen time).; isDynamic: boolean (必填); paramNames: string[] (必填); rendering?: string (可选) — Rendering mode declared via renderIntent.mode ("static" when unset; the "auto" alias is rejected, #609).; hasAction?: boolean (可选) — True when the route module exports an action (request-time form POST).; streamManifest?: StreamRouteManifest (可选); params?: Record<string, string> (可选)

packages/protocol/src/ssg.ts:339
SpeculationRulesOptions@openelement/protocol · ./ssginterfacepublic

Speculation Rules configuration for SSG post-processing

SpeculationRulesOptions

prerender?: string[] (可选) — URL patterns to prerender (fully render in background before navigation).; prefetch?: string[] (可选) — URL patterns to prefetch (fetch HTML + resources without rendering).; exclude?: string[] (可选) — URL patterns to exclude from both prefetch and prerender.; eagerness?: "immediate" | "moderate" | "conservative" (可选) — Eagerness level for prerender rules.

packages/protocol/src/ssg.ts:392
SsgBehaviorOptions@openelement/protocol · ./ssginterfacepublic

User-facing SSG build behavior switches (OpenElementOptions['ssg']).

SsgBehaviorOptions

dynamicRouteFailure?: "fail" | "warn" (可选) — Policy for dynamic-route render failures during SSG. See {@link SsgRenderOptions.dynamicRouteFailure}.

packages/protocol/src/ssg.ts:63
SsgPageOutput@openelement/protocol · ./ssginterfacepublic

Per-page render diagnostics returned by renderRoute()

SsgPageOutput

html: string (必填) — Rendered HTML string; status.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (必填) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; redirect?: { location: string; status: number; } (可选) — Redirect outcome (3xx). When set, `html` holds an interim status page and the result must not be persisted as a normal 200 page.; notFound?: boolean (可选) — True when the route signalled not-found (404).; errors: RenderError[] (必填) — Render errors collected during rendering; componentCount: number (必填) — Number of DSD components rendered on this page; renderTimeMs: number (必填) — Total render time for all components on this page (ms)

packages/protocol/src/ssg.ts:312
SsgRenderEvidence@openelement/protocol · ./ssginterfacepublic

The per-build render evidence record the SSG engine emits for audit.

SsgRenderEvidence

i18nOptions?: { [key: string]: unknown; locales: string[]; defaultLocale?: string; } | null (可选); admissionDecisions?: SsrAdmissionDecision[] (可选) — SSR admission decisions from the plan that rendered the pages.; manifestBudget.islandKB?: number (可选); manifestBudget.totalJsKB?: number (可选); manifestBudget.pageKB?: number (可选); onPrintBuildManifest?: ((input: { root: string; outDir: string; phase: 3; headExtras?: string; budget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; }; }) => void | Prom… (可选)

packages/protocol/src/ssg.ts:370
SsgRenderOptions@openelement/protocol · ./ssginterfacepublic

Options passed to the shared SSG render pipeline.

SsgRenderOptions

root: string (必填); outDir: string (必填); base?: string (可选); headExtras?: string (可选); html.lang?: string (可选); html.title?: string (可选); middleware.csp?: { policy?: string; reportOnly?: boolean; nonce?: boolean; } (可选); upgradeStrategy?: string (可选); viewTransition?: boolean (可选); speculation?: boolean | Record<string, unknown> (可选); islandTagNames?: string[] (可选); routesDir?: string (可选); dynamicRouteFailure?: "fail" | "warn" (可选) — Policy for dynamic-route render failures (HTTP status >= 500, non-empty render errors, or a renderRoute throw) during SSG. - 'fail' (default): abort the build - a failed page must never ship as a normal 200 page. - 'warn': log the failure and skip the page (the page is not written and is not registered in the ISR manifest).

packages/protocol/src/ssg.ts:36
SsgRenderSummary@openelement/protocol · ./ssginterfacepublic

Summary of an SSG render run, returned by ssgRender().

SsgRenderSummary

staticNon200: { path: string; status: number; }[] (必填) — Static routes whose handler returned a non-200 status. hono/ssg drops these responses (defaultPlugin), so they are not written to disk; they are listed here and in the build log instead of disappearing silently.; warnings: string[] (必填) — Non-fatal warnings collected during the SSG run (sitemap generation failures, etc.). Surfaced here so the build summary / release evidence carries them instead of letting them disappear silently.

packages/protocol/src/ssg.ts:72
SsrAdmissionPlan@openelement/protocol · ./ssginterfacepublic

The build-time SSR admission decisions per component tag.

SsrAdmissionPlan

renderableTags: string[] (必填); clientOnlyTags: string[] (必填); rejectedTags: string[] (必填); reasons: Record<string, string> (必填); decisions: SsrAdmissionDecision[] (必填); cemClassifications?: CompatibilityClassification[] (可选); foreignTags?: string[] (可选) — #979: foreign custom-element tags discovered in page / island JSX that are neither local islands, package-manifest islands, nor openElement-authored elements. Visibility only — each tag also carries a source:'foreign' decision (renderPath 'client-only') and the SSR/behavior is unchanged (opaque passthrough).

packages/protocol/src/ssg.ts:207
SsrBundle@openelement/protocol · ./ssginterfacepublic

The server bundle facts the SSG engine consumes for stream rendering.

SsrBundle

packages/protocol/src/ssg.ts:361
StaticComponentDecl@openelement/protocol · ./ssginterfacepublic

Build-host-only compiled component reached through a route's local import graph. These components participate in recursive SSR/SSG expansion but are not client islands and therefore add no hydration or browser entry.

StaticComponentDecl

tagName: string (必填); modulePath: string (必填); compilerInteractionEvents: string[] (必填) — Compiler-owned interaction events; empty means no inferred browser entry.

packages/protocol/src/ssg.ts:199
StreamRouteManifest@openelement/protocol · ./ssginterfacepublic

Build-only route projection bound to a specific compiled page program.

StreamRouteManifest

program: { version: number; tag: string; sha256: string; } (必填); fields: { field: string; signal: string; owners: Array<{ kind: "part" | "region"; index: number; location: string; source: PartProgramV1["sourceMap"]["records"][number… (必填)

packages/protocol/src/ssg.ts:13
STREAM_FRAME_FORBIDDEN_TAGS@openelement/protocol · ./stream-frame-policyconstpublic

Tags a deferred frame cannot safely install into an owned Part range: the browser installer rejects any frame whose markup carries one of these.

readonly ["script", "style", "template", "iframe", "object", "embed", "base", "meta", "link"]

packages/protocol/src/stream-frame-policy.ts:26
STREAM_FRAME_UNSAFE_URL@openelement/protocol · ./stream-frame-policyconstpublic

Schemes that make a URL attribute unsafe in a streamed frame.

RegExp

packages/protocol/src/stream-frame-policy.ts:60
STREAM_FRAME_URL_ATTRIBUTES@openelement/protocol · ./stream-frame-policyconstpublic

URL-carrying attributes the frame check screens for script-bearing scheme obfuscation; only these attribute names are value-screened.

readonly ["href", "src", "action", "formaction", "xlink:href"]

packages/protocol/src/stream-frame-policy.ts:42
STREAM_FRAME_URL_CONTROL_MAX@openelement/protocol · ./stream-frame-policyconstpublic

Control characters at or below this code point are stripped before the URL-scheme test, so tab/newline/control obfuscation cannot smuggle a scheme past admission.

32

packages/protocol/src/stream-frame-policy.ts:55
unsafeStreamFrameAttribute@openelement/protocol · ./stream-frame-policyfunctionpublic

Whether a static attribute (name/value as authored into the Part Program) makes a streamed frame unsafely installable: event-handler, seed-spoofing, and srcdoc names fail outright, and URL-carrying names fail when the entity-decoded, control-stripped value carries a script scheme.

(name: string, value: string): boolean

packages/protocol/src/stream-frame-policy.ts:113
StyleSheetLike@openelement/protocol · ./style-sheetinterfacepublic

Minimal stylesheet contract (replaceSync + cssRules) satisfied by native and shim sheets.

StyleSheetLike

replaceSync: (text: string) => void (必填); cssRules: StyleSheetRule[] (必填)

packages/protocol/src/style-sheet.ts:14
StyleSheetRule@openelement/protocol · ./style-sheetinterfacepublic

Cross-environment CSSStyleSheet abstraction. In browsers this delegates to the native CSSStyleSheet API. In SSR runtimes it falls back to a minimal in-memory implementation that exposes the subset used by OpenElement and renderDsd().

StyleSheetRule

cssText: string (必填)

packages/protocol/src/style-sheet.ts:9
VOID_TAGS@openelement/protocol · ./void-tagsconstpublic

HTML void elements — the ONE canonical tag set for every serializer, validator, and compiler in the workspace (issue #1220, M4). This module is import-free and host-free by design: it sits at the base of the module graph so the DOM runtime (internal/core/html-escape.ts), the Part Program exchange artifact (internal/protocol/part-program.ts), and the compiler semantic core can all consume the same definition without an import cycle or a second source of truth. Content is the full HTML Standard void-element list, `param` included. Do not redefine this set anywhere else; internal/core/html-escape.ts and internal/protocol/part-program.ts re-export it, and __tests__/void-tags-convergence.test.ts enforces the single owner.

ReadonlySet<string>

packages/protocol/src/void-tags.ts:16
Action@openelement/element · roottypepublic

Route action: handles form submissions for a page route.

Action<T, Env, Platform, Route>

packages/protocol/src/data.ts:64
ACTION_FETCH_HEADER@openelement/element · rootconstpublic

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"

packages/protocol/src/data.ts:125
ActionContext@openelement/element · rootinterfacepublic

Context passed to a route action function (extends loader context).

ActionContext<Env, Platform, Route>

formData: FormData (必填); request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:47
ActionResult@openelement/element · roottypepublic

Wire shape returned to the JavaScript form-enhancement path. The no-JS path never sees this: it gets the equivalent semantics as plain HTTP (303 on success, 422 with the re-rendered form on validation failure, redirect/error as status codes). Success carries no data envelope. The application-loop contract makes a successful non-GET action answer 303 (PRG) — the framework never answers 200 with a rendered page, or with a success document, for a successful mutation — so the fetch channel answers `{ type: 'redirect' }` naming the PRG target and the authored return value is discarded by design. Success data travels the PRG target instead (query state the loader re-runs with, which the props projector then maps; see the router guide's "Form actions" section). The union previously declared a `{ type: 'success' }` member that no code path ever emitted — removed so the type matches the wire. Error outcomes (CSRF 403, unknown action 404, unparseable body 400, unexpected 500) are NOT part of this union: since #863 they answer RFC 9457 Problem Details with the PROBLEM_JSON_MEDIA_TYPE content type — see ProblemDetails.

ActionResult<Failure>

packages/protocol/src/data.ts:92
AppShellConfig@openelement/element · roottypepublic

Application shell declaration: `false` disables the shell entirely, `'default'` uses the built-in shell, and the object form names a tag with the module path that defines it (`import`, resolved like a {@link FrameworkOptions.middleware.use } entry) plus the compiled shell properties the router injects per route.

AppShellConfig

packages/protocol/src/framework.ts:96
assertValidTagName@openelement/element · rootfunctionpublic

Assert that a tag name is a valid custom element name.

(tagName: string): void

packages/element/src/internal/core/tag-utils.ts:50
collectPublicProps@openelement/element · rootfunctionpublic

Collect all public (non-internal) own properties from a host object. Keys starting with `__openElement` are framework-internal and excluded. Uses Reflect.get for safe access (respects getters); a getter that throws is skipped with a warning so one bad prop cannot take the tree down.

(host: object): Record<string, unknown>

packages/element/src/internal/core/props-utils.ts:41
CompatibilityClassification@openelement/element · rootinterfacepublic

The per-tag verdict the compatibility scanner records: the tier a discovered tag was classified as, the human-readable `reason`, where the tag was found (`source`), and the SSR/DSD/hydration facts the verdict was derived from.

CompatibilityClassification

tagName: string (必填); tier: CompatibilityTier (必填); reason: string (必填); source: "local" | "package" | "nested" (必填); modulePath?: string (可选); ssr?: boolean (可选); dsd?: boolean (可选); hydrate?: string (可选)

packages/protocol/src/framework.ts:326
CompatibilityTier@openelement/element · roottypepublic

How far a discovered tag may participate in the build: 'ssr-capable' renders and hydrates, 'client-only' ships to the browser without server output, 'experimental-dom' is admitted with a downgraded guarantee, and 'rejected' fails the build.

CompatibilityTier

packages/protocol/src/framework.ts:319
ComponentLayer@openelement/element · roottypepublic

The delivery layer a component belongs to: fully static DSD markup ('dsd-static'), DSD markup with a client island ('dsd-interactive'), a client-only island with no SSR output ('pure-island'), or a light-DOM element ('light-dom'). Recorded per component in the build manifest and consumed by the hydration scheduler.

ComponentLayer

packages/protocol/src/framework.ts:23
computed@openelement/element · rootfunctionpublic

Create a derived read-only signal recomputed from its dependencies.

<T>(fn: () => T): ReadonlySignal<T>

packages/element/src/internal/signal/framework.ts:23
consumeContext@openelement/element · rootfunctionpublic

Consumer-local reactive projection of a protocol context value.

<T>(context: Context<T>, host?: HTMLElement): WritableSignal<T>

key.toString: () => string (必填) — Returns a string representation of an object.; key.valueOf: () => symbol (必填) — Returns the primitive value of the specified object.; key.description: string (必填) — Expose the [[Description]] internal slot of a symbol directly.; key.__@toPrimitive@3992: (hint: string) => symbol (必填) — Converts a Symbol object to a symbol.; key.__@toStringTag@3994: string (必填); defaultValue: T (必填)

packages/element/src/internal/core/signal-context.ts:141
Context@openelement/element · rootinterfacepublic

A typed context token: protocol identity (`key`) plus its default value.

Context<T>

key.toString: () => string (必填) — Returns a string representation of an object.; key.valueOf: () => symbol (必填) — Returns the primitive value of the specified object.; key.description: string (必填) — Expose the [[Description]] internal slot of a symbol directly.; key.__@toPrimitive@3992: (hint: string) => symbol (必填) — Converts a Symbol object to a symbol.; key.__@toStringTag@3994: string (必填); defaultValue: T (必填)

packages/element/src/internal/core/signal-context.ts:13
createContext@openelement/element · rootfunctionpublic

Create a typed context token shared between provider and consumer elements.

<T>(key: symbol, defaultValue: T): Context<T>

toString: () => string (必填) — Returns a string representation of an object.; valueOf: () => symbol (必填) — Returns the primitive value of the specified object.; description: string (必填) — Expose the [[Description]] internal slot of a symbol directly.; __@toPrimitive@3992: (hint: string) => symbol (必填) — Converts a Symbol object to a symbol.; __@toStringTag@3994: string (必填)

packages/element/src/internal/core/signal-context.ts:58
createDeferredDsdExecutor@openelement/element · rootfunctionpublic

Create one request-local deferred shell from a generated route manifest. The manifest hash is checked against the exact runtime wire program before any shell can be produced.

(options: CreateDeferredDsdOptions): Promise<DeferredDsdExecutor>

componentClass: CustomElementConstructor (必填); props?: Record<string, unknown> (可选); manifest: DeferredDsdManifest (必填); instanceId: string (必填); documentToken?: string (可选)

packages/element/src/public-runtime.ts:379
CreateDeferredDsdOptions@openelement/element · rootinterfacepublic

Inputs for a request-scoped deferred DSD server executor.

CreateDeferredDsdOptions

componentClass: CustomElementConstructor (必填); props?: Record<string, unknown> (可选); manifest: DeferredDsdManifest (必填); instanceId: string (必填); documentToken?: string (可选)

packages/element/src/public-runtime.ts:306
createLogger@openelement/element · rootfunctionpublic

Create a {@link Logger} that prefixes every message with `[tag]`.

(tag: string): Logger

packages/element/src/internal/core/logger.ts:18
DANGEROUS_KEYS@openelement/element · rootconstpublic

Object prototype keys that must never be injected from untrusted props.

ReadonlySet<string>

packages/element/src/internal/core/security.ts:25
deepGetElementById@openelement/element · rootfunctionpublic

Resolve `id` (a `#hash` or bare id) against `root` and, when the id is not in that root's own tree, recurse into every nested shadow root. Returns the first match or `null`; a malformed percent-encoded id is not an error.

(id: string, root?: Document | ShadowRoot): HTMLElement | null

packages/element/src/internal/core/deep-fragment.ts:20
DeferredDsdExecutor@openelement/element · rootinterfacepublic

Initial shell, typed seed, and bounded updates for a deferred DSD request.

DeferredDsdExecutor

shell: string (必填); owner: DeferredServerOwner (必填); seed: Record<string, { state: "resolved"; type: string; value: unknown; } | { state: "pending"; type: string; } | { state: "missing"; type: string; }> (必填); resolvedValue: (field: string, value: unknown) => unknown (必填); serializeResolved: (field: string, value: unknown) => string[] (必填)

packages/element/src/public-runtime.ts:315
DeferredDsdManifest@openelement/element · rootinterfacepublic

Maps route-local deferred fields to the compiled Part or Region owners they update.

DeferredDsdManifest

program: { version: number; tag: string; sha256: string; } (必填); fields: readonly { field: string; signal: string; owners: readonly { kind: "part" | "region"; index: number; }[]; }[] (必填)

packages/element/src/public-runtime.ts:296
documentStreamParts@openelement/element · rootfunctionpublic

The same document serialization boundary, with only body wrappers left open.

(options?: DocumentWrapOptions): { prefix: string; suffix: string; }

title?: string (可选); lang?: string (可选); clientScript?: string (可选); scripts?: DocumentScriptDescriptor[] (可选); meta.description?: string (可选); meta.tags?: Record<string, string | number | boolean>[] (可选); devScripts?: string (可选); headExtras?: string (可选); dangerouslyHeadFragments?: string[] (可选); allowHeadExtrasScripts?: boolean (可选); links?: { rel: string; href: string; hreflang?: string; }[] (可选); structuredData?: readonly Record<string, unknown>[] (可选); cspNonce?: string (可选); streamBootstrap?: string (可选) — Trusted framework bootstrap emitted synchronously in the document head.

packages/element/src/internal/core/html-escape.ts:115
effect@openelement/element · rootfunctionpublic

Run a side effect that re-subscribes whenever its signal dependencies change.

(fn: () => void | Unsubscribe): Unsubscribe

packages/element/src/internal/signal/framework.ts:27
element@openelement/element · rootfunctionpublic

Compiler-recognized element decorator; inert no-op at runtime.

(_tag: string, _options?: { root?: "light" | "shadow-open" | "shadow-closed"; delegatesFocus?: boolean; formAssociated?: boolean; }): (target: unknown, context?: unknown) => void

packages/element/src/internal/core/compile-decorators.ts:20
ensureDeepFragmentNavigation@openelement/element · rootfunctionpublic

Install (once per document) framework-level fragment navigation: a same-document anchor click whose target lives inside a nested shadow root scrolls to it and pushes the hash instead of being dropped by the browser. `{ enabled: false }` opts an application out.

(options?: DeepFragmentOptions): void

enabled?: boolean (可选) — Set false before installation to opt out for an application.

packages/element/src/internal/core/deep-fragment.ts:67
ensurePreHydrationClickCapture@openelement/element · rootfunctionpublic

Install the bounded pre-upgrade interaction capture on an owning root (default: the document). Generated client entries call this with their declared island tags before any compiled element upgrades; after a successful claim the element replays the captured events whose targets live inside its root (compiled claim capture/replay, internal/compiled/runtime.ts). Idempotent per root (repeat calls merge tags, never reinstall listeners) and a no-op where no DOM exists (SSR). Invariant: the capture itself — one fixed listener set per owning root, installed once per page — is page-lifetime by design and is NOT the leak. The M1 leak was retained event-target records; each element releases exactly its own records at its activation decision (success or failure), while records owned by still-pending elements survive for their delayed/lazy upgrade (#1170). Boundedness: the facade capture passes the declared-island filter, so only interactions under a still-pending DECLARED island tag enter the queue — ordinary events and undeclared third-party custom elements are skipped (nested pending declared islands still capture through their own unsettled host). With no tags declared the legacy dash heuristic applies. The shared queue carries a hard capacity cap (fail closed), detached records are swept when a claim root adopts its share (and under queue pressure), and each activation decision deterministically empties that root's own bucket, so post-hydration traffic and removals never grow retention.

(root?: EventTarget, pendingTags?: readonly string[]): void

addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void (必填) — The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target. [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener); dispatchEvent: (event: Event) => boolean (必填) — The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent(). [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent); removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void (必填) — The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.…

packages/element/src/internal/compiled/runtime/pre-upgrade-events.ts:672
ERROR_PREFIX@openelement/element · rootconstpublic

Error message prefix for all openElement errors.

"[openElement]"

packages/protocol/src/errors.ts:50
ErrorBoundary@openelement/element · rootclasspublic

Base class for elements that catch descendant render/hydration errors and apply a retry policy.

class ErrorBoundary extends OpenElement

packages/element/src/error-boundary.ts:45
ErrorTelemetryHook@openelement/element · roottypepublic

Callback receiving every reported {@linkcode OpenElementError} for telemetry.

ErrorTelemetryHook

packages/protocol/src/errors.ts:132
escapeAttr@openelement/element · rootfunctionpublic

Escape an HTML attribute value. Delegates to `escapeHtml` so both share the single `ESCAPE_MAP` and the same single-pass replacement (consolidated in #633). Empty-value conventions remain intentionally distinct by design: - `escapeHtml` returns '' for non-string input. - `escapeAttrValue` (below) coerces via `String()` and is the boundary meant for unknown/variable attribute values.

(value: string): string

packages/element/src/internal/core/html-escape.ts:53
escapeHtml@openelement/element · rootfunctionpublic

Escape the five HTML-significant characters in text content.

(str: string): string

packages/element/src/internal/core/html-escape.ts:37
formatError@openelement/element · rootfunctionpublic

Format an unknown thrown value as a human-readable string.

(e: unknown): string

packages/element/src/internal/core/errors.ts:52
FrameworkOptions@openelement/element · rootinterfacepublic

The adapter-facing framework options: where routes, islands and components live, which renderer serializes pages, the application shell and layout declarations, the document `<html>`/head injection channels, and the request-time middleware switches. Every field is optional; the adapter applies its documented default. This is the type an application config file's default export is checked against, so the rendered option table and the actual config surface cannot drift.

FrameworkOptions

renderer?: "native" | "lit" (可选) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderDsd); 'lit' renders LitElement pages through; routesDir?: string (可选) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; islandsDir?: string (可选) — Directory island modules are discovered in. Defaults to `app/islands`.; componentsDir?: string (可选) — Directory non-route components live in. Defaults to `app/components`.; packageIslands?: string[] (可选) — Extra package names whose island modules the build admits, e.g. `['@openelement/ui']`.; appShell?: AppShellConfig (可选) — Application shell declaration; `false` disables the shell, `'default'` uses the built-in one.; layouts?: LayoutsConfig (可选) — Per-layout shell declarations keyed by layout name.; mode?: "ssg" (可选) — Build mode. 'ssg' (default) generates static HTML.; headExtras?: string (可选) — @dangerous injected as-is, only use with controlled content; html.lang?: string (可选); html.title?: string (可选); inject.stylesheets?: (string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[] (可选) — Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.; inject.scripts?: (string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str… (可选) — Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.; inject.headFragments?: string[] (可选) — @dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.; ssr.noExternal?: (string | RegExp)[] (可选); island.upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (可选); build.outDir?: string (可选) — Output directory for the build artifacts. Defaults to `dist`.; build.manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; } (可选) — Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.; viewTransition?: boolean (可选) — Enable the View Transitions API for client navigations. Defaults to true.; speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (可选) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; middleware.cors?: boolean (可选) — Enable the built-in CORS middleware.; middleware.corsOrigin?: string | string[] (可选) — Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.; middleware.corsOriginModule?: string (可选) — Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `appShell.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.; middleware.requestId?: boolean (可选) — Emit and honor a per-request id header.; middleware.logger?: boolean (可选) — Log each request through the built-in logger.; middleware.securityHeaders?: boolean (可选) — Attach the built-in security response headers.; middleware.csp?: { policy?: string; nonce?: boolean; reportOnly?: boolean; } (可选) — Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.; middleware.use?: string[] (可选) — Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `appShell.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configur…

packages/protocol/src/framework.ts:170
HYDRATION_STRATEGIES@openelement/element · rootconstpublic

Runtime list of supported hydration strategies; the single source of truth for the `HydrationStrategy` union. Consumed by island/registry validation and re-exported from the element root for app and build adapters.

readonly ["load", "idle", "visible", "only", "none"]

packages/protocol/src/framework.ts:28
HydrationStrategy@openelement/element · roottypepublic

Island hydration trigger: 'load' | 'idle' | 'visible' | 'only'.

"load" | "idle" | "visible" | "only" | "none"

packages/protocol/src/framework.ts:30
IDLE_FALLBACK_TIMEOUT_MS@openelement/element · rootconstpublic

Idle-hydration scheduling fallback (milliseconds) when neither `requestIdleCallback` nor `requestAnimationFrame` is available.

50

packages/protocol/src/policy.ts:70
injectPropsSafe@openelement/element · rootfunctionpublic

Safely assign caller-supplied props onto a target object, skipping keys that could enable prototype pollution and tolerating read-only properties. The canonical guarded assigner for the canonical dangerous-key rule (#903, #1214): the

(target: Record<string, unknown>, props: Record<string, unknown>, tagName: string, log?: { warn(message: string): void; debug(message: string): void; }): void

packages/element/src/internal/core/security.ts:119
isDangerousKey@openelement/element · rootfunctionpublic

Shared dangerous-key predicate (#903, #1214). Prototype-internal keys must never be injected from untrusted props on ANY path: host prop collection (collectPublicProps / normalizePublicProps in props-utils.ts), guarded assignment (injectPropsSafe below — the SPA bootstrap page-projection write boundary in

(key: string): boolean

packages/element/src/internal/core/security.ts:51
IslandOptions@openelement/element · rootinterfacepublic

Per-island delivery options (hydration strategy, SSR/DSD participation).

IslandOptions

hydrate?: "load" | "idle" | "visible" | "only" | "none" (可选) — Hydration strategy: - 'load': load immediately when module is imported - 'idle': defer to requestIdleCallback (default) - 'visible': use IntersectionObserver to defer until element is visible - 'only': client-only render, no DSD/SSR output Named `hydrate` to match `defineIslandConfig()` in the Router package — one option name across both packages.; dsd?: boolean (可选) — Whether to use DSD for SSR rendering of this island. Honored by the build-side island scan (via `defineIslandConfig`), not by `defineIsland()` itself: passing it in `IslandOptions` has no runtime effect.; ssr?: boolean (可选) — Whether this island may be admitted into server rendering. Like `dsd`, decided by the build-side island scan; inert when passed to `defineIsland()`.

packages/protocol/src/island.ts:8
isSafeAttributeName@openelement/element · rootfunctionpublic

Shared safe-attribute-name predicate (#1033): the SSR face of the one canonical predicate in `../protocol/forbidden-sinks.ts`. A name must be valid HTML attribute-name grammar (blocks quote/space injection, #602), must not be an event handler (`on*`, case-insensitive), and must not be a forbidden sink (`innerhtml`/`srcdoc`). The compiler, protocol validator, and server serializer enforce the same predicate with their own failure strategies; every path delegates to the single implementation, so the boundary cannot diverge.

(name: string): boolean

packages/element/src/internal/core/security.ts:65
isValidTagName@openelement/element · rootfunctionpublic

Check if a tag name is a valid custom element name per HTML spec.

(tagName: string): boolean

packages/element/src/internal/core/tag-utils.ts:38
Loader@openelement/element · roottypepublic

Route loader: fetches data for a page route.

Loader<T, Env, Platform, Route>

packages/protocol/src/data.ts:56
LoaderContext@openelement/element · rootinterfacepublic

Context passed to a request-time ('dynamic') route loader.

LoaderContext<Env, Platform, Route>

request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:40
LocalePath@openelement/element · rootinterfacepublic

Locale-aware resolved path contract.

LocalePath

locale: string (必填); path: string (必填); localizedPath: string (必填); isDefaultLocalePath: boolean (必填)

packages/protocol/src/framework.ts:82
Logger@openelement/element · rootinterfacepublic

logger.ts - Tagged console logger. Lightweight scoped logger. Returns plain functions so it is tree-shakable and has zero class overhead.

Logger

debug: (msg: string, ...args: unknown[]) => void (必填); info: (msg: string, ...args: unknown[]) => void (必填); warn: (msg: string, ...args: unknown[]) => void (必填); error: (msg: string, ...args: unknown[]) => void (必填)

packages/element/src/internal/core/logger.ts:10
MAX_ACTION_BODY_BYTES@openelement/element · rootconstpublic

Request-body bound (bytes) the generated entry applies to action POST routes; larger uploads belong on API routes with explicit limits.

number

packages/protocol/src/policy.ts:57
MAX_COMPOSITION_DEPTH@openelement/element · rootconstpublic

Nested element expansion depth bound for `renderDsd`: cyclic component composition fails closed instead of recursing without end.

8

packages/protocol/src/policy.ts:51
Middleware@openelement/element · roottypepublic

Fetch middleware contract (#858): WinterCG shape, dialect-free — no Hono/h3 context object. Composed at the handler boundary in onion order (`use[0]` is outermost: it sees the request first and the response last), so it runs with identical semantics in the dev server, the `start` CLI, the e2e fixture server, and the Nitro production entry. A middleware may short-circuit by returning a Response without calling `next()`, or post-process the Response that `next()` returns. Module contract: a Middleware is the DEFAULT EXPORT of a module referenced from `middleware.use` by path (e.g. './app/middleware/auth.ts'). The generated server entry imports the module, so the middleware may close over module scope and import local helpers and third-party packages — it is a real module in the server module graph, never serialized source.

Middleware

packages/protocol/src/framework.ts:158
OpenElement@openelement/element · rootclasspublic

Custom Element base class for the compiled Part Program architecture. Subclasses are produced by the compiler; hand-written subclasses that never pass through the compiler fail closed at connect time.

class OpenElement extends OpenElementConfiguration

packages/element/src/open-element-implementation.ts:104
OpenElementAttribute@openelement/element · rootinterfacepublic

One documented attribute of a custom element declaration.

OpenElementAttribute

name: string (必填); type?: string (可选); default?: string (可选); description?: string (可选); reflects?: boolean (可选); fieldName?: string (可选)

packages/protocol/src/manifest.ts:15
OpenElementCssPart@openelement/element · rootinterfacepublic

One documented CSS part of a custom element declaration.

OpenElementCssPart

name: string (必填); description?: string (可选)

packages/protocol/src/manifest.ts:38
OpenElementDeclaration@openelement/element · rootinterfacepublic

One custom element declaration in a package manifest: tag, members and delivery metadata.

OpenElementDeclaration

tagName: string (必填); className?: string (可选); superclassName?: string (可选); attributes?: OpenElementAttribute[] (可选); events?: OpenElementEvent[] (可选); slots?: OpenElementSlot[] (可选); cssParts?: OpenElementCssPart[] (可选); openElement.ssr?: boolean (可选); openElement.dsd?: boolean (可选); openElement.layer?: ComponentLayer (可选); openElement.hydrate?: "load" | "idle" | "visible" | "only" | "none" (可选); openElement.status?: "stable" | "experimental" (可选) — Stability marker from the owning package's manifest policy.; openElement.module?: string (可选); openElement.export?: string (可选); description?: string (可选)

packages/protocol/src/manifest.ts:56
OpenElementError@openelement/element · rootclasspublic

Framework error carrying a stable code, severity, phase and recoverability contract.

class OpenElementError extends Error

packages/protocol/src/errors.ts:100
OpenElementEvent@openelement/element · rootinterfacepublic

One documented custom event of a custom element declaration.

OpenElementEvent

name: string (必填); type?: string (可选); description?: string (可选)

packages/protocol/src/manifest.ts:25
OpenElementPackageManifest@openelement/element · rootinterfacepublic

Package manifest of component declarations (not a Custom Elements Manifest).

OpenElementPackageManifest

schemaVersion: string (必填); packageName: string (必填); version: string (必填); description?: string (可选); author?: string (可选); license?: string (可选); homepage?: string (可选); repository?: string (可选); declarations: OpenElementDeclaration[] (必填)

packages/protocol/src/manifest.ts:69
OpenElementRouteKind@openelement/element · roottypepublic

Host-agnostic route and asset contracts shared by app and build drivers.

OpenElementRouteKind

packages/protocol/src/app-model.ts:2
OpenElementRouteNode@openelement/element · rootinterfacepublic

One node of the host-agnostic route tree: the matched URL `path` and route kind, the source and module paths the drivers resolve, the optional registered tag and param names, and the nested `children`.

OpenElementRouteNode

kind: OpenElementRouteKind (必填); path: string (必填); filePath?: string (可选); importPath?: string (可选); tagName?: string (可选); paramNames?: string[] (可选); children?: OpenElementRouteNode[] (可选); meta?: Record<string, unknown> (可选)

packages/protocol/src/app-model.ts:9
OpenElementSlot@openelement/element · rootinterfacepublic

One documented slot of a custom element declaration.

OpenElementSlot

name: string (必填); description?: string (可选)

packages/protocol/src/manifest.ts:32
PROBLEM_JSON_MEDIA_TYPE@openelement/element · rootconstpublic

Media type of the RFC 9457 action error channel (#863).

"application/problem+json"

packages/protocol/src/data.ts:117
ProblemDetails@openelement/element · rootinterfacepublic

RFC 9457 Problem Details document (#863): the action error channel answers `application/problem+json` instead of the bespoke `{ type: 'error', error: { message } }` JSON, so HTTP tooling recognizes failures natively. With `type: 'about:blank'`, `title` is the HTTP reason phrase and `detail` carries the specific explanation. The wire shape is alpha-unfrozen; the 1.0 acceptance freezes it in this problem+json form.

ProblemDetails

type: string (必填) — URI reference identifying the problem type; 'about:blank' when none applies.; title: string (必填) — Short human-readable summary (the HTTP reason phrase for 'about:blank').; status.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (必填) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; detail?: string (可选) — Human-readable explanation specific to this occurrence.

packages/protocol/src/data.ts:105
property@openelement/element · rootfunctionpublic

Compiler-recognized property decorator; inert no-op at runtime.

(_options: { reflect: boolean; attribute?: false | string; type?: unknown; converter?: unknown; }): (target: unknown, context?: unknown) => void

reflect: boolean (必填); attribute?: string | false (可选); type?: unknown (可选); converter?: unknown (可选)

packages/element/src/internal/core/compile-decorators.ts:34
provideContext@openelement/element · rootfunctionpublic

Provide a plain protocol value; the provider Signal remains OE-private.

<T>(host: HTMLElement, context: Context<T>, value: T): Unsubscribe

packages/element/src/internal/core/signal-context.ts:109
ReadonlySignal@openelement/element · rootinterfacepublic

Read-only signal protocol used by computed values.

ReadonlySignal<T>

value: T (必填); subscribe: (fn: (value: T) => void) => Unsubscribe (必填); __@SIGNAL_BRAND@4106.valueOf: () => boolean (必填) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:26
renderDsd@openelement/element · rootfunctionpublic

Server-render one compiled element through canonical Element composition.

(input: string | CustomElementConstructor, options?: RenderDsdOptions): RenderOutput

packages/element/src/public-runtime.ts:771
RenderDsdOptions@openelement/element · rootinterfacepublic

Options for one `renderDsd()` call: the compiled component class to serialize, the values projected onto its compiled properties, optional route/source diagnostics metadata, the nested compiled tags the build admitted, and trusted parent-owned light children keyed by slot name.

RenderDsdOptions

componentClass?: CustomElementConstructor (可选); props?: Record<string, unknown> (可选); sourceInfo.route?: string (可选); sourceInfo.source?: string (可选); ssrRenderableTags?: readonly string[] (可选) — Build-admitted nested compiled tags. Omitted means shell-only rendering.; projectedChildren?: ReadonlyMap<string, TrustedHtml> (可选) — Trusted parent-owned light children keyed by slot name.

packages/element/src/public-runtime.ts:145
RenderError@openelement/element · rootclasspublic

Recoverable render-phase error carrying the failing component path and tag.

class RenderError extends OpenElementError

packages/element/src/internal/core/errors.ts:95
RenderOutput@openelement/element · rootinterfacepublic

The public result of one `renderDsd()` call: the serialized DSD `html`, the render errors collected while composing it (empty on success), the render metrics for the root component, and the hydration hints the client scheduler reads to upgrade islands.

RenderOutput

html: string (必填); errors: RenderError[] (必填); metrics: DsdRenderMetrics (必填); hydrationHints: HydrationHint[] (必填)

packages/protocol/src/render.ts:34
reportError@openelement/element · rootfunctionpublic

Report an {@linkcode OpenElementError} to the telemetry hook, or console.error when none is installed.

(error: OpenElementError): void

code: string (必填); severity: ErrorSeverity (必填); phase: ErrorPhase (必填); recoverable: boolean (必填); statusCode.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; statusCode.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; statusCode.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; statusCode.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; statusCode.valueOf: () => number (必填) — Returns the primitive value of the specified object.; statusCode.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; toJSON: () => Record<string, unknown> (必填); name: string (必填); message: string (必填); stack?: string (可选); cause?: unknown (可选)

packages/element/src/internal/core/errors.ts:139
RouteEntry@openelement/element · rootinterfacepublic

One route admitted by the scanner: URL `path`, source `filePath`, the route `type`, the generated variable name (`varName`) the entry binds it to, and the optional registration tag. {@link RouteEntry.definePage} and {@link RouteEntry.hasEnhancedForms} carry the two source-derived admission facts the generated entries branch on.

RouteEntry

path: string (必填); filePath: string (必填); type: "page" | "api" | "island" | "special" (必填); varName: string (必填); tagName?: string (可选); definePage?: boolean (可选) — True when the route module's default export is a definePage() definition (#960 — registration decoupling). The generated entry registers the page class under the path-derived fallback tag and IGNORES the tagName export for registration: on a definePage route the export only names a content element. Plain element routes keep tagName as their registration tag.; source?: string (可选) — Source text captured during scanning when includeSource is enabled.; hasEnhancedForms?: boolean (可选) — True when the page route source carries data-open-enhance (#569): the client entry must ship the form-enhancement layer even when the app has zero islands.; special?: SpecialFileType (可选); params?: string[] (可选)

packages/protocol/src/framework.ts:113
ServerRouteContext@openelement/element · rootinterfacepublic

Canonical request-time/SSG server route context.

ServerRouteContext<Env, Platform, Route>

request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:25
ServerRouteMetadata@openelement/element · rootinterfacepublic

Context passed to a request-time ('dynamic') route loader. This is the server contract: the loader runs on the server with the Web-standard request, matched route params, the host environment and the platform object, and signals validation failure via fail()/redirect().

ServerRouteMetadata

path: string (必填); filePath: string (必填)

packages/protocol/src/data.ts:19
setErrorTelemetryHook@openelement/element · rootfunctionpublic

Install the process-wide error telemetry hook (replaceable for tests, HMR, multi-app pages).

(hook: ErrorTelemetryHook): void

packages/element/src/internal/core/errors.ts:127
signal@openelement/element · rootfunctionpublic

Create a writable signal through the selected signal engine.

<T>(initialValue: T): WritableSignal<T>

packages/element/src/internal/signal/framework.ts:19
Signal@openelement/element · roottypepublic

Alias for APIs that accept either writable or read-only signals.

Signal<T>

packages/protocol/src/signal.ts:31
SpecialFileType@openelement/element · roottypepublic

Special file kinds the route scanner recognizes by filename: `renderer` and `middleware`.

SpecialFileType

packages/protocol/src/framework.ts:79
SsrAdmissionDecision@openelement/element · rootinterfacepublic

The build's admission verdict for one discovered tag: where the declaration lives (`modulePath`), how it was discovered (`source`), which render path it is admitted to, and the reason recorded for the manifest.

SsrAdmissionDecision

tagName: string (必填); modulePath: string (必填) — Module path of the island declaration. Empty for 'foreign' decisions: a foreign tag is consumed in JSX but declares no module the build owns.; source: "local" | "package" | "nested" | "foreign" (必填) — 'foreign' (#979): a third-party WC tag discovered by the foreign-tag scanner in page/island JSX — recorded for visibility only; SSR still treats it as an opaque passthrough (renderPath 'client-only').; renderPath: "ssr+client" | "client-only" | "rejected" (必填); reason: string (必填)

packages/protocol/src/render.ts:56
STREAM_FRAME_FORBIDDEN_TAGS@openelement/element · rootconstpublic

Tags a deferred frame cannot safely install into an owned Part range: the browser installer rejects any frame whose markup carries one of these.

readonly ["script", "style", "template", "iframe", "object", "embed", "base", "meta", "link"]

packages/protocol/src/stream-frame-policy.ts:26
STREAM_FRAME_UNSAFE_URL@openelement/element · rootconstpublic

Schemes that make a URL attribute unsafe in a streamed frame.

RegExp

packages/protocol/src/stream-frame-policy.ts:60
STREAM_FRAME_URL_ATTRIBUTES@openelement/element · rootconstpublic

URL-carrying attributes the frame check screens for script-bearing scheme obfuscation; only these attribute names are value-screened.

readonly ["href", "src", "action", "formaction", "xlink:href"]

packages/protocol/src/stream-frame-policy.ts:42
STREAM_FRAME_URL_CONTROL_MAX@openelement/element · rootconstpublic

Control characters at or below this code point are stripped before the URL-scheme test, so tab/newline/control obfuscation cannot smuggle a scheme past admission.

32

packages/protocol/src/stream-frame-policy.ts:55
STREAM_MAX_FIELDS@openelement/element · rootconstpublic

Deferred fields (declared streamed properties) one stream route's manifest may carry. The build scan, the server executor, and the browser seed contract enforce the same bound.

32

packages/protocol/src/policy.ts:24
STREAM_MAX_OWNERS@openelement/element · rootconstpublic

Part/Region owners one stream route's manifest may address in total across all deferred fields.

64

packages/protocol/src/policy.ts:30
STREAM_MAX_PAYLOAD_LENGTH@openelement/element · rootconstpublic

Serialized stream payload bound, as a string length in UTF-16 code units: one seed attribute or one deferred frame's markup may not exceed it. The server checks the JSON text and the rendered range before emitting; the browser checks the attribute before parsing.

number

packages/protocol/src/policy.ts:45
STREAM_MAX_SEED_PROPERTIES@openelement/element · rootconstpublic

Typed properties one streamed seed may carry: the browser seed contract rejects the WHOLE seed above this count, so an oversized component would silently fail to hydrate instead of failing loud at the server.

64

packages/protocol/src/policy.ts:37
STREAM_TIMEOUT_MS@openelement/element · rootconstpublic

Deferred-field resolution budget (milliseconds) for one streamed response: fields still pending when it expires are failed in place and the stream ends with the shell and whatever resolved.

30000

packages/protocol/src/policy.ts:64
StyleSheet@openelement/element · rootconstpublic

Cross-realm StyleSheet constructor: the native CSSStyleSheet or the internal shim.

new () => StyleSheetLike

packages/element/src/internal/core/style-sheet.ts:67
StyleSheetLike@openelement/element · rootinterfacepublic

Minimal stylesheet contract (replaceSync + cssRules) satisfied by native and shim sheets.

StyleSheetLike

replaceSync: (text: string) => void (必填); cssRules: StyleSheetRule[] (必填)

packages/protocol/src/style-sheet.ts:14
trustedHtml@openelement/element · rootfunctionpublic

Mark an HTML string as trusted for explicit `innerHTML` sinks (the trust does not serialize).

(html: string): TrustedHtml

packages/element/src/internal/core/security.ts:86
TrustedHtml@openelement/element · rootinterfacepublic

Opaque capability marking HTML the application has explicitly vetted as trusted.

TrustedHtml

html: string (必填)

packages/element/src/internal/core/security.ts:81
unsafeStreamFrameAttribute@openelement/element · rootfunctionpublic

Whether a static attribute (name/value as authored into the Part Program) makes a streamed frame unsafely installable: event-handler, seed-spoofing, and srcdoc names fail outright, and URL-carrying names fail when the entity-decoded, control-stripped value carries a script scheme.

(name: string, value: string): boolean

packages/protocol/src/stream-frame-policy.ts:113
wrapInDocument@openelement/element · rootfunctionpublic

Wrap rendered HTML in a full HTML document. Adds DOCTYPE, head (title, meta, preload), and body. Supports CSP nonce and dev scripts (e.g. Vite client, route module registration).

(html: string, options?: DocumentWrapOptions): string

packages/element/src/internal/core/html-escape.ts:109
ACTION_FETCH_HEADER@openelement/element · ./authoringconstpublic

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"

packages/protocol/src/data.ts:125
assertValidTagName@openelement/element · ./authoringfunctionpublic

Assert that a tag name is a valid custom element name.

(tagName: string): void

packages/element/src/internal/core/tag-utils.ts:50
DANGEROUS_KEYS@openelement/element · ./authoringconstpublic

Object prototype keys that must never be injected from untrusted props.

ReadonlySet<string>

packages/element/src/internal/core/security.ts:25
ERROR_PREFIX@openelement/element · ./authoringconstpublic

Error message prefix for all openElement errors.

"[openElement]"

packages/protocol/src/errors.ts:50
HYDRATION_STRATEGIES@openelement/element · ./authoringconstpublic

Runtime list of supported hydration strategies; the single source of truth for the `HydrationStrategy` union. Consumed by island/registry validation and re-exported from the element root for app and build adapters.

readonly ["load", "idle", "visible", "only", "none"]

packages/protocol/src/framework.ts:28
HydrationStrategy@openelement/element · ./authoringtypepublic

Island hydration trigger: 'load' | 'idle' | 'visible' | 'only'.

"load" | "idle" | "visible" | "only" | "none"

packages/protocol/src/framework.ts:30
injectPropsSafe@openelement/element · ./authoringfunctionpublic

Safely assign caller-supplied props onto a target object, skipping keys that could enable prototype pollution and tolerating read-only properties. The canonical guarded assigner for the canonical dangerous-key rule (#903, #1214): the

(target: Record<string, unknown>, props: Record<string, unknown>, tagName: string, log?: { warn(message: string): void; debug(message: string): void; }): void

packages/element/src/internal/core/security.ts:119
isDangerousKey@openelement/element · ./authoringfunctionpublic

Shared dangerous-key predicate (#903, #1214). Prototype-internal keys must never be injected from untrusted props on ANY path: host prop collection (collectPublicProps / normalizePublicProps in props-utils.ts), guarded assignment (injectPropsSafe below — the SPA bootstrap page-projection write boundary in

(key: string): boolean

packages/element/src/internal/core/security.ts:51
isSafeAttributeName@openelement/element · ./authoringfunctionpublic

Shared safe-attribute-name predicate (#1033): the SSR face of the one canonical predicate in `../protocol/forbidden-sinks.ts`. A name must be valid HTML attribute-name grammar (blocks quote/space injection, #602), must not be an event handler (`on*`, case-insensitive), and must not be a forbidden sink (`innerhtml`/`srcdoc`). The compiler, protocol validator, and server serializer enforce the same predicate with their own failure strategies; every path delegates to the single implementation, so the boundary cannot diverge.

(name: string): boolean

packages/element/src/internal/core/security.ts:65
isValidTagName@openelement/element · ./authoringfunctionpublic

Check if a tag name is a valid custom element name per HTML spec.

(tagName: string): boolean

packages/element/src/internal/core/tag-utils.ts:38
MAX_ACTION_BODY_BYTES@openelement/element · ./authoringconstpublic

Request-body bound (bytes) the generated entry applies to action POST routes; larger uploads belong on API routes with explicit limits.

number

packages/protocol/src/policy.ts:57
OpenElementError@openelement/element · ./authoringclasspublic

Framework error carrying a stable code, severity, phase and recoverability contract.

class OpenElementError extends Error

packages/protocol/src/errors.ts:100
PROBLEM_JSON_MEDIA_TYPE@openelement/element · ./authoringconstpublic

Media type of the RFC 9457 action error channel (#863).

"application/problem+json"

packages/protocol/src/data.ts:117
STREAM_FRAME_FORBIDDEN_TAGS@openelement/element · ./authoringconstpublic

Tags a deferred frame cannot safely install into an owned Part range: the browser installer rejects any frame whose markup carries one of these.

readonly ["script", "style", "template", "iframe", "object", "embed", "base", "meta", "link"]

packages/protocol/src/stream-frame-policy.ts:26
STREAM_FRAME_UNSAFE_URL@openelement/element · ./authoringconstpublic

Schemes that make a URL attribute unsafe in a streamed frame.

RegExp

packages/protocol/src/stream-frame-policy.ts:60
STREAM_FRAME_URL_ATTRIBUTES@openelement/element · ./authoringconstpublic

URL-carrying attributes the frame check screens for script-bearing scheme obfuscation; only these attribute names are value-screened.

readonly ["href", "src", "action", "formaction", "xlink:href"]

packages/protocol/src/stream-frame-policy.ts:42
STREAM_FRAME_URL_CONTROL_MAX@openelement/element · ./authoringconstpublic

Control characters at or below this code point are stripped before the URL-scheme test, so tab/newline/control obfuscation cannot smuggle a scheme past admission.

32

packages/protocol/src/stream-frame-policy.ts:55
STREAM_MAX_FIELDS@openelement/element · ./authoringconstpublic

Deferred fields (declared streamed properties) one stream route's manifest may carry. The build scan, the server executor, and the browser seed contract enforce the same bound.

32

packages/protocol/src/policy.ts:24
STREAM_MAX_OWNERS@openelement/element · ./authoringconstpublic

Part/Region owners one stream route's manifest may address in total across all deferred fields.

64

packages/protocol/src/policy.ts:30
STREAM_MAX_PAYLOAD_LENGTH@openelement/element · ./authoringconstpublic

Serialized stream payload bound, as a string length in UTF-16 code units: one seed attribute or one deferred frame's markup may not exceed it. The server checks the JSON text and the rendered range before emitting; the browser checks the attribute before parsing.

number

packages/protocol/src/policy.ts:45
STREAM_MAX_SEED_PROPERTIES@openelement/element · ./authoringconstpublic

Typed properties one streamed seed may carry: the browser seed contract rejects the WHOLE seed above this count, so an oversized component would silently fail to hydrate instead of failing loud at the server.

64

packages/protocol/src/policy.ts:37
STREAM_TIMEOUT_MS@openelement/element · ./authoringconstpublic

Deferred-field resolution budget (milliseconds) for one streamed response: fields still pending when it expires are failed in place and the stream ends with the shell and whatever resolved.

30000

packages/protocol/src/policy.ts:64
Action@openelement/element · ./basetypepublic

Route action: handles form submissions for a page route.

Action<T, Env, Platform, Route>

packages/protocol/src/data.ts:64
ACTION_FETCH_HEADER@openelement/element · ./baseconstpublic

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"

packages/protocol/src/data.ts:125
ActionContext@openelement/element · ./baseinterfacepublic

Context passed to a route action function (extends loader context).

ActionContext<Env, Platform, Route>

formData: FormData (必填); request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:47
ActionResult@openelement/element · ./basetypepublic

Wire shape returned to the JavaScript form-enhancement path. The no-JS path never sees this: it gets the equivalent semantics as plain HTTP (303 on success, 422 with the re-rendered form on validation failure, redirect/error as status codes). Success carries no data envelope. The application-loop contract makes a successful non-GET action answer 303 (PRG) — the framework never answers 200 with a rendered page, or with a success document, for a successful mutation — so the fetch channel answers `{ type: 'redirect' }` naming the PRG target and the authored return value is discarded by design. Success data travels the PRG target instead (query state the loader re-runs with, which the props projector then maps; see the router guide's "Form actions" section). The union previously declared a `{ type: 'success' }` member that no code path ever emitted — removed so the type matches the wire. Error outcomes (CSRF 403, unknown action 404, unparseable body 400, unexpected 500) are NOT part of this union: since #863 they answer RFC 9457 Problem Details with the PROBLEM_JSON_MEDIA_TYPE content type — see ProblemDetails.

ActionResult<Failure>

packages/protocol/src/data.ts:92
AppShellConfig@openelement/element · ./basetypepublic

Application shell declaration: `false` disables the shell entirely, `'default'` uses the built-in shell, and the object form names a tag with the module path that defines it (`import`, resolved like a {@link FrameworkOptions.middleware.use } entry) plus the compiled shell properties the router injects per route.

AppShellConfig

packages/protocol/src/framework.ts:96
assertValidTagName@openelement/element · ./basefunctionpublic

Assert that a tag name is a valid custom element name.

(tagName: string): void

packages/element/src/internal/core/tag-utils.ts:50
collectPublicProps@openelement/element · ./basefunctionpublic

Collect all public (non-internal) own properties from a host object. Keys starting with `__openElement` are framework-internal and excluded. Uses Reflect.get for safe access (respects getters); a getter that throws is skipped with a warning so one bad prop cannot take the tree down.

(host: object): Record<string, unknown>

packages/element/src/internal/core/props-utils.ts:41
CompatibilityClassification@openelement/element · ./baseinterfacepublic

The per-tag verdict the compatibility scanner records: the tier a discovered tag was classified as, the human-readable `reason`, where the tag was found (`source`), and the SSR/DSD/hydration facts the verdict was derived from.

CompatibilityClassification

tagName: string (必填); tier: CompatibilityTier (必填); reason: string (必填); source: "local" | "package" | "nested" (必填); modulePath?: string (可选); ssr?: boolean (可选); dsd?: boolean (可选); hydrate?: string (可选)

packages/protocol/src/framework.ts:326
CompatibilityTier@openelement/element · ./basetypepublic

How far a discovered tag may participate in the build: 'ssr-capable' renders and hydrates, 'client-only' ships to the browser without server output, 'experimental-dom' is admitted with a downgraded guarantee, and 'rejected' fails the build.

CompatibilityTier

packages/protocol/src/framework.ts:319
ComponentLayer@openelement/element · ./basetypepublic

The delivery layer a component belongs to: fully static DSD markup ('dsd-static'), DSD markup with a client island ('dsd-interactive'), a client-only island with no SSR output ('pure-island'), or a light-DOM element ('light-dom'). Recorded per component in the build manifest and consumed by the hydration scheduler.

ComponentLayer

packages/protocol/src/framework.ts:23
computed@openelement/element · ./basefunctionpublic

Create a derived read-only signal recomputed from its dependencies.

<T>(fn: () => T): ReadonlySignal<T>

packages/element/src/internal/signal/framework.ts:23
consumeContext@openelement/element · ./basefunctionpublic

Consumer-local reactive projection of a protocol context value.

<T>(context: Context<T>, host?: HTMLElement): WritableSignal<T>

key.toString: () => string (必填) — Returns a string representation of an object.; key.valueOf: () => symbol (必填) — Returns the primitive value of the specified object.; key.description: string (必填) — Expose the [[Description]] internal slot of a symbol directly.; key.__@toPrimitive@5195: (hint: string) => symbol (必填) — Converts a Symbol object to a symbol.; key.__@toStringTag@5197: string (必填); defaultValue: T (必填)

packages/element/src/internal/core/signal-context.ts:141
Context@openelement/element · ./baseinterfacepublic

A typed context token: protocol identity (`key`) plus its default value.

Context<T>

key.toString: () => string (必填) — Returns a string representation of an object.; key.valueOf: () => symbol (必填) — Returns the primitive value of the specified object.; key.description: string (必填) — Expose the [[Description]] internal slot of a symbol directly.; key.__@toPrimitive@5195: (hint: string) => symbol (必填) — Converts a Symbol object to a symbol.; key.__@toStringTag@5197: string (必填); defaultValue: T (必填)

packages/element/src/internal/core/signal-context.ts:13
createContext@openelement/element · ./basefunctionpublic

Create a typed context token shared between provider and consumer elements.

<T>(key: symbol, defaultValue: T): Context<T>

toString: () => string (必填) — Returns a string representation of an object.; valueOf: () => symbol (必填) — Returns the primitive value of the specified object.; description: string (必填) — Expose the [[Description]] internal slot of a symbol directly.; __@toPrimitive@5195: (hint: string) => symbol (必填) — Converts a Symbol object to a symbol.; __@toStringTag@5197: string (必填)

packages/element/src/internal/core/signal-context.ts:58
createDeferredDsdExecutor@openelement/element · ./basefunctionpublic

Create one request-local deferred shell from a generated route manifest. The manifest hash is checked against the exact runtime wire program before any shell can be produced.

(options: CreateDeferredDsdOptions): Promise<DeferredDsdExecutor>

componentClass: CustomElementConstructor (必填); props?: Record<string, unknown> (可选); manifest: DeferredDsdManifest (必填); instanceId: string (必填); documentToken?: string (可选)

packages/element/src/public-runtime.ts:379
CreateDeferredDsdOptions@openelement/element · ./baseinterfacepublic

Inputs for a request-scoped deferred DSD server executor.

CreateDeferredDsdOptions

componentClass: CustomElementConstructor (必填); props?: Record<string, unknown> (可选); manifest: DeferredDsdManifest (必填); instanceId: string (必填); documentToken?: string (可选)

packages/element/src/public-runtime.ts:306
createLogger@openelement/element · ./basefunctionpublic

Create a {@link Logger} that prefixes every message with `[tag]`.

(tag: string): Logger

packages/element/src/internal/core/logger.ts:18
DANGEROUS_KEYS@openelement/element · ./baseconstpublic

Object prototype keys that must never be injected from untrusted props.

ReadonlySet<string>

packages/element/src/internal/core/security.ts:25
deepGetElementById@openelement/element · ./basefunctionpublic

Resolve `id` (a `#hash` or bare id) against `root` and, when the id is not in that root's own tree, recurse into every nested shadow root. Returns the first match or `null`; a malformed percent-encoded id is not an error.

(id: string, root?: Document | ShadowRoot): HTMLElement | null

packages/element/src/internal/core/deep-fragment.ts:20
DeferredDsdExecutor@openelement/element · ./baseinterfacepublic

Initial shell, typed seed, and bounded updates for a deferred DSD request.

DeferredDsdExecutor

shell: string (必填); owner: DeferredServerOwner (必填); seed: Record<string, { state: "resolved"; type: string; value: unknown; } | { state: "pending"; type: string; } | { state: "missing"; type: string; }> (必填); resolvedValue: (field: string, value: unknown) => unknown (必填); serializeResolved: (field: string, value: unknown) => string[] (必填)

packages/element/src/public-runtime.ts:315
DeferredDsdManifest@openelement/element · ./baseinterfacepublic

Maps route-local deferred fields to the compiled Part or Region owners they update.

DeferredDsdManifest

program: { version: number; tag: string; sha256: string; } (必填); fields: readonly { field: string; signal: string; owners: readonly { kind: "part" | "region"; index: number; }[]; }[] (必填)

packages/element/src/public-runtime.ts:296
documentStreamParts@openelement/element · ./basefunctionpublic

The same document serialization boundary, with only body wrappers left open.

(options?: DocumentWrapOptions): { prefix: string; suffix: string; }

title?: string (可选); lang?: string (可选); clientScript?: string (可选); scripts?: DocumentScriptDescriptor[] (可选); meta.description?: string (可选); meta.tags?: Record<string, string | number | boolean>[] (可选); devScripts?: string (可选); headExtras?: string (可选); dangerouslyHeadFragments?: string[] (可选); allowHeadExtrasScripts?: boolean (可选); links?: { rel: string; href: string; hreflang?: string; }[] (可选); structuredData?: readonly Record<string, unknown>[] (可选); cspNonce?: string (可选); streamBootstrap?: string (可选) — Trusted framework bootstrap emitted synchronously in the document head.

packages/element/src/internal/core/html-escape.ts:115
effect@openelement/element · ./basefunctionpublic

Run a side effect that re-subscribes whenever its signal dependencies change.

(fn: () => void | Unsubscribe): Unsubscribe

packages/element/src/internal/signal/framework.ts:27
element@openelement/element · ./basefunctionpublic

Compiler-recognized element decorator; inert no-op at runtime.

(_tag: string, _options?: { root?: "light" | "shadow-open" | "shadow-closed"; delegatesFocus?: boolean; formAssociated?: boolean; }): (target: unknown, context?: unknown) => void

packages/element/src/internal/core/compile-decorators.ts:20
ensureDeepFragmentNavigation@openelement/element · ./basefunctionpublic

Install (once per document) framework-level fragment navigation: a same-document anchor click whose target lives inside a nested shadow root scrolls to it and pushes the hash instead of being dropped by the browser. `{ enabled: false }` opts an application out.

(options?: DeepFragmentOptions): void

enabled?: boolean (可选) — Set false before installation to opt out for an application.

packages/element/src/internal/core/deep-fragment.ts:67
ensurePreHydrationClickCapture@openelement/element · ./basefunctionpublic

Install the bounded pre-upgrade interaction capture on an owning root (default: the document). Generated client entries call this with their declared island tags before any compiled element upgrades; after a successful claim the element replays the captured events whose targets live inside its root (compiled claim capture/replay, internal/compiled/runtime.ts). Idempotent per root (repeat calls merge tags, never reinstall listeners) and a no-op where no DOM exists (SSR). Invariant: the capture itself — one fixed listener set per owning root, installed once per page — is page-lifetime by design and is NOT the leak. The M1 leak was retained event-target records; each element releases exactly its own records at its activation decision (success or failure), while records owned by still-pending elements survive for their delayed/lazy upgrade (#1170). Boundedness: the facade capture passes the declared-island filter, so only interactions under a still-pending DECLARED island tag enter the queue — ordinary events and undeclared third-party custom elements are skipped (nested pending declared islands still capture through their own unsettled host). With no tags declared the legacy dash heuristic applies. The shared queue carries a hard capacity cap (fail closed), detached records are swept when a claim root adopts its share (and under queue pressure), and each activation decision deterministically empties that root's own bucket, so post-hydration traffic and removals never grow retention.

(root?: EventTarget, pendingTags?: readonly string[]): void

addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void (必填) — The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target. [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener); dispatchEvent: (event: Event) => boolean (必填) — The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent(). [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent); removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void (必填) — The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.…

packages/element/src/internal/compiled/runtime/pre-upgrade-events.ts:672
ERROR_PREFIX@openelement/element · ./baseconstpublic

Error message prefix for all openElement errors.

"[openElement]"

packages/protocol/src/errors.ts:50
ErrorBoundary@openelement/element · ./baseclasspublic

Base class for elements that catch descendant render/hydration errors and apply a retry policy.

class ErrorBoundary extends OpenElement

packages/element/src/error-boundary.ts:45
ErrorTelemetryHook@openelement/element · ./basetypepublic

Callback receiving every reported {@linkcode OpenElementError} for telemetry.

ErrorTelemetryHook

packages/protocol/src/errors.ts:132
escapeAttr@openelement/element · ./basefunctionpublic

Escape an HTML attribute value. Delegates to `escapeHtml` so both share the single `ESCAPE_MAP` and the same single-pass replacement (consolidated in #633). Empty-value conventions remain intentionally distinct by design: - `escapeHtml` returns '' for non-string input. - `escapeAttrValue` (below) coerces via `String()` and is the boundary meant for unknown/variable attribute values.

(value: string): string

packages/element/src/internal/core/html-escape.ts:53
escapeHtml@openelement/element · ./basefunctionpublic

Escape the five HTML-significant characters in text content.

(str: string): string

packages/element/src/internal/core/html-escape.ts:37
formatError@openelement/element · ./basefunctionpublic

Format an unknown thrown value as a human-readable string.

(e: unknown): string

packages/element/src/internal/core/errors.ts:52
FrameworkOptions@openelement/element · ./baseinterfacepublic

The adapter-facing framework options: where routes, islands and components live, which renderer serializes pages, the application shell and layout declarations, the document `<html>`/head injection channels, and the request-time middleware switches. Every field is optional; the adapter applies its documented default. This is the type an application config file's default export is checked against, so the rendered option table and the actual config surface cannot drift.

FrameworkOptions

renderer?: "native" | "lit" (可选) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderDsd); 'lit' renders LitElement pages through; routesDir?: string (可选) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; islandsDir?: string (可选) — Directory island modules are discovered in. Defaults to `app/islands`.; componentsDir?: string (可选) — Directory non-route components live in. Defaults to `app/components`.; packageIslands?: string[] (可选) — Extra package names whose island modules the build admits, e.g. `['@openelement/ui']`.; appShell?: AppShellConfig (可选) — Application shell declaration; `false` disables the shell, `'default'` uses the built-in one.; layouts?: LayoutsConfig (可选) — Per-layout shell declarations keyed by layout name.; mode?: "ssg" (可选) — Build mode. 'ssg' (default) generates static HTML.; headExtras?: string (可选) — @dangerous injected as-is, only use with controlled content; html.lang?: string (可选); html.title?: string (可选); inject.stylesheets?: (string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[] (可选) — Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.; inject.scripts?: (string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str… (可选) — Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.; inject.headFragments?: string[] (可选) — @dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.; ssr.noExternal?: (string | RegExp)[] (可选); island.upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (可选); build.outDir?: string (可选) — Output directory for the build artifacts. Defaults to `dist`.; build.manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; } (可选) — Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.; viewTransition?: boolean (可选) — Enable the View Transitions API for client navigations. Defaults to true.; speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (可选) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; middleware.cors?: boolean (可选) — Enable the built-in CORS middleware.; middleware.corsOrigin?: string | string[] (可选) — Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.; middleware.corsOriginModule?: string (可选) — Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `appShell.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.; middleware.requestId?: boolean (可选) — Emit and honor a per-request id header.; middleware.logger?: boolean (可选) — Log each request through the built-in logger.; middleware.securityHeaders?: boolean (可选) — Attach the built-in security response headers.; middleware.csp?: { policy?: string; nonce?: boolean; reportOnly?: boolean; } (可选) — Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.; middleware.use?: string[] (可选) — Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `appShell.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configur…

packages/protocol/src/framework.ts:170
HYDRATION_STRATEGIES@openelement/element · ./baseconstpublic

Runtime list of supported hydration strategies; the single source of truth for the `HydrationStrategy` union. Consumed by island/registry validation and re-exported from the element root for app and build adapters.

readonly ["load", "idle", "visible", "only", "none"]

packages/protocol/src/framework.ts:28
HydrationStrategy@openelement/element · ./basetypepublic

Island hydration trigger: 'load' | 'idle' | 'visible' | 'only'.

"load" | "idle" | "visible" | "only" | "none"

packages/protocol/src/framework.ts:30
IDLE_FALLBACK_TIMEOUT_MS@openelement/element · ./baseconstpublic

Idle-hydration scheduling fallback (milliseconds) when neither `requestIdleCallback` nor `requestAnimationFrame` is available.

50

packages/protocol/src/policy.ts:70
injectPropsSafe@openelement/element · ./basefunctionpublic

Safely assign caller-supplied props onto a target object, skipping keys that could enable prototype pollution and tolerating read-only properties. The canonical guarded assigner for the canonical dangerous-key rule (#903, #1214): the

(target: Record<string, unknown>, props: Record<string, unknown>, tagName: string, log?: { warn(message: string): void; debug(message: string): void; }): void

packages/element/src/internal/core/security.ts:119
isDangerousKey@openelement/element · ./basefunctionpublic

Shared dangerous-key predicate (#903, #1214). Prototype-internal keys must never be injected from untrusted props on ANY path: host prop collection (collectPublicProps / normalizePublicProps in props-utils.ts), guarded assignment (injectPropsSafe below — the SPA bootstrap page-projection write boundary in

(key: string): boolean

packages/element/src/internal/core/security.ts:51
IslandOptions@openelement/element · ./baseinterfacepublic

Per-island delivery options (hydration strategy, SSR/DSD participation).

IslandOptions

hydrate?: "load" | "idle" | "visible" | "only" | "none" (可选) — Hydration strategy: - 'load': load immediately when module is imported - 'idle': defer to requestIdleCallback (default) - 'visible': use IntersectionObserver to defer until element is visible - 'only': client-only render, no DSD/SSR output Named `hydrate` to match `defineIslandConfig()` in the Router package — one option name across both packages.; dsd?: boolean (可选) — Whether to use DSD for SSR rendering of this island. Honored by the build-side island scan (via `defineIslandConfig`), not by `defineIsland()` itself: passing it in `IslandOptions` has no runtime effect.; ssr?: boolean (可选) — Whether this island may be admitted into server rendering. Like `dsd`, decided by the build-side island scan; inert when passed to `defineIsland()`.

packages/protocol/src/island.ts:8
isSafeAttributeName@openelement/element · ./basefunctionpublic

Shared safe-attribute-name predicate (#1033): the SSR face of the one canonical predicate in `../protocol/forbidden-sinks.ts`. A name must be valid HTML attribute-name grammar (blocks quote/space injection, #602), must not be an event handler (`on*`, case-insensitive), and must not be a forbidden sink (`innerhtml`/`srcdoc`). The compiler, protocol validator, and server serializer enforce the same predicate with their own failure strategies; every path delegates to the single implementation, so the boundary cannot diverge.

(name: string): boolean

packages/element/src/internal/core/security.ts:65
isValidTagName@openelement/element · ./basefunctionpublic

Check if a tag name is a valid custom element name per HTML spec.

(tagName: string): boolean

packages/element/src/internal/core/tag-utils.ts:38
Loader@openelement/element · ./basetypepublic

Route loader: fetches data for a page route.

Loader<T, Env, Platform, Route>

packages/protocol/src/data.ts:56
LoaderContext@openelement/element · ./baseinterfacepublic

Context passed to a request-time ('dynamic') route loader.

LoaderContext<Env, Platform, Route>

request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:40
LocalePath@openelement/element · ./baseinterfacepublic

Locale-aware resolved path contract.

LocalePath

locale: string (必填); path: string (必填); localizedPath: string (必填); isDefaultLocalePath: boolean (必填)

packages/protocol/src/framework.ts:82
Logger@openelement/element · ./baseinterfacepublic

logger.ts - Tagged console logger. Lightweight scoped logger. Returns plain functions so it is tree-shakable and has zero class overhead.

Logger

debug: (msg: string, ...args: unknown[]) => void (必填); info: (msg: string, ...args: unknown[]) => void (必填); warn: (msg: string, ...args: unknown[]) => void (必填); error: (msg: string, ...args: unknown[]) => void (必填)

packages/element/src/internal/core/logger.ts:10
MAX_ACTION_BODY_BYTES@openelement/element · ./baseconstpublic

Request-body bound (bytes) the generated entry applies to action POST routes; larger uploads belong on API routes with explicit limits.

number

packages/protocol/src/policy.ts:57
MAX_COMPOSITION_DEPTH@openelement/element · ./baseconstpublic

Nested element expansion depth bound for `renderDsd`: cyclic component composition fails closed instead of recursing without end.

8

packages/protocol/src/policy.ts:51
Middleware@openelement/element · ./basetypepublic

Fetch middleware contract (#858): WinterCG shape, dialect-free — no Hono/h3 context object. Composed at the handler boundary in onion order (`use[0]` is outermost: it sees the request first and the response last), so it runs with identical semantics in the dev server, the `start` CLI, the e2e fixture server, and the Nitro production entry. A middleware may short-circuit by returning a Response without calling `next()`, or post-process the Response that `next()` returns. Module contract: a Middleware is the DEFAULT EXPORT of a module referenced from `middleware.use` by path (e.g. './app/middleware/auth.ts'). The generated server entry imports the module, so the middleware may close over module scope and import local helpers and third-party packages — it is a real module in the server module graph, never serialized source.

Middleware

packages/protocol/src/framework.ts:158
OpenElement@openelement/element · ./baseclasspublic

Custom Element base class for the compiled Part Program architecture. Subclasses are produced by the compiler; hand-written subclasses that never pass through the compiler fail closed at connect time.

class OpenElement extends OpenElementConfiguration

packages/element/src/open-element-implementation.ts:104
OpenElementAttribute@openelement/element · ./baseinterfacepublic

One documented attribute of a custom element declaration.

OpenElementAttribute

name: string (必填); type?: string (可选); default?: string (可选); description?: string (可选); reflects?: boolean (可选); fieldName?: string (可选)

packages/protocol/src/manifest.ts:15
OpenElementCssPart@openelement/element · ./baseinterfacepublic

One documented CSS part of a custom element declaration.

OpenElementCssPart

name: string (必填); description?: string (可选)

packages/protocol/src/manifest.ts:38
OpenElementDeclaration@openelement/element · ./baseinterfacepublic

One custom element declaration in a package manifest: tag, members and delivery metadata.

OpenElementDeclaration

tagName: string (必填); className?: string (可选); superclassName?: string (可选); attributes?: OpenElementAttribute[] (可选); events?: OpenElementEvent[] (可选); slots?: OpenElementSlot[] (可选); cssParts?: OpenElementCssPart[] (可选); openElement.ssr?: boolean (可选); openElement.dsd?: boolean (可选); openElement.layer?: ComponentLayer (可选); openElement.hydrate?: "load" | "idle" | "visible" | "only" | "none" (可选); openElement.status?: "stable" | "experimental" (可选) — Stability marker from the owning package's manifest policy.; openElement.module?: string (可选); openElement.export?: string (可选); description?: string (可选)

packages/protocol/src/manifest.ts:56
OpenElementError@openelement/element · ./baseclasspublic

Framework error carrying a stable code, severity, phase and recoverability contract.

class OpenElementError extends Error

packages/protocol/src/errors.ts:100
OpenElementEvent@openelement/element · ./baseinterfacepublic

One documented custom event of a custom element declaration.

OpenElementEvent

name: string (必填); type?: string (可选); description?: string (可选)

packages/protocol/src/manifest.ts:25
OpenElementPackageManifest@openelement/element · ./baseinterfacepublic

Package manifest of component declarations (not a Custom Elements Manifest).

OpenElementPackageManifest

schemaVersion: string (必填); packageName: string (必填); version: string (必填); description?: string (可选); author?: string (可选); license?: string (可选); homepage?: string (可选); repository?: string (可选); declarations: OpenElementDeclaration[] (必填)

packages/protocol/src/manifest.ts:69
OpenElementRouteKind@openelement/element · ./basetypepublic

Host-agnostic route and asset contracts shared by app and build drivers.

OpenElementRouteKind

packages/protocol/src/app-model.ts:2
OpenElementRouteNode@openelement/element · ./baseinterfacepublic

One node of the host-agnostic route tree: the matched URL `path` and route kind, the source and module paths the drivers resolve, the optional registered tag and param names, and the nested `children`.

OpenElementRouteNode

kind: OpenElementRouteKind (必填); path: string (必填); filePath?: string (可选); importPath?: string (可选); tagName?: string (可选); paramNames?: string[] (可选); children?: OpenElementRouteNode[] (可选); meta?: Record<string, unknown> (可选)

packages/protocol/src/app-model.ts:9
OpenElementSlot@openelement/element · ./baseinterfacepublic

One documented slot of a custom element declaration.

OpenElementSlot

name: string (必填); description?: string (可选)

packages/protocol/src/manifest.ts:32
PROBLEM_JSON_MEDIA_TYPE@openelement/element · ./baseconstpublic

Media type of the RFC 9457 action error channel (#863).

"application/problem+json"

packages/protocol/src/data.ts:117
ProblemDetails@openelement/element · ./baseinterfacepublic

RFC 9457 Problem Details document (#863): the action error channel answers `application/problem+json` instead of the bespoke `{ type: 'error', error: { message } }` JSON, so HTTP tooling recognizes failures natively. With `type: 'about:blank'`, `title` is the HTTP reason phrase and `detail` carries the specific explanation. The wire shape is alpha-unfrozen; the 1.0 acceptance freezes it in this problem+json form.

ProblemDetails

type: string (必填) — URI reference identifying the problem type; 'about:blank' when none applies.; title: string (必填) — Short human-readable summary (the HTTP reason phrase for 'about:blank').; status.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (必填) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; detail?: string (可选) — Human-readable explanation specific to this occurrence.

packages/protocol/src/data.ts:105
property@openelement/element · ./basefunctionpublic

Compiler-recognized property decorator; inert no-op at runtime.

(_options: { reflect: boolean; attribute?: false | string; type?: unknown; converter?: unknown; }): (target: unknown, context?: unknown) => void

reflect: boolean (必填); attribute?: string | false (可选); type?: unknown (可选); converter?: unknown (可选)

packages/element/src/internal/core/compile-decorators.ts:34
provideContext@openelement/element · ./basefunctionpublic

Provide a plain protocol value; the provider Signal remains OE-private.

<T>(host: HTMLElement, context: Context<T>, value: T): Unsubscribe

packages/element/src/internal/core/signal-context.ts:109
ReadonlySignal@openelement/element · ./baseinterfacepublic

Read-only signal protocol used by computed values.

ReadonlySignal<T>

value: T (必填); subscribe: (fn: (value: T) => void) => Unsubscribe (必填); __@SIGNAL_BRAND@5309.valueOf: () => boolean (必填) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:26
renderDsd@openelement/element · ./basefunctionpublic

Server-render one compiled element through canonical Element composition.

(input: string | CustomElementConstructor, options?: RenderDsdOptions): RenderOutput

packages/element/src/public-runtime.ts:771
RenderDsdOptions@openelement/element · ./baseinterfacepublic

Options for one `renderDsd()` call: the compiled component class to serialize, the values projected onto its compiled properties, optional route/source diagnostics metadata, the nested compiled tags the build admitted, and trusted parent-owned light children keyed by slot name.

RenderDsdOptions

componentClass?: CustomElementConstructor (可选); props?: Record<string, unknown> (可选); sourceInfo.route?: string (可选); sourceInfo.source?: string (可选); ssrRenderableTags?: readonly string[] (可选) — Build-admitted nested compiled tags. Omitted means shell-only rendering.; projectedChildren?: ReadonlyMap<string, TrustedHtml> (可选) — Trusted parent-owned light children keyed by slot name.

packages/element/src/public-runtime.ts:145
RenderError@openelement/element · ./baseclasspublic

Recoverable render-phase error carrying the failing component path and tag.

class RenderError extends OpenElementError

packages/element/src/internal/core/errors.ts:95
RenderOutput@openelement/element · ./baseinterfacepublic

The public result of one `renderDsd()` call: the serialized DSD `html`, the render errors collected while composing it (empty on success), the render metrics for the root component, and the hydration hints the client scheduler reads to upgrade islands.

RenderOutput

html: string (必填); errors: RenderError[] (必填); metrics: DsdRenderMetrics (必填); hydrationHints: HydrationHint[] (必填)

packages/protocol/src/render.ts:34
reportError@openelement/element · ./basefunctionpublic

Report an {@linkcode OpenElementError} to the telemetry hook, or console.error when none is installed.

(error: OpenElementError): void

code: string (必填); severity: ErrorSeverity (必填); phase: ErrorPhase (必填); recoverable: boolean (必填); statusCode.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; statusCode.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; statusCode.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; statusCode.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; statusCode.valueOf: () => number (必填) — Returns the primitive value of the specified object.; statusCode.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; toJSON: () => Record<string, unknown> (必填); name: string (必填); message: string (必填); stack?: string (可选); cause?: unknown (可选)

packages/element/src/internal/core/errors.ts:139
RouteEntry@openelement/element · ./baseinterfacepublic

One route admitted by the scanner: URL `path`, source `filePath`, the route `type`, the generated variable name (`varName`) the entry binds it to, and the optional registration tag. {@link RouteEntry.definePage} and {@link RouteEntry.hasEnhancedForms} carry the two source-derived admission facts the generated entries branch on.

RouteEntry

path: string (必填); filePath: string (必填); type: "page" | "api" | "island" | "special" (必填); varName: string (必填); tagName?: string (可选); definePage?: boolean (可选) — True when the route module's default export is a definePage() definition (#960 — registration decoupling). The generated entry registers the page class under the path-derived fallback tag and IGNORES the tagName export for registration: on a definePage route the export only names a content element. Plain element routes keep tagName as their registration tag.; source?: string (可选) — Source text captured during scanning when includeSource is enabled.; hasEnhancedForms?: boolean (可选) — True when the page route source carries data-open-enhance (#569): the client entry must ship the form-enhancement layer even when the app has zero islands.; special?: SpecialFileType (可选); params?: string[] (可选)

packages/protocol/src/framework.ts:113
ServerRouteContext@openelement/element · ./baseinterfacepublic

Canonical request-time/SSG server route context.

ServerRouteContext<Env, Platform, Route>

request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:25
ServerRouteMetadata@openelement/element · ./baseinterfacepublic

Context passed to a request-time ('dynamic') route loader. This is the server contract: the loader runs on the server with the Web-standard request, matched route params, the host environment and the platform object, and signals validation failure via fail()/redirect().

ServerRouteMetadata

path: string (必填); filePath: string (必填)

packages/protocol/src/data.ts:19
setErrorTelemetryHook@openelement/element · ./basefunctionpublic

Install the process-wide error telemetry hook (replaceable for tests, HMR, multi-app pages).

(hook: ErrorTelemetryHook): void

packages/element/src/internal/core/errors.ts:127
signal@openelement/element · ./basefunctionpublic

Create a writable signal through the selected signal engine.

<T>(initialValue: T): WritableSignal<T>

packages/element/src/internal/signal/framework.ts:19
Signal@openelement/element · ./basetypepublic

Alias for APIs that accept either writable or read-only signals.

Signal<T>

packages/protocol/src/signal.ts:31
SpecialFileType@openelement/element · ./basetypepublic

Special file kinds the route scanner recognizes by filename: `renderer` and `middleware`.

SpecialFileType

packages/protocol/src/framework.ts:79
SsrAdmissionDecision@openelement/element · ./baseinterfacepublic

The build's admission verdict for one discovered tag: where the declaration lives (`modulePath`), how it was discovered (`source`), which render path it is admitted to, and the reason recorded for the manifest.

SsrAdmissionDecision

tagName: string (必填); modulePath: string (必填) — Module path of the island declaration. Empty for 'foreign' decisions: a foreign tag is consumed in JSX but declares no module the build owns.; source: "local" | "package" | "nested" | "foreign" (必填) — 'foreign' (#979): a third-party WC tag discovered by the foreign-tag scanner in page/island JSX — recorded for visibility only; SSR still treats it as an opaque passthrough (renderPath 'client-only').; renderPath: "ssr+client" | "client-only" | "rejected" (必填); reason: string (必填)

packages/protocol/src/render.ts:56
STREAM_FRAME_FORBIDDEN_TAGS@openelement/element · ./baseconstpublic

Tags a deferred frame cannot safely install into an owned Part range: the browser installer rejects any frame whose markup carries one of these.

readonly ["script", "style", "template", "iframe", "object", "embed", "base", "meta", "link"]

packages/protocol/src/stream-frame-policy.ts:26
STREAM_FRAME_UNSAFE_URL@openelement/element · ./baseconstpublic

Schemes that make a URL attribute unsafe in a streamed frame.

RegExp

packages/protocol/src/stream-frame-policy.ts:60
STREAM_FRAME_URL_ATTRIBUTES@openelement/element · ./baseconstpublic

URL-carrying attributes the frame check screens for script-bearing scheme obfuscation; only these attribute names are value-screened.

readonly ["href", "src", "action", "formaction", "xlink:href"]

packages/protocol/src/stream-frame-policy.ts:42
STREAM_FRAME_URL_CONTROL_MAX@openelement/element · ./baseconstpublic

Control characters at or below this code point are stripped before the URL-scheme test, so tab/newline/control obfuscation cannot smuggle a scheme past admission.

32

packages/protocol/src/stream-frame-policy.ts:55
STREAM_MAX_FIELDS@openelement/element · ./baseconstpublic

Deferred fields (declared streamed properties) one stream route's manifest may carry. The build scan, the server executor, and the browser seed contract enforce the same bound.

32

packages/protocol/src/policy.ts:24
STREAM_MAX_OWNERS@openelement/element · ./baseconstpublic

Part/Region owners one stream route's manifest may address in total across all deferred fields.

64

packages/protocol/src/policy.ts:30
STREAM_MAX_PAYLOAD_LENGTH@openelement/element · ./baseconstpublic

Serialized stream payload bound, as a string length in UTF-16 code units: one seed attribute or one deferred frame's markup may not exceed it. The server checks the JSON text and the rendered range before emitting; the browser checks the attribute before parsing.

number

packages/protocol/src/policy.ts:45
STREAM_MAX_SEED_PROPERTIES@openelement/element · ./baseconstpublic

Typed properties one streamed seed may carry: the browser seed contract rejects the WHOLE seed above this count, so an oversized component would silently fail to hydrate instead of failing loud at the server.

64

packages/protocol/src/policy.ts:37
STREAM_TIMEOUT_MS@openelement/element · ./baseconstpublic

Deferred-field resolution budget (milliseconds) for one streamed response: fields still pending when it expires are failed in place and the stream ends with the shell and whatever resolved.

30000

packages/protocol/src/policy.ts:64
StyleSheet@openelement/element · ./baseconstpublic

Cross-realm StyleSheet constructor: the native CSSStyleSheet or the internal shim.

new () => StyleSheetLike

packages/element/src/internal/core/style-sheet.ts:67
StyleSheetLike@openelement/element · ./baseinterfacepublic

Minimal stylesheet contract (replaceSync + cssRules) satisfied by native and shim sheets.

StyleSheetLike

replaceSync: (text: string) => void (必填); cssRules: StyleSheetRule[] (必填)

packages/protocol/src/style-sheet.ts:14
trustedHtml@openelement/element · ./basefunctionpublic

Mark an HTML string as trusted for explicit `innerHTML` sinks (the trust does not serialize).

(html: string): TrustedHtml

packages/element/src/internal/core/security.ts:86
TrustedHtml@openelement/element · ./baseinterfacepublic

Opaque capability marking HTML the application has explicitly vetted as trusted.

TrustedHtml

html: string (必填)

packages/element/src/internal/core/security.ts:81
unsafeStreamFrameAttribute@openelement/element · ./basefunctionpublic

Whether a static attribute (name/value as authored into the Part Program) makes a streamed frame unsafely installable: event-handler, seed-spoofing, and srcdoc names fail outright, and URL-carrying names fail when the entity-decoded, control-stripped value carries a script scheme.

(name: string, value: string): boolean

packages/protocol/src/stream-frame-policy.ts:113
wrapInDocument@openelement/element · ./basefunctionpublic

Wrap rendered HTML in a full HTML document. Adds DOCTYPE, head (title, meta, preload), and body. Supports CSP nonce and dev scripts (e.g. Vite client, route module registration).

(html: string, options?: DocumentWrapOptions): string

packages/element/src/internal/core/html-escape.ts:109
composeFetchMiddleware@openelement/element · ./build-utilsfunctionpublic

Compose a fetch middleware chain (#858) around a handler, in onion order: `middleware[0]` is outermost — it sees the request first and the response last. A middleware may short-circuit by returning a Response without calling `next()`. Extra arguments (runtime context such as env/platform) thread transparently past the middleware chain to the terminal handler — the WinterCG-shaped middleware itself only ever sees `(request, next)`. Generated server entries call this once at module scope so the dev server, the `start` CLI, the e2e fixture server, and the Nitro production entry all share the same composed handler.

<Args extends unknown[]>(middleware: Middleware[], handler: (request: Request, ...args: Args) => Promise<Response>): (request: Request, ...args: Args) => Promise<Response>

packages/element/src/internal/core/runtime.ts:47
createRuntimeAdapter@openelement/element · ./build-utilsfunctionpublic

Normalize a runtime adapter declaration: pass the name, fetch handler and optional prerender iterator through unchanged so a host integration only implements the {@link RuntimeAdapter} contract it needs.

<Env extends Record<string, unknown> = Record<string, unknown>>(options: RuntimeAdapterOptions<Env>): RuntimeAdapter<Env>

name: string (必填); fetch: OpenElementRequestHandler<Env> (必填); prerender?: (() => AsyncIterable<RuntimePrerenderResult> | Iterable<RuntimePrerenderResult>) (可选)

packages/element/src/internal/core/runtime.ts:23
formatJson@openelement/element · ./build-utilsfunctionpublic

Serialize a value to pretty-printed JSON ending with a newline.

(value: unknown): string

packages/element/src/internal/core/write-json.ts:11
insertBeforeBodyClose@openelement/element · ./build-utilsfunctionpublic

Insert markup before a tolerant HTML body close (`</body >`, case-insensitive).

(html: string, content: string): string

packages/element/src/internal/core/html-route-utils.ts:2
normalizeSeparators@openelement/element · ./build-utilsfunctionpublic

Normalize path separators and collapse duplicates. - Backslashes and forward slashes are replaced with the chosen separator. - Repeated separators are collapsed to a single separator.

(path: string, sep?: "/" | "-"): string

packages/element/src/internal/core/path-utils.ts:17
OpenElementRequestHandler@openelement/element · ./build-utilstypepublic

The host-neutral request handler every runtime adapter and generated server entry exposes: a WinterCG `(request, context?) => Response` with no server engine dialect baked in.

OpenElementRequestHandler<Env>

packages/protocol/src/runtime.ts:27
pathToTagName@openelement/element · ./build-utilsfunctionpublic

Convert a file path into a kebab-cased custom element tag name. - Removes a leading `./` or `/`. - Strips known file extensions (`ts`, `tsx`, `js`, `jsx`, `mjs`, `mdx`). - Replaces directory separators with hyphens. - Ensures the result starts with a letter and contains at least one hyphen.

(filePath: string): string

packages/element/src/internal/core/path-utils.ts:32
RuntimeContext@openelement/element · ./build-utilsinterfacepublic

runtime.ts - Runtime adapter protocol. Replacement boundary for Nitro, Workers, Node, Deno, or future fetch-compatible runtimes. Preserves openElement semantics while leaving concrete server engines outside this package.

RuntimeContext<Env>

env?: Env (可选); platform?: unknown (可选); params?: Record<string, string> (可选)

packages/protocol/src/runtime.ts:9
SsrRenderError@openelement/element · ./build-utilsclasspublic

Thrown by the SSG build pipeline when the SSR bundle fails to load or the pipeline throws; re-exported via `@openelement/element/build-utils`. Carries the failing component path plus the original error as `cause`.

class SsrRenderError extends OpenElementError

packages/element/src/internal/core/errors.ts:74
transformIslandSource@openelement/element · ./build-utilsfunctionpublic

Inject island metadata markers into source code. Only transforms files inside the islands directory. Tag names are derived from the file path and normalized to valid custom element names (lowercase letters, digits, and hyphens). Unsafe characters are silently normalized to hyphens.

(source: string, options: IslandTransformOptions): IslandTransformResult

packages/element/src/internal/core/island-transform.ts:20
Action@openelement/element · ./client-onlytypepublic

Route action: handles form submissions for a page route.

Action<T, Env, Platform, Route>

packages/protocol/src/data.ts:64
ACTION_FETCH_HEADER@openelement/element · ./client-onlyconstpublic

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"

packages/protocol/src/data.ts:125
ActionContext@openelement/element · ./client-onlyinterfacepublic

Context passed to a route action function (extends loader context).

ActionContext<Env, Platform, Route>

formData: FormData (必填); request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:47
ActionResult@openelement/element · ./client-onlytypepublic

Wire shape returned to the JavaScript form-enhancement path. The no-JS path never sees this: it gets the equivalent semantics as plain HTTP (303 on success, 422 with the re-rendered form on validation failure, redirect/error as status codes). Success carries no data envelope. The application-loop contract makes a successful non-GET action answer 303 (PRG) — the framework never answers 200 with a rendered page, or with a success document, for a successful mutation — so the fetch channel answers `{ type: 'redirect' }` naming the PRG target and the authored return value is discarded by design. Success data travels the PRG target instead (query state the loader re-runs with, which the props projector then maps; see the router guide's "Form actions" section). The union previously declared a `{ type: 'success' }` member that no code path ever emitted — removed so the type matches the wire. Error outcomes (CSRF 403, unknown action 404, unparseable body 400, unexpected 500) are NOT part of this union: since #863 they answer RFC 9457 Problem Details with the PROBLEM_JSON_MEDIA_TYPE content type — see ProblemDetails.

ActionResult<Failure>

packages/protocol/src/data.ts:92
AppShellConfig@openelement/element · ./client-onlytypepublic

Application shell declaration: `false` disables the shell entirely, `'default'` uses the built-in shell, and the object form names a tag with the module path that defines it (`import`, resolved like a {@link FrameworkOptions.middleware.use } entry) plus the compiled shell properties the router injects per route.

AppShellConfig

packages/protocol/src/framework.ts:96
assertValidTagName@openelement/element · ./client-onlyfunctionpublic

Assert that a tag name is a valid custom element name.

(tagName: string): void

packages/element/src/internal/core/tag-utils.ts:50
collectPublicProps@openelement/element · ./client-onlyfunctionpublic

Collect all public (non-internal) own properties from a host object. Keys starting with `__openElement` are framework-internal and excluded. Uses Reflect.get for safe access (respects getters); a getter that throws is skipped with a warning so one bad prop cannot take the tree down.

(host: object): Record<string, unknown>

packages/element/src/internal/core/props-utils.ts:41
CompatibilityClassification@openelement/element · ./client-onlyinterfacepublic

The per-tag verdict the compatibility scanner records: the tier a discovered tag was classified as, the human-readable `reason`, where the tag was found (`source`), and the SSR/DSD/hydration facts the verdict was derived from.

CompatibilityClassification

tagName: string (必填); tier: CompatibilityTier (必填); reason: string (必填); source: "local" | "package" | "nested" (必填); modulePath?: string (可选); ssr?: boolean (可选); dsd?: boolean (可选); hydrate?: string (可选)

packages/protocol/src/framework.ts:326
CompatibilityTier@openelement/element · ./client-onlytypepublic

How far a discovered tag may participate in the build: 'ssr-capable' renders and hydrates, 'client-only' ships to the browser without server output, 'experimental-dom' is admitted with a downgraded guarantee, and 'rejected' fails the build.

CompatibilityTier

packages/protocol/src/framework.ts:319
ComponentLayer@openelement/element · ./client-onlytypepublic

The delivery layer a component belongs to: fully static DSD markup ('dsd-static'), DSD markup with a client island ('dsd-interactive'), a client-only island with no SSR output ('pure-island'), or a light-DOM element ('light-dom'). Recorded per component in the build manifest and consumed by the hydration scheduler.

ComponentLayer

packages/protocol/src/framework.ts:23
computed@openelement/element · ./client-onlyfunctionpublic

Create a derived read-only signal recomputed from its dependencies.

<T>(fn: () => T): ReadonlySignal<T>

packages/element/src/internal/signal/framework.ts:23
consumeContext@openelement/element · ./client-onlyfunctionpublic

Consumer-local reactive projection of a protocol context value.

<T>(context: Context<T>, host?: HTMLElement): WritableSignal<T>

key.toString: () => string (必填) — Returns a string representation of an object.; key.valueOf: () => symbol (必填) — Returns the primitive value of the specified object.; key.description: string (必填) — Expose the [[Description]] internal slot of a symbol directly.; key.__@toPrimitive@6383: (hint: string) => symbol (必填) — Converts a Symbol object to a symbol.; key.__@toStringTag@6385: string (必填); defaultValue: T (必填)

packages/element/src/internal/core/signal-context.ts:141
Context@openelement/element · ./client-onlyinterfacepublic

A typed context token: protocol identity (`key`) plus its default value.

Context<T>

key.toString: () => string (必填) — Returns a string representation of an object.; key.valueOf: () => symbol (必填) — Returns the primitive value of the specified object.; key.description: string (必填) — Expose the [[Description]] internal slot of a symbol directly.; key.__@toPrimitive@6383: (hint: string) => symbol (必填) — Converts a Symbol object to a symbol.; key.__@toStringTag@6385: string (必填); defaultValue: T (必填)

packages/element/src/internal/core/signal-context.ts:13
createContext@openelement/element · ./client-onlyfunctionpublic

Create a typed context token shared between provider and consumer elements.

<T>(key: symbol, defaultValue: T): Context<T>

toString: () => string (必填) — Returns a string representation of an object.; valueOf: () => symbol (必填) — Returns the primitive value of the specified object.; description: string (必填) — Expose the [[Description]] internal slot of a symbol directly.; __@toPrimitive@6383: (hint: string) => symbol (必填) — Converts a Symbol object to a symbol.; __@toStringTag@6385: string (必填)

packages/element/src/internal/core/signal-context.ts:58
createDeferredDsdExecutor@openelement/element · ./client-onlyfunctionpublic

Create one request-local deferred shell from a generated route manifest. The manifest hash is checked against the exact runtime wire program before any shell can be produced.

(options: CreateDeferredDsdOptions): Promise<DeferredDsdExecutor>

componentClass: CustomElementConstructor (必填); props?: Record<string, unknown> (可选); manifest: DeferredDsdManifest (必填); instanceId: string (必填); documentToken?: string (可选)

packages/element/src/public-runtime.ts:379
CreateDeferredDsdOptions@openelement/element · ./client-onlyinterfacepublic

Inputs for a request-scoped deferred DSD server executor.

CreateDeferredDsdOptions

componentClass: CustomElementConstructor (必填); props?: Record<string, unknown> (可选); manifest: DeferredDsdManifest (必填); instanceId: string (必填); documentToken?: string (可选)

packages/element/src/public-runtime.ts:306
createLogger@openelement/element · ./client-onlyfunctionpublic

Create a {@link Logger} that prefixes every message with `[tag]`.

(tag: string): Logger

packages/element/src/internal/core/logger.ts:18
DANGEROUS_KEYS@openelement/element · ./client-onlyconstpublic

Object prototype keys that must never be injected from untrusted props.

ReadonlySet<string>

packages/element/src/internal/core/security.ts:25
deepGetElementById@openelement/element · ./client-onlyfunctionpublic

Resolve `id` (a `#hash` or bare id) against `root` and, when the id is not in that root's own tree, recurse into every nested shadow root. Returns the first match or `null`; a malformed percent-encoded id is not an error.

(id: string, root?: Document | ShadowRoot): HTMLElement | null

packages/element/src/internal/core/deep-fragment.ts:20
DeferredDsdExecutor@openelement/element · ./client-onlyinterfacepublic

Initial shell, typed seed, and bounded updates for a deferred DSD request.

DeferredDsdExecutor

shell: string (必填); owner: DeferredServerOwner (必填); seed: Record<string, { state: "resolved"; type: string; value: unknown; } | { state: "pending"; type: string; } | { state: "missing"; type: string; }> (必填); resolvedValue: (field: string, value: unknown) => unknown (必填); serializeResolved: (field: string, value: unknown) => string[] (必填)

packages/element/src/public-runtime.ts:315
DeferredDsdManifest@openelement/element · ./client-onlyinterfacepublic

Maps route-local deferred fields to the compiled Part or Region owners they update.

DeferredDsdManifest

program: { version: number; tag: string; sha256: string; } (必填); fields: readonly { field: string; signal: string; owners: readonly { kind: "part" | "region"; index: number; }[]; }[] (必填)

packages/element/src/public-runtime.ts:296
documentStreamParts@openelement/element · ./client-onlyfunctionpublic

The same document serialization boundary, with only body wrappers left open.

(options?: DocumentWrapOptions): { prefix: string; suffix: string; }

title?: string (可选); lang?: string (可选); clientScript?: string (可选); scripts?: DocumentScriptDescriptor[] (可选); meta.description?: string (可选); meta.tags?: Record<string, string | number | boolean>[] (可选); devScripts?: string (可选); headExtras?: string (可选); dangerouslyHeadFragments?: string[] (可选); allowHeadExtrasScripts?: boolean (可选); links?: { rel: string; href: string; hreflang?: string; }[] (可选); structuredData?: readonly Record<string, unknown>[] (可选); cspNonce?: string (可选); streamBootstrap?: string (可选) — Trusted framework bootstrap emitted synchronously in the document head.

packages/element/src/internal/core/html-escape.ts:115
effect@openelement/element · ./client-onlyfunctionpublic

Run a side effect that re-subscribes whenever its signal dependencies change.

(fn: () => void | Unsubscribe): Unsubscribe

packages/element/src/internal/signal/framework.ts:27
element@openelement/element · ./client-onlyfunctionpublic

Compiler-recognized element decorator; inert no-op at runtime.

(_tag: string, _options?: { root?: "light" | "shadow-open" | "shadow-closed"; delegatesFocus?: boolean; formAssociated?: boolean; }): (target: unknown, context?: unknown) => void

packages/element/src/internal/core/compile-decorators.ts:20
ensureDeepFragmentNavigation@openelement/element · ./client-onlyfunctionpublic

Install (once per document) framework-level fragment navigation: a same-document anchor click whose target lives inside a nested shadow root scrolls to it and pushes the hash instead of being dropped by the browser. `{ enabled: false }` opts an application out.

(options?: DeepFragmentOptions): void

enabled?: boolean (可选) — Set false before installation to opt out for an application.

packages/element/src/internal/core/deep-fragment.ts:67
ensurePreHydrationClickCapture@openelement/element · ./client-onlyfunctionpublic

Install the bounded pre-upgrade interaction capture on an owning root (default: the document). Generated client entries call this with their declared island tags before any compiled element upgrades; after a successful claim the element replays the captured events whose targets live inside its root (compiled claim capture/replay, internal/compiled/runtime.ts). Idempotent per root (repeat calls merge tags, never reinstall listeners) and a no-op where no DOM exists (SSR). Invariant: the capture itself — one fixed listener set per owning root, installed once per page — is page-lifetime by design and is NOT the leak. The M1 leak was retained event-target records; each element releases exactly its own records at its activation decision (success or failure), while records owned by still-pending elements survive for their delayed/lazy upgrade (#1170). Boundedness: the facade capture passes the declared-island filter, so only interactions under a still-pending DECLARED island tag enter the queue — ordinary events and undeclared third-party custom elements are skipped (nested pending declared islands still capture through their own unsettled host). With no tags declared the legacy dash heuristic applies. The shared queue carries a hard capacity cap (fail closed), detached records are swept when a claim root adopts its share (and under queue pressure), and each activation decision deterministically empties that root's own bucket, so post-hydration traffic and removals never grow retention.

(root?: EventTarget, pendingTags?: readonly string[]): void

addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void (必填) — The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target. [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener); dispatchEvent: (event: Event) => boolean (必填) — The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent(). [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent); removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void (必填) — The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.…

packages/element/src/internal/compiled/runtime/pre-upgrade-events.ts:672
ERROR_PREFIX@openelement/element · ./client-onlyconstpublic

Error message prefix for all openElement errors.

"[openElement]"

packages/protocol/src/errors.ts:50
ErrorBoundary@openelement/element · ./client-onlyclasspublic

Base class for elements that catch descendant render/hydration errors and apply a retry policy.

class ErrorBoundary extends OpenElement

packages/element/src/error-boundary.ts:45
ErrorTelemetryHook@openelement/element · ./client-onlytypepublic

Callback receiving every reported {@linkcode OpenElementError} for telemetry.

ErrorTelemetryHook

packages/protocol/src/errors.ts:132
escapeAttr@openelement/element · ./client-onlyfunctionpublic

Escape an HTML attribute value. Delegates to `escapeHtml` so both share the single `ESCAPE_MAP` and the same single-pass replacement (consolidated in #633). Empty-value conventions remain intentionally distinct by design: - `escapeHtml` returns '' for non-string input. - `escapeAttrValue` (below) coerces via `String()` and is the boundary meant for unknown/variable attribute values.

(value: string): string

packages/element/src/internal/core/html-escape.ts:53
escapeHtml@openelement/element · ./client-onlyfunctionpublic

Escape the five HTML-significant characters in text content.

(str: string): string

packages/element/src/internal/core/html-escape.ts:37
formatError@openelement/element · ./client-onlyfunctionpublic

Format an unknown thrown value as a human-readable string.

(e: unknown): string

packages/element/src/internal/core/errors.ts:52
FrameworkOptions@openelement/element · ./client-onlyinterfacepublic

The adapter-facing framework options: where routes, islands and components live, which renderer serializes pages, the application shell and layout declarations, the document `<html>`/head injection channels, and the request-time middleware switches. Every field is optional; the adapter applies its documented default. This is the type an application config file's default export is checked against, so the rendered option table and the actual config surface cannot drift.

FrameworkOptions

renderer?: "native" | "lit" (可选) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderDsd); 'lit' renders LitElement pages through; routesDir?: string (可选) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; islandsDir?: string (可选) — Directory island modules are discovered in. Defaults to `app/islands`.; componentsDir?: string (可选) — Directory non-route components live in. Defaults to `app/components`.; packageIslands?: string[] (可选) — Extra package names whose island modules the build admits, e.g. `['@openelement/ui']`.; appShell?: AppShellConfig (可选) — Application shell declaration; `false` disables the shell, `'default'` uses the built-in one.; layouts?: LayoutsConfig (可选) — Per-layout shell declarations keyed by layout name.; mode?: "ssg" (可选) — Build mode. 'ssg' (default) generates static HTML.; headExtras?: string (可选) — @dangerous injected as-is, only use with controlled content; html.lang?: string (可选); html.title?: string (可选); inject.stylesheets?: (string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[] (可选) — Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.; inject.scripts?: (string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str… (可选) — Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.; inject.headFragments?: string[] (可选) — @dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.; ssr.noExternal?: (string | RegExp)[] (可选); island.upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (可选); build.outDir?: string (可选) — Output directory for the build artifacts. Defaults to `dist`.; build.manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; } (可选) — Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.; viewTransition?: boolean (可选) — Enable the View Transitions API for client navigations. Defaults to true.; speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (可选) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; middleware.cors?: boolean (可选) — Enable the built-in CORS middleware.; middleware.corsOrigin?: string | string[] (可选) — Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.; middleware.corsOriginModule?: string (可选) — Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `appShell.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.; middleware.requestId?: boolean (可选) — Emit and honor a per-request id header.; middleware.logger?: boolean (可选) — Log each request through the built-in logger.; middleware.securityHeaders?: boolean (可选) — Attach the built-in security response headers.; middleware.csp?: { policy?: string; nonce?: boolean; reportOnly?: boolean; } (可选) — Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.; middleware.use?: string[] (可选) — Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `appShell.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configur…

packages/protocol/src/framework.ts:170
HYDRATION_STRATEGIES@openelement/element · ./client-onlyconstpublic

Runtime list of supported hydration strategies; the single source of truth for the `HydrationStrategy` union. Consumed by island/registry validation and re-exported from the element root for app and build adapters.

readonly ["load", "idle", "visible", "only", "none"]

packages/protocol/src/framework.ts:28
HydrationStrategy@openelement/element · ./client-onlytypepublic

Island hydration trigger: 'load' | 'idle' | 'visible' | 'only'.

"load" | "idle" | "visible" | "only" | "none"

packages/protocol/src/framework.ts:30
IDLE_FALLBACK_TIMEOUT_MS@openelement/element · ./client-onlyconstpublic

Idle-hydration scheduling fallback (milliseconds) when neither `requestIdleCallback` nor `requestAnimationFrame` is available.

50

packages/protocol/src/policy.ts:70
injectPropsSafe@openelement/element · ./client-onlyfunctionpublic

Safely assign caller-supplied props onto a target object, skipping keys that could enable prototype pollution and tolerating read-only properties. The canonical guarded assigner for the canonical dangerous-key rule (#903, #1214): the

(target: Record<string, unknown>, props: Record<string, unknown>, tagName: string, log?: { warn(message: string): void; debug(message: string): void; }): void

packages/element/src/internal/core/security.ts:119
isDangerousKey@openelement/element · ./client-onlyfunctionpublic

Shared dangerous-key predicate (#903, #1214). Prototype-internal keys must never be injected from untrusted props on ANY path: host prop collection (collectPublicProps / normalizePublicProps in props-utils.ts), guarded assignment (injectPropsSafe below — the SPA bootstrap page-projection write boundary in

(key: string): boolean

packages/element/src/internal/core/security.ts:51
IslandOptions@openelement/element · ./client-onlyinterfacepublic

Per-island delivery options (hydration strategy, SSR/DSD participation).

IslandOptions

hydrate?: "load" | "idle" | "visible" | "only" | "none" (可选) — Hydration strategy: - 'load': load immediately when module is imported - 'idle': defer to requestIdleCallback (default) - 'visible': use IntersectionObserver to defer until element is visible - 'only': client-only render, no DSD/SSR output Named `hydrate` to match `defineIslandConfig()` in the Router package — one option name across both packages.; dsd?: boolean (可选) — Whether to use DSD for SSR rendering of this island. Honored by the build-side island scan (via `defineIslandConfig`), not by `defineIsland()` itself: passing it in `IslandOptions` has no runtime effect.; ssr?: boolean (可选) — Whether this island may be admitted into server rendering. Like `dsd`, decided by the build-side island scan; inert when passed to `defineIsland()`.

packages/protocol/src/island.ts:8
isSafeAttributeName@openelement/element · ./client-onlyfunctionpublic

Shared safe-attribute-name predicate (#1033): the SSR face of the one canonical predicate in `../protocol/forbidden-sinks.ts`. A name must be valid HTML attribute-name grammar (blocks quote/space injection, #602), must not be an event handler (`on*`, case-insensitive), and must not be a forbidden sink (`innerhtml`/`srcdoc`). The compiler, protocol validator, and server serializer enforce the same predicate with their own failure strategies; every path delegates to the single implementation, so the boundary cannot diverge.

(name: string): boolean

packages/element/src/internal/core/security.ts:65
isValidTagName@openelement/element · ./client-onlyfunctionpublic

Check if a tag name is a valid custom element name per HTML spec.

(tagName: string): boolean

packages/element/src/internal/core/tag-utils.ts:38
Loader@openelement/element · ./client-onlytypepublic

Route loader: fetches data for a page route.

Loader<T, Env, Platform, Route>

packages/protocol/src/data.ts:56
LoaderContext@openelement/element · ./client-onlyinterfacepublic

Context passed to a request-time ('dynamic') route loader.

LoaderContext<Env, Platform, Route>

request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:40
LocalePath@openelement/element · ./client-onlyinterfacepublic

Locale-aware resolved path contract.

LocalePath

locale: string (必填); path: string (必填); localizedPath: string (必填); isDefaultLocalePath: boolean (必填)

packages/protocol/src/framework.ts:82
Logger@openelement/element · ./client-onlyinterfacepublic

logger.ts - Tagged console logger. Lightweight scoped logger. Returns plain functions so it is tree-shakable and has zero class overhead.

Logger

debug: (msg: string, ...args: unknown[]) => void (必填); info: (msg: string, ...args: unknown[]) => void (必填); warn: (msg: string, ...args: unknown[]) => void (必填); error: (msg: string, ...args: unknown[]) => void (必填)

packages/element/src/internal/core/logger.ts:10
MAX_ACTION_BODY_BYTES@openelement/element · ./client-onlyconstpublic

Request-body bound (bytes) the generated entry applies to action POST routes; larger uploads belong on API routes with explicit limits.

number

packages/protocol/src/policy.ts:57
MAX_COMPOSITION_DEPTH@openelement/element · ./client-onlyconstpublic

Nested element expansion depth bound for `renderDsd`: cyclic component composition fails closed instead of recursing without end.

8

packages/protocol/src/policy.ts:51
Middleware@openelement/element · ./client-onlytypepublic

Fetch middleware contract (#858): WinterCG shape, dialect-free — no Hono/h3 context object. Composed at the handler boundary in onion order (`use[0]` is outermost: it sees the request first and the response last), so it runs with identical semantics in the dev server, the `start` CLI, the e2e fixture server, and the Nitro production entry. A middleware may short-circuit by returning a Response without calling `next()`, or post-process the Response that `next()` returns. Module contract: a Middleware is the DEFAULT EXPORT of a module referenced from `middleware.use` by path (e.g. './app/middleware/auth.ts'). The generated server entry imports the module, so the middleware may close over module scope and import local helpers and third-party packages — it is a real module in the server module graph, never serialized source.

Middleware

packages/protocol/src/framework.ts:158
OpenElement@openelement/element · ./client-onlyclasspublic

Custom Element base class for the compiled Part Program architecture. Subclasses are produced by the compiler; hand-written subclasses that never pass through the compiler fail closed at connect time.

class OpenElement extends OpenElementConfiguration

packages/element/src/open-element-implementation.ts:104
OpenElementAttribute@openelement/element · ./client-onlyinterfacepublic

One documented attribute of a custom element declaration.

OpenElementAttribute

name: string (必填); type?: string (可选); default?: string (可选); description?: string (可选); reflects?: boolean (可选); fieldName?: string (可选)

packages/protocol/src/manifest.ts:15
OpenElementCssPart@openelement/element · ./client-onlyinterfacepublic

One documented CSS part of a custom element declaration.

OpenElementCssPart

name: string (必填); description?: string (可选)

packages/protocol/src/manifest.ts:38
OpenElementDeclaration@openelement/element · ./client-onlyinterfacepublic

One custom element declaration in a package manifest: tag, members and delivery metadata.

OpenElementDeclaration

tagName: string (必填); className?: string (可选); superclassName?: string (可选); attributes?: OpenElementAttribute[] (可选); events?: OpenElementEvent[] (可选); slots?: OpenElementSlot[] (可选); cssParts?: OpenElementCssPart[] (可选); openElement.ssr?: boolean (可选); openElement.dsd?: boolean (可选); openElement.layer?: ComponentLayer (可选); openElement.hydrate?: "load" | "idle" | "visible" | "only" | "none" (可选); openElement.status?: "stable" | "experimental" (可选) — Stability marker from the owning package's manifest policy.; openElement.module?: string (可选); openElement.export?: string (可选); description?: string (可选)

packages/protocol/src/manifest.ts:56
OpenElementError@openelement/element · ./client-onlyclasspublic

Framework error carrying a stable code, severity, phase and recoverability contract.

class OpenElementError extends Error

packages/protocol/src/errors.ts:100
OpenElementEvent@openelement/element · ./client-onlyinterfacepublic

One documented custom event of a custom element declaration.

OpenElementEvent

name: string (必填); type?: string (可选); description?: string (可选)

packages/protocol/src/manifest.ts:25
OpenElementPackageManifest@openelement/element · ./client-onlyinterfacepublic

Package manifest of component declarations (not a Custom Elements Manifest).

OpenElementPackageManifest

schemaVersion: string (必填); packageName: string (必填); version: string (必填); description?: string (可选); author?: string (可选); license?: string (可选); homepage?: string (可选); repository?: string (可选); declarations: OpenElementDeclaration[] (必填)

packages/protocol/src/manifest.ts:69
OpenElementRouteKind@openelement/element · ./client-onlytypepublic

Host-agnostic route and asset contracts shared by app and build drivers.

OpenElementRouteKind

packages/protocol/src/app-model.ts:2
OpenElementRouteNode@openelement/element · ./client-onlyinterfacepublic

One node of the host-agnostic route tree: the matched URL `path` and route kind, the source and module paths the drivers resolve, the optional registered tag and param names, and the nested `children`.

OpenElementRouteNode

kind: OpenElementRouteKind (必填); path: string (必填); filePath?: string (可选); importPath?: string (可选); tagName?: string (可选); paramNames?: string[] (可选); children?: OpenElementRouteNode[] (可选); meta?: Record<string, unknown> (可选)

packages/protocol/src/app-model.ts:9
OpenElementSlot@openelement/element · ./client-onlyinterfacepublic

One documented slot of a custom element declaration.

OpenElementSlot

name: string (必填); description?: string (可选)

packages/protocol/src/manifest.ts:32
PROBLEM_JSON_MEDIA_TYPE@openelement/element · ./client-onlyconstpublic

Media type of the RFC 9457 action error channel (#863).

"application/problem+json"

packages/protocol/src/data.ts:117
ProblemDetails@openelement/element · ./client-onlyinterfacepublic

RFC 9457 Problem Details document (#863): the action error channel answers `application/problem+json` instead of the bespoke `{ type: 'error', error: { message } }` JSON, so HTTP tooling recognizes failures natively. With `type: 'about:blank'`, `title` is the HTTP reason phrase and `detail` carries the specific explanation. The wire shape is alpha-unfrozen; the 1.0 acceptance freezes it in this problem+json form.

ProblemDetails

type: string (必填) — URI reference identifying the problem type; 'about:blank' when none applies.; title: string (必填) — Short human-readable summary (the HTTP reason phrase for 'about:blank').; status.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (必填) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; detail?: string (可选) — Human-readable explanation specific to this occurrence.

packages/protocol/src/data.ts:105
property@openelement/element · ./client-onlyfunctionpublic

Compiler-recognized property decorator; inert no-op at runtime.

(_options: { reflect: boolean; attribute?: false | string; type?: unknown; converter?: unknown; }): (target: unknown, context?: unknown) => void

reflect: boolean (必填); attribute?: string | false (可选); type?: unknown (可选); converter?: unknown (可选)

packages/element/src/internal/core/compile-decorators.ts:34
provideContext@openelement/element · ./client-onlyfunctionpublic

Provide a plain protocol value; the provider Signal remains OE-private.

<T>(host: HTMLElement, context: Context<T>, value: T): Unsubscribe

packages/element/src/internal/core/signal-context.ts:109
ReadonlySignal@openelement/element · ./client-onlyinterfacepublic

Read-only signal protocol used by computed values.

ReadonlySignal<T>

value: T (必填); subscribe: (fn: (value: T) => void) => Unsubscribe (必填); __@SIGNAL_BRAND@6497.valueOf: () => boolean (必填) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:26
renderDsd@openelement/element · ./client-onlyfunctionpublic

Server-render one compiled element through canonical Element composition.

(input: string | CustomElementConstructor, options?: RenderDsdOptions): RenderOutput

packages/element/src/public-runtime.ts:771
RenderDsdOptions@openelement/element · ./client-onlyinterfacepublic

Options for one `renderDsd()` call: the compiled component class to serialize, the values projected onto its compiled properties, optional route/source diagnostics metadata, the nested compiled tags the build admitted, and trusted parent-owned light children keyed by slot name.

RenderDsdOptions

componentClass?: CustomElementConstructor (可选); props?: Record<string, unknown> (可选); sourceInfo.route?: string (可选); sourceInfo.source?: string (可选); ssrRenderableTags?: readonly string[] (可选) — Build-admitted nested compiled tags. Omitted means shell-only rendering.; projectedChildren?: ReadonlyMap<string, TrustedHtml> (可选) — Trusted parent-owned light children keyed by slot name.

packages/element/src/public-runtime.ts:145
RenderError@openelement/element · ./client-onlyclasspublic

Recoverable render-phase error carrying the failing component path and tag.

class RenderError extends OpenElementError

packages/element/src/internal/core/errors.ts:95
RenderOutput@openelement/element · ./client-onlyinterfacepublic

The public result of one `renderDsd()` call: the serialized DSD `html`, the render errors collected while composing it (empty on success), the render metrics for the root component, and the hydration hints the client scheduler reads to upgrade islands.

RenderOutput

html: string (必填); errors: RenderError[] (必填); metrics: DsdRenderMetrics (必填); hydrationHints: HydrationHint[] (必填)

packages/protocol/src/render.ts:34
reportError@openelement/element · ./client-onlyfunctionpublic

Report an {@linkcode OpenElementError} to the telemetry hook, or console.error when none is installed.

(error: OpenElementError): void

code: string (必填); severity: ErrorSeverity (必填); phase: ErrorPhase (必填); recoverable: boolean (必填); statusCode.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; statusCode.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; statusCode.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; statusCode.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; statusCode.valueOf: () => number (必填) — Returns the primitive value of the specified object.; statusCode.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; toJSON: () => Record<string, unknown> (必填); name: string (必填); message: string (必填); stack?: string (可选); cause?: unknown (可选)

packages/element/src/internal/core/errors.ts:139
RouteEntry@openelement/element · ./client-onlyinterfacepublic

One route admitted by the scanner: URL `path`, source `filePath`, the route `type`, the generated variable name (`varName`) the entry binds it to, and the optional registration tag. {@link RouteEntry.definePage} and {@link RouteEntry.hasEnhancedForms} carry the two source-derived admission facts the generated entries branch on.

RouteEntry

path: string (必填); filePath: string (必填); type: "page" | "api" | "island" | "special" (必填); varName: string (必填); tagName?: string (可选); definePage?: boolean (可选) — True when the route module's default export is a definePage() definition (#960 — registration decoupling). The generated entry registers the page class under the path-derived fallback tag and IGNORES the tagName export for registration: on a definePage route the export only names a content element. Plain element routes keep tagName as their registration tag.; source?: string (可选) — Source text captured during scanning when includeSource is enabled.; hasEnhancedForms?: boolean (可选) — True when the page route source carries data-open-enhance (#569): the client entry must ship the form-enhancement layer even when the app has zero islands.; special?: SpecialFileType (可选); params?: string[] (可选)

packages/protocol/src/framework.ts:113
ServerRouteContext@openelement/element · ./client-onlyinterfacepublic

Canonical request-time/SSG server route context.

ServerRouteContext<Env, Platform, Route>

request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:25
ServerRouteMetadata@openelement/element · ./client-onlyinterfacepublic

Context passed to a request-time ('dynamic') route loader. This is the server contract: the loader runs on the server with the Web-standard request, matched route params, the host environment and the platform object, and signals validation failure via fail()/redirect().

ServerRouteMetadata

path: string (必填); filePath: string (必填)

packages/protocol/src/data.ts:19
setErrorTelemetryHook@openelement/element · ./client-onlyfunctionpublic

Install the process-wide error telemetry hook (replaceable for tests, HMR, multi-app pages).

(hook: ErrorTelemetryHook): void

packages/element/src/internal/core/errors.ts:127
signal@openelement/element · ./client-onlyfunctionpublic

Create a writable signal through the selected signal engine.

<T>(initialValue: T): WritableSignal<T>

packages/element/src/internal/signal/framework.ts:19
Signal@openelement/element · ./client-onlytypepublic

Alias for APIs that accept either writable or read-only signals.

Signal<T>

packages/protocol/src/signal.ts:31
SpecialFileType@openelement/element · ./client-onlytypepublic

Special file kinds the route scanner recognizes by filename: `renderer` and `middleware`.

SpecialFileType

packages/protocol/src/framework.ts:79
SsrAdmissionDecision@openelement/element · ./client-onlyinterfacepublic

The build's admission verdict for one discovered tag: where the declaration lives (`modulePath`), how it was discovered (`source`), which render path it is admitted to, and the reason recorded for the manifest.

SsrAdmissionDecision

tagName: string (必填); modulePath: string (必填) — Module path of the island declaration. Empty for 'foreign' decisions: a foreign tag is consumed in JSX but declares no module the build owns.; source: "local" | "package" | "nested" | "foreign" (必填) — 'foreign' (#979): a third-party WC tag discovered by the foreign-tag scanner in page/island JSX — recorded for visibility only; SSR still treats it as an opaque passthrough (renderPath 'client-only').; renderPath: "ssr+client" | "client-only" | "rejected" (必填); reason: string (必填)

packages/protocol/src/render.ts:56
STREAM_FRAME_FORBIDDEN_TAGS@openelement/element · ./client-onlyconstpublic

Tags a deferred frame cannot safely install into an owned Part range: the browser installer rejects any frame whose markup carries one of these.

readonly ["script", "style", "template", "iframe", "object", "embed", "base", "meta", "link"]

packages/protocol/src/stream-frame-policy.ts:26
STREAM_FRAME_UNSAFE_URL@openelement/element · ./client-onlyconstpublic

Schemes that make a URL attribute unsafe in a streamed frame.

RegExp

packages/protocol/src/stream-frame-policy.ts:60
STREAM_FRAME_URL_ATTRIBUTES@openelement/element · ./client-onlyconstpublic

URL-carrying attributes the frame check screens for script-bearing scheme obfuscation; only these attribute names are value-screened.

readonly ["href", "src", "action", "formaction", "xlink:href"]

packages/protocol/src/stream-frame-policy.ts:42
STREAM_FRAME_URL_CONTROL_MAX@openelement/element · ./client-onlyconstpublic

Control characters at or below this code point are stripped before the URL-scheme test, so tab/newline/control obfuscation cannot smuggle a scheme past admission.

32

packages/protocol/src/stream-frame-policy.ts:55
STREAM_MAX_FIELDS@openelement/element · ./client-onlyconstpublic

Deferred fields (declared streamed properties) one stream route's manifest may carry. The build scan, the server executor, and the browser seed contract enforce the same bound.

32

packages/protocol/src/policy.ts:24
STREAM_MAX_OWNERS@openelement/element · ./client-onlyconstpublic

Part/Region owners one stream route's manifest may address in total across all deferred fields.

64

packages/protocol/src/policy.ts:30
STREAM_MAX_PAYLOAD_LENGTH@openelement/element · ./client-onlyconstpublic

Serialized stream payload bound, as a string length in UTF-16 code units: one seed attribute or one deferred frame's markup may not exceed it. The server checks the JSON text and the rendered range before emitting; the browser checks the attribute before parsing.

number

packages/protocol/src/policy.ts:45
STREAM_MAX_SEED_PROPERTIES@openelement/element · ./client-onlyconstpublic

Typed properties one streamed seed may carry: the browser seed contract rejects the WHOLE seed above this count, so an oversized component would silently fail to hydrate instead of failing loud at the server.

64

packages/protocol/src/policy.ts:37
STREAM_TIMEOUT_MS@openelement/element · ./client-onlyconstpublic

Deferred-field resolution budget (milliseconds) for one streamed response: fields still pending when it expires are failed in place and the stream ends with the shell and whatever resolved.

30000

packages/protocol/src/policy.ts:64
StyleSheet@openelement/element · ./client-onlyconstpublic

Cross-realm StyleSheet constructor: the native CSSStyleSheet or the internal shim.

new () => StyleSheetLike

packages/element/src/internal/core/style-sheet.ts:67
StyleSheetLike@openelement/element · ./client-onlyinterfacepublic

Minimal stylesheet contract (replaceSync + cssRules) satisfied by native and shim sheets.

StyleSheetLike

replaceSync: (text: string) => void (必填); cssRules: StyleSheetRule[] (必填)

packages/protocol/src/style-sheet.ts:14
trustedHtml@openelement/element · ./client-onlyfunctionpublic

Mark an HTML string as trusted for explicit `innerHTML` sinks (the trust does not serialize).

(html: string): TrustedHtml

packages/element/src/internal/core/security.ts:86
TrustedHtml@openelement/element · ./client-onlyinterfacepublic

Opaque capability marking HTML the application has explicitly vetted as trusted.

TrustedHtml

html: string (必填)

packages/element/src/internal/core/security.ts:81
unsafeStreamFrameAttribute@openelement/element · ./client-onlyfunctionpublic

Whether a static attribute (name/value as authored into the Part Program) makes a streamed frame unsafely installable: event-handler, seed-spoofing, and srcdoc names fail outright, and URL-carrying names fail when the entity-decoded, control-stripped value carries a script scheme.

(name: string, value: string): boolean

packages/protocol/src/stream-frame-policy.ts:113
wrapInDocument@openelement/element · ./client-onlyfunctionpublic

Wrap rendered HTML in a full HTML document. Adds DOCTYPE, head (title, meta, preload), and body. Supports CSP nonce and dev scripts (e.g. Vite client, route module registration).

(html: string, options?: DocumentWrapOptions): string

packages/element/src/internal/core/html-escape.ts:109
escapeAttr@openelement/element · ./htmlfunctionpublic

Escape an HTML attribute value. Delegates to `escapeHtml` so both share the single `ESCAPE_MAP` and the same single-pass replacement (consolidated in #633). Empty-value conventions remain intentionally distinct by design: - `escapeHtml` returns '' for non-string input. - `escapeAttrValue` (below) coerces via `String()` and is the boundary meant for unknown/variable attribute values.

(value: string): string

packages/element/src/internal/core/html-escape.ts:53
escapeAttrValue@openelement/element · ./htmlfunctionpublic

Escape a string for use as an attribute value (double-quoted)

(value: unknown): string

packages/element/src/internal/core/html-escape.ts:58
escapeHtml@openelement/element · ./htmlfunctionpublic

Escape the five HTML-significant characters in text content.

(str: string): string

packages/element/src/internal/core/html-escape.ts:37
SafeHtml@openelement/element · ./htmltypepublic

Branded type: a string that has been HTML-escaped (safe for text content)

SafeHtml

packages/protocol/src/framework.ts:9
trustedHtml@openelement/element · ./htmlfunctionpublic

Mark an HTML string as trusted for explicit `innerHTML` sinks (the trust does not serialize).

(html: string): TrustedHtml

packages/element/src/internal/core/security.ts:86
TrustedHtml@openelement/element · ./htmlinterfacepublic

Opaque capability marking HTML the application has explicitly vetted as trusted.

TrustedHtml

html: string (必填)

packages/element/src/internal/core/security.ts:81
UnsafeHtml@openelement/element · ./htmltypepublic

Branded type: a string that is intentionally raw/untrusted HTML

UnsafeHtml

packages/protocol/src/framework.ts:12
wrapInDocument@openelement/element · ./htmlfunctionpublic

Wrap rendered HTML in a full HTML document. Adds DOCTYPE, head (title, meta, preload), and body. Supports CSP nonce and dev scripts (e.g. Vite client, route module registration).

(html: string, options?: DocumentWrapOptions): string

packages/element/src/internal/core/html-escape.ts:109
Fragment@openelement/element · ./jsx-dev-runtimefunctionpublic

Typechecking-only fragment marker; fails closed when executed at runtime.

(_props?: unknown): JSX.Element

packages/element/src/jsx-dev-runtime.ts:39
JSX@openelement/element · ./jsx-dev-runtimenamespacepublic

JSX type interface consumed by TypeScript's automatic JSX transform.

any

packages/element/src/jsx-dev-runtime.ts:44
jsxDEV@openelement/element · ./jsx-dev-runtimefunctionpublic

Typechecking-only factory; fails closed when executed at runtime.

(_type: unknown, _props: unknown, _key: unknown, _isStaticChildren: unknown, _source: unknown, _self: unknown): JSX.Element

packages/element/src/jsx-dev-runtime.ts:27
Fragment@openelement/element · ./jsx-runtimefunctionpublic

Typechecking-only fragment marker; fails closed when executed at runtime.

(_props?: unknown): JSX.Element

packages/element/src/jsx-runtime.ts:40
jsx@openelement/element · ./jsx-runtimefunctionpublic

Typechecking-only factory; fails closed when executed at runtime.

(_type: unknown, _props: unknown): JSX.Element

packages/element/src/jsx-runtime.ts:30
JSX@openelement/element · ./jsx-runtimenamespacepublic

JSX type interface consumed by TypeScript's automatic JSX transform.

any

packages/element/src/jsx-runtime.ts:45
jsxs@openelement/element · ./jsx-runtimefunctionpublic

Typechecking-only factory; fails closed when executed at runtime.

(_type: unknown, _props: unknown): JSX.Element

packages/element/src/jsx-runtime.ts:35
createLogger@openelement/element · ./loggerfunctionpublic

Create a {@link Logger} that prefixes every message with `[tag]`.

(tag: string): Logger

packages/element/src/internal/core/logger.ts:18
createWarnScope@openelement/element · ./loggerfunctionpublic

Create a fresh, empty warning scope for one render.

(): WarnScope

packages/element/src/internal/core/logger.ts:41
Logger@openelement/element · ./loggerinterfacepublic

logger.ts - Tagged console logger. Lightweight scoped logger. Returns plain functions so it is tree-shakable and has zero class overhead.

Logger

debug: (msg: string, ...args: unknown[]) => void (必填); info: (msg: string, ...args: unknown[]) => void (必填); warn: (msg: string, ...args: unknown[]) => void (必填); error: (msg: string, ...args: unknown[]) => void (必填)

packages/element/src/internal/core/logger.ts:10
warnOnce@openelement/element · ./loggerfunctionpublic

Warn at most once per `key` for the given render {@link WarnScope}, falling back to a process-wide set when no scope is passed.

(key: string, logger: Logger, msg: string, scope?: WarnScope): void

packages/element/src/internal/core/logger.ts:52
WarnScope@openelement/element · ./loggerinterfacepublic

A render-scoped warning tracker. Pass a fresh `WarnScope` (via `createWarnScope()`) into `warnOnce` at a render entry (e.g. once per SSR document in `wrapInDocument`). Suppression is therefore scoped to a single render: the next page/request gets a new scope and the same key can warn again, so one muted key can never silence a diagnostic across all requests/SSG pages (#643).

WarnScope

warned: Set<string> (必填)

packages/element/src/internal/core/logger.ts:36
Action@openelement/element · ./no-regionstypepublic

Route action: handles form submissions for a page route.

Action<T, Env, Platform, Route>

packages/protocol/src/data.ts:64
ACTION_FETCH_HEADER@openelement/element · ./no-regionsconstpublic

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"

packages/protocol/src/data.ts:125
ActionContext@openelement/element · ./no-regionsinterfacepublic

Context passed to a route action function (extends loader context).

ActionContext<Env, Platform, Route>

formData: FormData (必填); request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:47
ActionResult@openelement/element · ./no-regionstypepublic

Wire shape returned to the JavaScript form-enhancement path. The no-JS path never sees this: it gets the equivalent semantics as plain HTTP (303 on success, 422 with the re-rendered form on validation failure, redirect/error as status codes). Success carries no data envelope. The application-loop contract makes a successful non-GET action answer 303 (PRG) — the framework never answers 200 with a rendered page, or with a success document, for a successful mutation — so the fetch channel answers `{ type: 'redirect' }` naming the PRG target and the authored return value is discarded by design. Success data travels the PRG target instead (query state the loader re-runs with, which the props projector then maps; see the router guide's "Form actions" section). The union previously declared a `{ type: 'success' }` member that no code path ever emitted — removed so the type matches the wire. Error outcomes (CSRF 403, unknown action 404, unparseable body 400, unexpected 500) are NOT part of this union: since #863 they answer RFC 9457 Problem Details with the PROBLEM_JSON_MEDIA_TYPE content type — see ProblemDetails.

ActionResult<Failure>

packages/protocol/src/data.ts:92
AppShellConfig@openelement/element · ./no-regionstypepublic

Application shell declaration: `false` disables the shell entirely, `'default'` uses the built-in shell, and the object form names a tag with the module path that defines it (`import`, resolved like a {@link FrameworkOptions.middleware.use } entry) plus the compiled shell properties the router injects per route.

AppShellConfig

packages/protocol/src/framework.ts:96
assertValidTagName@openelement/element · ./no-regionsfunctionpublic

Assert that a tag name is a valid custom element name.

(tagName: string): void

packages/element/src/internal/core/tag-utils.ts:50
collectPublicProps@openelement/element · ./no-regionsfunctionpublic

Collect all public (non-internal) own properties from a host object. Keys starting with `__openElement` are framework-internal and excluded. Uses Reflect.get for safe access (respects getters); a getter that throws is skipped with a warning so one bad prop cannot take the tree down.

(host: object): Record<string, unknown>

packages/element/src/internal/core/props-utils.ts:41
CompatibilityClassification@openelement/element · ./no-regionsinterfacepublic

The per-tag verdict the compatibility scanner records: the tier a discovered tag was classified as, the human-readable `reason`, where the tag was found (`source`), and the SSR/DSD/hydration facts the verdict was derived from.

CompatibilityClassification

tagName: string (必填); tier: CompatibilityTier (必填); reason: string (必填); source: "local" | "package" | "nested" (必填); modulePath?: string (可选); ssr?: boolean (可选); dsd?: boolean (可选); hydrate?: string (可选)

packages/protocol/src/framework.ts:326
CompatibilityTier@openelement/element · ./no-regionstypepublic

How far a discovered tag may participate in the build: 'ssr-capable' renders and hydrates, 'client-only' ships to the browser without server output, 'experimental-dom' is admitted with a downgraded guarantee, and 'rejected' fails the build.

CompatibilityTier

packages/protocol/src/framework.ts:319
ComponentLayer@openelement/element · ./no-regionstypepublic

The delivery layer a component belongs to: fully static DSD markup ('dsd-static'), DSD markup with a client island ('dsd-interactive'), a client-only island with no SSR output ('pure-island'), or a light-DOM element ('light-dom'). Recorded per component in the build manifest and consumed by the hydration scheduler.

ComponentLayer

packages/protocol/src/framework.ts:23
computed@openelement/element · ./no-regionsfunctionpublic

Create a derived read-only signal recomputed from its dependencies.

<T>(fn: () => T): ReadonlySignal<T>

packages/element/src/internal/signal/framework.ts:23
consumeContext@openelement/element · ./no-regionsfunctionpublic

Consumer-local reactive projection of a protocol context value.

<T>(context: Context<T>, host?: HTMLElement): WritableSignal<T>

key.toString: () => string (必填) — Returns a string representation of an object.; key.valueOf: () => symbol (必填) — Returns the primitive value of the specified object.; key.description: string (必填) — Expose the [[Description]] internal slot of a symbol directly.; key.__@toPrimitive@7619: (hint: string) => symbol (必填) — Converts a Symbol object to a symbol.; key.__@toStringTag@7621: string (必填); defaultValue: T (必填)

packages/element/src/internal/core/signal-context.ts:141
Context@openelement/element · ./no-regionsinterfacepublic

A typed context token: protocol identity (`key`) plus its default value.

Context<T>

key.toString: () => string (必填) — Returns a string representation of an object.; key.valueOf: () => symbol (必填) — Returns the primitive value of the specified object.; key.description: string (必填) — Expose the [[Description]] internal slot of a symbol directly.; key.__@toPrimitive@7619: (hint: string) => symbol (必填) — Converts a Symbol object to a symbol.; key.__@toStringTag@7621: string (必填); defaultValue: T (必填)

packages/element/src/internal/core/signal-context.ts:13
createContext@openelement/element · ./no-regionsfunctionpublic

Create a typed context token shared between provider and consumer elements.

<T>(key: symbol, defaultValue: T): Context<T>

toString: () => string (必填) — Returns a string representation of an object.; valueOf: () => symbol (必填) — Returns the primitive value of the specified object.; description: string (必填) — Expose the [[Description]] internal slot of a symbol directly.; __@toPrimitive@7619: (hint: string) => symbol (必填) — Converts a Symbol object to a symbol.; __@toStringTag@7621: string (必填)

packages/element/src/internal/core/signal-context.ts:58
createDeferredDsdExecutor@openelement/element · ./no-regionsfunctionpublic

Create one request-local deferred shell from a generated route manifest. The manifest hash is checked against the exact runtime wire program before any shell can be produced.

(options: CreateDeferredDsdOptions): Promise<DeferredDsdExecutor>

componentClass: CustomElementConstructor (必填); props?: Record<string, unknown> (可选); manifest: DeferredDsdManifest (必填); instanceId: string (必填); documentToken?: string (可选)

packages/element/src/public-runtime.ts:379
CreateDeferredDsdOptions@openelement/element · ./no-regionsinterfacepublic

Inputs for a request-scoped deferred DSD server executor.

CreateDeferredDsdOptions

componentClass: CustomElementConstructor (必填); props?: Record<string, unknown> (可选); manifest: DeferredDsdManifest (必填); instanceId: string (必填); documentToken?: string (可选)

packages/element/src/public-runtime.ts:306
createLogger@openelement/element · ./no-regionsfunctionpublic

Create a {@link Logger} that prefixes every message with `[tag]`.

(tag: string): Logger

packages/element/src/internal/core/logger.ts:18
DANGEROUS_KEYS@openelement/element · ./no-regionsconstpublic

Object prototype keys that must never be injected from untrusted props.

ReadonlySet<string>

packages/element/src/internal/core/security.ts:25
deepGetElementById@openelement/element · ./no-regionsfunctionpublic

Resolve `id` (a `#hash` or bare id) against `root` and, when the id is not in that root's own tree, recurse into every nested shadow root. Returns the first match or `null`; a malformed percent-encoded id is not an error.

(id: string, root?: Document | ShadowRoot): HTMLElement | null

packages/element/src/internal/core/deep-fragment.ts:20
DeferredDsdExecutor@openelement/element · ./no-regionsinterfacepublic

Initial shell, typed seed, and bounded updates for a deferred DSD request.

DeferredDsdExecutor

shell: string (必填); owner: DeferredServerOwner (必填); seed: Record<string, { state: "resolved"; type: string; value: unknown; } | { state: "pending"; type: string; } | { state: "missing"; type: string; }> (必填); resolvedValue: (field: string, value: unknown) => unknown (必填); serializeResolved: (field: string, value: unknown) => string[] (必填)

packages/element/src/public-runtime.ts:315
DeferredDsdManifest@openelement/element · ./no-regionsinterfacepublic

Maps route-local deferred fields to the compiled Part or Region owners they update.

DeferredDsdManifest

program: { version: number; tag: string; sha256: string; } (必填); fields: readonly { field: string; signal: string; owners: readonly { kind: "part" | "region"; index: number; }[]; }[] (必填)

packages/element/src/public-runtime.ts:296
documentStreamParts@openelement/element · ./no-regionsfunctionpublic

The same document serialization boundary, with only body wrappers left open.

(options?: DocumentWrapOptions): { prefix: string; suffix: string; }

title?: string (可选); lang?: string (可选); clientScript?: string (可选); scripts?: DocumentScriptDescriptor[] (可选); meta.description?: string (可选); meta.tags?: Record<string, string | number | boolean>[] (可选); devScripts?: string (可选); headExtras?: string (可选); dangerouslyHeadFragments?: string[] (可选); allowHeadExtrasScripts?: boolean (可选); links?: { rel: string; href: string; hreflang?: string; }[] (可选); structuredData?: readonly Record<string, unknown>[] (可选); cspNonce?: string (可选); streamBootstrap?: string (可选) — Trusted framework bootstrap emitted synchronously in the document head.

packages/element/src/internal/core/html-escape.ts:115
effect@openelement/element · ./no-regionsfunctionpublic

Run a side effect that re-subscribes whenever its signal dependencies change.

(fn: () => void | Unsubscribe): Unsubscribe

packages/element/src/internal/signal/framework.ts:27
element@openelement/element · ./no-regionsfunctionpublic

Compiler-recognized element decorator; inert no-op at runtime.

(_tag: string, _options?: { root?: "light" | "shadow-open" | "shadow-closed"; delegatesFocus?: boolean; formAssociated?: boolean; }): (target: unknown, context?: unknown) => void

packages/element/src/internal/core/compile-decorators.ts:20
ensureDeepFragmentNavigation@openelement/element · ./no-regionsfunctionpublic

Install (once per document) framework-level fragment navigation: a same-document anchor click whose target lives inside a nested shadow root scrolls to it and pushes the hash instead of being dropped by the browser. `{ enabled: false }` opts an application out.

(options?: DeepFragmentOptions): void

enabled?: boolean (可选) — Set false before installation to opt out for an application.

packages/element/src/internal/core/deep-fragment.ts:67
ensurePreHydrationClickCapture@openelement/element · ./no-regionsfunctionpublic

Install the bounded pre-upgrade interaction capture on an owning root (default: the document). Generated client entries call this with their declared island tags before any compiled element upgrades; after a successful claim the element replays the captured events whose targets live inside its root (compiled claim capture/replay, internal/compiled/runtime.ts). Idempotent per root (repeat calls merge tags, never reinstall listeners) and a no-op where no DOM exists (SSR). Invariant: the capture itself — one fixed listener set per owning root, installed once per page — is page-lifetime by design and is NOT the leak. The M1 leak was retained event-target records; each element releases exactly its own records at its activation decision (success or failure), while records owned by still-pending elements survive for their delayed/lazy upgrade (#1170). Boundedness: the facade capture passes the declared-island filter, so only interactions under a still-pending DECLARED island tag enter the queue — ordinary events and undeclared third-party custom elements are skipped (nested pending declared islands still capture through their own unsettled host). With no tags declared the legacy dash heuristic applies. The shared queue carries a hard capacity cap (fail closed), detached records are swept when a claim root adopts its share (and under queue pressure), and each activation decision deterministically empties that root's own bucket, so post-hydration traffic and removals never grow retention.

(root?: EventTarget, pendingTags?: readonly string[]): void

addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void (必填) — The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target. [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener); dispatchEvent: (event: Event) => boolean (必填) — The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent(). [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent); removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void (必填) — The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.…

packages/element/src/internal/compiled/runtime/pre-upgrade-events.ts:672
ERROR_PREFIX@openelement/element · ./no-regionsconstpublic

Error message prefix for all openElement errors.

"[openElement]"

packages/protocol/src/errors.ts:50
ErrorBoundary@openelement/element · ./no-regionsclasspublic

Base class for elements that catch descendant render/hydration errors and apply a retry policy.

class ErrorBoundary extends OpenElement

packages/element/src/error-boundary.ts:45
ErrorTelemetryHook@openelement/element · ./no-regionstypepublic

Callback receiving every reported {@linkcode OpenElementError} for telemetry.

ErrorTelemetryHook

packages/protocol/src/errors.ts:132
escapeAttr@openelement/element · ./no-regionsfunctionpublic

Escape an HTML attribute value. Delegates to `escapeHtml` so both share the single `ESCAPE_MAP` and the same single-pass replacement (consolidated in #633). Empty-value conventions remain intentionally distinct by design: - `escapeHtml` returns '' for non-string input. - `escapeAttrValue` (below) coerces via `String()` and is the boundary meant for unknown/variable attribute values.

(value: string): string

packages/element/src/internal/core/html-escape.ts:53
escapeHtml@openelement/element · ./no-regionsfunctionpublic

Escape the five HTML-significant characters in text content.

(str: string): string

packages/element/src/internal/core/html-escape.ts:37
formatError@openelement/element · ./no-regionsfunctionpublic

Format an unknown thrown value as a human-readable string.

(e: unknown): string

packages/element/src/internal/core/errors.ts:52
FrameworkOptions@openelement/element · ./no-regionsinterfacepublic

The adapter-facing framework options: where routes, islands and components live, which renderer serializes pages, the application shell and layout declarations, the document `<html>`/head injection channels, and the request-time middleware switches. Every field is optional; the adapter applies its documented default. This is the type an application config file's default export is checked against, so the rendered option table and the actual config surface cannot drift.

FrameworkOptions

renderer?: "native" | "lit" (可选) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderDsd); 'lit' renders LitElement pages through; routesDir?: string (可选) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; islandsDir?: string (可选) — Directory island modules are discovered in. Defaults to `app/islands`.; componentsDir?: string (可选) — Directory non-route components live in. Defaults to `app/components`.; packageIslands?: string[] (可选) — Extra package names whose island modules the build admits, e.g. `['@openelement/ui']`.; appShell?: AppShellConfig (可选) — Application shell declaration; `false` disables the shell, `'default'` uses the built-in one.; layouts?: LayoutsConfig (可选) — Per-layout shell declarations keyed by layout name.; mode?: "ssg" (可选) — Build mode. 'ssg' (default) generates static HTML.; headExtras?: string (可选) — @dangerous injected as-is, only use with controlled content; html.lang?: string (可选); html.title?: string (可选); inject.stylesheets?: (string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[] (可选) — Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.; inject.scripts?: (string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str… (可选) — Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.; inject.headFragments?: string[] (可选) — @dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.; ssr.noExternal?: (string | RegExp)[] (可选); island.upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (可选); build.outDir?: string (可选) — Output directory for the build artifacts. Defaults to `dist`.; build.manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; } (可选) — Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.; viewTransition?: boolean (可选) — Enable the View Transitions API for client navigations. Defaults to true.; speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (可选) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; middleware.cors?: boolean (可选) — Enable the built-in CORS middleware.; middleware.corsOrigin?: string | string[] (可选) — Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.; middleware.corsOriginModule?: string (可选) — Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `appShell.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.; middleware.requestId?: boolean (可选) — Emit and honor a per-request id header.; middleware.logger?: boolean (可选) — Log each request through the built-in logger.; middleware.securityHeaders?: boolean (可选) — Attach the built-in security response headers.; middleware.csp?: { policy?: string; nonce?: boolean; reportOnly?: boolean; } (可选) — Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.; middleware.use?: string[] (可选) — Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `appShell.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configur…

packages/protocol/src/framework.ts:170
HYDRATION_STRATEGIES@openelement/element · ./no-regionsconstpublic

Runtime list of supported hydration strategies; the single source of truth for the `HydrationStrategy` union. Consumed by island/registry validation and re-exported from the element root for app and build adapters.

readonly ["load", "idle", "visible", "only", "none"]

packages/protocol/src/framework.ts:28
HydrationStrategy@openelement/element · ./no-regionstypepublic

Island hydration trigger: 'load' | 'idle' | 'visible' | 'only'.

"load" | "idle" | "visible" | "only" | "none"

packages/protocol/src/framework.ts:30
IDLE_FALLBACK_TIMEOUT_MS@openelement/element · ./no-regionsconstpublic

Idle-hydration scheduling fallback (milliseconds) when neither `requestIdleCallback` nor `requestAnimationFrame` is available.

50

packages/protocol/src/policy.ts:70
injectPropsSafe@openelement/element · ./no-regionsfunctionpublic

Safely assign caller-supplied props onto a target object, skipping keys that could enable prototype pollution and tolerating read-only properties. The canonical guarded assigner for the canonical dangerous-key rule (#903, #1214): the

(target: Record<string, unknown>, props: Record<string, unknown>, tagName: string, log?: { warn(message: string): void; debug(message: string): void; }): void

packages/element/src/internal/core/security.ts:119
isDangerousKey@openelement/element · ./no-regionsfunctionpublic

Shared dangerous-key predicate (#903, #1214). Prototype-internal keys must never be injected from untrusted props on ANY path: host prop collection (collectPublicProps / normalizePublicProps in props-utils.ts), guarded assignment (injectPropsSafe below — the SPA bootstrap page-projection write boundary in

(key: string): boolean

packages/element/src/internal/core/security.ts:51
IslandOptions@openelement/element · ./no-regionsinterfacepublic

Per-island delivery options (hydration strategy, SSR/DSD participation).

IslandOptions

hydrate?: "load" | "idle" | "visible" | "only" | "none" (可选) — Hydration strategy: - 'load': load immediately when module is imported - 'idle': defer to requestIdleCallback (default) - 'visible': use IntersectionObserver to defer until element is visible - 'only': client-only render, no DSD/SSR output Named `hydrate` to match `defineIslandConfig()` in the Router package — one option name across both packages.; dsd?: boolean (可选) — Whether to use DSD for SSR rendering of this island. Honored by the build-side island scan (via `defineIslandConfig`), not by `defineIsland()` itself: passing it in `IslandOptions` has no runtime effect.; ssr?: boolean (可选) — Whether this island may be admitted into server rendering. Like `dsd`, decided by the build-side island scan; inert when passed to `defineIsland()`.

packages/protocol/src/island.ts:8
isSafeAttributeName@openelement/element · ./no-regionsfunctionpublic

Shared safe-attribute-name predicate (#1033): the SSR face of the one canonical predicate in `../protocol/forbidden-sinks.ts`. A name must be valid HTML attribute-name grammar (blocks quote/space injection, #602), must not be an event handler (`on*`, case-insensitive), and must not be a forbidden sink (`innerhtml`/`srcdoc`). The compiler, protocol validator, and server serializer enforce the same predicate with their own failure strategies; every path delegates to the single implementation, so the boundary cannot diverge.

(name: string): boolean

packages/element/src/internal/core/security.ts:65
isValidTagName@openelement/element · ./no-regionsfunctionpublic

Check if a tag name is a valid custom element name per HTML spec.

(tagName: string): boolean

packages/element/src/internal/core/tag-utils.ts:38
Loader@openelement/element · ./no-regionstypepublic

Route loader: fetches data for a page route.

Loader<T, Env, Platform, Route>

packages/protocol/src/data.ts:56
LoaderContext@openelement/element · ./no-regionsinterfacepublic

Context passed to a request-time ('dynamic') route loader.

LoaderContext<Env, Platform, Route>

request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:40
LocalePath@openelement/element · ./no-regionsinterfacepublic

Locale-aware resolved path contract.

LocalePath

locale: string (必填); path: string (必填); localizedPath: string (必填); isDefaultLocalePath: boolean (必填)

packages/protocol/src/framework.ts:82
Logger@openelement/element · ./no-regionsinterfacepublic

logger.ts - Tagged console logger. Lightweight scoped logger. Returns plain functions so it is tree-shakable and has zero class overhead.

Logger

debug: (msg: string, ...args: unknown[]) => void (必填); info: (msg: string, ...args: unknown[]) => void (必填); warn: (msg: string, ...args: unknown[]) => void (必填); error: (msg: string, ...args: unknown[]) => void (必填)

packages/element/src/internal/core/logger.ts:10
MAX_ACTION_BODY_BYTES@openelement/element · ./no-regionsconstpublic

Request-body bound (bytes) the generated entry applies to action POST routes; larger uploads belong on API routes with explicit limits.

number

packages/protocol/src/policy.ts:57
MAX_COMPOSITION_DEPTH@openelement/element · ./no-regionsconstpublic

Nested element expansion depth bound for `renderDsd`: cyclic component composition fails closed instead of recursing without end.

8

packages/protocol/src/policy.ts:51
Middleware@openelement/element · ./no-regionstypepublic

Fetch middleware contract (#858): WinterCG shape, dialect-free — no Hono/h3 context object. Composed at the handler boundary in onion order (`use[0]` is outermost: it sees the request first and the response last), so it runs with identical semantics in the dev server, the `start` CLI, the e2e fixture server, and the Nitro production entry. A middleware may short-circuit by returning a Response without calling `next()`, or post-process the Response that `next()` returns. Module contract: a Middleware is the DEFAULT EXPORT of a module referenced from `middleware.use` by path (e.g. './app/middleware/auth.ts'). The generated server entry imports the module, so the middleware may close over module scope and import local helpers and third-party packages — it is a real module in the server module graph, never serialized source.

Middleware

packages/protocol/src/framework.ts:158
OpenElement@openelement/element · ./no-regionsclasspublic

Custom Element base class for the compiled Part Program architecture. Subclasses are produced by the compiler; hand-written subclasses that never pass through the compiler fail closed at connect time.

class OpenElement extends OpenElementConfiguration

packages/element/src/open-element-implementation.ts:104
OpenElementAttribute@openelement/element · ./no-regionsinterfacepublic

One documented attribute of a custom element declaration.

OpenElementAttribute

name: string (必填); type?: string (可选); default?: string (可选); description?: string (可选); reflects?: boolean (可选); fieldName?: string (可选)

packages/protocol/src/manifest.ts:15
OpenElementCssPart@openelement/element · ./no-regionsinterfacepublic

One documented CSS part of a custom element declaration.

OpenElementCssPart

name: string (必填); description?: string (可选)

packages/protocol/src/manifest.ts:38
OpenElementDeclaration@openelement/element · ./no-regionsinterfacepublic

One custom element declaration in a package manifest: tag, members and delivery metadata.

OpenElementDeclaration

tagName: string (必填); className?: string (可选); superclassName?: string (可选); attributes?: OpenElementAttribute[] (可选); events?: OpenElementEvent[] (可选); slots?: OpenElementSlot[] (可选); cssParts?: OpenElementCssPart[] (可选); openElement.ssr?: boolean (可选); openElement.dsd?: boolean (可选); openElement.layer?: ComponentLayer (可选); openElement.hydrate?: "load" | "idle" | "visible" | "only" | "none" (可选); openElement.status?: "stable" | "experimental" (可选) — Stability marker from the owning package's manifest policy.; openElement.module?: string (可选); openElement.export?: string (可选); description?: string (可选)

packages/protocol/src/manifest.ts:56
OpenElementError@openelement/element · ./no-regionsclasspublic

Framework error carrying a stable code, severity, phase and recoverability contract.

class OpenElementError extends Error

packages/protocol/src/errors.ts:100
OpenElementEvent@openelement/element · ./no-regionsinterfacepublic

One documented custom event of a custom element declaration.

OpenElementEvent

name: string (必填); type?: string (可选); description?: string (可选)

packages/protocol/src/manifest.ts:25
OpenElementPackageManifest@openelement/element · ./no-regionsinterfacepublic

Package manifest of component declarations (not a Custom Elements Manifest).

OpenElementPackageManifest

schemaVersion: string (必填); packageName: string (必填); version: string (必填); description?: string (可选); author?: string (可选); license?: string (可选); homepage?: string (可选); repository?: string (可选); declarations: OpenElementDeclaration[] (必填)

packages/protocol/src/manifest.ts:69
OpenElementRouteKind@openelement/element · ./no-regionstypepublic

Host-agnostic route and asset contracts shared by app and build drivers.

OpenElementRouteKind

packages/protocol/src/app-model.ts:2
OpenElementRouteNode@openelement/element · ./no-regionsinterfacepublic

One node of the host-agnostic route tree: the matched URL `path` and route kind, the source and module paths the drivers resolve, the optional registered tag and param names, and the nested `children`.

OpenElementRouteNode

kind: OpenElementRouteKind (必填); path: string (必填); filePath?: string (可选); importPath?: string (可选); tagName?: string (可选); paramNames?: string[] (可选); children?: OpenElementRouteNode[] (可选); meta?: Record<string, unknown> (可选)

packages/protocol/src/app-model.ts:9
OpenElementSlot@openelement/element · ./no-regionsinterfacepublic

One documented slot of a custom element declaration.

OpenElementSlot

name: string (必填); description?: string (可选)

packages/protocol/src/manifest.ts:32
PROBLEM_JSON_MEDIA_TYPE@openelement/element · ./no-regionsconstpublic

Media type of the RFC 9457 action error channel (#863).

"application/problem+json"

packages/protocol/src/data.ts:117
ProblemDetails@openelement/element · ./no-regionsinterfacepublic

RFC 9457 Problem Details document (#863): the action error channel answers `application/problem+json` instead of the bespoke `{ type: 'error', error: { message } }` JSON, so HTTP tooling recognizes failures natively. With `type: 'about:blank'`, `title` is the HTTP reason phrase and `detail` carries the specific explanation. The wire shape is alpha-unfrozen; the 1.0 acceptance freezes it in this problem+json form.

ProblemDetails

type: string (必填) — URI reference identifying the problem type; 'about:blank' when none applies.; title: string (必填) — Short human-readable summary (the HTTP reason phrase for 'about:blank').; status.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (必填) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; detail?: string (可选) — Human-readable explanation specific to this occurrence.

packages/protocol/src/data.ts:105
property@openelement/element · ./no-regionsfunctionpublic

Compiler-recognized property decorator; inert no-op at runtime.

(_options: { reflect: boolean; attribute?: false | string; type?: unknown; converter?: unknown; }): (target: unknown, context?: unknown) => void

reflect: boolean (必填); attribute?: string | false (可选); type?: unknown (可选); converter?: unknown (可选)

packages/element/src/internal/core/compile-decorators.ts:34
provideContext@openelement/element · ./no-regionsfunctionpublic

Provide a plain protocol value; the provider Signal remains OE-private.

<T>(host: HTMLElement, context: Context<T>, value: T): Unsubscribe

packages/element/src/internal/core/signal-context.ts:109
ReadonlySignal@openelement/element · ./no-regionsinterfacepublic

Read-only signal protocol used by computed values.

ReadonlySignal<T>

value: T (必填); subscribe: (fn: (value: T) => void) => Unsubscribe (必填); __@SIGNAL_BRAND@7733.valueOf: () => boolean (必填) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:26
renderDsd@openelement/element · ./no-regionsfunctionpublic

Server-render one compiled element through canonical Element composition.

(input: string | CustomElementConstructor, options?: RenderDsdOptions): RenderOutput

packages/element/src/public-runtime.ts:771
RenderDsdOptions@openelement/element · ./no-regionsinterfacepublic

Options for one `renderDsd()` call: the compiled component class to serialize, the values projected onto its compiled properties, optional route/source diagnostics metadata, the nested compiled tags the build admitted, and trusted parent-owned light children keyed by slot name.

RenderDsdOptions

componentClass?: CustomElementConstructor (可选); props?: Record<string, unknown> (可选); sourceInfo.route?: string (可选); sourceInfo.source?: string (可选); ssrRenderableTags?: readonly string[] (可选) — Build-admitted nested compiled tags. Omitted means shell-only rendering.; projectedChildren?: ReadonlyMap<string, TrustedHtml> (可选) — Trusted parent-owned light children keyed by slot name.

packages/element/src/public-runtime.ts:145
RenderError@openelement/element · ./no-regionsclasspublic

Recoverable render-phase error carrying the failing component path and tag.

class RenderError extends OpenElementError

packages/element/src/internal/core/errors.ts:95
RenderOutput@openelement/element · ./no-regionsinterfacepublic

The public result of one `renderDsd()` call: the serialized DSD `html`, the render errors collected while composing it (empty on success), the render metrics for the root component, and the hydration hints the client scheduler reads to upgrade islands.

RenderOutput

html: string (必填); errors: RenderError[] (必填); metrics: DsdRenderMetrics (必填); hydrationHints: HydrationHint[] (必填)

packages/protocol/src/render.ts:34
reportError@openelement/element · ./no-regionsfunctionpublic

Report an {@linkcode OpenElementError} to the telemetry hook, or console.error when none is installed.

(error: OpenElementError): void

code: string (必填); severity: ErrorSeverity (必填); phase: ErrorPhase (必填); recoverable: boolean (必填); statusCode.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; statusCode.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; statusCode.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; statusCode.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; statusCode.valueOf: () => number (必填) — Returns the primitive value of the specified object.; statusCode.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; toJSON: () => Record<string, unknown> (必填); name: string (必填); message: string (必填); stack?: string (可选); cause?: unknown (可选)

packages/element/src/internal/core/errors.ts:139
RouteEntry@openelement/element · ./no-regionsinterfacepublic

One route admitted by the scanner: URL `path`, source `filePath`, the route `type`, the generated variable name (`varName`) the entry binds it to, and the optional registration tag. {@link RouteEntry.definePage} and {@link RouteEntry.hasEnhancedForms} carry the two source-derived admission facts the generated entries branch on.

RouteEntry

path: string (必填); filePath: string (必填); type: "page" | "api" | "island" | "special" (必填); varName: string (必填); tagName?: string (可选); definePage?: boolean (可选) — True when the route module's default export is a definePage() definition (#960 — registration decoupling). The generated entry registers the page class under the path-derived fallback tag and IGNORES the tagName export for registration: on a definePage route the export only names a content element. Plain element routes keep tagName as their registration tag.; source?: string (可选) — Source text captured during scanning when includeSource is enabled.; hasEnhancedForms?: boolean (可选) — True when the page route source carries data-open-enhance (#569): the client entry must ship the form-enhancement layer even when the app has zero islands.; special?: SpecialFileType (可选); params?: string[] (可选)

packages/protocol/src/framework.ts:113
ServerRouteContext@openelement/element · ./no-regionsinterfacepublic

Canonical request-time/SSG server route context.

ServerRouteContext<Env, Platform, Route>

request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:25
ServerRouteMetadata@openelement/element · ./no-regionsinterfacepublic

Context passed to a request-time ('dynamic') route loader. This is the server contract: the loader runs on the server with the Web-standard request, matched route params, the host environment and the platform object, and signals validation failure via fail()/redirect().

ServerRouteMetadata

path: string (必填); filePath: string (必填)

packages/protocol/src/data.ts:19
setErrorTelemetryHook@openelement/element · ./no-regionsfunctionpublic

Install the process-wide error telemetry hook (replaceable for tests, HMR, multi-app pages).

(hook: ErrorTelemetryHook): void

packages/element/src/internal/core/errors.ts:127
signal@openelement/element · ./no-regionsfunctionpublic

Create a writable signal through the selected signal engine.

<T>(initialValue: T): WritableSignal<T>

packages/element/src/internal/signal/framework.ts:19
Signal@openelement/element · ./no-regionstypepublic

Alias for APIs that accept either writable or read-only signals.

Signal<T>

packages/protocol/src/signal.ts:31
SpecialFileType@openelement/element · ./no-regionstypepublic

Special file kinds the route scanner recognizes by filename: `renderer` and `middleware`.

SpecialFileType

packages/protocol/src/framework.ts:79
SsrAdmissionDecision@openelement/element · ./no-regionsinterfacepublic

The build's admission verdict for one discovered tag: where the declaration lives (`modulePath`), how it was discovered (`source`), which render path it is admitted to, and the reason recorded for the manifest.

SsrAdmissionDecision

tagName: string (必填); modulePath: string (必填) — Module path of the island declaration. Empty for 'foreign' decisions: a foreign tag is consumed in JSX but declares no module the build owns.; source: "local" | "package" | "nested" | "foreign" (必填) — 'foreign' (#979): a third-party WC tag discovered by the foreign-tag scanner in page/island JSX — recorded for visibility only; SSR still treats it as an opaque passthrough (renderPath 'client-only').; renderPath: "ssr+client" | "client-only" | "rejected" (必填); reason: string (必填)

packages/protocol/src/render.ts:56
STREAM_FRAME_FORBIDDEN_TAGS@openelement/element · ./no-regionsconstpublic

Tags a deferred frame cannot safely install into an owned Part range: the browser installer rejects any frame whose markup carries one of these.

readonly ["script", "style", "template", "iframe", "object", "embed", "base", "meta", "link"]

packages/protocol/src/stream-frame-policy.ts:26
STREAM_FRAME_UNSAFE_URL@openelement/element · ./no-regionsconstpublic

Schemes that make a URL attribute unsafe in a streamed frame.

RegExp

packages/protocol/src/stream-frame-policy.ts:60
STREAM_FRAME_URL_ATTRIBUTES@openelement/element · ./no-regionsconstpublic

URL-carrying attributes the frame check screens for script-bearing scheme obfuscation; only these attribute names are value-screened.

readonly ["href", "src", "action", "formaction", "xlink:href"]

packages/protocol/src/stream-frame-policy.ts:42
STREAM_FRAME_URL_CONTROL_MAX@openelement/element · ./no-regionsconstpublic

Control characters at or below this code point are stripped before the URL-scheme test, so tab/newline/control obfuscation cannot smuggle a scheme past admission.

32

packages/protocol/src/stream-frame-policy.ts:55
STREAM_MAX_FIELDS@openelement/element · ./no-regionsconstpublic

Deferred fields (declared streamed properties) one stream route's manifest may carry. The build scan, the server executor, and the browser seed contract enforce the same bound.

32

packages/protocol/src/policy.ts:24
STREAM_MAX_OWNERS@openelement/element · ./no-regionsconstpublic

Part/Region owners one stream route's manifest may address in total across all deferred fields.

64

packages/protocol/src/policy.ts:30
STREAM_MAX_PAYLOAD_LENGTH@openelement/element · ./no-regionsconstpublic

Serialized stream payload bound, as a string length in UTF-16 code units: one seed attribute or one deferred frame's markup may not exceed it. The server checks the JSON text and the rendered range before emitting; the browser checks the attribute before parsing.

number

packages/protocol/src/policy.ts:45
STREAM_MAX_SEED_PROPERTIES@openelement/element · ./no-regionsconstpublic

Typed properties one streamed seed may carry: the browser seed contract rejects the WHOLE seed above this count, so an oversized component would silently fail to hydrate instead of failing loud at the server.

64

packages/protocol/src/policy.ts:37
STREAM_TIMEOUT_MS@openelement/element · ./no-regionsconstpublic

Deferred-field resolution budget (milliseconds) for one streamed response: fields still pending when it expires are failed in place and the stream ends with the shell and whatever resolved.

30000

packages/protocol/src/policy.ts:64
StyleSheet@openelement/element · ./no-regionsconstpublic

Cross-realm StyleSheet constructor: the native CSSStyleSheet or the internal shim.

new () => StyleSheetLike

packages/element/src/internal/core/style-sheet.ts:67
StyleSheetLike@openelement/element · ./no-regionsinterfacepublic

Minimal stylesheet contract (replaceSync + cssRules) satisfied by native and shim sheets.

StyleSheetLike

replaceSync: (text: string) => void (必填); cssRules: StyleSheetRule[] (必填)

packages/protocol/src/style-sheet.ts:14
trustedHtml@openelement/element · ./no-regionsfunctionpublic

Mark an HTML string as trusted for explicit `innerHTML` sinks (the trust does not serialize).

(html: string): TrustedHtml

packages/element/src/internal/core/security.ts:86
TrustedHtml@openelement/element · ./no-regionsinterfacepublic

Opaque capability marking HTML the application has explicitly vetted as trusted.

TrustedHtml

html: string (必填)

packages/element/src/internal/core/security.ts:81
unsafeStreamFrameAttribute@openelement/element · ./no-regionsfunctionpublic

Whether a static attribute (name/value as authored into the Part Program) makes a streamed frame unsafely installable: event-handler, seed-spoofing, and srcdoc names fail outright, and URL-carrying names fail when the entity-decoded, control-stripped value carries a script scheme.

(name: string, value: string): boolean

packages/protocol/src/stream-frame-policy.ts:113
wrapInDocument@openelement/element · ./no-regionsfunctionpublic

Wrap rendered HTML in a full HTML document. Adds DOCTYPE, head (title, meta, preload), and body. Supports CSP nonce and dev scripts (e.g. Vite client, route module registration).

(html: string, options?: DocumentWrapOptions): string

packages/element/src/internal/core/html-escape.ts:109
analyzeModuleSemantics@openelement/compiler · rootfunctionpublic

Parse one module source and report the semantic facts the compiler boundary and the Vite graph adapters branch on. Pure: it never resolves imports from disk and never throws on foreign or invalid syntax — an unparsable module simply yields no recognized facts. The scan's factory vocabulary is host-injected: the default knows only the element package's own registration factories, and page-definition/registration facts for other packages require the caller's {@link ModuleSemanticsOptions.vocabulary} descriptors.

(source: string, fileName: string, options?: ModuleSemanticsOptions): ModuleSemanticFacts

packages/compiler/src/internal/compiler/semantic-core/module-analysis.ts:418
clearStyleRequests@openelement/compiler · rootfunctionpublic

Drop every registered edge (a build's bookkeeping is its own lifetime).

(): void

packages/compiler/src/internal/compiler/style-requests.ts:58
COMPILED_ELEMENT_MARKER@openelement/compiler · rootconstpublic

The authored substring every compiled element module contains (`@element(`), used as the cheap prefilter.

"@element("

packages/compiler/src/internal/compiler/plugin.ts:48
compiledArtifactStyleRequests@openelement/compiler · rootfunctionpublic

The `.css` style edges of one compiled artifact module, in authored order — or undefined when the module is not a shape this recovery adopts. Never throws and never guesses: a module without the Part Program marker, without a `.css` specifier, without an arrayed `static styles`, or with a sheet import no class arrays is left entirely to the graph's normal channels, exactly as before this recovery existed. Adoption is all-or-nothing per module, so it can never turn a working module into a fail-closed intercept while half its edges stay unregistered. The read tolerates both artifact forms the pack pipeline produces: the compiler's raw emission (TypeScript syntax, e.g. a `type`-annotated styles member) and the packed module (types stripped by the packer). The AST parse is ScriptKind.TSX for exactly that reason — a diagnostics gate on the file extension would refuse the raw form and silently drop its edges.

(source: string, fileName: string): readonly string[] | undefined

packages/compiler/src/internal/compiler/compiled-artifact-style-requests.ts:94
CompiledElementError@openelement/compiler · rootclasspublic

Error shape consumed by the Vite plugin and compiler tests.

class CompiledElementError extends CompilerDiagnosticError

packages/compiler/src/internal/compiler/semantic-core/compiler-diagnostics.ts:20
compiledElementPlugin@openelement/compiler · rootfunctionpublic

The `open:compiled-element` Vite plugin: runs at `enforce: 'pre'` so the compiler sees authored TSX before Vite's own TS/JSX lowering, compiles every module with a canonically bound `@element` decorator, and leaves all other modules untouched. `workspaceRoot` anchors generated source-map ids for linked workspace packages.

(options?: CompiledElementPluginOptions): Plugin

workspaceRoot?: string (可选) — Workspace root used as the second identity anchor: Vite ids outside the project root are typically linked workspace packages, and anchoring them on the workspace keeps machine paths out of emitted source maps. Callers that do not know a workspace root omit it and get ids passed through.; typeCheckEmitted?: boolean (可选) — Type-check every module the compiler emits and fail the build when one does not compile (#1386 item 2). Off by default: it runs a TypeScript program per emitted module, which a dev-server transform must not pay. A build or verification pass turns it on, so the emitted program is checked against the declarations the consumer compiles against.; resolutionPaths?: Record<string, string[]> (可选) — Specifier → candidate files map used when `typeCheckEmitted` is on.; staticSidecars?: readonly StaticSidecarDescriptor[] (可选) — Static-sidecar descriptors the host application admits into the compiled module grammar (e.g. its island delivery policy factory). The default core knows none: without an injected descriptor a module carrying a sidecar policy statement fails closed with OEC9008.

packages/compiler/src/internal/compiler/plugin.ts:173
compileElementModule@openelement/compiler · rootfunctionpublic

Compile one opted-in module without binding the caller to Vite. The core adapter hook and the inline SSR/client builds all use this same function, which prevents duplicate compiler implementations from drifting. Returns null for modules without a canonically bound

(code: string, id: string, options?: SemanticCoreOptions): CompileElementResult | null

packages/compiler/src/internal/compiler/plugin.ts:84
compileElementProgram@openelement/compiler · rootfunctionpublic

Compile one authored TSX module into the compiled Part Program module. `fileName` is used for diagnostics and the emitted source map only — filesystem resolution is the caller's job. Fails closed with a {@link CompiledElementError} carrying the ordered OEC diagnostics. `options.staticSidecars` admits host-declared sidecar policy statements (e.g. an island delivery descriptor); the default core admits none.

(source: string, fileName: string, options?: SemanticCoreOptions): CompileElementResult

packages/compiler/src/internal/compiler/semantic-core/compile.ts:101
CompileElementResult@openelement/compiler · rootinterfacepublic

The compiled module the transform emits for one authored TSX source: the generated `code`, its Source Map v3, the Part Program facts the runtime consumes, and the ordered diagnostics that did not fail the compile.

CompileElementResult

code: string (必填); map: CompiledElementSourceMap (必填) — Real Source Map v3 for the emitted module (VLQ line+column segments derived from the compiler's span records and emission provenance). The same map is embedded as the module's inline map; the Vite shell returns it as its `map` output for downstream composition (#1210).; program: PartProgramV1 (必填); styleRequests?: readonly string[] (可选) — The module's style edges (#1558): the authored `.css` specifiers the class's `static styles` arrays, in authored order. The host build's style-asset plugin intercepts these edges — a build with no intercepting plugin fails at import resolution, never by silently inlining.

packages/compiler/src/internal/compiler/semantic-core/compile.ts:74
ElementCompilerDiagnostic@openelement/compiler · rootinterfacepublic

A source-aware compiler diagnostic: stable OEC code, message and source range.

ElementCompilerDiagnostic

code: string (必填); message: string (必填); file: string (必填); line.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; line.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; line.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; line.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; line.valueOf: () => number (必填) — Returns the primitive value of the specified object.; line.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; character: number (必填); start: number (必填); end: number (必填)

packages/compiler/src/internal/compiler/semantic-core/compiler-diagnostics.ts:17
EmittedModuleDiagnostic@openelement/compiler · rootinterfacepublic

One diagnostic the type checker produced for the emitted module. `file` is the virtual module id the check was given; the remaining fields locate the range inside the EMITTED text.

EmittedModuleDiagnostic

code.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; code.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; code.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; code.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; code.valueOf: () => number (必填) — Returns the primitive value of the specified object.; code.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; message: string (必填); file: string (必填); line: number (必填); character: number (必填)

packages/compiler/src/internal/compiler/semantic-core/type-check.ts:37
EmittedModuleTypeCheckOptions@openelement/compiler · rootinterfacepublic

How the emitted module's imports resolve, and any virtual files to add.

EmittedModuleTypeCheckOptions

paths?: Record<string, string[]> (可选) — Module resolution map for the specifiers the emitted module imports, in TypeScript `paths` form (specifier → candidate files). A caller that resolves `@openelement/element` through the workspace passes that map; omitting it means imported specifiers resolve through `node_modules`, which is what a packed consumer has instead.; compilerOptions?: ts.CompilerOptions (可选) — Extra compiler options, merged over the defaults below.; extraFiles?: Readonly<Record<string, string>> (可选) — Support files the emitted module imports, supplied as text for ids that do not exist on disk (a bundler's other virtual modules). The emitted module itself is added under `fileName`.

packages/compiler/src/internal/compiler/semantic-core/type-check.ts:46
emittedModuleTypeChecks@openelement/compiler · rootfunctionpublic

`true` when the emitted module type-checks. The boolean form exists so a caller that only needs a verdict does not destructure an empty array; the diagnostics form is for callers that must report what failed.

(code: string, fileName: string, options?: EmittedModuleTypeCheckOptions): boolean

packages/compiler/src/internal/compiler/semantic-core/type-check.ts:178
getStyleRequest@openelement/compiler · rootfunctionpublic

The edge a resolved sheet module id carries, if any.

(moduleId: string): RegisteredStyleRequest | undefined

packages/compiler/src/internal/compiler/style-requests.ts:42
hasElementDecoratorApplication@openelement/compiler · rootfunctionpublic

Precise second stage behind the substring prefilter: a canonically bound `@element(...)` decorator application on a class declaration (provenance decided by the semantic core's intrinsic-binding model). Modules that only mention the marker in a string literal or comment, or spell it through a foreign/local binding, do not reach the compiler.

(code: string, id: string): boolean

packages/compiler/src/internal/compiler/plugin.ts:69
hasStyleImporter@openelement/compiler · rootfunctionpublic

True when the importing module has registered edges (query suffixes ignored).

(importerId: string): boolean

packages/compiler/src/internal/compiler/style-requests.ts:47
isCompiledElementModule@openelement/compiler · rootfunctionpublic

Cheap first stage only — NOT a recognizer. The substring match exists to keep plain modules off the AST path and may false-positive (string literals and comments match); it may also false-negative on namespace-qualified spellings (`@ns.element(...)`), which are unsupported by the grammar anyway (#1209). Binding provenance and admission are decided exclusively by the semantic core.

(code: string, id: string): boolean

packages/compiler/src/internal/compiler/plugin.ts:58
ModuleSemanticFacts@openelement/compiler · rootinterfacepublic

The bundler-neutral facts one module source yields: its relative imports, the intrinsic bindings it admits ({@link ModuleSemanticFacts.compiledElementDecorator}, {@link ModuleSemanticFacts.exportedTagName}, custom-element tags it defines or references) and the interaction-event names its handlers bind. The Vite graph adapter branches on these without re-parsing the AST.

ModuleSemanticFacts

relativeImports: string[] (必填); compiledElementDecorator: boolean (必填); unsupportedElementDecorator?: string (可选) — Set when a class decorator spells the `element` intrinsic through unsupported or ambiguous provenance (type-only import, namespace access, default import, conflicting duplicate bindings, or a relative-module re-export). Never set for clearly foreign bindings (third-party packages, local declarations, bare/global spellings) — those modules are simply not OpenElement modules. The plugin gate compil…; exportedTagName?: string (可选); definePage: boolean (必填) — True when the module default-exports a page-definition factory call from the host's injected vocabulary, or is an .mdx route. The default scan (no injected vocabulary) never recognizes another package's factories.; usesExportedTagName: boolean (必填); enhancedForm: boolean (必填); defaultCompiledTag?: string (可选); definedCustomElementTags: string[] (必填); referencedCustomElementTags: string[] (必填); compilerInteractionEvents: string[] (必填)

packages/compiler/src/internal/compiler/semantic-core/module-analysis.ts:12
ModuleSemanticsOptions@openelement/compiler · rootinterfacepublic

Host-supplied vocabulary extensions for the module scan.

ModuleSemanticsOptions

vocabulary?: readonly ModuleVocabularyDescriptor[] (可选) — Vocabulary descriptors the host admits beyond the core's own element bindings. The default scan knows no other package: a route module's page-definition export or registration factory is recognized only when the host injects its descriptor.

packages/compiler/src/internal/compiler/semantic-core/module-analysis.ts:94
ModuleVocabularyDescriptor@openelement/compiler · rootinterfacepublic

One module-scan vocabulary entry the host admits: a binding identity (module specifier + exported name, aliases followed) plus the fact a canonical call of that binding contributes. Plain data — the scan consumes the descriptors without learning the caller's package vocabulary, the same direction as the compiler's {@link StaticSidecarDescriptor} admission (#1473 item 3).

ModuleVocabularyDescriptor

moduleSpecifier: string (必填) — Canonical module specifier the factory must be imported from.; exportName: string (必填) — Exported name of the factory binding.; kind: "page-definition" | "element-registration" (必填) — What a canonical call of the binding contributes to the scan.

packages/protocol/src/module-descriptors.ts:33
RegisteredStyleRequest@openelement/compiler · rootinterfacepublic

One registered style edge: the authored import's build-graph coordinates.

RegisteredStyleRequest

moduleId: string (必填) — Resolved edge module id — the registry key, and what resolveId answers.; importer: string (必填) — The importing module's id as the build graph tracks it.; specifier: string (必填) — The authored `.css` specifier the generated module imports verbatim.; file: string (必填) — The sheet file's absolute path — where the intercepting build reads the bytes.

packages/compiler/src/internal/compiler/style-requests.ts:20
registerStyleRequest@openelement/compiler · rootfunctionpublic

Register one generated edge (idempotent per module id — recompiles overwrite).

(request: RegisteredStyleRequest): void

moduleId: string (必填) — Resolved edge module id — the registry key, and what resolveId answers.; importer: string (必填) — The importing module's id as the build graph tracks it.; specifier: string (必填) — The authored `.css` specifier the generated module imports verbatim.; file: string (必填) — The sheet file's absolute path — where the intercepting build reads the bytes.

packages/compiler/src/internal/compiler/style-requests.ts:36
SemanticCoreOptions@openelement/compiler · rootinterfacepublic

Host-supplied admission extensions for the semantic core.

SemanticCoreOptions

staticSidecars?: readonly StaticSidecarDescriptor[] (可选) — Static-sidecar descriptors the host admits. The default core knows none: a module carrying a sidecar policy statement fails closed until the host injects its descriptor.

packages/compiler/src/internal/compiler/semantic-core/module-analysis.ts:84
stableModuleId@openelement/compiler · rootfunctionpublic

Compile-time source identity for a module: absolute Vite ids are converted to project-relative POSIX paths so Part Program `metadata.sourceFile` and `sourceMap.file` never embed the build machine's path. Module resolution, diagnostics, and HMR keys keep using the caller's own id. Anchors are explicit, never guessed from path substrings (a checkout living under e.g. `/srv/www/` must not fool the cut): the Vite project root first, then the workspace root when the caller knows it (a module outside the project root is typically a linked workspace package). Callers that hand the compiler a path outside every known root (synthetic ids, projects without a Vite root) get the id back unchanged — there is no correct relative form to invent, and the library boundary must not reject paths it cannot anchor. This module stays runtime-neutral: resolving a workspace root from disk is the caller's job.

(file: string, root: string | undefined, workspaceRoot?: string): string

packages/compiler/src/internal/compiler/plugin.ts:124
StaticSidecarDescriptor@openelement/compiler · rootinterfacepublic

One static-sidecar descriptor the host injects into the element compiler: the admission granted is a colocated static policy statement (#1473 item 3, the static-sidecar admission pattern).

StaticSidecarDescriptor

moduleSpecifier: string (必填) — Canonical module specifier the sidecar export must be imported from.; exportName: string (必填) — Exported name of the sidecar factory binding.; kind: "static-sidecar" (必填) — The admission granted: a colocated static policy statement.

packages/protocol/src/module-descriptors.ts:16
stripInlineSourceMapComment@openelement/compiler · rootfunctionpublic

Strip the inline map comment from a compiled module at the Vite boundary. The core artifact embeds its real Source Map v3 inline for standalone consumers; the Vite transform returns that same map as its `map` output so Vite composes it with the rest of the pipeline — leaving the comment in the served code would create a second, conflicting map story (#1210).

(code: string): string

packages/compiler/src/internal/compiler/plugin.ts:104
styleEdgesForFile@openelement/compiler · rootfunctionpublic

Every edge whose sheet file is the given path — the dev HMR reverse lookup.

(file: string): RegisteredStyleRequest[]

packages/compiler/src/internal/compiler/style-requests.ts:52
styleRequestFile@openelement/compiler · rootfunctionpublic

The sheet file's absolute path for one authored edge: the importing module's directory joined with the authored specifier. Relative specifiers only (the compiler refuses bare ones), so the join is total.

(importerId: string, specifier: string): string

packages/compiler/src/internal/compiler/style-requests.ts:87
styleRequestModuleId@openelement/compiler · rootfunctionpublic

The registry key for one authored edge: the sheet file's resolved path. Query suffixes on the importer id (dev-time cache busting) are stripped, so recompiles re-register under one key; the full relative path keeps same-named sheets in sibling subdirectories distinct edges.

(importerId: string, specifier: string): string

packages/compiler/src/internal/compiler/style-requests.ts:73
typeCheckEmittedModule@openelement/compiler · rootfunctionpublic

Type-check one emitted compiled module. Returns `[]` when the module type-checks; otherwise every diagnostic the checker reported, in emission order, so a build can print all of them instead of only the first. The `fileName` should be the module's real (virtual) id, not a placeholder: module resolution and `paths` matching both key off it, and the diagnostics quote it back.

(code: string, fileName: string, options?: EmittedModuleTypeCheckOptions): EmittedModuleDiagnostic[]

packages/compiler/src/internal/compiler/semantic-core/type-check.ts:91
validatePartProgram@openelement/compiler · rootfunctionpublic

Validate an unknown value as a Part Program v1. The validator is intentionally strict: unknown instruction kinds, missing ownership records and unsafe paths fail before a runtime can guess at their meaning.

(raw: unknown): asserts raw is PartProgram

packages/protocol/src/part-program.ts:876
element@openelement/compiler · ./vitefunctionpublic

The `open:compiled-element` Vite plugin: runs at `enforce: 'pre'` so the compiler sees authored TSX before Vite's own TS/JSX lowering, compiles every module with a canonically bound `@element` decorator, and leaves all other modules untouched. `workspaceRoot` anchors generated source-map ids for linked workspace packages.

(options?: CompiledElementPluginOptions): Plugin

workspaceRoot?: string (可选) — Workspace root used as the second identity anchor: Vite ids outside the project root are typically linked workspace packages, and anchoring them on the workspace keeps machine paths out of emitted source maps. Callers that do not know a workspace root omit it and get ids passed through.; typeCheckEmitted?: boolean (可选) — Type-check every module the compiler emits and fail the build when one does not compile (#1386 item 2). Off by default: it runs a TypeScript program per emitted module, which a dev-server transform must not pay. A build or verification pass turns it on, so the emitted program is checked against the declarations the consumer compiles against.; resolutionPaths?: Record<string, string[]> (可选) — Specifier → candidate files map used when `typeCheckEmitted` is on.; staticSidecars?: readonly StaticSidecarDescriptor[] (可选) — Static-sidecar descriptors the host application admits into the compiled module grammar (e.g. its island delivery policy factory). The default core knows none: without an injected descriptor a module carrying a sidecar policy statement fails closed with OEC9008.

packages/compiler/src/internal/compiler/plugin.ts:173
Action@openelement/router · roottypepublic

Route action: handles form submissions for a page route.

Action<T, Env, Platform, Route>

packages/protocol/src/data.ts:64
ACTION_FETCH_HEADER@openelement/router · rootconstpublic

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"

packages/protocol/src/data.ts:125
ActionContext@openelement/router · rootinterfacepublic

Context passed to a route action function (extends loader context).

ActionContext<Env, Platform, Route>

formData: FormData (必填); request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:47
ActionOutcome@openelement/router · roottypepublic

The discriminated result an action returns: `success` carries the action's data; `failure` carries an HTTP status and payload. See `ActionResult` for the canonical classifier that produces it.

ActionOutcome<Data>

packages/router/src/authoring.ts:200
ActionResult@openelement/router · roottypepublic

Wire shape returned to the JavaScript form-enhancement path. The no-JS path never sees this: it gets the equivalent semantics as plain HTTP (303 on success, 422 with the re-rendered form on validation failure, redirect/error as status codes). Success carries no data envelope. The application-loop contract makes a successful non-GET action answer 303 (PRG) — the framework never answers 200 with a rendered page, or with a success document, for a successful mutation — so the fetch channel answers `{ type: 'redirect' }` naming the PRG target and the authored return value is discarded by design. Success data travels the PRG target instead (query state the loader re-runs with, which the props projector then maps; see the router guide's "Form actions" section). The union previously declared a `{ type: 'success' }` member that no code path ever emitted — removed so the type matches the wire. Error outcomes (CSRF 403, unknown action 404, unparseable body 400, unexpected 500) are NOT part of this union: since #863 they answer RFC 9457 Problem Details with the PROBLEM_JSON_MEDIA_TYPE content type — see ProblemDetails.

ActionResult<Failure>

packages/protocol/src/data.ts:92
classifyActionResult@openelement/router · rootfunctionpublic

Canonical application-level classification for an action return value. Server and SPA executors project this result differently, but neither may redefine validation failure or admit a raw Response as action data.

<Data>(result: Data): ActionOutcome<Data>

packages/router/src/authoring.ts:209
CONVENTION_APP_SHELL_PATH@openelement/router · rootconstpublic

Convention path for the auto-registered application shell.

"app/islands/app-shell.tsx"

packages/router/src/config.ts:91
CONVENTION_APP_SHELL_SUFFIX@openelement/router · rootconstpublic

Convention-relative suffix of the auto-registered application shell.

"islands/app-shell.tsx"

packages/router/src/config.ts:82
CONVENTION_APP_SHELL_TAG@openelement/router · rootconstpublic

The tag name the convention shell is registered under.

"app-shell"

packages/router/src/config.ts:97
CONVENTION_BASE_DIR@openelement/router · rootconstpublic

Default convention base: the directory the tokens/app-shell/data conventions resolve under when `dirs` is omitted (or has no shared leading segment).

"app"

packages/router/src/config.ts:76
CONVENTION_COMPONENTS_DIR@openelement/router · rootconstpublic

Default component directory (`app/components`), the `dirs.components` default.

"app/components"

packages/router/src/config.ts:70
CONVENTION_HEAD_PATH@openelement/router · rootconstpublic

Convention path for the structural document-head module (`app/head.tsx`).

"app/head.tsx"

packages/router/src/config.ts:94
CONVENTION_HEAD_SUFFIX@openelement/router · rootconstpublic

Convention-relative suffix of the structural document-head module.

"head.tsx"

packages/router/src/config.ts:85
CONVENTION_ISLANDS_DIR@openelement/router · rootconstpublic

Default island directory (`app/islands`), the `dirs.islands` default.

"app/islands"

packages/router/src/config.ts:67
CONVENTION_PACKAGE_JSON@openelement/router · rootconstpublic

The site-title convention source (the package.json `name` field).

"package.json"

packages/router/src/config.ts:100
CONVENTION_ROUTES_DIR@openelement/router · rootconstpublic

Default route directory (`app/routes`), the `dirs.routes` default.

"app/routes"

packages/router/src/config.ts:64
CONVENTION_STYLES_SUFFIX@openelement/router · rootconstpublic

Convention-relative suffix of the design-token stylesheet.

"styles/tokens.css"

packages/router/src/config.ts:79
CONVENTION_TOKENS_PATH@openelement/router · rootconstpublic

Convention path for the design-token stylesheet.

"app/styles/tokens.css"

packages/router/src/config.ts:88
conventionAppShellPath@openelement/router · rootfunctionpublic

The app-shell convention path for a resolved `dirs` block.

(base: string): string

packages/router/src/config.ts:608
conventionHeadPath@openelement/router · rootfunctionpublic

The structural document-head convention path for a resolved `dirs` block.

(base: string): string

packages/router/src/config.ts:613
conventionTokensPath@openelement/router · rootfunctionpublic

The token stylesheet convention path for a resolved `dirs` block.

(base: string): string

packages/router/src/config.ts:603
createRequestContext@openelement/router · rootfunctionpublic

Build the canonical OpenElement request context from a platform request event.

<Env extends Record<string, unknown> = Record<string, unknown>>(options: CreateRequestContextOptions<Env>): OpenElementRequestContext<Env>

request: Request (必填); params?: Record<string, string> (可选); env?: Env (可选); platform?: unknown (可选)

packages/router/src/model.ts:27
CreateRequestContextOptions@openelement/router · rootinterfacepublic

Inputs for building an {@linkcode OpenElementRequestContext} from a platform request event.

CreateRequestContextOptions<Env>

request: Request (必填); params?: Record<string, string> (可选); env?: Env (可选); platform?: unknown (可选)

packages/router/src/model.ts:17
defineConfig@openelement/router · rootfunctionpublic

`defineConfig()` — identity helper that pins the config file's shape.

(config: OpenElementUserConfig): OpenElementUserConfig

renderer?: "native" | "lit" (可选) — Page renderer. Omit to keep the compiled native renderer.; dirs.routes?: string (可选) — Route directory. Defaults to `app/routes`.; dirs.islands?: string (可选) — Island directory. Defaults to `app/islands`.; dirs.components?: string (可选) — Component directory. Defaults to `app/components`.; appShell?: false | { import: string; props?: Record<string, unknown>; } (可选) — Application shell. `false` opts out of the `app-shell.tsx` convention; an object registers the named module. `tagName` is derived from the import's basename, so it is not part of the surface.; packageIslands?: string[] (可选) — Extra package names whose island modules the build admits (e.g. `['@openelement/ui']`). The loader folds this list into the SSR externalization list the bundler needs, so a package listed here is bundled rather than imported at run time; there is no separate `ssr.noExternal` key.; head.title?: string (可选) — Document title; defaults to the package.json `name`.; head.description?: string (可选) — `<meta name="description">` + `og:description`.; head.lang?: string (可选) — `<html lang>`; defaults to `en`.; head.favicon?: string (可选) — Site-root-relative favicon path, emitted as `<link rel="icon">`.; head.ogImage?: string (可选) — `og:image` URL. Absolute (crawlable) or site-root-relative.; head.stylesheets?: string[] (可选) — External stylesheets linked into `<head>`.; head.scripts?: OpenElementHeadScript[] (可选) — External scripts emitted into `<head>`; inline code is not accepted here.; styles.tokens?: string (可选) — Token stylesheet path; defaults to the `styles/tokens.css` convention.; i18n?: OpenElementI18nConfig (可选) — Locale-prefixed build configuration.; viewTransition?: boolean (可选) — Client-navigation View Transitions. Boolean for now; an object form (per-transition types) is a possible future widening of this key.; tailwind?: boolean | TailwindPresetOptions (可选) — The Tailwind preset (alpha9 C2 #1505, opt-in): the config-file home for the same option the inline `openElement(...)` face takes. `true` enables the preset with defaults; an object names the theme/components sources, the `@scope` face tags, and the DSD link injection — see `TailwindPresetOptions` (@openelement/router/vite).; speculation?: boolean (可选) — Speculation Rules emission. Boolean for now: `true` uses the framework route-derived defaults, `false` emits none. An object form (explicit prerender/prefetch lists, exclusions, eagerness) is a possible future widening of this key.; build.manifestBudget?: Record<string, number> (可选) — Advisory per-entry manifest budgets in KB, e.g. `{ islandKB: 100, totalJsKB: 300 }`.; middleware.corsOrigin?: string | string[] (可选) — CORS allowlist; omitted means localhost-only reflection (production warning).

packages/router/src/config.ts:228
defineIslandConfig@openelement/router · rootfunctionpublic

Validate and register an island delivery descriptor; returns the normalized config.

(config: IslandConfig): IslandConfig

ssr?: boolean (可选); dsd?: boolean (可选); hydrate?: IslandDeliveryStrategy (可选) — Delivery strategy for this island: one of the four element hydration triggers ('load' | 'idle' | 'visible' | 'only' — the element package's `HydrationStrategy`), or the router-level 'media' delivery strategy, which fetches the chunk only while the required `media` query matches.; media?: string (可选) — Media query required by the `media` delivery strategy.; tags?: readonly string[] (可选) — Custom-element tags delivered by this one capability module.; tagNames?: readonly string[] (可选) — Alias accepted by generated artifact producers.; exportNames?: Readonly<Record<string, string>> (可选) — Named constructor exports keyed by delivered custom-element tag.

packages/router/src/authoring.ts:651
definePage@openelement/router · rootfunctionpublic

Attach a page descriptor to a compiled page element class. Canonical page authoring: the route module default-exports the compiled class (produced by the open:compiled-element transform) wrapped in definePage(). The descriptor holds head/route/renderIntent metadata plus the optional props/error projectors; it must NOT create classes or hold a render function — the compiled class's Part Program is the render. import { definePage } from '@openelement/router'; import { HomePage } from '../components/page-home.tsx'; export const loader = async (ctx) => ({ ... }); // module named exports export default definePage(HomePage, { head: { title: 'Home' }, props: ({ data }) => ({ heading: data?.heading ?? '' }), });

<Data = unknown, Params extends Record<string, string> = Record<string, string>>(componentClass: CustomElementConstructor, descriptor?: PageDescriptorInput<Data, Params>): PageComponentConstructor<Data, Params>

packages/router/src/authoring.ts:401
fail@openelement/router · rootfunctionpublic

Return a structured action failure with an HTTP status and typed data payload.

<Data>(status: number, data: Data): OpenElementActionFailure<Data>

toString: (radix?: number) => string (必填) — Returns a string representation of an object.; toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; valueOf: () => number (必填) — Returns the primitive value of the specified object.; toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.

packages/router/src/authoring.ts:179
isActionFailure@openelement/router · rootfunctionpublic

Type guard for {@linkcode OpenElementActionFailure}, including its duck-typed cross-realm shape.

(error: unknown): error is OpenElementActionFailure

packages/router/src/authoring.ts:184
IslandConfig@openelement/router · rootinterfacepublic

Per-island delivery configuration (SSR/DSD participation and hydration strategy).

IslandConfig

ssr?: boolean (可选); dsd?: boolean (可选); hydrate?: IslandDeliveryStrategy (可选) — Delivery strategy for this island: one of the four element hydration triggers ('load' | 'idle' | 'visible' | 'only' — the element package's `HydrationStrategy`), or the router-level 'media' delivery strategy, which fetches the chunk only while the required `media` query matches.; media?: string (可选) — Media query required by the `media` delivery strategy.; tags?: readonly string[] (可选) — Custom-element tags delivered by this one capability module.; tagNames?: readonly string[] (可选) — Alias accepted by generated artifact producers.; exportNames?: Readonly<Record<string, string>> (可选) — Named constructor exports keyed by delivered custom-element tag.

packages/router/src/authoring.ts:575
IslandDeliveryStrategy@openelement/router · roottypepublic

Delivery strategy for an island: a hydration trigger or media-gated loading.

IslandDeliveryStrategy

packages/router/src/authoring.ts:572
isOpenElementNotFound@openelement/router · rootfunctionpublic

Type guard for {@linkcode OpenElementNotFound}, including its duck-typed cross-realm shape.

(error: unknown): error is OpenElementNotFound

packages/router/src/authoring.ts:143
isOpenElementRedirect@openelement/router · rootfunctionpublic

Type guard for {@linkcode OpenElementRedirect}, including its duck-typed cross-realm shape.

(error: unknown): error is OpenElementRedirect

packages/router/src/authoring.ts:127
JsonValue@openelement/router · roottypepublic

A JSON value: the complete set of shapes the structured-data channel admits (JSON primitives, arrays and plain objects, all readonly). Functions, `undefined`, bigint, symbols, class instances, Date, Map and Set are rejected by the runtime normalizer and by this type, so an author cannot write a document the serializer would refuse.

JsonValue

packages/router/src/authoring.ts:230
Loader@openelement/router · roottypepublic

Route loader: fetches data for a page route.

Loader<T, Env, Platform, Route>

packages/protocol/src/data.ts:56
LoaderContext@openelement/router · rootinterfacepublic

Context passed to a request-time ('dynamic') route loader.

LoaderContext<Env, Platform, Route>

request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:40
notFound@openelement/router · rootfunctionpublic

Throw an {@linkcode OpenElementNotFound} to render the 404 path.

(message?: string): never

packages/router/src/authoring.ts:122
OPEN_ELEMENT_APP_SHELL_KEYS@openelement/router · rootconstpublic

Accepted keys inside `appShell`.

readonly string[]

packages/router/src/config.ts:294
OPEN_ELEMENT_BUILD_KEYS@openelement/router · rootconstpublic

Accepted keys inside `build`.

readonly string[]

packages/router/src/config.ts:303
OPEN_ELEMENT_CONFIG_FILE@openelement/router · rootconstpublic

Canonical config-file name, resolved in the project root.

"openelement.config.ts"

packages/router/src/config.ts:61
OPEN_ELEMENT_CONFIG_KEYS@openelement/router · rootconstpublic

The exact accepted key set, used by the fail-closed unknown-key check and by the error message (the message must name the accepted surface, never just reject). The nested arrays below are this module's single copy of the sub-key surfaces; the host-tooling loader imports them instead of restating them.

readonly string[]

packages/router/src/config.ts:239
OPEN_ELEMENT_DIRS_KEYS@openelement/router · rootconstpublic

Accepted keys inside `dirs`.

readonly string[]

packages/router/src/config.ts:291
OPEN_ELEMENT_HEAD_KEYS@openelement/router · rootconstpublic

Accepted keys inside `head`.

readonly string[]

packages/router/src/config.ts:263
OPEN_ELEMENT_HEAD_SCRIPT_KEYS@openelement/router · rootconstpublic

Keys of one `head.scripts` entry.

readonly string[]

packages/router/src/config.ts:274
OPEN_ELEMENT_HEAD_STRING_KEYS@openelement/router · rootconstpublic

Head keys that carry a plain string value.

readonly string[]

packages/router/src/config.ts:282
OPEN_ELEMENT_I18N_KEYS@openelement/router · rootconstpublic

Accepted keys inside `i18n`.

readonly string[]

packages/router/src/config.ts:300
OPEN_ELEMENT_MIDDLEWARE_KEYS@openelement/router · rootconstpublic

Accepted keys inside `middleware`.

readonly string[]

packages/router/src/config.ts:306
OPEN_ELEMENT_STYLES_KEYS@openelement/router · rootconstpublic

Accepted keys inside `styles`.

readonly string[]

packages/router/src/config.ts:297
OpenElementActionFailure@openelement/router · rootclasspublic

Expected-failure channel for actions (decision 0120): validation failures RETURN `fail(status, data)` — never throw — so the server can answer 422 with the form re-rendered and the submitted values echoed back. Thrown values keep the exception channel (redirect/notFound/error page).

class OpenElementActionFailure

packages/router/src/authoring.ts:160
OpenElementBuildConfig@openelement/router · rootinterfacepublic

Build-output switches.

OpenElementBuildConfig

manifestBudget?: Record<string, number> (可选) — Advisory per-entry manifest budgets in KB, e.g. `{ islandKB: 100, totalJsKB: 300 }`.

packages/router/src/config.ts:156
OpenElementDirsConfig@openelement/router · rootinterfacepublic

Source roots; see the `dirs` section of the module doc comment.

OpenElementDirsConfig

routes?: string (可选) — Route directory. Defaults to `app/routes`.; islands?: string (可选) — Island directory. Defaults to `app/islands`.; components?: string (可选) — Component directory. Defaults to `app/components`.

packages/router/src/config.ts:146
OpenElementHeadConfig@openelement/router · rootinterfacepublic

The document-head channel. Structured only: every entry serializes through the framework's URL/attribute validators, so a raw HTML string has no way in. Structural head content that is not expressible here (font preloads, icons, feed links, inline CSS) belongs in the `app/head.tsx` convention instead.

OpenElementHeadConfig

title?: string (可选) — Document title; defaults to the package.json `name`.; description?: string (可选) — `<meta name="description">` + `og:description`.; lang?: string (可选) — `<html lang>`; defaults to `en`.; favicon?: string (可选) — Site-root-relative favicon path, emitted as `<link rel="icon">`.; ogImage?: string (可选) — `og:image` URL. Absolute (crawlable) or site-root-relative.; stylesheets?: string[] (可选) — External stylesheets linked into `<head>`.; scripts?: OpenElementHeadScript[] (可选) — External scripts emitted into `<head>`; inline code is not accepted here.

packages/router/src/config.ts:120
OpenElementHeadScript@openelement/router · rootinterfacepublic

One structured `<script src>` descriptor accepted by `head.scripts`.

OpenElementHeadScript

src: string (必填) — Script URL: absolute, or site-root relative (`/theme-init.js`).; defer?: boolean (可选) — Emit `defer`; leave unset for a parser-blocking external script.; crossOrigin?: string (可选) — `crossorigin` attribute value, e.g. `anonymous`.; integrity?: string (可选) — Subresource-integrity digest for the script.

packages/router/src/config.ts:103
OpenElementI18nConfig@openelement/router · rootinterfacepublic

Locale configuration for a locale-prefixed build.

OpenElementI18nConfig

locales: string[] (必填) — Every locale the build emits, default locale included.; defaultLocale: string (必填) — The locale served at the unprefixed root.

packages/router/src/config.ts:138
OpenElementNotFound@openelement/router · rootclasspublic

Not-found signal thrown from a loader to render the route's 404 path.

class OpenElementNotFound extends OpenElementError

packages/router/src/authoring.ts:101
OpenElementPageDescriptor@openelement/router · rootinterfacepublic

The page descriptor the pipeline reads (`module.default.openElementPage`). Attached to the compiled page class by definePage(); the class owns the render program, so the descriptor carries metadata and projectors only.

OpenElementPageDescriptor<Data, Params>

kind: "page" (必填); route.id?: string (可选); route.params?: readonly string[] (可选); route.layout?: string | false (可选) — Named layout selection (decision 0123): a string picks one of the `openElement({ layouts })` entries by name (unknown names fall back to the default shell); `false` renders the page without any app shell. Unset means the default shell.; head?: PageHead | PageHeadResolver<Data, Params> (可选); renderIntent: NormalizedPageRenderIntent (必填); props?: PagePropsProjector<Data, Params> (可选); error?: PageErrorProjector<Data, Params> (可选)

packages/router/src/authoring.ts:362
OpenElementRedirect@openelement/router · rootclasspublic

Redirect signal thrown from a loader/action to short-circuit rendering with an HTTP redirect.

class OpenElementRedirect extends OpenElementError

packages/router/src/authoring.ts:73
OpenElementRequestContext@openelement/router · rootinterfacepublic

Host-agnostic request context shared by App request adapters.

OpenElementRequestContext<Env>

request: Request (必填); url: URL (必填); path: string (必填); method: string (必填); params: Record<string, string> (必填); searchParams: URLSearchParams (必填); env?: Env (可选); platform?: unknown (可选)

packages/router/src/model.ts:3
OpenElementUserConfig@openelement/router · rootinterfacepublic

Overrides accepted by an `openelement.config.ts` file (unknown keys fail closed).

OpenElementUserConfig

renderer?: "native" | "lit" (可选) — Page renderer. Omit to keep the compiled native renderer.; dirs.routes?: string (可选) — Route directory. Defaults to `app/routes`.; dirs.islands?: string (可选) — Island directory. Defaults to `app/islands`.; dirs.components?: string (可选) — Component directory. Defaults to `app/components`.; appShell?: false | { import: string; props?: Record<string, unknown>; } (可选) — Application shell. `false` opts out of the `app-shell.tsx` convention; an object registers the named module. `tagName` is derived from the import's basename, so it is not part of the surface.; packageIslands?: string[] (可选) — Extra package names whose island modules the build admits (e.g. `['@openelement/ui']`). The loader folds this list into the SSR externalization list the bundler needs, so a package listed here is bundled rather than imported at run time; there is no separate `ssr.noExternal` key.; head.title?: string (可选) — Document title; defaults to the package.json `name`.; head.description?: string (可选) — `<meta name="description">` + `og:description`.; head.lang?: string (可选) — `<html lang>`; defaults to `en`.; head.favicon?: string (可选) — Site-root-relative favicon path, emitted as `<link rel="icon">`.; head.ogImage?: string (可选) — `og:image` URL. Absolute (crawlable) or site-root-relative.; head.stylesheets?: string[] (可选) — External stylesheets linked into `<head>`.; head.scripts?: OpenElementHeadScript[] (可选) — External scripts emitted into `<head>`; inline code is not accepted here.; styles.tokens?: string (可选) — Token stylesheet path; defaults to the `styles/tokens.css` convention.; i18n?: OpenElementI18nConfig (可选) — Locale-prefixed build configuration.; viewTransition?: boolean (可选) — Client-navigation View Transitions. Boolean for now; an object form (per-transition types) is a possible future widening of this key.; tailwind?: boolean | TailwindPresetOptions (可选) — The Tailwind preset (alpha9 C2 #1505, opt-in): the config-file home for the same option the inline `openElement(...)` face takes. `true` enables the preset with defaults; an object names the theme/components sources, the `@scope` face tags, and the DSD link injection — see `TailwindPresetOptions` (@openelement/router/vite).; speculation?: boolean (可选) — Speculation Rules emission. Boolean for now: `true` uses the framework route-derived defaults, `false` emits none. An object form (explicit prerender/prefetch lists, exclusions, eagerness) is a possible future widening of this key.; build.manifestBudget?: Record<string, number> (可选) — Advisory per-entry manifest budgets in KB, e.g. `{ islandKB: 100, totalJsKB: 300 }`.; middleware.corsOrigin?: string | string[] (可选) — CORS allowlist; omitted means localhost-only reflection (production warning).

packages/router/src/config.ts:165
PageComponentConstructor@openelement/router · roottypepublic

A compiled element class carrying the page descriptor static.

PageComponentConstructor<Data, Params>

packages/router/src/authoring.ts:375
PageErrorProjector@openelement/router · roottypepublic

Maps a caught render/loader/action failure onto the error variant of the page's compiled properties. Its presence declares that the page's compiled markup carries an error variant (the generated entry renders the page with these props and status 500 — the POST/GET error-boundary channel of decision 0121 §7); without it the generic status page answers.

PageErrorProjector<Data, Params>

packages/router/src/authoring.ts:330
PageHead@openelement/router · rootinterfacepublic

Page <head> meaning declared by a route descriptor (decision 0143; canonical/alternates in #1326; structured data via the typed JSON-LD channel). Either a static object or — via PageHeadResolver — resolved per render from the request-scoped context by resolvePageDocument (@openelement/router/document) before either serializer runs.

PageHead

title?: string (可选); description?: string (可选); meta?: Record<string, string | number | boolean>[] (可选); canonical?: string (可选) — Canonical URL of this page (#1326), resolved into <link rel="canonical"> by the shared Document seam.; alternates?: { href: string; hreflang?: string; }[] (可选) — Locale alternates of this page (#1326), resolved into <link rel="alternate" hreflang="..."> entries in author order.; structuredData?: StructuredDataEntry[] (可选) — Structured data (JSON-LD) for this page, resolved into one `<script type="application/ld+json">` element per document in <head>. This is a DATA channel, not a markup channel: entries must be JSON data, and resolvePageDocument fails closed on anything JSON cannot represent (functions, undefined, non-finite numbers, non-plain objects, cycles). It is deliberately NOT reachable through `dangerouslyHe…; dangerouslyHeadFragments?: string[] (可选)

packages/router/src/authoring.ts:253
PageHeadResolver@openelement/router · roottypepublic

Resolves a page's head from the request-scoped context (#1326). The resolver receives the same context object the props projector gets and must stay a pure function of it — the Document seam (@openelement/router/ document) never fetches, caches, or schedules loaders on its own.

PageHeadResolver<Data, Params>

packages/router/src/authoring.ts:341
PagePropsContext@openelement/router · rootinterfacepublic

The request-scoped context handed to a page's props projector. Everything a compiled page can render must pass through here: the compiled render() only reads `this.<property>`, so the projector is the single deterministic seam that maps loader data, action data, params and request onto the page's compiled properties (decision 0143).

PagePropsContext<Data, Params>

data: Data (必填); actionData: unknown (必填) — The 422 re-render payload of a RETURNED action failure (`fail(status, data)`): the classified `failure.data`, verbatim. It is `undefined` on every other render — a successful action answers 303 (PRG), and the projector runs again only on the redirected GET, where success data arrives through the loader's re-run (read the PRG target's query state there). There is no success envelope on this channe…; params: Params (必填); request?: Request (可选); locale?: string (可选) — Resolved application locale for this render, when i18n is configured.; route.path?: string (可选); route.filePath?: string (可选); meta: PageMeta (必填)

packages/router/src/authoring.ts:289
PagePropsProjector@openelement/router · roottypepublic

Maps the request-scoped context onto the page's compiled properties. Declared as part of the page descriptor; the generated server entry and the SPA bootstrap call it per render and feed the result to renderDsd() props (server) or pre-connect property sets (SPA).

PagePropsProjector<Data, Params>

packages/router/src/authoring.ts:318
PROBLEM_JSON_MEDIA_TYPE@openelement/router · rootconstpublic

Media type of the RFC 9457 action error channel (#863).

"application/problem+json"

packages/protocol/src/data.ts:117
ProblemDetails@openelement/router · rootinterfacepublic

RFC 9457 Problem Details document (#863): the action error channel answers `application/problem+json` instead of the bespoke `{ type: 'error', error: { message } }` JSON, so HTTP tooling recognizes failures natively. With `type: 'about:blank'`, `title` is the HTTP reason phrase and `detail` carries the specific explanation. The wire shape is alpha-unfrozen; the 1.0 acceptance freezes it in this problem+json form.

ProblemDetails

type: string (必填) — URI reference identifying the problem type; 'about:blank' when none applies.; title: string (必填) — Short human-readable summary (the HTTP reason phrase for 'about:blank').; status.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (必填) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; detail?: string (可选) — Human-readable explanation specific to this occurrence.

packages/protocol/src/data.ts:105
projectPageProps@openelement/router · rootfunctionpublic

Default request-to-props projection used when a page descriptor declares no props projector: route params first, then loader-data record entries. The compiled serializer consumes only the page's declared compiled properties, so extra entries are ignored. Shared by the generated server entries and the SPA bootstrap (each carries its own copy — generated code cannot import this module's internals). Dangerous keys are filtered through the canonical isDangerousKey predicate (#1214): a hostile loader payload such as JSON.parse('{"__proto__": ...}') can never re-prototype the projection record or the page host it is projected onto. The generated server runtime enforces the same rule with a serialized copy of the canonical DANGEROUS_KEYS list.

(context: { params?: Record<string, string>; data?: unknown; }): Record<string, unknown>

params?: Record<string, string> (可选); data?: unknown (可选)

packages/router/src/authoring.ts:552
redirect@openelement/router · rootfunctionpublic

Throw an {@linkcode OpenElementRedirect} for `location` (status must be a real 3xx).

(location: string | URL, status?: number): never

hash: string (必填) — The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "". [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash); host: string (必填) — The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "". [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host); hostname: string (必填) — The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN. [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname); href: string (必填) — The **`href`** property of the URL interface is a string containing the whole URL. [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href); toString: () => string (必填); origin: string (必填) — The **`origin`** read-only property of the URL interface returns a string containing the Unicode serialization of the origin of the represented URL. [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin); password: string (必填) — The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "". [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password); pathname: string (必填) — The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character. [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname); port: string (必填) — The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "". [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port); protocol: string (必填) — The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":". [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol); search: string (必填) — The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "". [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search); searchParams: URLSearchParams (必填) — The **`searchParams`** read-only property of the URL interface returns a URLSearchParams object allowing access to the GET decoded query arguments contained in the URL. [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams); username: string (必填) — The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "". [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username); toJSON: () => string (必填) — The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as URL.toString(). [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON)

packages/router/src/authoring.ts:117
resolveDirs@openelement/router · rootfunctionpublic

Resolve `dirs` to the three absolute-in-project roots the scanner reads. Omitted entries take the documented defaults.

(dirs: OpenElementDirsConfig | undefined): { routes: string; islands: string; components: string; base: string; }

routes?: string (可选) — Route directory. Defaults to `app/routes`.; islands?: string (可选) — Island directory. Defaults to `app/islands`.; components?: string (可选) — Component directory. Defaults to `app/components`.

packages/router/src/config.ts:567
ServerRouteContext@openelement/router · rootinterfacepublic

Canonical request-time/SSG server route context.

ServerRouteContext<Env, Platform, Route>

request: Request (必填); params: Record<string, string> (必填); env: Env (必填); platform: Platform (必填); responseHeaders: Headers (必填) — Mutable response-only channel merged into the framework response.; route: Route (必填)

packages/protocol/src/data.ts:25
ServerRouteMetadata@openelement/router · rootinterfacepublic

Context passed to a request-time ('dynamic') route loader. This is the server contract: the loader runs on the server with the Web-standard request, matched route params, the host environment and the platform object, and signals validation failure via fail()/redirect().

ServerRouteMetadata

path: string (必填); filePath: string (必填)

packages/protocol/src/data.ts:19
StructuredDataEntry@openelement/router · roottypepublic

One structured-data document — a JSON-LD node such as a schema.org BlogPosting or WebSite. Its values are JSON data (string, finite number, boolean, null, array, plain object) and nothing else: the serializer emits the document as data, so an HTML string is not a document here.

StructuredDataEntry

packages/router/src/authoring.ts:244
runBuildCli@openelement/router · ./cli/buildfunctionpublic

Run the production build and exit with the build's verdict. Shared by the `openelement build` bin subcommand (cli.ts) and this module's own main block, so both faces behave identically.

(): Promise<void>

packages/router/src/cli/build.ts:21
runServeCli@openelement/router · ./cli/startfunctionpublic

Run the serve CLI with the arguments that follow the command (the bin's `start` subcommand passes them through verbatim, so `--mode=preview` reaches the mode parser unchanged). Shared by the `openelement` bin (cli.ts) and this module's own main block.

(argv: string[]): Promise<void>

packages/router/src/cli/start.ts:358
ClientScriptDescriptor@openelement/router · ./documentinterfacepublic

One framework client script a resolved document embeds before `</body>`. Shape-compatible with the serializer's script descriptors, so the document channel routes it through without conversion; entries without src or code are meaningless and rejected at resolution (never silently dropped).

ClientScriptDescriptor

src?: string (可选) — External script URL (attribute-escaped at serialization).; code?: string (可选) — Inline script body. Trusted framework input, never user content.; type?: string (可选) — Script type attribute, e.g. 'module'; omitted means a classic script.

packages/router/src/loading/module/nonce.ts:31
PageHeadAlternate@openelement/router · ./documentinterfacepublic

One <link rel="alternate"> record, typically carrying an hreflang.

PageHeadAlternate

href: string (必填); hreflang?: string (可选)

packages/router/src/document.ts:42
ResolvedDocument@openelement/router · ./documentinterfacepublic

A page's resolved document meaning: every <head> field after the head resolver (when the descriptor declares one) has run, plus the normalized `links` projection the serializers consume. Call-site precedence is resolved-document value first, route/build docConfig fallback second.

ResolvedDocument

title?: string (可选); description?: string (可选); meta?: Record<string, string | number | boolean>[] (可选); structuredData?: StructuredDataEntry[] (可选) — Structured data (JSON-LD), one serialized `<script type= "application/ld+json">` element per entry. Normalized here to plain JSON data so the serializer only has to escape, never interpret.; dangerouslyHeadFragments?: string[] (可选); clientScripts?: ClientScriptDescriptor[] (可选) — The framework client scripts this document embeds before `</body>` — structured descriptors rendered by the serializer at document time (#1471), never by post-build HTML surgery. The serializer attaches the per-request CSP nonce; SSG output carries none.; lang?: string (可选) — Document language: the resolved application locale for this render.; canonical?: string (可选); alternates?: PageHeadAlternate[] (可选); links: ResolvedDocumentLink[] (必填) — Canonical first, then alternates in author order — deterministic.

packages/router/src/document.ts:60
resolvePageDocument@openelement/router · ./documentfunctionpublic

Resolves the descriptor head into the page's ResolvedDocument. A head may be a static object or a resolver receiving the same request-scoped context the props projector gets; resolver output is validated exactly like a static head so malformed page meaning fails loudly at either build time or request time instead of being silently dropped from the serialized document. `clientScripts` carries the framework's client-script descriptors (the build's client asset manifest — the render wiring hands them in, they are never author head data); they are validated like every other field and become part of the resolved document, so every render channel — the SSG render pass included — serializes the final script tags from one place.

(head: PageHead | PageHeadResolver | undefined, context: PagePropsContext, clientScripts?: readonly ClientScriptDescriptor[]): ResolvedDocument

title?: string (可选); description?: string (可选); meta?: Record<string, string | number | boolean>[] (可选); canonical?: string (可选) — Canonical URL of this page (#1326), resolved into <link rel="canonical"> by the shared Document seam.; alternates?: { href: string; hreflang?: string; }[] (可选) — Locale alternates of this page (#1326), resolved into <link rel="alternate" hreflang="..."> entries in author order.; structuredData?: StructuredDataEntry[] (可选) — Structured data (JSON-LD) for this page, resolved into one `<script type="application/ld+json">` element per document in <head>. This is a DATA channel, not a markup channel: entries must be JSON data, and resolvePageDocument fails closed on anything JSON cannot represent (functions, undefined, non-finite numbers, non-plain objects, cycles). It is deliberately NOT reachable through `dangerouslyHe…; dangerouslyHeadFragments?: string[] (可选)

packages/router/src/document.ts:190
createHonoAdapter@openelement/router · ./honofunctionpublic

Wraps a WinterCG handler in a Hono app: every method and path delegates to the handler with the host's env binding and — when the host runtime provides one — its execution context. The generated entry's `openElementRuntimeAdapter` and default export plug in unmodified: ```ts import { createHonoAdapter } from '@openelement/router/hono'; import openElement from './dist/server/entry.js'; const app = await createHonoAdapter(openElement); export default app; ```

(handler: WinterCgHandler): Promise<object>

packages/router/src/hono-adapter.ts:43
WinterCgHandler@openelement/router · ./honotypepublic

The WinterCG request handler the generated entries export.

WinterCgHandler

packages/router/src/hono-adapter.ts:21
createRouteMiddleware@openelement/router · ./httpfunctionpublic

Mount after host middleware/routes; unmatched URLs continue to the host.

(records: readonly HttpRouteRecord[], options?: RouteTableOptions & { methodNotAllowed?: (request: Request, allow: readonly string[]) => Response | Promise<Response>; }): (request: Request, next: () => Promise<Response>…

packages/router/src/http.ts:48
HttpHandler@openelement/router · ./httptypepublic

Dialect-free WinterCG route handler: return a Response to short-circuit, or `next()` to pass control down the method's handler chain; the last handler's `next` is the host middleware chain's own next.

HttpHandler

packages/router/src/http.ts:16
HttpRouteContext@openelement/router · ./httpinterfacepublic

Route-scoped request context handed to every {@link HttpHandler}.

HttpRouteContext

params: Record<string, string> (必填); searchParams: URLSearchParams (必填); url: URL (必填)

packages/router/src/http.ts:5
HttpRouteRecord@openelement/router · ./httpinterfacepublic

A route record for the WinterCG middleware ({@link createRouteMiddleware}): the matching fields of a {@link RouteRecord} plus a per-method handler (or handler chain) map, so one path can answer each HTTP method differently.

HttpRouteRecord

handlers: Readonly<Record<string, HttpHandler | readonly HttpHandler[]>> (必填); path: string (必填); id?: string (可选); pattern.protocol?: string (可选); pattern.username?: string (可选); pattern.password?: string (可选); pattern.hostname?: string (可选); pattern.port?: string (可选); pattern.search?: string (可选); pattern.hash?: string (可选); pattern.baseURL?: string (可选)

packages/router/src/http.ts:27
defineLitPage@openelement/router · ./litfunctionpublic

Attach a page descriptor and host tag to a LitElement page class. import { defineLitPage } from '@openelement/router/lit'; import { NotesListPage } from '../components/notes-list-page.ts'; export const loader = async (ctx) => ({ ... }); export default defineLitPage('notes-list-page', NotesListPage, { renderIntent: { mode: 'dynamic' }, head: { title: 'Notes' }, props: ({ data }) => ({ notes: data?.notes ?? [] }), }); The class is rendered server-side by

<Data = unknown, Params extends Record<string, string> = Record<string, string>>(tag: string, componentClass: CustomElementConstructor, descriptor?: LitPageDescriptorInput<Data, Params>): LitPageConstructor<Data, Params>

packages/router/src/lit.ts:63
LitPageConstructor@openelement/router · ./littypepublic

A LitElement page class carrying the page descriptor and its host tag.

LitPageConstructor<Data, Params>

packages/router/src/lit.ts:39
OpenElementPageDescriptor@openelement/router · ./litinterfacepublic

The page descriptor the pipeline reads (`module.default.openElementPage`). Attached to the compiled page class by definePage(); the class owns the render program, so the descriptor carries metadata and projectors only.

OpenElementPageDescriptor<Data, Params>

kind: "page" (必填); route.id?: string (可选); route.params?: readonly string[] (可选); route.layout?: string | false (可选) — Named layout selection (decision 0123): a string picks one of the `openElement({ layouts })` entries by name (unknown names fall back to the default shell); `false` renders the page without any app shell. Unset means the default shell.; head?: PageHead | PageHeadResolver<Data, Params> (可选); renderIntent: NormalizedPageRenderIntent (必填); props?: PagePropsProjector<Data, Params> (可选); error?: PageErrorProjector<Data, Params> (可选)

packages/router/src/authoring.ts:362
renderLitPageToHtml@openelement/router · ./lit-ssrfunctionpublic

Render a registered LitElement page host to DSD HTML. Fails closed when the tag is invalid or no element class is registered for it in the SSR registry: the generated entry registers every page/island class explicitly before rendering, so an unregistered host is a pipeline bug, never a silent passthrough.

({ tag, props, }: { tag: string; props?: Record<string, unknown>; }): { html: string; }

tag: string (必填); props?: Record<string, unknown> (可选)

packages/router/src/lit-ssr.ts:70
createOpenElementNitroHandler@openelement/router · ./nitro-mountfunctionpublic

Mounts an OpenElement request handler on a Nitro v3 route. Near pass-through: the event's standard `req` goes in, the handler's Response comes out — h3 v2 serves a returned Response as-is.

<Env extends Record<string, unknown> = Record<string, unknown>>(options: OpenElementNitroMountOptions<Env>): (event: NitroRequestEvent<Env>) => Promise<Response>

handler: OpenElementRequestHandler<Env> (必填); env?: Env (可选); platform?: unknown (可选); onBeforeRequestContext?: ((context: OpenElementRequestContext<Env>) => void | Promise<void>) (可选) — Observes the normalized OpenElement request context before the application handler runs. Route params are empty here unless the host supplies them on `event.context.params` before dispatch.

packages/router/src/nitro-mount.ts:60
NitroRequestEvent@openelement/router · ./nitro-mountinterfacepublic

Minimal Nitro v3 route event shape (#857). Nitro v3 is fetch-native: its h3 v2 event carries `req`, a srvx ServerRequest that already IS a standard Request, so the pre-v3 method/path/headers/body translation layer is gone. The mount only wires the OpenElement runtime context around the standard Request → Response seam.

NitroRequestEvent<Env>

req: Request (必填); context.params?: Record<string, string> (可选); env?: Env (可选); platform?: unknown (可选)

packages/router/src/nitro-mount.ts:11
OpenElementNitroMountOptions@openelement/router · ./nitro-mountinterfacepublic

Options for mounting an OpenElement request handler under a Nitro/Node server.

OpenElementNitroMountOptions<Env>

handler: OpenElementRequestHandler<Env> (必填); env?: Env (可选); platform?: unknown (可选); onBeforeRequestContext?: ((context: OpenElementRequestContext<Env>) => void | Promise<void>) (可选) — Observes the normalized OpenElement request context before the application handler runs. Route params are empty here unless the host supplies them on `event.context.params` before dispatch.

packages/router/src/nitro-mount.ts:19
normalizeRoutePatternForURLPattern@openelement/router · ./routerfunctionpublic

Convert the framework's Hono-style route dialect to WHATWG URLPattern syntax.

(path: string): string

packages/router/src/internal/router/route-pattern.ts:2
RouteMatch@openelement/router · ./routerinterfacepublic

One URL matched against the table: the matched `route` record, the identity reported for it, the decoded path `params`, the parsed `searchParams`, and the raw URLPattern `patternResult` the match was derived from.

RouteMatch<T>

route: T (必填); id: string (必填); params: Record<string, string> (必填); searchParams: URLSearchParams (必填); patternResult: RoutePatternResult (必填)

packages/router/src/internal/router/route-table.ts:67
RouteRecord@openelement/router · ./routerinterfacepublic

One route as the table stores it: the pathname `path`, an optional stable `id` used in match results, optional non-pathname URL component patterns, and the admitted `methods`.

RouteRecord

path: string (必填); id?: string (可选); pattern.protocol?: string (可选); pattern.username?: string (可选); pattern.password?: string (可选); pattern.hostname?: string (可选); pattern.port?: string (可选); pattern.search?: string (可选); pattern.hash?: string (可选); pattern.baseURL?: string (可选); methods?: readonly string[] (可选)

packages/router/src/internal/router/route-table.ts:54
RouteResolution@openelement/router · ./routertypepublic

The table's verdict for one request: a `match` (with the resolved method), `method-not-allowed` (with the `allow` list the caller answers 405 with), or `not-found` when no path in the table matches at all.

RouteResolution<T>

packages/router/src/internal/router/route-table.ts:80
RouteTable@openelement/router · ./routerclasspublic

Immutable route matcher built once from a route list: it freezes every record, rejects duplicate identities and pathname-owning patterns at construction, and answers {@link RouteTable.resolve} with a {@link RouteResolution}. `Pattern` is injectable so callers can pin the URLPattern implementation.

class RouteTable

packages/router/src/internal/router/route-table.ts:163
RouteTableOptions@openelement/router · ./routerinterfacepublic

Construction options: a URL prefix every route is mounted under, and whether a trailing slash is significant.

RouteTableOptions

basePath?: string (可选); trailingSlash?: "strict" | "ignore" (可选)

packages/router/src/internal/router/route-table.ts:86
CompiledRouteMatcher@openelement/router · ./router/clienttypepublic

The matcher surface a client route list compiles to: matching, resolution and candidate count.

CompiledRouteMatcher

match: (input: string | URL, search?: string) => RouteMatch<RouteConfig> | null (必填); resolve: (input: string | URL, search?: string, method?: string) => RouteResolution<RouteConfig> (必填); candidateCount: (input: string | URL) => number (必填)

packages/router/src/internal/router/client-router.ts:82
compileRouteMatcher@openelement/router · ./router/clientfunctionpublic

Compile a client route list into the canonical {@link RouteTable} matcher, with no router instance attached.

(routes: RouteConfig[]): CompiledRouteMatcher

packages/router/src/internal/router/client-router.ts:110
createRouter@openelement/router · ./router/clientfunctionpublic

Create the client-side SPA router for `options.mode` over `options.routes`: it matches through the shared RouteTable, owns its navigation listeners and history/hash state, and reports every committed navigation through `onChange`.

(options: RouterOptions): RouterInstance

mode: RouterMode (必填); routes: RouteConfig[] (必填); onChange?: (() => void | Promise<void>) (可选) — Called after navigation or browser history/hash changes update the current match.; onPending?: (() => void) (可选) — Invalidate pending execution as soon as a newer navigation owns intent.; viewTransitions?: boolean (可选) — Opt in to wrapping the render step of every navigation in document.startViewTransition when the platform offers it (the animation itself is user CSS via ::view-transition-* — the framework ships zero animation code). Default off, NAMED DEVIATION from #1561's wrap-by-default ruling — verified cross-engine platform behavior (2026-10-08, Chromium 147 / Firefox Nightly / WebKit 26.4, deterministic th…

packages/router/src/internal/router/client-router.ts:133
matchRoute@openelement/router · ./router/clientfunctionpublic

Match a route through the canonical RouteTable.

(pathname: string, search: string, routes: RouteConfig[]): RouteMatch<RouteConfig> | null

packages/router/src/internal/router/client-router.ts:98
RouteConfig@openelement/router · ./router/clientinterfacepublic

One client route: a {@link RouteRecord} plus the custom element `tagName` SPA mode instantiates for it and an optional `guard` that may veto the navigation by returning `false` or a redirect path.

RouteConfig

tagName: string (必填) — Custom element tag to instantiate directly in SPA mode.; guard?: (() => Promise<boolean | string>) (可选); path: string (必填); id?: string (可选); pattern.protocol?: string (可选); pattern.username?: string (可选); pattern.password?: string (可选); pattern.hostname?: string (可选); pattern.port?: string (可选); pattern.search?: string (可选); pattern.hash?: string (可选); pattern.baseURL?: string (可选); methods?: readonly string[] (可选)

packages/router/src/internal/router/client-router.ts:29
RouterInstance@openelement/router · ./router/clientinterfacepublic

A live client router: the navigation entry points, the current match (`currentPath`/`currentRoute`/`params`/`searchParams`), and `dispose()` to release its listeners.

RouterInstance

navigate: (path: string) => Promise<void> (必填); replace: (path: string) => Promise<void> (必填); dispose: () => void (必填); currentPath: string (必填); currentRoute: RouteConfig | null (必填); params: Record<string, string> (必填); searchParams: URLSearchParams (必填)

packages/router/src/internal/router/client-router.ts:69
RouterMode@openelement/router · ./router/clienttypepublic

Navigation strategy: the History API ('history'), the URL hash ('hash'), or file-protocol auto-detection ('auto').

RouterMode

packages/router/src/internal/router/client-router.ts:22
ACTION_FETCH_HEADER@openelement/router · ./server-runtimeconstpublic

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"

packages/protocol/src/data.ts:125
actionErrorResponse@openelement/router · ./server-runtimefunctionpublic

The fetch-channel 500 (#863, #558): an unexpected action rejection answers RFC 9457 problem+json with internals scrubbed in production (the detail degrades to the reason phrase; development keeps the message for debugging). The native channel stays on the generated handler's HTML error boundary. `production` is the entry's `import.meta.env.PROD`, injected so this module stays free of build-tool globals.

(context: OpenElementRequestScope, routePath: string, error: unknown, production: boolean): Response

req: RequestScopeRequest (必填); headers: Headers (必填) — The response-header channel. Headers the handler or the built-in middleware write before a response exists (`Cache-Control`, `Vary`, `X-Request-Id`, the security set) land here and merge into every response the scope builds. Stream routes hand the handler a separate committed stream channel; the scope keeps supplying the framework set.; env: Record<string, unknown> (必填) — The runtime env binding (`fetch(request, env)`).; executionCtx: unknown (必填) — The host execution context; throws when the host passed none (call sites guard).; header: (name: string, value: string, options?: { append?: boolean; }) => void (必填) — Writes one response header on the channel (set by default, append opt-in).; get: (key: string) => unknown (必填) — Reads one typed variable (e.g. `cspNonce`).; set: (key: string, value: unknown) => void (必填) — Writes one typed variable.; json: (object: unknown, status?: number, headers?: Record<string, string>) => Response (必填) — `application/json` response starting from the channel headers.; text: (text: string, status?: number, headers?: Record<string, string>) => Response (必填) — `text/plain; charset=UTF-8` response starting from the channel headers.; html: (html: string, status?: number, headers?: Record<string, string>) => Response (必填) — `text/html; charset=UTF-8` response starting from the channel headers.; redirect: (location: string, status?: number) => Response (必填) — Redirect response (`Location` + status, default 302).; body: (data: BodyInit | null, status?: number, headers?: Record<string, string>) => Response (必填) — Raw-body response starting from the channel headers.

packages/router/src/vite/internal/server-runtime/action-runtime.ts:345
ActionExecution@openelement/router · ./server-runtimeinterfacepublic

What one protocol run hands back to the generated handler.

ActionExecution

response?: Response (可选) — When set, the handler returns this response and renders nothing.; actionResult?: ActionOutcome (可选) — The classified action outcome for the 422 re-render (native failure path).

packages/router/src/vite/internal/server-runtime/action-runtime.ts:63
ActionLoadContext@openelement/router · ./server-runtimetypepublic

The load context the generated handler built; actions receive it plus `formData`.

ActionLoadContext

packages/router/src/vite/internal/server-runtime/action-runtime.ts:51
ActionProtocolState@openelement/router · ./server-runtimeinterfacepublic

The per-request action channel state: mutated by {@linkcode runActionProtocol} before any protocol exit so the generated handler's catch block can branch on the fetch path.

ActionProtocolState

isFetch: boolean (必填)

packages/router/src/vite/internal/server-runtime/action-runtime.ts:58
actionRedirectResponse@openelement/router · ./server-runtimefunctionpublic

The redirect exit for a POST action: every 3xx an author throws out of an action is coerced to 303 — PRG must be method-safe and non-cacheable. The native form channel answers a real 303; the fetch channel answers HTTP 200 with the redirect carried as the ActionResult body (`{ type: 'redirect', status: 303, location }`) — the serialized client executor matches on the body, not the HTTP status. GET handlers keep the author's status (the generated catch emits that branch itself).

(context: OpenElementRequestScope, location: string, isFetch: boolean): Response

req: RequestScopeRequest (必填); headers: Headers (必填) — The response-header channel. Headers the handler or the built-in middleware write before a response exists (`Cache-Control`, `Vary`, `X-Request-Id`, the security set) land here and merge into every response the scope builds. Stream routes hand the handler a separate committed stream channel; the scope keeps supplying the framework set.; env: Record<string, unknown> (必填) — The runtime env binding (`fetch(request, env)`).; executionCtx: unknown (必填) — The host execution context; throws when the host passed none (call sites guard).; header: (name: string, value: string, options?: { append?: boolean; }) => void (必填) — Writes one response header on the channel (set by default, append opt-in).; get: (key: string) => unknown (必填) — Reads one typed variable (e.g. `cspNonce`).; set: (key: string, value: unknown) => void (必填) — Writes one typed variable.; json: (object: unknown, status?: number, headers?: Record<string, string>) => Response (必填) — `application/json` response starting from the channel headers.; text: (text: string, status?: number, headers?: Record<string, string>) => Response (必填) — `text/plain; charset=UTF-8` response starting from the channel headers.; html: (html: string, status?: number, headers?: Record<string, string>) => Response (必填) — `text/html; charset=UTF-8` response starting from the channel headers.; redirect: (location: string, status?: number) => Response (必填) — Redirect response (`Location` + status, default 302).; body: (data: BodyInit | null, status?: number, headers?: Record<string, string>) => Response (必填) — Raw-body response starting from the channel headers.

packages/router/src/vite/internal/server-runtime/action-runtime.ts:325
ApiRouteFunction@openelement/router · ./server-runtimetypepublic

A fn-form API handler: the `(ctx) => Response` form an API route module default-exports.

ApiRouteFunction

packages/router/src/vite/internal/server-runtime/wintercg.ts:183
applyCspNonce@openelement/router · ./server-runtimefunctionpublic

Instantiates a generated CSP policy template for one request: replaces the first `NONCE_PLACEHOLDER` marker with the request nonce. The template is build-time data (route wiring produced it from the author's `middleware.csp` policy); only this substitution is runtime semantics.

(policyTemplate: string, nonce: string): string

packages/router/src/vite/internal/server-runtime/response-channel.ts:145
AppShellRuntime@openelement/router · ./server-runtimeinterfacepublic

The app-shell runtime bound into the generated entry.

AppShellRuntime

resolveAppShell: (routeMeta?: Record<string, unknown>) => ResolvedAppShell (必填) — Resolve the shell for one route's metadata: `layout: false` disables the shell, a named layout looks up `appShellPlan.layouts`, anything else (and an unset layout) takes the plan default.; renderAppShell: (pageHtml: unknown, routePath: string, options?: { locale?: string; routeMeta?: Record<string, unknown>; }) => string (必填) — Render route content inside the resolved app shell layout: the page HTML is projected into the shell's default slot through the page renderer, so nested admitted islands expand deterministically and route content stays inside the declared layout-main boundary. An unresolved shell returns the content unchanged.

packages/router/src/vite/internal/server-runtime/document-runtime.ts:58
AppShellRuntimeDeps@openelement/router · ./server-runtimeinterfacepublic

What {@linkcode createAppShellRuntime} binds: the entry's Element imports plus its serialized plan data.

AppShellRuntimeDeps

ssr: PageSsrRenderer (必填) — The entry's bound page renderer (`__ssr`) — the shell renders through the same seam.; trustedHtml: (html: string) => TrustedHtmlValue (必填) — The entry's `trustedHtml` import — the slot projection is an explicit trust boundary.; appShellPlan: AppShellPlan (必填) — The build's shell plan (serialized generated data).; locales: readonly string[] (必填) — Declared project locales (serialized generated data).; navSections: readonly unknown[] (必填) — Nav sections (serialized generated data; empty on the 1.0 surface).; headerNav: readonly Record<string, unknown>[] (必填) — Header nav links (serialized generated data; empty on the 1.0 surface).; defaultLocale: string (必填) — The project's default locale (generated data).

packages/router/src/vite/internal/server-runtime/document-runtime.ts:80
assertCompiledStreamRoute@openelement/router · ./server-runtimefunctionpublic

Startup guard for a page route under the compiled stream runtime: the route's literal stream declaration must match the build-time manifest (field list, program tag, program version) and the module must carry the compiled Part Program the manifest was derived from. Moved verbatim from the emitted `__assertStreamRoute` body.

(module: unknown, route: string, file: string, manifest: StreamRouteManifestLike | undefined): void

packages/router/src/vite/internal/server-runtime/route-dispatch.ts:37
assertLitStreamRoute@openelement/router · ./server-runtimefunctionpublic

Startup guard for a page route under a renderer without compiled-stream support (the lit fork): a route declaring `renderIntent.stream` fails the build loudly instead of silently rendering static.

(module: unknown, route: string, file: string): void

packages/router/src/vite/internal/server-runtime/route-dispatch.ts:21
boundRequestScope@openelement/router · ./server-runtimefunctionpublic

The scope accessor the generated handlers and built-in middleware share.

(request: Request): OpenElementRequestScope | undefined

cache: RequestCache (必填) — The **`cache`** read-only property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache); credentials: RequestCredentials (必填) — The **`credentials`** read-only property of the Request interface reflects the value given to the Request() constructor in the credentials option. It determines whether or not the browser sends credentials with the request, as well as whether any Set-Cookie response headers are respected. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/credentials); destination: RequestDestination (必填) — The **`destination`** read-only property of the Request interface returns a string describing the type of content being requested. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/destination); headers: Headers (必填) — The **`headers`** read-only property of the Request interface contains the Headers object associated with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers); integrity: string (必填) — The **`integrity`** read-only property of the Request interface contains the subresource integrity value of the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity); keepalive: boolean (必填) — The **`keepalive`** read-only property of the Request interface contains the request's keepalive setting (true or false), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive); method: string (必填) — The **`method`** read-only property of the Request interface contains the request's method (GET, POST, etc.) [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method); mode: RequestMode (必填) — The **`mode`** read-only property of the Request interface contains the mode of the request (e.g., cors, no-cors, same-origin, or navigate.) This is used to determine if cross-origin requests lead to valid responses, and which properties of the response are readable. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/mode); redirect: RequestRedirect (必填) — The **`redirect`** read-only property of the Request interface contains the mode for how redirects are handled. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect); referrer: string (必填) — The **`referrer`** read-only property of the Request interface is set by the user agent to be the referrer of the Request. (e.g., client, no-referrer, or a URL.) [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/referrer); referrerPolicy: ReferrerPolicy (必填) — The **`referrerPolicy`** read-only property of the Request interface returns the referrer policy, which governs what referrer information, sent in the Referer header, should be included with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/referrerPolicy); signal: AbortSignal (必填) — The read-only **`signal`** property of the Request interface returns the AbortSignal associated with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal); url: string (必填) — The **`url`** read-only property of the Request interface contains the URL of the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url); clone: () => Request (必填) — The **`clone()`** method of the Request interface creates a copy of the current Request object. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone); body: ReadableStream<Uint8Array<ArrayBuffer>> | null (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body); bodyUsed: boolean (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed); arrayBuffer: () => Promise<ArrayBuffer> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer); blob: () => Promise<Blob> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob); bytes: () => Promise<Uint8Array<ArrayBuffer>> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes); formData: () => Promise<FormData> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData); json: () => Promise<any> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json); text: () => Promise<string> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text)

packages/router/src/vite/internal/server-runtime/wintercg.ts:254
CorsOptions@openelement/router · ./server-runtimeinterfacepublic

Options for {@linkcode createCorsMiddleware} — the surface the generated entry emits.

CorsOptions

origin?: string | string[] | ((origin: string) => string | undefined | null) (可选) — The `Access-Control-Allow-Origin` value: one origin, a list, or a resolver returning an origin or undefined.; allowMethods?: string[] (可选) — The `Access-Control-Allow-Methods` list.; allowHeaders?: string[] (可选) — The `Access-Control-Allow-Headers` list.; exposeHeaders?: string[] (可选) — The `Access-Control-Expose-Headers` list.; credentials?: boolean (可选) — Emits `Access-Control-Allow-Credentials: true`.; maxAge.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; maxAge.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; maxAge.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; maxAge.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; maxAge.valueOf: () => number (必填) — Returns the primitive value of the specified object.; maxAge.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.

packages/router/src/vite/internal/server-runtime/middleware.ts:93
createActionBodyLimit@openelement/router · ./server-runtimefunctionpublic

The default body-limit handler for action POST routes (#568), bound to the serialized `MAX_ACTION_BODY_BYTES` policy constant (see the module doc): an oversized body answers the fetch channel with problem+json 413 (same fork as the CSRF 403) and the native form channel with plain text. The no-store/Vary negotiation headers ride every 413 like every other action response. Larger uploads belong on API routes with explicit limits. Runs as the first element of the generated POST handler chain (`(request, route, next)` — the {@link HttpHandler } shape of

(maxSize: number): (request: Request, route: unknown, next: () => Promise<Response>) => Promise<Response>

toString: (radix?: number) => string (必填) — Returns a string representation of an object.; toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; valueOf: () => number (必填) — Returns the primitive value of the specified object.; toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.

packages/router/src/vite/internal/server-runtime/action-runtime.ts:256
createAppShellRuntime@openelement/router · ./server-runtimefunctionpublic

Binds the app-shell runtime to the entry's renderer, trust boundary, and serialized shell/nav/locale data. The entry destructures `{ resolveAppShell: __resolveAppShell, renderAppShell: __renderAppShell }`.

(deps: AppShellRuntimeDeps): AppShellRuntime

ssr: PageSsrRenderer (必填) — The entry's bound page renderer (`__ssr`) — the shell renders through the same seam.; trustedHtml: (html: string) => TrustedHtmlValue (必填) — The entry's `trustedHtml` import — the slot projection is an explicit trust boundary.; appShellPlan: AppShellPlan (必填) — The build's shell plan (serialized generated data).; locales: readonly string[] (必填) — Declared project locales (serialized generated data).; navSections: readonly unknown[] (必填) — Nav sections (serialized generated data; empty on the 1.0 surface).; headerNav: readonly Record<string, unknown>[] (必填) — Header nav links (serialized generated data; empty on the 1.0 surface).; defaultLocale: string (必填) — The project's default locale (generated data).

packages/router/src/vite/internal/server-runtime/document-runtime.ts:102
createCorsMiddleware@openelement/router · ./server-runtimefunctionpublic

The CORS middleware: non-preflight requests get the allow-origin (and credentials/expose) headers on the channel and an appended `Vary: Origin` when the origin is not `*`; an `OPTIONS` preflight short-circuits with 204 and the full allow set. The origin resolver may return undefined to deny — the generated default reflects only localhost origins and denies everything else.

(options?: CorsOptions): WinterCgFetchMiddleware

origin?: string | string[] | ((origin: string) => string | undefined | null) (可选) — The `Access-Control-Allow-Origin` value: one origin, a list, or a resolver returning an origin or undefined.; allowMethods?: string[] (可选) — The `Access-Control-Allow-Methods` list.; allowHeaders?: string[] (可选) — The `Access-Control-Allow-Headers` list.; exposeHeaders?: string[] (可选) — The `Access-Control-Expose-Headers` list.; credentials?: boolean (可选) — Emits `Access-Control-Allow-Credentials: true`.; maxAge.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; maxAge.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; maxAge.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; maxAge.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; maxAge.valueOf: () => number (必填) — Returns the primitive value of the specified object.; maxAge.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.

packages/router/src/vite/internal/server-runtime/middleware.ts:118
createCspNonce@openelement/router · ./server-runtimefunctionpublic

Creates one per-request CSP nonce: a UUID without its dashes (32 hex characters). The CSP middleware embeds this value into the `script-src 'nonce-…'` policy it sets on the response and exposes it to the handlers as the `cspNonce` request-scope variable.

(): string

packages/router/src/vite/internal/server-runtime/response-channel.ts:135
createDeferredPageShell@openelement/router · ./server-runtimefunctionpublic

The per-route shell gate the streamed handlers await before any streamed document exists: the route must resolve its build manifest, the page class must carry the compiled Part Program, and both must agree on tag and program version — the gate fails closed with the route before the executor re-verifies the wire hash (#1276 B1.3-F1). Bound to the entry's serialized manifests and its `createDeferredDsdExecutor` import; the returned gate is the `__createDeferredPageShell` call site (Amendment 1 — the last runtime function body that stayed emitted for its oracle pin).

(config: DeferredPageShellConfig): (route: string, routeModule: unknown, props: unknown, instanceId: string, documentToken: string) => Promise<StreamExecutorView>

streamManifests: Record<string, StreamRouteManifest> (必填) — The entry's serialized route→stream-manifest build data (`__streamManifests`).; createDeferredDsdExecutor: (options: { componentClass: unknown; props?: unknown; manifest: StreamRouteManifest; instanceId: string; documentToken?: string; }) => Promise<StreamExecutorVi… (必填) — The entry's `createDeferredDsdExecutor` import — the deferred shell it produces is the pump's executor view.

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:490
createGeneratedApp@openelement/router · ./server-runtimefunctionpublic

Assembles the generated app from the entry's route descriptor. Pure factory: descriptor data in, handler contract out — every emitted call site in the entry binds a property of the returned record.

(config: GeneratedAppConfig): GeneratedApp

islands: Record<string, string> (必填) — Build-time island map: tag -> client module path (#951 upgrade URLs).; appShellPlan: AppShellPlan (必填) — The build's shell plan (serialized generated data).; locales: readonly string[] (必填) — Declared project locales (serialized generated data).; navSections: readonly unknown[] (必填) — Nav sections (serialized generated data; empty on the 1.0 surface).; headerNav: readonly Record<string, unknown>[] (必填) — Header nav links (serialized generated data; empty on the 1.0 surface).; defaultLocale: string (必填) — The project's default locale (generated data).; devClientScriptSrc: string | null (必填) — The dev island-client URL the entry computed from its compile-time `import.meta.env` constants; null when the app ships no client entry.; pageHandlerPaths: readonly string[] (必填) — Page route paths, in route order — the handler table's keys.; fetchMiddleware?: readonly FetchMiddleware[] (可选) — `middleware.use` module defaults, user-configured order (use[0] outermost).; pageRuntime?: GeneratedPageRuntime (可选)

packages/router/src/vite/internal/server-runtime/app.ts:146
createLitPageRenderer@openelement/router · ./server-runtimefunctionpublic

The lit renderer (#1339): render a registered LitElement page host to DSD HTML through

(deps: LitPageRendererDeps): PageSsrRenderer

renderLitPageToHtml: (input: { tag: string; props?: Record<string, unknown>; }) => { html: string; } (必填) — `renderLitPageToHtml` — the registered LitElement page host renders to DSD HTML.

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:128
createLoggerMiddleware@openelement/router · ./server-runtimefunctionpublic

Logs `<-- METHOD /path` before the chain and `--> METHOD /path 200 12ms` after it, with the elapsed time humanized the way the previous built-in logged it. No color support: the color policy read `process.env`, which shipped runtime code must not (P3).

(options?: LoggerOptions): WinterCgFetchMiddleware

print?: ((line: string) => void) (可选) — The print function. Default `console.log`.

packages/router/src/vite/internal/server-runtime/middleware.ts:70
createMethodNotAllowedResponder@openelement/router · ./server-runtimefunctionpublic

The 405 responder handed to `createRouteMiddleware` as `methodNotAllowed`: no-store (request-time responses are never cacheable), the action negotiation `Vary`, and the `Allow` header listing the route's methods (#572). Reads the per-request scope bound by the WinterCG composition layer so the WinterCG-side middleware can answer through the scope's text channel with the channel headers merged in.

(): (request: Request, allow: string[]) => Response

packages/router/src/vite/internal/server-runtime/route-dispatch.ts:100
createNativePageRenderer@openelement/router · ./server-runtimefunctionpublic

The native renderer (default): render a registered compiled element class through Element composition. Fails closed for invalid tags, depth-bound violations, and unregistered hosts — an unknown OpenElement host cannot be server-rendered (client-only and foreign tags pass through per the admission plan).

(deps: NativePageRendererDeps): PageSsrRenderer

renderDsd: (tag: string, options: { componentClass?: unknown; props?: Record<string, unknown>; sourceInfo?: PageSsrSourceInfo; ssrRenderableTags?: readonly string[]; proj… (必填) — Element's sync compiled serializer (`renderDsd`).; customElements: { get(tag: string): unknown; } (必填) — The SSR registry (the runtime's `customElements` global).; ssrRenderableTags: readonly string[] (必填) — Build-admitted nested compiled tags (serialized generated data).

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:77
createPageHandlerTable@openelement/router · ./server-runtimefunctionpublic

Creates the per-path page handler table the generated GET/POST wiring populates: one mutable method record per page path, keyed by the route path literal the wiring emits.

(paths: readonly string[]): Record<string, Record<string, unknown>>

packages/router/src/vite/internal/server-runtime/route-dispatch.ts:86
createPagePropsRuntime@openelement/router · ./server-runtimefunctionpublic

Binds the page props projection to the generated entry's serialized dangerous-key list. Returns the three projection seams under their generated binding names (`__pageProps`, `__pageErrorProps` — the entry destructures them).

(deps: PagePropsRuntimeDeps): PagePropsRuntime

dangerousKeys: ReadonlySet<string> (必填) — The canonical dangerous-key set (the factory imports it from the kernel-free /authoring leaf): one rule, no second copy.

packages/router/src/vite/internal/server-runtime/page-render.ts:124
createRequestIdMiddleware@openelement/router · ./server-runtimefunctionpublic

Reads the inbound request id (honoring it only when it is present, ≤ `limitLength`, and free of characters outside `[A-Za-z0-9_-=]`), regenerates otherwise, exposes it as the `requestId` scope variable and the response header — the request-id header rides every response the scope builds.

(options?: RequestIdOptions): WinterCgFetchMiddleware

limitLength.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; limitLength.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; limitLength.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; limitLength.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; limitLength.valueOf: () => number (必填) — Returns the primitive value of the specified object.; limitLength.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; headerName?: string (可选) — The response header carrying the id. Default `X-Request-Id`.; generator?: ((request: Request) => string) (可选) — The id generator. Default `crypto.randomUUID()`.

packages/router/src/vite/internal/server-runtime/middleware.ts:40
createRequestScope@openelement/router · ./server-runtimefunctionpublic

Creates one per-request scope. Exported for the generated wiring's test harnesses; {@linkcode WinterCgApp.fetch} creates and binds one per dispatch.

(request: Request, env?: Record<string, unknown>, platform?: unknown): OpenElementRequestScope

cache: RequestCache (必填) — The **`cache`** read-only property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache); credentials: RequestCredentials (必填) — The **`credentials`** read-only property of the Request interface reflects the value given to the Request() constructor in the credentials option. It determines whether or not the browser sends credentials with the request, as well as whether any Set-Cookie response headers are respected. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/credentials); destination: RequestDestination (必填) — The **`destination`** read-only property of the Request interface returns a string describing the type of content being requested. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/destination); headers: Headers (必填) — The **`headers`** read-only property of the Request interface contains the Headers object associated with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers); integrity: string (必填) — The **`integrity`** read-only property of the Request interface contains the subresource integrity value of the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity); keepalive: boolean (必填) — The **`keepalive`** read-only property of the Request interface contains the request's keepalive setting (true or false), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive); method: string (必填) — The **`method`** read-only property of the Request interface contains the request's method (GET, POST, etc.) [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method); mode: RequestMode (必填) — The **`mode`** read-only property of the Request interface contains the mode of the request (e.g., cors, no-cors, same-origin, or navigate.) This is used to determine if cross-origin requests lead to valid responses, and which properties of the response are readable. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/mode); redirect: RequestRedirect (必填) — The **`redirect`** read-only property of the Request interface contains the mode for how redirects are handled. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect); referrer: string (必填) — The **`referrer`** read-only property of the Request interface is set by the user agent to be the referrer of the Request. (e.g., client, no-referrer, or a URL.) [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/referrer); referrerPolicy: ReferrerPolicy (必填) — The **`referrerPolicy`** read-only property of the Request interface returns the referrer policy, which governs what referrer information, sent in the Referer header, should be included with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/referrerPolicy); signal: AbortSignal (必填) — The read-only **`signal`** property of the Request interface returns the AbortSignal associated with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal); url: string (必填) — The **`url`** read-only property of the Request interface contains the URL of the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url); clone: () => Request (必填) — The **`clone()`** method of the Request interface creates a copy of the current Request object. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone); body: ReadableStream<Uint8Array<ArrayBuffer>> | null (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body); bodyUsed: boolean (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed); arrayBuffer: () => Promise<ArrayBuffer> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer); blob: () => Promise<Blob> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob); bytes: () => Promise<Uint8Array<ArrayBuffer>> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes); formData: () => Promise<FormData> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData); json: () => Promise<any> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json); text: () => Promise<string> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text)

packages/router/src/vite/internal/server-runtime/wintercg.ts:106
createSecureHeadersMiddleware@openelement/router · ./server-runtimefunctionpublic

The security response headers, applied after the response exists so a handler cannot skip them, plus `X-Powered-By` removal. Same names and values (and the same disabled `Cross-Origin-Embedder-Policy` default) as the built-in set they replace.

(): WinterCgFetchMiddleware

packages/router/src/vite/internal/server-runtime/middleware.ts:178
createStatusHtml@openelement/router · ./server-runtimefunctionpublic

Binds the status-page renderer to the entry's `escapeHtml` import. Both the native and the lit entry import the same canonical escaper (@openelement/element[/html]), so the one implementation serves every status channel (404 fallbacks, render failures, SSG redirect pages).

(escapeHtml: (value: string) => string): StatusHtmlRenderer

packages/router/src/vite/internal/server-runtime/document-runtime.ts:48
createStreamBody@openelement/router · ./server-runtimefunctionpublic

Binds the streaming body builder to the entry's injected Element function (and the policy timeout default): the returned builder is the `__streamBody` call site the generated handler invokes once per streamed response.

(config: StreamBodyConfig): StreamBodyFn

escapeAttr: (value: string) => string (必填) — The entry's `escapeAttr` import — an Element function, injected so this module stays free of an Element runtime edge.; timeoutMs.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; timeoutMs.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; timeoutMs.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; timeoutMs.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; timeoutMs.valueOf: () => number (必填) — Returns the primitive value of the specified object.; timeoutMs.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:274
createStreamHeaderChannel@openelement/router · ./server-runtimefunctionpublic

Creates the per-request response-header channel for a streamed route: the author-facing `Headers` proxy plus its commitment switch. The proxy guards the mutating members (`append`, `set`, `delete`) after {@linkcode ResponseHeaderChannel.commit}: a late write from a held `context.responseHeaders` reference is a no-op with a structured diagnostic naming the route, header, and operation (the no-op rule; it never throws and never reinterprets a late `Location`/`Set-Cookie` as a protocol decision). Every other member — reads, `forEach` included — behaves exactly like the wrapped `Headers`, and `forEach` hands the callback the proxy itself so a callback-held reference is gated the same way. `route` only feeds the diagnostic payload.

(route: string): ResponseHeaderChannel

packages/router/src/vite/internal/server-runtime/response-channel.ts:60
createStreamRequestScope@openelement/router · ./server-runtimefunctionpublic

The request scope for one streamed route: the loader's `request.signal` aborts when the client disconnects (upstream abort fan-out), the response body's `cancel()` tears the whole scope down, and {@linkcode * StreamRequestScope.abortWork} aborts pending loader work at the timeout without cancelling the still-open response.

(original: Request): StreamRequestScope

cache: RequestCache (必填) — The **`cache`** read-only property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache); credentials: RequestCredentials (必填) — The **`credentials`** read-only property of the Request interface reflects the value given to the Request() constructor in the credentials option. It determines whether or not the browser sends credentials with the request, as well as whether any Set-Cookie response headers are respected. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/credentials); destination: RequestDestination (必填) — The **`destination`** read-only property of the Request interface returns a string describing the type of content being requested. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/destination); headers: Headers (必填) — The **`headers`** read-only property of the Request interface contains the Headers object associated with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers); integrity: string (必填) — The **`integrity`** read-only property of the Request interface contains the subresource integrity value of the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity); keepalive: boolean (必填) — The **`keepalive`** read-only property of the Request interface contains the request's keepalive setting (true or false), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive); method: string (必填) — The **`method`** read-only property of the Request interface contains the request's method (GET, POST, etc.) [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method); mode: RequestMode (必填) — The **`mode`** read-only property of the Request interface contains the mode of the request (e.g., cors, no-cors, same-origin, or navigate.) This is used to determine if cross-origin requests lead to valid responses, and which properties of the response are readable. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/mode); redirect: RequestRedirect (必填) — The **`redirect`** read-only property of the Request interface contains the mode for how redirects are handled. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect); referrer: string (必填) — The **`referrer`** read-only property of the Request interface is set by the user agent to be the referrer of the Request. (e.g., client, no-referrer, or a URL.) [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/referrer); referrerPolicy: ReferrerPolicy (必填) — The **`referrerPolicy`** read-only property of the Request interface returns the referrer policy, which governs what referrer information, sent in the Referer header, should be included with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/referrerPolicy); signal: AbortSignal (必填) — The read-only **`signal`** property of the Request interface returns the AbortSignal associated with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal); url: string (必填) — The **`url`** read-only property of the Request interface contains the URL of the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url); clone: () => Request (必填) — The **`clone()`** method of the Request interface creates a copy of the current Request object. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone); body: ReadableStream<Uint8Array<ArrayBuffer>> | null (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body); bodyUsed: boolean (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed); arrayBuffer: () => Promise<ArrayBuffer> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer); blob: () => Promise<Blob> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob); bytes: () => Promise<Uint8Array<ArrayBuffer>> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes); formData: () => Promise<FormData> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData); json: () => Promise<any> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json); text: () => Promise<string> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text)

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:124
createWinterCgApp@openelement/router · ./server-runtimefunctionpublic

Creates the internal WinterCG app one generated entry assembles. The dispatch builds lazily on the first fetch (registration happens at module scope) and rebuilds if anything registers afterwards.

(): WinterCgApp

packages/router/src/vite/internal/server-runtime/wintercg.ts:270
DANGEROUS_KEYS@openelement/router · ./server-runtimeconstpublic

Object prototype keys that must never be injected from untrusted props.

ReadonlySet<string>

packages/element/src/internal/core/security.ts:25
DeferredPageShellConfig@openelement/router · ./server-runtimeinterfacepublic

The entry bindings the deferred-shell gate reads. `streamManifests` is the generated `__streamManifests` build data; the executor creator is the entry's `createDeferredDsdExecutor` Element import, injected so this module stays free of an Element runtime edge (#1339).

DeferredPageShellConfig

streamManifests: Record<string, StreamRouteManifest> (必填) — The entry's serialized route→stream-manifest build data (`__streamManifests`).; createDeferredDsdExecutor: (options: { componentClass: unknown; props?: unknown; manifest: StreamRouteManifest; instanceId: string; documentToken?: string; }) => Promise<StreamExecutorVi… (必填) — The entry's `createDeferredDsdExecutor` import — the deferred shell it produces is the pump's executor view.

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:464
GeneratedApp@openelement/router · ./server-runtimeinterfacepublic

Everything the generated entry destructures and re-exports.

GeneratedApp

app: WinterCgApp (必填) — The internal WinterCG app — the entry's default export.; requestScope: (request: Request) => OpenElementRequestScope (必填) — The per-request scope accessor the generated handlers bind (`__requestScope`): one scope per dispatch, keyed by request identity.; handler: (request: Request, context?: { env?: unknown; platform?: unknown; }) => Promise<Response> (必填) — The WinterCG request handler: the app's composed dispatch with the fetch-middleware onion composed around it when `middleware.use` is configured (#858).; devFetch?: { fetch: (request: Request, env: unknown, executionContext: unknown) => Promise<Response>; } (可选) — Dev-server boundary export, present only with `middleware.use` (#858).; runtimeAdapter: Record<string, unknown> (必填) — Deployment adapter record (`openElementRuntimeAdapter`).; pageHandlers: Record<string, Record<string, unknown>> (必填) — Per-path page handler table the generated GET/POST wiring populates.; apiRouteRecords: { id: string; path: string; handlers: unknown; }[] (必填) — API route records the generated API wiring pushes into.; methodNotAllowed: (request: Request, allow: string[]) => Response (必填) — The 405 responder for `createRouteMiddleware({ methodNotAllowed })` (#572).; actionBodyLimit: (request: Request, route: unknown, next: () => Promise<Response>) => Promise<Response> (必填) — The default action body-limit middleware (#568), bound to the policy constant.; registerSsrComponent: (tag: string, ctor: unknown) => void (必填) — SSR registration seam (security.ts).; setRequestTimeClientScript: (src: string | null | undefined) => void (必填) — Request-time client-script src setter (`dist/server/index.js` startup).; clientScriptDescriptors: () => Array<{ type: "module"; src: string; }> (必填) — wrapInDocument `scripts` descriptors for the current runtime mode (#951).; locales: readonly string[] (必填); getDefaultLocale: () => string (必填); ssr?: PageSsrRenderer (可选) — Page-render bindings — present only when the config carried `pageRuntime`.; pageProps?: ((routeModule: unknown, context: PageContext) => ProjectedProps) (可选); pageErrorProps?: ((routeModule: unknown, error: unknown, context: PageContext) => ProjectedProps) (可选); statusHtml?: StatusHtmlRenderer (可选); resolveAppShell?: ((routeMeta?: Record<string, unknown>) => ResolvedAppShell) (可选); renderAppShell?: ((pageHtml: unknown, routePath: string, options?: { locale?: string; routeMeta?: Record<string, unknown>; }) => string) (可选)

packages/router/src/vite/internal/server-runtime/app.ts:96
GeneratedAppConfig@openelement/router · ./server-runtimeinterfacepublic

The route-descriptor data the generated entry hands the factory.

GeneratedAppConfig

islands: Record<string, string> (必填) — Build-time island map: tag -> client module path (#951 upgrade URLs).; appShellPlan: AppShellPlan (必填) — The build's shell plan (serialized generated data).; locales: readonly string[] (必填) — Declared project locales (serialized generated data).; navSections: readonly unknown[] (必填) — Nav sections (serialized generated data; empty on the 1.0 surface).; headerNav: readonly Record<string, unknown>[] (必填) — Header nav links (serialized generated data; empty on the 1.0 surface).; defaultLocale: string (必填) — The project's default locale (generated data).; devClientScriptSrc: string | null (必填) — The dev island-client URL the entry computed from its compile-time `import.meta.env` constants; null when the app ships no client entry.; pageHandlerPaths: readonly string[] (必填) — Page route paths, in route order — the handler table's keys.; fetchMiddleware?: readonly FetchMiddleware[] (可选) — `middleware.use` module defaults, user-configured order (use[0] outermost).; pageRuntime?: GeneratedPageRuntime (可选)

packages/router/src/vite/internal/server-runtime/app.ts:70
GeneratedPageRuntime@openelement/router · ./server-runtimeinterfacepublic

The page-render seam the entry's Element imports feed (renderer-adapter selected). Present only when the entry has page routes: an API-only entry imports no Element renderer and binds none of it.

GeneratedPageRuntime

mode: "native" | "lit" (必填); ssrRenderableTags: readonly string[] (必填) — Build-admitted SSR-renderable tags (serialized generated data).; trustedHtml: (html: string) => TrustedHtmlValue (必填); escapeHtml: (value: string) => string (必填); renderDsd?: ((tag: string, options: { componentClass?: unknown; props?: Record<string, unknown>; sourceInfo?: PageSsrSourceInfo; ssrRenderableTags?: readonly string[]; pro… (可选) — native only: the compiled serializer and the SSR registry.; customElements?: { get(tag: string): unknown; } (可选); renderLitPageToHtml?: ((input: { tag: string; props?: Record<string, unknown>; }) => { html: string; }) (可选) — lit only: the lit-ssr page renderer.

packages/router/src/vite/internal/server-runtime/app.ts:56
installSsrRegistryGuard@openelement/router · ./server-runtimefunctionpublic

Installs the SSR registry guard and returns its registration seam. Behavior contract (moved verbatim from the generated entry): - The TRUE original `define` is captured ONCE on the registry itself (SSR_REGISTRY_ORIGINAL_DEFINE): the registry outlives vite dev SSR module re-evaluations, so a second installation must never capture the already-wrapped `define` as its "original" (#1339). - On the dev SSR stub registry (SSR_REGISTRY_STUB_MARKER) re-definition WINS — the registry outlives module re-evaluation, so route edits only reach SSR output when define() overwrites the stale class (#952). - `NotSupportedError` from a non-stub registry is swallowed (the shim's duplicate-define rejection is its designed live-reload notice); any other error propagates. - A tag the entry registered itself (ownership map) is re-registered through the TRUE original define — a dev re-evaluation registers a FRESH class for the SAME tag and the new class must win. A registration the entry did NOT make is a genuine conflict and keeps the fail-closed no-op.

(): SsrRegistryGuard

packages/router/src/vite/internal/server-runtime/security.ts:70
isSsgPrerenderDispatch@openelement/router · ./server-runtimefunctionpublic

True when the dispatch is an SSG prerender pass. Static build output cannot carry per-request state — the SSG nonce contract (nonce.ts: SSG output carries none, static bytes cannot be per-request) — so the CSP auto-nonce binds nothing on this pass: the handlers' `c.get('cspNonce')` stays undefined and `wrapInDocument` serializes the client script tags nonce-free while the SSG CSP injector writes the policy-only meta.

(env: unknown): boolean

packages/router/src/vite/internal/server-runtime/response-channel.ts:166
LitPageRendererDeps@openelement/router · ./server-runtimeinterfacepublic

The subset of

LitPageRendererDeps

renderLitPageToHtml: (input: { tag: string; props?: Record<string, unknown>; }) => { html: string; } (必填) — `renderLitPageToHtml` — the registered LitElement page host renders to DSD HTML.

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:115
localeFromPath@openelement/router · ./server-runtimefunctionpublic

Path-derived locale resolution: the first non-empty path segment when it is a declared locale, the fallback otherwise. `locales` is the generated entry's `__locales` project declaration, so request-time resolution and the pages the build emits agree (see expandI18nLocales).

(locales: readonly string[], path: unknown, fallback: string): string

packages/router/src/vite/internal/server-runtime/page-render.ts:72
localizeShellHref@openelement/router · ./server-runtimefunctionpublic

Shell href localization: root-relative hrefs gain the active locale prefix unless they already carry it; locale-neutral, external, and protocol-relative hrefs pass through untouched. Nav data is not part of the 1.0 surface, so the generated `__headerNav` is empty today — the contract keeps its guard.

(href: string, locale: string, defaultLocale: string): string

packages/router/src/vite/internal/server-runtime/document-runtime.ts:26
LoggerOptions@openelement/router · ./server-runtimeinterfacepublic

Options for {@linkcode createLoggerMiddleware}.

LoggerOptions

print?: ((line: string) => void) (可选) — The print function. Default `console.log`.

packages/router/src/vite/internal/server-runtime/middleware.ts:59
matchesMiddlewareScope@openelement/router · ./server-runtimefunctionpublic

Hono-compatible middleware-scope matching: `'/p/*'` matches `/p` itself and everything beneath it; `'/*'` matches everything; a bare `'/p'` matches only `/p` exactly.

(pattern: string, pathname: string): boolean

packages/router/src/vite/internal/server-runtime/wintercg.ts:236
mergeChannelHeaders@openelement/router · ./server-runtimefunctionpublic

Merges the loader/action response-header channel into a response. Channel entries are appended after the framework-set headers, so multi-value `Set-Cookie` accumulates; a protocol header ({@linkcode PROTOCOL_HEADERS}) the response already carries is skipped — the channel cannot override the protocol. An empty channel returns the original `Response` object untouched, so responses that never touch the channel keep their identity (and their streaming body is not rebuilt).

(response: Response, channel: Headers): Response

headers: Headers (必填) — The **`headers`** read-only property of the Response interface contains the Headers object associated with the response. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers); ok: boolean (必填) — The **`ok`** read-only property of the Response interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok); redirected: boolean (必填) — The **`redirected`** read-only property of the Response interface indicates whether or not the response is the result of a request you made which was redirected. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected); status.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (必填) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; statusText: string (必填) — The **`statusText`** read-only property of the Response interface contains the status message corresponding to the HTTP status code in Response.status. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText); type: ResponseType (必填) — The **`type`** read-only property of the Response interface contains the type of the response. The type determines whether scripts are able to access the response body and headers. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type); url: string (必填) — The **`url`** read-only property of the Response interface contains the URL of the response. The value of the url property will be the final URL obtained after any redirects. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url); clone: () => Response (必填) — The **`clone()`** method of the Response interface creates a clone of a response object, identical in every way, but stored in a different variable. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone); body: ReadableStream<Uint8Array<ArrayBuffer>> | null (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body); bodyUsed: boolean (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed); arrayBuffer: () => Promise<ArrayBuffer> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer); blob: () => Promise<Blob> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob); bytes: () => Promise<Uint8Array<ArrayBuffer>> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes); formData: () => Promise<FormData> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData); json: () => Promise<any> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json); text: () => Promise<string> (必填) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text)

packages/router/src/vite/internal/server-runtime/response-channel.ts:111
NativePageRendererDeps@openelement/router · ./server-runtimeinterfacepublic

The subset of the Element serializer the native renderer needs.

NativePageRendererDeps

renderDsd: (tag: string, options: { componentClass?: unknown; props?: Record<string, unknown>; sourceInfo?: PageSsrSourceInfo; ssrRenderableTags?: readonly string[]; proj… (必填) — Element's sync compiled serializer (`renderDsd`).; customElements: { get(tag: string): unknown; } (必填) — The SSR registry (the runtime's `customElements` global).; ssrRenderableTags: readonly string[] (必填) — Build-admitted nested compiled tags (serialized generated data).

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:52
OpenElementRequestScope@openelement/router · ./server-runtimeinterfacepublic

The per-request scope: one instance per dispatch, bound to its request by the identity registry. Response headers written before the response exists (`header()`) flow into every response the scope constructs — the merge point the Hono context's prepared headers used to own.

OpenElementRequestScope

req: RequestScopeRequest (必填); headers: Headers (必填) — The response-header channel. Headers the handler or the built-in middleware write before a response exists (`Cache-Control`, `Vary`, `X-Request-Id`, the security set) land here and merge into every response the scope builds. Stream routes hand the handler a separate committed stream channel; the scope keeps supplying the framework set.; env: Record<string, unknown> (必填) — The runtime env binding (`fetch(request, env)`).; executionCtx: unknown (必填) — The host execution context; throws when the host passed none (call sites guard).; header: (name: string, value: string, options?: { append?: boolean; }) => void (必填) — Writes one response header on the channel (set by default, append opt-in).; get: (key: string) => unknown (必填) — Reads one typed variable (e.g. `cspNonce`).; set: (key: string, value: unknown) => void (必填) — Writes one typed variable.; json: (object: unknown, status?: number, headers?: Record<string, string>) => Response (必填) — `application/json` response starting from the channel headers.; text: (text: string, status?: number, headers?: Record<string, string>) => Response (必填) — `text/plain; charset=UTF-8` response starting from the channel headers.; html: (html: string, status?: number, headers?: Record<string, string>) => Response (必填) — `text/html; charset=UTF-8` response starting from the channel headers.; redirect: (location: string, status?: number) => Response (必填) — Redirect response (`Location` + status, default 302).; body: (data: BodyInit | null, status?: number, headers?: Record<string, string>) => Response (必填) — Raw-body response starting from the channel headers.

packages/router/src/vite/internal/server-runtime/wintercg.ts:66
PageContext@openelement/router · ./server-runtimeinterfacepublic

The request-scoped page context the generated handlers build for one render (#1326).

PageContext

packages/router/src/vite/internal/server-runtime/page-render.ts:84
pageDefinition@openelement/router · ./server-runtimefunctionpublic

Canonical page-definition extractor: a route module's default export carries the authoring descriptor on `openElementPage`; anything else projects to the empty descriptor. Kept a hoisted-friendly plain function — the generated entry calls it at module evaluation (route registration, routeInfo) and inside every request handler.

(routeModule: unknown): PageDefinition

packages/router/src/vite/internal/server-runtime/page-render.ts:42
PageDefinition@openelement/router · ./server-runtimetypepublic

The page descriptor a definePage/defineLitPage route module carries on its default export.

PageDefinition

packages/router/src/vite/internal/server-runtime/page-render.ts:23
PagePropsRuntime@openelement/router · ./server-runtimeinterfacepublic

The page props projection runtime: the default projection from route params/loader data plus the descriptor's `props`/`error` projector seams. Every seam filters the canonical dangerous-key set (#1214) so hostile params, loader data, or author projector output can never pollute the props record that flows into the compiled serializer.

PagePropsRuntime

defaultPageProps: (context: PageContext) => ProjectedProps (必填) — The descriptor-less fallback: params + plain-object loader data.; pageProps: (routeModule: unknown, context: PageContext) => ProjectedProps (必填) — The descriptor `props` projector, falling back to the default projection.; pageErrorProps: (routeModule: unknown, error: unknown, context: PageContext) => ProjectedProps (必填) — The descriptor `error` projector for the error-boundary re-render.

packages/router/src/vite/internal/server-runtime/page-render.ts:100
PagePropsRuntimeDeps@openelement/router · ./server-runtimeinterfacepublic

The binding the generated-app factory hands {@linkcode createPagePropsRuntime}.

PagePropsRuntimeDeps

dangerousKeys: ReadonlySet<string> (必填) — The canonical dangerous-key set (the factory imports it from the kernel-free /authoring leaf): one rule, no second copy.

packages/router/src/vite/internal/server-runtime/page-render.ts:110
PageSsrRenderer@openelement/router · ./server-runtimetypepublic

The generated entry's `__ssr` binding: render one registered host tag to HTML. `depth` bounds nested island expansion; `projectedChildren` claims external content (the app-shell slot). Fails closed per the forks below.

PageSsrRenderer

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:43
PageSsrSourceInfo@openelement/router · ./server-runtimeinterfacepublic

Source metadata the serializer attributes to a render (the `{ route }` seam).

PageSsrSourceInfo

route?: string (可选); source?: string (可选)

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:30
ProjectedChildren@openelement/router · ./server-runtimetypepublic

Trusted parent-owned light children keyed by slot name (the shell slot claim).

ProjectedChildren

forEach: (callbackfn: (value: TrustedHtmlValue, key: string, map: ReadonlyMap<string, TrustedHtmlValue>) => void, thisArg?: any) => void (必填); get: (key: string) => TrustedHtmlValue (必填); has: (key: string) => boolean (必填); size.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; size.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; size.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; size.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; size.valueOf: () => number (必填) — Returns the primitive value of the specified object.; size.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; entries: () => MapIterator<[string, TrustedHtmlValue]> (必填) — Returns an iterable of key, value pairs for every entry in the map.; keys: () => MapIterator<string> (必填) — Returns an iterable of keys in the map; values: () => MapIterator<TrustedHtmlValue> (必填) — Returns an iterable of values in the map; __@iterator@12893: () => MapIterator<[string, TrustedHtmlValue]> (必填) — Returns an iterable of entries in the map.

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:36
ProjectedProps@openelement/router · ./server-runtimetypepublic

The projected props record handed to the compiled page host.

ProjectedProps

packages/router/src/vite/internal/server-runtime/page-render.ts:91
PROTOCOL_HEADERS@openelement/router · ./server-runtimeconstpublic

Headers the loader/action channel may never override once the response already carries them: the framework protocol always wins on conflict. Compared case-insensitively against the channel entry's name; the channel may still introduce one of these when the response does not set it itself.

ReadonlySet<string>

packages/router/src/vite/internal/server-runtime/response-channel.ts:36
RequestIdOptions@openelement/router · ./server-runtimeinterfacepublic

Options for {@linkcode createRequestIdMiddleware}.

RequestIdOptions

limitLength.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; limitLength.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; limitLength.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; limitLength.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; limitLength.valueOf: () => number (必填) — Returns the primitive value of the specified object.; limitLength.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; headerName?: string (可选) — The response header carrying the id. Default `X-Request-Id`.; generator?: ((request: Request) => string) (可选) — The id generator. Default `crypto.randomUUID()`.

packages/router/src/vite/internal/server-runtime/middleware.ts:24
RequestScopeRequest@openelement/router · ./server-runtimeinterfacepublic

The request view the generated wiring binds as `c.req`.

RequestScopeRequest

raw: Request (必填) — The underlying WinterCG request (replaceable — the body limit swaps in a buffered twin).; url: string (必填) — The full request URL string.; path: string (必填) — The request pathname.; param: () => Record<string, string> (必填) — The route-match path params (empty outside a match).; header: (name: string) => string (必填) — One request header.

packages/router/src/vite/internal/server-runtime/wintercg.ts:46
resolveCompiledPageTag@openelement/router · ./server-runtimefunctionpublic

Native page-tag resolution (#1276, B1.3-F1): the compiled Part Program is the one canonical source for the route→program tag binding. A definePage route module default-exports the compiled page class, whose `__partProgram.tag` carries the

(routeModule: unknown, fallbackTag: string): string

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:145
resolveLitPageTag@openelement/router · ./server-runtimefunctionpublic

Lit page-tag resolution (#1339 lit fork): a defineLitPage route records its host tag on the class's `openElementPageTag` static (there is no compiled Part Program in the lit path); the path-derived tag stays the fallback.

(routeModule: unknown, fallbackTag: string): string

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:160
ResponseHeaderChannel@openelement/router · ./server-runtimeinterfacepublic

The per-request response-header channel: the mutable `Headers` instance the loader and the action receive as `context.responseHeaders`, plus the commitment switch the generated stream handler flips when the response is committed.

ResponseHeaderChannel

channel: Headers (必填) — Author-facing view of the channel. Before commitment every `Headers` mutator passes through unchanged; after {@linkcode ResponseHeaderChannel.commit} the mutating methods are gated — a late `append`/`set`/`delete` becomes a warn-and-ignore diagnostic naming the route, header, and operation. It never throws and never mutates the committed response.; commit: () => void (必填) — The header-commitment point: the generated handler calls this once, immediately before it exposes the response body. Later mutator calls are ignored with a diagnostic. Idempotent.

packages/router/src/vite/internal/server-runtime/types.ts:18
routeMeta@openelement/router · ./server-runtimefunctionpublic

Canonical route metadata derived from a route module: only the keys the entry consumers read (route, layout, title, description), each present exactly when the descriptor defines it — spread-conditional, so an absent key stays absent instead of becoming `undefined`.

(routeModule: unknown): Record<string, unknown>

packages/router/src/vite/internal/server-runtime/page-render.ts:53
RouteModule@openelement/router · ./server-runtimeinterfacepublic

A route module namespace as the generated entry imports it (`import * as $route`).

RouteModule

packages/router/src/vite/internal/server-runtime/page-render.ts:26
runActionProtocol@openelement/router · ./server-runtimefunctionpublic

Runs the action POST protocol for one request: resolve the action (named `?/name` map or bare `action` export), enforce the same-origin CSRF floor, parse the form body, classify the outcome, and answer per channel: - fetch callers (`ACTION_FETCH_HEADER: true`) always get JSON — the ActionResult union for outcomes, RFC 9457 problem+json for protocol errors (CSRF 403, unknown action 404, unparseable body 400); - native form callers get PRG 303 on success, the status page on protocol errors, and `{ actionResult }` back for a `fail()` so the handler re-renders the form at the author's status (422).

(context: OpenElementRequestScope, routeModule: unknown, loadContext: ActionLoadContext, renderStatusPage: (title: string, message: string, status: number) => Response, state: ActionProtocolState): Promise<ActionExecuti…

req: RequestScopeRequest (必填); headers: Headers (必填) — The response-header channel. Headers the handler or the built-in middleware write before a response exists (`Cache-Control`, `Vary`, `X-Request-Id`, the security set) land here and merge into every response the scope builds. Stream routes hand the handler a separate committed stream channel; the scope keeps supplying the framework set.; env: Record<string, unknown> (必填) — The runtime env binding (`fetch(request, env)`).; executionCtx: unknown (必填) — The host execution context; throws when the host passed none (call sites guard).; header: (name: string, value: string, options?: { append?: boolean; }) => void (必填) — Writes one response header on the channel (set by default, append opt-in).; get: (key: string) => unknown (必填) — Reads one typed variable (e.g. `cspNonce`).; set: (key: string, value: unknown) => void (必填) — Writes one typed variable.; json: (object: unknown, status?: number, headers?: Record<string, string>) => Response (必填) — `application/json` response starting from the channel headers.; text: (text: string, status?: number, headers?: Record<string, string>) => Response (必填) — `text/plain; charset=UTF-8` response starting from the channel headers.; html: (html: string, status?: number, headers?: Record<string, string>) => Response (必填) — `text/html; charset=UTF-8` response starting from the channel headers.; redirect: (location: string, status?: number) => Response (必填) — Redirect response (`Location` + status, default 302).; body: (data: BodyInit | null, status?: number, headers?: Record<string, string>) => Response (必填) — Raw-body response starting from the channel headers.

packages/router/src/vite/internal/server-runtime/action-runtime.ts:82
SSG_PRERENDER_ENV_KEY@openelement/router · ./server-runtimeconstpublic

The env key the SSG prerender pass sets to `true` on every build-time dispatch (ssg-render.ts passes `{ [SSG_PRERENDER_ENV_KEY]: true }` as the request env). Since #1560 the prerender driver is our own static generator, so the key is owned here — this module is the single source; the build side imports the constant, and no second copy exists to drift.

"OPEN_ELEMENT_SSG_CONTEXT"

packages/router/src/vite/internal/server-runtime/response-channel.ts:156
SsrRegistryGuard@openelement/router · ./server-runtimeinterfacepublic

What the generated entry gets from {@linkcode installSsrRegistryGuard}.

SsrRegistryGuard

register: (tag: string, ctor: unknown) => void (必填) — Registers one component class under `tag` with the same ownership/conflict rules the generated entry has always applied (#952, #1339).

packages/router/src/vite/internal/server-runtime/security.ts:36
StatusHtmlRenderer@openelement/router · ./server-runtimetypepublic

The generated entry's `__statusHtml` binding: title/message rendered into a minimal status page.

StatusHtmlRenderer

packages/router/src/vite/internal/server-runtime/document-runtime.ts:40
STREAM_BROWSER_BOOTSTRAP@openelement/router · ./server-runtimeconstpublic

The browser installer bootstrap — the inline head script of every streamed page: the MutationObserver that scans streaming templates, the typed seed admission against the same policy budgets the server enforced, the anchor range ownership check, the frame markup safety screen, and the pagehide retirement/BFCache contract. The module owns the string so the server pump and the browser installer read the same constants from one place; S4 will re-home it from the per-page inline form to a shared asset.

string

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:549
StreamBodyConfig@openelement/router · ./server-runtimeinterfacepublic

Binding-time configuration of {@linkcode createStreamBody}.

StreamBodyConfig

escapeAttr: (value: string) => string (必填) — The entry's `escapeAttr` import — an Element function, injected so this module stays free of an Element runtime edge.; timeoutMs.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; timeoutMs.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; timeoutMs.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; timeoutMs.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; timeoutMs.valueOf: () => number (必填) — Returns the primitive value of the specified object.; timeoutMs.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:100
StreamBodyFn@openelement/router · ./server-runtimetypepublic

The bound streaming body builder the generated handler calls.

StreamBodyFn

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:115
StreamBodyOptions@openelement/router · ./server-runtimeinterfacepublic

Per-request inputs of the streaming body builder.

StreamBodyOptions

scope: StreamRequestScope (必填); route: string (必填); manifest: StreamRouteManifest (必填); executor: StreamExecutorView (必填); records: readonly StreamFieldRecord[] (必填); document: StreamDocumentParts (必填); token: string (必填)

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:89
StreamDocumentParts@openelement/router · ./server-runtimeinterfacepublic

The streamed document halves the element `documentStreamParts` produced.

StreamDocumentParts

prefix: string (必填); suffix: string (必填)

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:83
StreamExecutorView@openelement/router · ./server-runtimeinterfacepublic

The slice of the element deferred executor the pump consumes.

StreamExecutorView

shell: string (必填); owner: { readonly instanceId: string; } (必填); seed: Record<string, { type: string; }> (必填); resolvedValue: (field: string, value: unknown) => unknown (必填); serializeResolved: (field: string, value: unknown) => string[] (必填)

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:74
StreamFieldRecord@openelement/router · ./server-runtimeinterfacepublic

One declared deferred field's settlement record (the pump's queue unit).

StreamFieldRecord

entry: { field: string; signal: string; owners: Array<{ kind: "part" | "region"; index: number; location: string; source: PartProgramV1["sourceMap"]["records"][number… (必填); settled: boolean (必填); failed: boolean (必填); error: unknown (必填); value: unknown (必填); notify?: (() => void) (可选)

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:52
streamFields@openelement/router · ./server-runtimefunctionpublic

The deferred-field front gate: validates the loader data against the route's build manifest (one plain object, the `STREAM_MAX_FIELDS` / `STREAM_MAX_OWNERS` budget, every declared field present, no undeclared thenable), attaches both settlement observers per field, and hands back the records the pump queues. Every rejection first sweeps the loader's own thenables for observation (see {@linkcode observeThenables}).

(data: unknown, manifest: StreamRouteManifest): StreamFieldRecord[]

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:197
StreamRequestScope@openelement/router · ./server-runtimeinterfacepublic

The request scope the generated handler builds around a streamed route.

StreamRequestScope

request: Request (必填) — The request the loader sees, carrying the scope's abort signal.; upstreamSignal: AbortSignal (必填) — The original WinterCG request's signal (the response-cancel source).; abortWork: () => void (必填) — Aborts the loader's work without tearing down the scope bridge.; cancel: () => void (必填) — Detaches the upstream bridge and aborts the scope (handler-level exit).

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:62
TrustedHtmlValue@openelement/router · ./server-runtimeinterfacepublic

Opaque capability marking HTML the application has explicitly vetted as trusted.

TrustedHtmlValue

html: string (必填)

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:25
WinterCgApp@openelement/router · ./server-runtimeinterfacepublic

The internal WinterCG app: the composition surface the generated entry wires.

WinterCgApp

use: (pattern: string, middleware: WinterCgFetchMiddleware) => void (必填) — Registers middleware, optionally path-scoped (`'*'`, `'/p/*'`, or a bare `'/p'`).; route: (middleware: WinterCgFetchMiddleware) => void (必填) — Registers the route-table layer: theWinterCG middleware that resolves method-keyed records (createRouteMiddleware). It composes after the fn-form mounts — the route layer, not an outer middleware — so a mount and a record at the same path resolve with route specificity, the way the replaced composition ordered them.; all: (path: string, handler: ApiRouteFunction) => void (必填) — Mounts a fn-form API handler at a path — every method reaches it, params resolve from the match.; notFound: (handler: (request: Request, scope: OpenElementRequestScope) => Response | Promise<Response>) => void (必填) — The 404 terminal: invoked when no middleware or mount produced a response.; fetch: (request: Request, env?: Record<string, unknown>, platform?: unknown) => Promise<Response> (必填) — The dispatch: the composed chain over one request. Never rejects.; request: (input: string | URL | Request, init?: RequestInit, env?: Record<string, unknown>) => Promise<Response> (必填) — `Request`-convenience dispatch (the SSG prerender and test harnesses).; requestScope: (request: Request) => OpenElementRequestScope (必填) — The per-request scope accessor the generated handlers bind (`__requestScope`).; routes: readonly { method: "ALL"; path: string; }[] (必填) — The fn-form mounts (the SSG prerender's page-discovery exclusion set).

packages/router/src/vite/internal/server-runtime/wintercg.ts:195
WinterCgFetchMiddleware@openelement/router · ./server-runtimetypepublic

The dialect-free fetch middleware the whole composition speaks.

WinterCgFetchMiddleware

packages/router/src/vite/internal/server-runtime/wintercg.ts:40
applyTailwindPreset@openelement/router · ./vitefunctionpublic

Apply the preset's SSG post-processing: compile the bundle, then walk the rendered HTML files injecting the links and enforcing the prohibition. Called from the build plugin's closeBundle after Phase 3 (the SSG render) has written the pages — build-layer only, no request-path involvement.

(options: TailwindPresetOptions, config: ResolvedConfig, outDir: string): Promise<TailwindBundleResult>

theme?: string[] (可选) — Style sources compiled into the bundle's `theme` layer: package CSS specifiers (`@openelement/ui/theme.css`) or app-relative paths. Their `@theme` blocks (and any Tailwind utilities they reference) compile through `@tailwindcss/vite`.; components?: string[] (可选) — Style sources wrapped into `@layer components` — the component-facing token/recipe layer. Also the source of the `@scope` light-DOM face.; scopeTags?: string[] (可选) — Host tags the `@scope` light-DOM face is emitted for (one `@scope (tag)` block per tag carrying the components layer). Empty/absent skips the face. Package-island apps derive this from the package manifest.; injectDsdLinks?: boolean (可选) — Whether the bundle link is also injected into every DSD shadow template (seam 2's shadow adoption). Default `false`: the compiled claim requires the DSD template's children to equal the Part Program's own nodes (the

packages/router/src/vite/preset-tailwind.ts:648
ArtifactInfo@openelement/router · ./viteinterfacepublic

File size info for a single artifact

ArtifactInfo

name: string (必填); path: string (必填); sizeBytes.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; sizeBytes.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; sizeBytes.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; sizeBytes.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; sizeBytes.valueOf: () => number (必填) — Returns the primitive value of the specified object.; sizeBytes.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; sizeKB: string (必填); gzipBytes?: number (可选) — gzip -9 bytes; only computed for JS chunks, not HTML pages.; gzipKB?: string (可选)

packages/router/src/vite/build-manifest.ts:29
buildApp@openelement/router · ./vitefunctionpublic

Build an OpenElement application through the supported adapter boundary. Consumers configure the adapter in `vite.config.ts`; this function owns the invocation so CLI callers do not need to know the adapter's internal build phases or Vite plugin ordering.

(config?: InlineConfig): Promise<unknown>

packages/router/src/vite/index.ts:63
buildHeadExtras@openelement/router · ./vitefunctionpublic

Build the headExtras string from FrameworkOptions.inject. Serializes headFragments, stylesheets, and scripts into a single HTML string to inject into <head>. Validates all URLs and ensures no raw <script> tags bypass the structured injection APIs.

(options: FrameworkOptions): HeadExtrasResult

packages/router/src/vite/head-injection.ts:133
BuildManifest@openelement/router · ./viteinterfacepublic

Full build manifest summary

BuildManifest

phase: 1 | 2 | 3 (必填); timestamp: string (必填); islands: ArtifactInfo[] (必填); clientEntry: ArtifactInfo | null (必填); sharedChunks: ArtifactInfo[] (必填) — JS chunks that are neither an island chunk nor the client entry: the shared runtime chunks every island page eagerly imports, and dynamically fetched chunks like the search combobox.; htmlPages: ArtifactInfo[] (必填); totalJsBytes.toString: (radix?: number) => string (必填) — Returns a string representation of an object.; totalJsBytes.toFixed: (fractionDigits?: number) => string (必填) — Returns a string representing a number in fixed-point notation.; totalJsBytes.toExponential: (fractionDigits?: number) => string (必填) — Returns a string containing a number represented in exponential notation.; totalJsBytes.toPrecision: (precision?: number) => string (必填) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; totalJsBytes.valueOf: () => number (必填) — Returns the primitive value of the specified object.; totalJsBytes.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (必填) — Converts a number to a string by using the current or specified locale.; totalJsGzipBytes: number (必填) — Sum of per-file gzip sizes over every scanned JS chunk.; totalHtmlBytes: number (必填); headExtrasSize: number (必填); warnings: string[] (必填) — Budget warnings (files > threshold)

packages/router/src/vite/build-manifest.ts:40
default@openelement/router · ./vitefunctionpublic

Low-level Vite plugin pipeline: SSR dev server, SSG and islands without the content/i18n conveniences of `openElement()`.

(config?: OpenPipelineConfig): Plugin[]

mode?: "ssg" (可选) — Build/dev mode. 'ssg' (default) enables SSR dev server + static generation.; routes.dir?: string (可选); output.outDir?: string (可选); island.dir?: string (可选); island.upgradeStrategy?: string (可选); viewTransition?: boolean (可选); headExtras?: string (可选)

packages/router/src/vite/index.ts:39
FrameworkOptions@openelement/router · ./vitetypepublic

Adapter options extend Element options with build-only delivery declarations. The element package remains unaware of Vite/SSG policy.

FrameworkOptions

packages/router/src/vite/framework.ts:36
HeadExtrasResult@openelement/router · ./viteinterfacepublic

Result of building head extras from FrameworkOptions.

HeadExtrasResult

headExtras: string (必填); allowHeadExtrasScripts: boolean (必填)

packages/router/src/vite/head-injection.ts:121
mdxPlugin@openelement/router · ./vitefunctionpublic

Vite plugin compiling `.mdx` route files into compiled page modules.

(options?: OpenMdxPluginOptions): Plugin

routesDir?: string (可选) — Routes directory (as configured in openElement()). The compiled page tag derives from the route-file-relative path so the generated entry's path-derived registration tag matches the program tag.

packages/router/src/vite/plugin-mdx.ts:61
openElement@openelement/router · ./vitefunctionpublic

Create the full OpenElement Vite plugin set: route pipeline, SSG and islands.

(options?: OpenElementOptions): Plugin[]

head.title?: string (可选) — Document title; defaults to the package.json `name`.; head.description?: string (可选) — `<meta name="description">` + `og:description`.; head.lang?: string (可选) — `<html lang>`; defaults to `en`.; head.favicon?: string (可选) — Site-root-relative favicon path, emitted as `<link rel="icon">`.; head.ogImage?: string (可选) — `og:image` URL. Absolute (crawlable) or site-root-relative.; head.stylesheets?: string[] (可选) — External stylesheets linked into `<head>`.; head.scripts?: OpenElementHeadScript[] (可选) — External scripts emitted into `<head>`; inline code is not accepted here.; ssg.dynamicRouteFailure?: "fail" | "warn" (可选) — Policy for dynamic-route render failures during SSG. See {@link SsgRenderOptions.dynamicRouteFailure}.; build.outDir?: string (可选) — Output directory for the build artifacts. Defaults to `dist`.; build.manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; } (可选) — Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.; renderer?: "native" | "lit" (可选) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderDsd); 'lit' renders LitElement pages through; routesDir?: string (可选) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; islandsDir?: string (可选) — Directory island modules are discovered in. Defaults to `app/islands`.; componentsDir?: string (可选) — Directory non-route components live in. Defaults to `app/components`.; packageIslands?: string[] (可选) — Extra package names whose island modules the build admits, e.g. `['@openelement/ui']`.; appShell?: AppShellConfig (可选) — Application shell declaration; `false` disables the shell, `'default'` uses the built-in one.; layouts?: LayoutsConfig (可选) — Per-layout shell declarations keyed by layout name.; mode?: "ssg" (可选) — Build mode. 'ssg' (default) generates static HTML.; headExtras?: string (可选) — @dangerous injected as-is, only use with controlled content; inject.stylesheets?: (string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[] (可选) — Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.; inject.scripts?: (string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str… (可选) — Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.; inject.headFragments?: string[] (可选) — @dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.; ssr.noExternal?: (string | RegExp)[] (可选); island.upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (可选); viewTransition?: boolean (可选) — Enable the View Transitions API for client navigations. Defaults to true.; speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (可选) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; middleware.cors?: boolean (可选) — Enable the built-in CORS middleware.; middleware.corsOrigin?: string | string[] (可选) — Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.; middleware.corsOriginModule?: string (可选) — Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `appShell.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.; middleware.requestId?: boolean (可选) — Emit and honor a per-request id header.; middleware.logger?: boolean (可选) — Log each request through the built-in logger.; middleware.securityHeaders?: boolean (可选) — Attach the built-in security response headers.; middleware.csp?: { policy?: string; nonce?: boolean; reportOnly?: boolean; } (可选) — Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.; middleware.use?: string[] (可选) — Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `appShell.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configur…; criticalAssets.fonts?: CriticalFontAsset[] (可选); criticalAssets.styles?: (string | CriticalStyleAsset)[] (可选); criticalAssets.stylesheets?: (string | CriticalStyleAsset)[] (可选) — Alias for styles accepted by config producers.; criticalAssets.inlineScripts?: (string | CriticalInlineScriptAsset)[] (可选); criticalAssets.allowExternalRenderBlocking?: boolean (可选) — Allow intentional external render-blocking styles/scripts.; criticalAssets.allowRenderBlockingExternal?: boolean (可选) — Alias retained only within this build-side config shape.; criticalAssets.minifyInlineStyles?: boolean (可选) — Minify inline CSS. Defaults to true.; criticalAssets.origin?: string (可选) — Origin used to distinguish same-origin and cross-origin absolute URLs.; critical?: CriticalAssetsOptions (可选); i18n?: OpenElementI18nOptions (可选); tailwind?: boolean | TailwindPresetOptions (可选) — Opt-in Tailwind preset (alpha9 C2, #1505). `true` or an options object enables the build-layer seams: the compiled `@layer theme, base, components, utilities` bundle asset and the DSD/head link-not-inline emission. Default (absent) keeps the build byte-identical to a preset-less pipeline.

packages/router/src/vite/app-vite.ts:43
OpenElementBlogOptions@openelement/router · ./viteinterfacepublic

Blog options stored in the adapter build context.

OpenElementBlogOptions

contentDir?: string (可选); basePath?: string (可选)

packages/router/src/vite/framework.ts:51
OpenElementBuildContext@openelement/router · ./viteclasspublic

The build's shared mutable state: the resolved framework options, the phase-1/phase-3 metadata, the sub-plugin data slots, and the production plan and artifact records the release and deployment adapters read. One instance is threaded through every adapter plugin for a build.

class OpenElementBuildContext

packages/router/src/vite/build-context.ts:182
OpenElementBuildContextLike@openelement/router · ./viteinterfacepublic

Minimal build-context contract available to adapter sub-plugins.

OpenElementBuildContextLike

plugins: { [key: string]: unknown; blogOptions: OpenElementBlogOptions | null; navSections: OpenElementNavSection[]; headerNav: OpenElementHeaderNavLink[]; sitemapOptio… (必填); registerPlugin: (name: string, instance: unknown) => void (必填)

packages/router/src/vite/framework.ts:76
OpenElementI18nContextOptions@openelement/router · ./viteinterfacepublic

Locale options carried through the build context to the i18n integration.

OpenElementI18nContextOptions

packages/router/src/vite/framework.ts:69
OpenElementI18nOptions@openelement/router · ./viteinterfacepublic

Project locale declaration. The build expands every static and dynamic route under each additional locale prefix (`/zh/docs`), passes the resolved locale to page `head`/`props` hooks and localizes app-shell navigation. Absent means a single-locale site with no locale prefixing — the pre-i18n output, byte for byte.

OpenElementI18nOptions

locales: string[] (必填) — Locale prefixes the build expands, e.g. `['en', 'zh']`.; defaultLocale?: string (可选) — Locale served without a prefix. Defaults to the first entry.

packages/router/src/vite/framework.ts:25
OpenElementNavSection@openelement/router · ./viteinterfacepublic

Navigation section produced by the adapter content pipeline.

OpenElementNavSection

section: string (必填); items: { path: string; label: string; order?: number; }[] (必填)

packages/router/src/vite/framework.ts:57
OpenElementOptions@openelement/router · ./viteinterfacepublic

Options for the openElement() unified Vite entry. The framework-options face here is deliberately narrower than the internal {@linkcode FrameworkOptions} transfer type: - the document-head channel is spelled `head` (never `html`), the same spelling `openelement.config.ts` uses — passing `html` fails closed and names the replacement; - the source roots keep their explicit spellings (`routesDir`, `islandsDir`, `componentsDir`), while a config file's `dirs` block is the spelling that also moves the file conventions.

OpenElementOptions

head.title?: string (可选) — Document title; defaults to the package.json `name`.; head.description?: string (可选) — `<meta name="description">` + `og:description`.; head.lang?: string (可选) — `<html lang>`; defaults to `en`.; head.favicon?: string (可选) — Site-root-relative favicon path, emitted as `<link rel="icon">`.; head.ogImage?: string (可选) — `og:image` URL. Absolute (crawlable) or site-root-relative.; head.stylesheets?: string[] (可选) — External stylesheets linked into `<head>`.; head.scripts?: OpenElementHeadScript[] (可选) — External scripts emitted into `<head>`; inline code is not accepted here.; ssg.dynamicRouteFailure?: "fail" | "warn" (可选) — Policy for dynamic-route render failures during SSG. See {@link SsgRenderOptions.dynamicRouteFailure}.; build.outDir?: string (可选) — Output directory for the build artifacts. Defaults to `dist`.; build.manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; } (可选) — Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.; renderer?: "native" | "lit" (可选) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderDsd); 'lit' renders LitElement pages through; routesDir?: string (可选) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; islandsDir?: string (可选) — Directory island modules are discovered in. Defaults to `app/islands`.; componentsDir?: string (可选) — Directory non-route components live in. Defaults to `app/components`.; packageIslands?: string[] (可选) — Extra package names whose island modules the build admits, e.g. `['@openelement/ui']`.; appShell?: AppShellConfig (可选) — Application shell declaration; `false` disables the shell, `'default'` uses the built-in one.; layouts?: LayoutsConfig (可选) — Per-layout shell declarations keyed by layout name.; mode?: "ssg" (可选) — Build mode. 'ssg' (default) generates static HTML.; headExtras?: string (可选) — @dangerous injected as-is, only use with controlled content; inject.stylesheets?: (string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[] (可选) — Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.; inject.scripts?: (string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str… (可选) — Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.; inject.headFragments?: string[] (可选) — @dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.; ssr.noExternal?: (string | RegExp)[] (可选); island.upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (可选); viewTransition?: boolean (可选) — Enable the View Transitions API for client navigations. Defaults to true.; speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (可选) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; middleware.cors?: boolean (可选) — Enable the built-in CORS middleware.; middleware.corsOrigin?: string | string[] (可选) — Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.; middleware.corsOriginModule?: string (可选) — Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `appShell.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.; middleware.requestId?: boolean (可选) — Emit and honor a per-request id header.; middleware.logger?: boolean (可选) — Log each request through the built-in logger.; middleware.securityHeaders?: boolean (可选) — Attach the built-in security response headers.; middleware.csp?: { policy?: string; nonce?: boolean; reportOnly?: boolean; } (可选) — Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.; middleware.use?: string[] (可选) — Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `appShell.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configur…; criticalAssets.fonts?: CriticalFontAsset[] (可选); criticalAssets.styles?: (string | CriticalStyleAsset)[] (可选); criticalAssets.stylesheets?: (string | CriticalStyleAsset)[] (可选) — Alias for styles accepted by config producers.; criticalAssets.inlineScripts?: (string | CriticalInlineScriptAsset)[] (可选); criticalAssets.allowExternalRenderBlocking?: boolean (可选) — Allow intentional external render-blocking styles/scripts.; criticalAssets.allowRenderBlockingExternal?: boolean (可选) — Alias retained only within this build-side config shape.; criticalAssets.minifyInlineStyles?: boolean (可选) — Minify inline CSS. Defaults to true.; criticalAssets.origin?: string (可选) — Origin used to distinguish same-origin and cross-origin absolute URLs.; critical?: CriticalAssetsOptions (可选); i18n?: OpenElementI18nOptions (可选); tailwind?: boolean | TailwindPresetOptions (可选) — Opt-in Tailwind preset (alpha9 C2, #1505). `true` or an options object enables the build-layer seams: the compiled `@layer theme, base, components, utilities` bundle asset and the DSD/head link-not-inline emission. Default (absent) keeps the build byte-identical to a preset-less pipeline.

packages/router/src/vite/app-vite.ts:35
OpenMdxPluginOptions@openelement/router · ./viteinterfacepublic

Options for the `.mdx` route plugin ({@linkcode mdxPlugin}).

OpenMdxPluginOptions

routesDir?: string (可选) — Routes directory (as configured in openElement()). The compiled page tag derives from the route-file-relative path so the generated entry's path-derived registration tag matches the program tag.

packages/router/src/vite/plugin-mdx.ts:28
openPipeline@openelement/router · ./vitefunctionpublic

Low-level Vite plugin pipeline: SSR dev server, SSG and islands without the content/i18n conveniences of `openElement()`.

(config?: OpenPipelineConfig): Plugin[]

mode?: "ssg" (可选) — Build/dev mode. 'ssg' (default) enables SSR dev server + static generation.; routes.dir?: string (可选); output.outDir?: string (可选); island.dir?: string (可选); island.upgradeStrategy?: string (可选); viewTransition?: boolean (可选); headExtras?: string (可选)

packages/router/src/vite/index.ts:39
OpenPipelineConfig@openelement/router · ./viteinterfacepublic

Options for the low-level {@linkcode openPipeline} Vite plugin pipeline.

OpenPipelineConfig

mode?: "ssg" (可选) — Build/dev mode. 'ssg' (default) enables SSR dev server + static generation.; routes.dir?: string (可选); output.outDir?: string (可选); island.dir?: string (可选); island.upgradeStrategy?: string (可选); viewTransition?: boolean (可选); headExtras?: string (可选)

packages/router/src/vite/index.ts:28
renderTailwindPresetEntry@openelement/router · ./vitefunctionpublic

The bundle entry the preset compiles: the declared cascade order, then Tailwind itself, then the app's declared theme and component sources, as given. Callers staging a real entry pass sources through {@linkcode renderStagedPresetEntry}, which resolves them against the app root first.

(options: TailwindPresetOptions): string

theme?: string[] (可选) — Style sources compiled into the bundle's `theme` layer: package CSS specifiers (`@openelement/ui/theme.css`) or app-relative paths. Their `@theme` blocks (and any Tailwind utilities they reference) compile through `@tailwindcss/vite`.; components?: string[] (可选) — Style sources wrapped into `@layer components` — the component-facing token/recipe layer. Also the source of the `@scope` light-DOM face.; scopeTags?: string[] (可选) — Host tags the `@scope` light-DOM face is emitted for (one `@scope (tag)` block per tag carrying the components layer). Empty/absent skips the face. Package-island apps derive this from the package manifest.; injectDsdLinks?: boolean (可选) — Whether the bundle link is also injected into every DSD shadow template (seam 2's shadow adoption). Default `false`: the compiled claim requires the DSD template's children to equal the Part Program's own nodes (the

packages/router/src/vite/preset-tailwind.ts:209
renderTailwindScopeFace@openelement/router · ./vitefunctionpublic

The `@scope` light-DOM face: one block per declared host tag.

(options: TailwindPresetOptions, componentsCss: string): string

theme?: string[] (可选) — Style sources compiled into the bundle's `theme` layer: package CSS specifiers (`@openelement/ui/theme.css`) or app-relative paths. Their `@theme` blocks (and any Tailwind utilities they reference) compile through `@tailwindcss/vite`.; components?: string[] (可选) — Style sources wrapped into `@layer components` — the component-facing token/recipe layer. Also the source of the `@scope` light-DOM face.; scopeTags?: string[] (可选) — Host tags the `@scope` light-DOM face is emitted for (one `@scope (tag)` block per tag carrying the components layer). Empty/absent skips the face. Package-island apps derive this from the package manifest.; injectDsdLinks?: boolean (可选) — Whether the bundle link is also injected into every DSD shadow template (seam 2's shadow adoption). Default `false`: the compiled claim requires the DSD template's children to equal the Part Program's own nodes (the

packages/router/src/vite/preset-tailwind.ts:241
resolveTailwindPresetOptions@openelement/router · ./vitefunctionpublic

Normalize `tailwind: true` / object / undefined into resolved options.

(option: boolean | TailwindPresetOptions | undefined): TailwindPresetOptions | undefined

packages/router/src/vite/preset-tailwind.ts:110
scopePresetComponentCss@openelement/router · ./vitefunctionpublic

Rewrite a component-face stylesheet for light-DOM adoption: shadow-only selectors become their light equivalents and the block is scoped to one host tag. Build-layer mirror of the runtime's scopeCompiledLightCss contract (element keeps the runtime instance; this copy serves the SSG asset where no element runtime runs).

(tag: string, css: string): string

packages/router/src/vite/preset-tailwind.ts:231
SpeculationRulesOptions@openelement/router · ./viteinterfacepublic

Speculation Rules configuration for SSG post-processing

SpeculationRulesOptions

prerender?: string[] (可选) — URL patterns to prerender (fully render in background before navigation).; prefetch?: string[] (可选) — URL patterns to prefetch (fetch HTML + resources without rendering).; exclude?: string[] (可选) — URL patterns to exclude from both prefetch and prerender.; eagerness?: "immediate" | "moderate" | "conservative" (可选) — Eagerness level for prerender rules.

packages/protocol/src/ssg.ts:392
SsgBehaviorOptions@openelement/router · ./viteinterfacepublic

User-facing SSG build behavior switches (OpenElementOptions['ssg']).

SsgBehaviorOptions

dynamicRouteFailure?: "fail" | "warn" (可选) — Policy for dynamic-route render failures during SSG. See {@link SsgRenderOptions.dynamicRouteFailure}.

packages/protocol/src/ssg.ts:63
TAILWIND_BUNDLE_ASSET@openelement/router · ./viteconstpublic

The emitted bundle asset names, under the build's `assets/` directory.

"open-tailwind.css"

packages/router/src/vite/preset-tailwind.ts:71
TAILWIND_LAYER_ORDER@openelement/router · ./viteconstpublic

The declared cascade order the bundle compiles into (seam 1).

"@layer theme, base, components, utilities;"

packages/router/src/vite/preset-tailwind.ts:68
TAILWIND_SCOPE_ASSET@openelement/router · ./viteconstpublic

The emitted `@scope` light-DOM face asset, under `assets/`.

"open-tailwind.scope.css"

packages/router/src/vite/preset-tailwind.ts:73
TailwindBundleResult@openelement/router · ./viteinterfacepublic

What one preset bundle compile produced (assets, hrefs, compiled text).

TailwindBundleResult

bundlePath: string (必填) — Absolute path of the compiled bundle asset.; scopePath?: string (可选) — Absolute path of the `@scope` face asset, when emitted.; bundleHref: string (必填) — Public hrefs for the emitted assets (base-joined).; scopeHref?: string (可选); bundleCss: string (必填) — The compiled bundle text (the full-inline prohibition's signature).

packages/router/src/vite/preset-tailwind.ts:270
TailwindPresetOptions@openelement/router · ./viteinterfacepublic

Options for the opt-in Tailwind preset. `tailwind: true` uses every default.

TailwindPresetOptions

theme?: string[] (可选) — Style sources compiled into the bundle's `theme` layer: package CSS specifiers (`@openelement/ui/theme.css`) or app-relative paths. Their `@theme` blocks (and any Tailwind utilities they reference) compile through `@tailwindcss/vite`.; components?: string[] (可选) — Style sources wrapped into `@layer components` — the component-facing token/recipe layer. Also the source of the `@scope` light-DOM face.; scopeTags?: string[] (可选) — Host tags the `@scope` light-DOM face is emitted for (one `@scope (tag)` block per tag carrying the components layer). Empty/absent skips the face. Package-island apps derive this from the package manifest.; injectDsdLinks?: boolean (可选) — Whether the bundle link is also injected into every DSD shadow template (seam 2's shadow adoption). Default `false`: the compiled claim requires the DSD template's children to equal the Part Program's own nodes (the

packages/router/src/vite/preset-tailwind.ts:76
CREATE_INSTALL_TAG@openelement/create · ./install-commandconstpublic

The dist-tag a versionless documented install resolves: npm's scope alias defaults to `latest`, which the 1.0 line rides since the alpha.11 ruling. The exact version is registry truth; the canonical spelling names no tag.

"latest"

packages/create/src/install-command.ts:33
CREATE_NPM_CREATE_SCOPE@openelement/create · ./install-commandconstpublic

The scope `npm create` resolves to {@linkcode CREATE_PACKAGE_SPECIFIER}: npm's initializer alias maps a bare `@scope` (optionally `@scope@<tag>`) to `@scope/create` at the same tag — untagged, at the scope's default dist-tag — so the canonical spelling never repeats the `/create` suffix (owner-verified against npm's init alias rules).

"@openelement"

packages/create/src/install-command.ts:26
CREATE_PACKAGE_SPECIFIER@openelement/create · ./install-commandconstpublic

The npm specifier the generator is published under.

"@openelement/create"

packages/create/src/install-command.ts:17
CREATE_PROJECT_PLACEHOLDER@openelement/create · ./install-commandconstpublic

Placeholder the usage text and the docs use in place of a project name.

"<project-name>"

packages/create/src/install-command.ts:36
createInstallCommand@openelement/create · ./install-commandfunctionpublic

The documented install command shapes, all verified against the published two-bin artifact (bins `openelement-create` and `create-openelement`, both `src/cli.js`; npm 11 / pnpm 12): - canonical: `npm create

(projectName?: string, options?: { tag?: string; }): string

packages/create/src/install-command.ts:59
manifest@openelement/ui · rootconstpublic

The build-time generated package manifest (declarations for every UI component).

OpenElementPackageManifest

packages/ui/src/manifest.ts:15
OpenButton@openelement/ui · rootclasspublic

Button or link control: an `href` property switches the compiled anchor

class OpenButton extends OpenElement

packages/ui/src/open-button.tsx:44
OpenCodeBlock@openelement/ui · rootclasspublic

Code block with a copy button.

class OpenCodeBlock extends OpenElement

packages/ui/src/open-code-block.tsx:30
OpenDialog@openelement/ui · rootclasspublic

Dialog component using native <dialog> element + popover API.

class OpenDialog extends OpenElement

packages/ui/src/open-dialog.tsx:49
OpenDropdown@openelement/ui · rootclasspublic

Popover-API dropdown with CSS Anchor Positioning placement.

class OpenDropdown extends OpenElement

packages/ui/src/open-dropdown.tsx:33
OpenInput@openelement/ui · rootclasspublic

Form-associated text input with a label, an inline error slot, and native

class OpenInput extends OpenElement

packages/ui/src/open-input.tsx:54
OpenThemeToggle@openelement/ui · rootclasspublic

Theme toggle button for dark/light mode: reads and flips the document's

class OpenThemeToggle extends OpenElement

packages/ui/src/open-theme-toggle.tsx:32
readInstanceState@openelement/ui · rootfunctionpublic

Read the host's `key` slot, initializing it with `init()` on first use.

<T>(host: object, key: string, init: () => T): T

packages/ui/src/instance-state.ts:15
registerOpenUi@openelement/ui · rootfunctionpublic

Explicitly register every first-party UI element. Safe to call repeatedly.

(registry?: CustomElementRegistry | undefined): void

define: (name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions) => void (必填) — The **`define()`** method of the CustomElementRegistry interface adds a definition for a custom element to the custom element registry, mapping its name to the constructor which will be used to create it. [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/define); get: (name: string) => CustomElementConstructor (必填) — The **`get()`** method of the CustomElementRegistry interface returns the constructor for a previously-defined custom element. [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/get); getName: (constructor: CustomElementConstructor) => string | null (必填) — The **`getName()`** method of the CustomElementRegistry interface returns the name for a previously-defined custom element. [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/getName); initialize: (root: Node) => void (必填); upgrade: (root: Node) => void (必填) — The **`upgrade()`** method of the CustomElementRegistry interface upgrades all shadow-containing custom elements in a Node subtree, even before they are connected to the main document. [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/upgrade); whenDefined: (name: string) => Promise<CustomElementConstructor> (必填) — The **`whenDefined()`** method of the CustomElementRegistry interface returns a Promise that resolves when the named element is defined. [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/whenDefined)

packages/ui/src/register.ts:21
writeInstanceState@openelement/ui · rootfunctionpublic

Overwrite the host's `key` slot.

(host: object, key: string, value: unknown): void

packages/ui/src/instance-state.ts:26
readInstanceState@openelement/ui · ./instance-statefunctionpublic

Read the host's `key` slot, initializing it with `init()` on first use.

<T>(host: object, key: string, init: () => T): T

packages/ui/src/instance-state.ts:15
writeInstanceState@openelement/ui · ./instance-statefunctionpublic

Overwrite the host's `key` slot.

(host: object, key: string, value: unknown): void

packages/ui/src/instance-state.ts:26
manifest@openelement/ui · ./manifestconstpublic

The build-time generated package manifest (declarations for every UI component).

OpenElementPackageManifest

packages/ui/src/manifest.ts:15
OpenButton@openelement/ui · ./open-buttonclasspublic

Button or link control: an `href` property switches the compiled anchor

class OpenButton extends OpenElement

packages/ui/src/open-button.tsx:44
OpenCodeBlock@openelement/ui · ./open-code-blockclasspublic

Code block with a copy button.

class OpenCodeBlock extends OpenElement

packages/ui/src/open-code-block.tsx:30
OpenDialog@openelement/ui · ./open-dialogclasspublic

Dialog component using native <dialog> element + popover API.

class OpenDialog extends OpenElement

packages/ui/src/open-dialog.tsx:49
OpenDropdown@openelement/ui · ./open-dropdownclasspublic

Popover-API dropdown with CSS Anchor Positioning placement.

class OpenDropdown extends OpenElement

packages/ui/src/open-dropdown.tsx:33
OpenInput@openelement/ui · ./open-inputclasspublic

Form-associated text input with a label, an inline error slot, and native

class OpenInput extends OpenElement

packages/ui/src/open-input.tsx:54
OpenThemeToggle@openelement/ui · ./open-theme-toggleclasspublic

Theme toggle button for dark/light mode: reads and flips the document's

class OpenThemeToggle extends OpenElement

packages/ui/src/open-theme-toggle.tsx:32

05 / 配置选项

应用选项类型,逐成员一行。

由配置入口所校验的应用选项类型渲染而成,因此这张表与真实配置面不可能漂移。嵌套选项组以点号路径呈现;类型列是声明的类型文本。

head.title
string

Document title; defaults to the package.json `name`.

可选
head.description
string

`<meta name="description">` + `og:description`.

可选
head.lang
string

`<html lang>`; defaults to `en`.

可选
head.favicon
string

Site-root-relative favicon path, emitted as `<link rel="icon">`.

可选
head.ogImage
string

`og:image` URL. Absolute (crawlable) or site-root-relative.

可选
head.stylesheets
string[]

External stylesheets linked into `<head>`.

可选
head.scripts
OpenElementHeadScript[]

External scripts emitted into `<head>`; inline code is not accepted here.

可选
ssg.dynamicRouteFailure
"fail" | "warn"

Policy for dynamic-route render failures during SSG. See {@link SsgRenderOptions.dynamicRouteFailure}.

可选
renderer
"native" | "lit"

Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderDsd); 'lit' renders LitElement pages through

可选
routesDir
string

Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.

可选
islandsDir
string

Directory island modules are discovered in. Defaults to `app/islands`.

可选
componentsDir
string

Directory non-route components live in. Defaults to `app/components`.

可选
packageIslands
string[]

Extra package names whose island modules the build admits, e.g. `['@openelement/ui']`.

可选
appShell
AppShellConfig

Application shell declaration; `false` disables the shell, `'default'` uses the built-in one.

可选
layouts
LayoutsConfig

Per-layout shell declarations keyed by layout name.

可选
mode
"ssg"

Build mode. 'ssg' (default) generates static HTML.

可选
headExtras
string

@dangerous injected as-is, only use with controlled content

可选
inject.stylesheets
(string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[]

Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.

可选
inject.scripts
(string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str…

Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.

可选
inject.headFragments
string[]

@dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.

可选
ssr.noExternal
(string | RegExp)[]

可选
island.upgradeStrategy
"load" | "idle" | "visible" | "only" | "none"

可选
build.outDir
string

Output directory for the build artifacts. Defaults to `dist`.

可选
build.manifestBudget
{ islandKB?: number; totalJsKB?: number; pageKB?: number; }

Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.

可选
viewTransition
boolean

Enable the View Transitions API for client navigations. Defaults to true.

可选
speculation
boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; }

Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.

可选
middleware.cors
boolean

Enable the built-in CORS middleware.

可选
middleware.corsOrigin
string | string[]

Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.

可选
middleware.corsOriginModule
string

Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `appShell.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.

可选
middleware.requestId
boolean

Emit and honor a per-request id header.

可选
middleware.logger
boolean

Log each request through the built-in logger.

可选
middleware.securityHeaders
boolean

Attach the built-in security response headers.

可选
middleware.csp
{ policy?: string; nonce?: boolean; reportOnly?: boolean; }

Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.

可选
middleware.use
string[]

Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `appShell.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configur…

可选
criticalAssets.fonts
CriticalFontAsset[]

可选
criticalAssets.styles
(string | CriticalStyleAsset)[]

可选
criticalAssets.stylesheets
(string | CriticalStyleAsset)[]

Alias for styles accepted by config producers.

可选
criticalAssets.inlineScripts
(string | CriticalInlineScriptAsset)[]

可选
criticalAssets.allowExternalRenderBlocking
boolean

Allow intentional external render-blocking styles/scripts.

可选
criticalAssets.allowRenderBlockingExternal
boolean

Alias retained only within this build-side config shape.

可选
criticalAssets.minifyInlineStyles
boolean

Minify inline CSS. Defaults to true.

可选
criticalAssets.origin
string

Origin used to distinguish same-origin and cross-origin absolute URLs.

可选
critical
CriticalAssetsOptions

可选
i18n
OpenElementI18nOptions

可选
tailwind
boolean | TailwindPresetOptions

Opt-in Tailwind preset (alpha9 C2, #1505). `true` or an options object enables the build-layer seams: the compiled `@layer theme, base, components, utilities` bundle asset and the DSD/head link-not-inline emission. Default (absent) keeps the build byte-identical to a preset-less pipeline.

可选

04 / 元素参考

来自编译器 manifest 的 Custom Element。

标签、层级、hydration 策略、属性、事件、插槽与 CSS parts 均来自 @openelement/ui 编译器 manifest——SSR/claim 管线校验所依据的同一份真值。

<open-button>OpenButtondsd-interactiveload

Button or link control: an `href` property switches the compiled anchor

@openelement/ui/open-button
属性variant: string — variant attribute; size: string — size attribute; disabled: boolean = false — disabled attribute; href: string — href attribute; target: string — target attribute; type: string — type attribute事件open-click: CustomEvent — Fired on open-click插槽(default) — Default slotCSS partscontrol — The visible button or anchor element
<open-code-block>OpenCodeBlockdsd-staticidle

Code block with a copy button.

@openelement/ui/open-code-block
属性事件插槽(default) — Default slotCSS partscopy — The copy button
<open-dialog>OpenDialogdsd-interactiveidle实验性

Dialog component using native <dialog> element + popover API.

@openelement/ui/open-dialog
属性open: boolean = false — open attribute; label: string — label attribute事件open-dialog-close: CustomEvent — Fired on open-dialog-close插槽(default) — Default slot; trigger — The 'trigger' slot; footer — The 'footer' slotCSS partsoverlay — The dialog backdrop/element; header — The header bar; close — The close button; body — The content area (<slot>); footer — The optional footer slot
<open-dropdown>OpenDropdowndsd-interactiveload实验性

Popover-API dropdown with CSS Anchor Positioning placement.

@openelement/ui/open-dropdown
属性事件插槽trigger — Control used to toggle the dropdown; (default) — Dropdown contentCSS partstrigger — Trigger wrapper; content — Popover content
<open-input>OpenInputdsd-interactiveload实验性

Form-associated text input with a label, an inline error slot, and native

@openelement/ui/open-input
属性type: string — type attribute; placeholder: string — placeholder attribute; label: string — label attribute; name: string — name attribute; value: string — value attribute; disabled: boolean = false — disabled attribute; required: boolean = false — required attribute; error: string — error attribute事件open-input: CustomEvent<{ value: unknown }> — Fired on open-input; open-change: CustomEvent<{ value: unknown }> — Fired on open-change; open-focus: CustomEvent — Fired on open-focus; open-blur: CustomEvent — Fired on open-blur插槽CSS partswrapper — The outer input-wrapper div; label — The label element; control — The input element; error — The error message small element
<open-theme-toggle>OpenThemeToggledsd-interactiveload

Theme toggle button for dark/light mode: reads and flips the document's

@openelement/ui/open-theme-toggle
属性theme: string — theme attribute事件open:theme-change: CustomEvent<{ theme: unknown }> — Fired on open:theme-change插槽CSS partstoggle — The button element; icon-sun — The sun SVG icon; icon-moon — The moon SVG icon