Define Fiber<I> and Effect<I> types in src/host/fiber.ts
This commit is contained in:
17
src/host/fiber.ts
Normal file
17
src/host/fiber.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export interface Fiber<I> {
|
||||
instance: I;
|
||||
tag: string;
|
||||
props: Record<string, unknown>;
|
||||
key: string | undefined;
|
||||
children: Fiber<I>[];
|
||||
parent: Fiber<I> | null;
|
||||
effect: Effect<I> | null;
|
||||
signalDisposers: (() => void)[];
|
||||
prevProps: Record<string, unknown> | null;
|
||||
}
|
||||
|
||||
export type Effect<I> =
|
||||
| { type: "update"; payload: unknown }
|
||||
| { type: "insert"; before: Fiber<I> | null }
|
||||
| { type: "move"; before: Fiber<I> | null }
|
||||
| { type: "remove" };
|
||||
@@ -19,5 +19,7 @@ export { ValuePointer, selectNode, setNode } from "./core/pointer.js";
|
||||
export { createRoot as createHostRoot } from "./host/config.js";
|
||||
export type { HostConfig, Root } from "./host/config.js";
|
||||
|
||||
export type { Fiber, Effect } from "./host/fiber.js";
|
||||
|
||||
export { TransformRegistry, childCtx, matchesSchema, ctx as transformCtx } from "./transform/registry.js";
|
||||
export type { TransformContext, TransformFn, TransformRule } from "./transform/registry.js";
|
||||
Reference in New Issue
Block a user