Reintent

@reintent/catalog/internal

For a host adapter (0024): what a host gets for a node of a kind, as a catalog declares it.

Its data with the defaults filled in (KindData), its events as functions of the value the host gives (KindEvents, each an EventSend). implement in @reintent/react types its components by them.

Type Aliases

EventSend

type EventSend<E> = E extends EventDef<infer S> ? [SendParam<S>["value"]] extends [never] ? () => void : true extends SendParam<S>["given"] ? [Exclude<S, {
  send: "action";
  value: z.ZodType;
}>] extends [never] ? (value) => void : (value?) => void : (value?) => void : never;

Defined in: packages/catalog/src/host.ts

What a host sends back for an event of a kind: a function of the value it gives, as the catalog's schema takes it in (a default may be left out). A decide without a value takes one within the event's value; a control's args, when the node leaves them to the host; nothing otherwise.

Type Parameters

Type Parameter
E

KindData

type KindData<D> = PropsOf<D, "out">;

Defined in: packages/catalog/src/host.ts

A kind's data props as a host draws them: the catalog's defaults filled in (0043 §6).

Type Parameters

Type Parameter
D extends KindDef

KindEvents

type KindEvents<D> = { [K in keyof D["events"] as D["events"][K] extends EventDef<Send, false> ? K : never]: EventSend<D["events"][K]> } & { [K in keyof D["events"] as D["events"][K] extends EventDef<Send, false> ? never : K]?: EventSend<D["events"][K]> };

Defined in: packages/catalog/src/host.ts

A kind's events as a host gets them: each a send, absent when the node may leave it out.

Type Parameters

Type Parameter
D extends KindDef

Last updated on

Edit on GitHub