NodeBuilder.node
property · packages/site/src/index.ts:317
readonly node: SiteNode<Route, Surfaced>The node so far: frozen, usable for targets and hrefs at any stage.
Site / foldkit-site
interface · packages/site/src/index.ts:312
interface NodeBuilder<
Route extends {
readonly _tag: string
},
Surfaced extends string = never,
> {
readonly node: SiteNode<Route, Surfaced>
pipe<A>(fn: (builder: NodeBuilder<Route, Surfaced>) => A): A
title(title: (route: Route) => string): NodeBuilder<Route, Surfaced>
section(section: string): NodeBuilder<Route, Surfaced>
landing(landing: Omit<Route, '_tag'>): NodeBuilder<Route, Surfaced>
shortcut(shortcut: KeySequence): NodeBuilder<Route, Surfaced>
history(
history: HistoryIntent | ((prev: Route, next: Route) => HistoryIntent),
): NodeBuilder<Route, Surfaced>
layout(layout: NodeLayout): NodeBuilder<Route, Surfaced>
view(view: NodeView): NodeBuilder<Route, Surfaced>
meta<Model = any>(meta: NodeMeta<Route, Model>): NodeBuilder<Route, Surfaced>
indexed(indexed: boolean): NodeBuilder<Route, Surfaced>
access<Who>(access: NodeAccess<Who>): NodeBuilder<Route, Surfaced>
surface<SRoot, SModel, SMessage, SParams, Viewer = void>(
config: NodeSurface<Route, SRoot, SModel, SMessage, SParams, Viewer>,
): NodeBuilder<Route, Route['_tag']>
}A node under construction, from Site.node: each method annotates and
returns the builder, so nodes compose in steps and annotation bundles are
ordinary values. Methods — not pipeable fragments — because each stage of
a pipe is a separate generic call and could not infer the route. Read
.node at any stage for the frozen node so far.
NodeBuilder.nodeproperty · packages/site/src/index.ts:317
readonly node: SiteNode<Route, Surfaced>The node so far: frozen, usable for targets and hrefs at any stage.
NodeBuilder.pipemethod · packages/site/src/index.ts:333
pipe<A>(fn: (builder: NodeBuilder<Route, Surfaced>) => A): AOne named bundle through the builder, Effect-style: the bundle stays generic over the builder it meets, so it instantiates to this node's route with no annotation. Chain for more than one.
const inSection = <R extends { readonly _tag: string }>(b: NodeBuilder<R>) =>
b.section('People').shortcut(['G', 'P'])
const Person = Site.node(personRouter, AppRoute.Person).pipe(inSection).nodeFree pipe(builder, bundle) from effect composes the same way; this
method is the same spelling without the import.
NodeBuilder.titlemethod · packages/site/src/index.ts:335
title(title: (route: Route) => string): NodeBuilder<Route, Surfaced>The page's title for this route, once the route value is known.
NodeBuilder.sectionmethod · packages/site/src/index.ts:337
section(section: string): NodeBuilder<Route, Surfaced>The navigation section this route belongs to.
NodeBuilder.landingmethod · packages/site/src/index.ts:339
landing(landing: Omit<Route, '_tag'>): NodeBuilder<Route, Surfaced>Where the section's nav item points, as this node's params.
NodeBuilder.shortcutmethod · packages/site/src/index.ts:341
shortcut(shortcut: KeySequence): NodeBuilder<Route, Surfaced>The keys that go to this node's landing.
NodeBuilder.historymethod · packages/site/src/index.ts:343
history(
history: HistoryIntent | ((prev: Route, next: Route) => HistoryIntent),
): NodeBuilder<Route, Surfaced>Which history step a move within this node is.
NodeBuilder.layoutmethod · packages/site/src/index.ts:347
layout(layout: NodeLayout): NodeBuilder<Route, Surfaced>A layout wrapping everything under this node.
NodeBuilder.viewmethod · packages/site/src/index.ts:349
view(view: NodeView): NodeBuilder<Route, Surfaced>What this node draws for its own route.
NodeBuilder.metamethod · packages/site/src/index.ts:351
meta<Model = any>(meta: NodeMeta<Route, Model>): NodeBuilder<Route, Surfaced>What this node says of itself in the head, from its route and the Model.
NodeBuilder.indexedmethod · packages/site/src/index.ts:353
indexed(indexed: boolean): NodeBuilder<Route, Surfaced>Whether search engines index this node and the nodes below it.
NodeBuilder.accessmethod · packages/site/src/index.ts:355
access<Who>(access: NodeAccess<Who>): NodeBuilder<Route, Surfaced>Who may be shown this node and the nodes below it, and where anyone else goes.
NodeBuilder.surfacemethod · packages/site/src/index.ts:357
surface<SRoot, SModel, SMessage, SParams, Viewer = void>(
config: NodeSurface<Route, SRoot, SModel, SMessage, SParams, Viewer>,
): NodeBuilder<Route, Route['_tag']>The Surface this route activates, and the viewer its params read, if any.