Type Alias: BaseComponentProps<P>
API / @xmachines/play-dom / BaseComponentProps
type BaseComponentProps<P> = object;Defined in: @xmachines/json-render-dom
Catalog-agnostic component props type.
Use this when building shared component libraries that should not be tied to
a specific catalog instance. Mirrors BaseComponentProps<P> from
@xmachines/json-render-react, /vue, /svelte.
Example
import type { BaseComponentProps } from "@xmachines/json-render-dom";
function MyButton({ props, emit }: BaseComponentProps<{ label: string }>) { const el = document.createElement("button"); el.textContent = props.label; el.addEventListener("click", () => emit("click")); return el;}Type Parameters
| Type Parameter | Default type |
|---|---|
P extends Record<string, unknown> | Record<string, unknown> |
Properties
bindings
bindings: Record<string, string> | undefined;Defined in: @xmachines/json-render-dom
children
children: Node[];Defined in: @xmachines/json-render-dom
ctx
ctx: DomRenderContext;Defined in: @xmachines/json-render-dom
emit
emit: (event) => void;Defined in: @xmachines/json-render-dom
Parameters
| Parameter | Type |
|---|---|
event | string |
Returns
void
on
on: (event) => EventHandle;Defined in: @xmachines/json-render-dom
Parameters
| Parameter | Type |
|---|---|
event | string |
Returns
props
props: P;Defined in: @xmachines/json-render-dom