Skip to content

API index

Every documented export, with the page that covers it. Use Ctrl/+F.

For an explanation rather than a lookup, start from the Guide.

Primitives

SymbolWhat it doesPage
stateSignal-based state you ownLocal state
queryServer data, re-fetched from reactive paramsquery
mutationServer write, triggered explicitlyMutations
queryParamsState that lives in the URL query stringqueryParams
asyncProcessOne-off async operation with lifecycle stateasyncProcess
craftUseDrives a primitive outside a generator (component field)Learn 1

Not sure which one: Which primitive should I use?

Composition

SymbolWhat it doesPage
craftPipeComposes several insertions into oneInsertions
craftYieldRecordResolves a record of primitive generatorscraftService
insertStatePipeComposes several state insertionsTyped insertion pipes
insertQueryPipeComposes several query insertionsTyped insertion pipes
insertMutationPipeComposes several mutation insertionsTyped insertion pipes
insertQueryParamsPipeComposes several queryParams insertionsTyped insertion pipes
insertAsyncProcessPipeComposes several asyncProcess insertionsTyped insertion pipes
craftGenA standalone tracked generatorGenerators
craftMatchExhaustive pattern matchingPattern matching
.pipe(...)Program operators on a craft generatorProgram operators
catchTag, retryOperators for .pipe(...)Program operators

Insertions

SymbolWhat it doesPage
insertSelectDerives a slice of a primitiveSelecting
insertEntitiesEntity collection storage and updatesCollections
insertStoragePersisterPersists through the configured storage backendPersistence
insertReactOnMutationReloads / optimistically patches on a mutationReact on mutation
insertPaginationPlaceholderDataPlaceholder rows while a page loadsPagination placeholder

Forms

SymbolWhat it doesPage
insertFormDerives a form from a stateForms
insertFormAttributesValidators, disable, hiddenForms
insertSelectFormTreeTargets a field sub-treeNested forms
insertSubFormFieldA nested sub-formNested forms
insertFormSubmitWires submission to a mutationSubmitting
insertNoopTypingAnchorType anchor required per field treeForms
cRequired, cEmail, cMin/cMax, cMinLength/cMaxLength, cPatternBuilt-in validatorsValidators
cValidate, cAsyncValidateCustom and async validatorsValidators

Services and DI

SymbolWhat it doesPage
craftServiceDeclares a named, scoped servicecraftService
toCraftServiceAdapts an existing Angular dependencyIntegrating
abstractDeclares a contract with no implementationAbstract services
X.OmitInputsOpts out of a service's input bindingsPublic API
onAppStartStartup callback owned by a serviceApp start
craftLazyDefers a service's instantiationLazy services
craftRegisterForRegistry-driven service resolutionRegister
provideCraftTargetWrapperWraps craft targets at a provider boundaryTarget wrapper
provideTemplateTraceWraps effective template rendersObservability
provideCraftRouterTraceWraps Router events and Craft route stagesObservability
provideCraftHttpTraceWraps CraftHttpClient requestsObservability
craftAppConfigApplication config with the routing graphRouting setup

Routing

SymbolWhat it doesPage
craftRoute, craftRoutesDeclares typed routes and collectionsSetup
ValidateCascadeRoutesFile, CanRunCompile-time DI check for a routes fileSetup
RouteCheckedDIPer-route O(1) variant of the checkScaling routes
.withParent, ParentRoutes, assertChildRouteMountsPins a child collection to its mountScaling routes
withRetryRetryable lazy loadComponent / loadChildrenSetup
provideCraftRouter, provideCraftLoadingRouter with craft loading featuresPending UI
withErrorComponent, withRouteLoadError, withTransitionTimingsRouter featuresRoute load errors
CraftRouterOutletNon-blocking outletPending UI
craftRouterLinkType-safe navigation targetSetup
assertExhaustiveRouteExceptionsExhaustiveness proof for route exceptionsExceptions

Exceptions

SymbolWhat it doesPage
craftExceptionCreates a declared, typed exceptionExceptions
craftExceptionHandlerHandles route exceptionsExceptions
.exceptions(), .hasException()Reads a primitive's exceptions by originquery
globalError()Delegates to the global error componentGlobal error component

Reactivity

SymbolWhat it doesPage
craftComputedTracked computedcraftComputed
craftEffectTracked effectcraftEffect
craftMethodA tracked method on a primitivecraftMethod
source$An imperative event sourcesource$
on$Binds a method to a sourceon$
fromEventToSource$DOM event → sourcefromEventToSource$
sourceFromEventEvent-driven source helpersourceFromEvent
afterRecomputationRuns after a recomputation settlesafterRecomputation

HTTP and boundaries

SymbolWhat it doesPage
CraftHttpClientTracked HTTP client with typed exceptionsquery
browserBoundaryMarks a service as a browser boundaryBrowser boundaries
ConsoleYieldable console, overridable for tracingObservability

Testing

SymbolWhat it doesPage
setupCraftServiceTestingByRegisterSets up a service from a full registerTesting services
setupCraftComponentTestingByRegisterSame, for a component + its GenDeps_*Testing components
boundaryOnlyKeeps the graph real, mocks boundariesBrowser boundaries
mockHttpRequestForRouteMocks endpoints for a routeBrowser boundaries
ComponentTemplateOf, ComponentLogicOutputOf, SetupTestComponentTemplateResolves component logic and validates a template at compile timeType-level tests
TemplateHasElement, TemplateRendersNamedElementWhen, TemplateNamedElementRendersStateWhen, TemplateNamedElementDelegatesToContext, TemplateRenderAvailableActionWhenProves what a template renders and usesType-level tests
Expect, EqualTurns a type-level result into a compile-time assertionType-level tests

Tooling

Command / ruleWhat it doesPage
npx craft route addScaffolds a typed routeAutomation
npx craft route splitSplits a flat collectionScaling routes
npx craft route verifyVerifies route DI, templates and exceptionsAutomation
craft-brand --root src/appGenerates and refreshes GenDeps_*Brand config
@craft-ng/dev-tools/eslint-rulesThe ESLint rule setESLint rules
Template migratorMigrates templates to craft componentsTemplate migrator