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
| Symbol | What it does | Page |
|---|---|---|
state | Signal-based state you own | Local state |
query | Server data, re-fetched from reactive params | query |
mutation | Server write, triggered explicitly | Mutations |
queryParams | State that lives in the URL query string | queryParams |
asyncProcess | One-off async operation with lifecycle state | asyncProcess |
craftUse | Drives a primitive outside a generator (component field) | Learn 1 |
Not sure which one: Which primitive should I use?
Composition
| Symbol | What it does | Page |
|---|---|---|
craftPipe | Composes several insertions into one | Insertions |
craftYieldRecord | Resolves a record of primitive generators | craftService |
insertStatePipe | Composes several state insertions | Typed insertion pipes |
insertQueryPipe | Composes several query insertions | Typed insertion pipes |
insertMutationPipe | Composes several mutation insertions | Typed insertion pipes |
insertQueryParamsPipe | Composes several queryParams insertions | Typed insertion pipes |
insertAsyncProcessPipe | Composes several asyncProcess insertions | Typed insertion pipes |
craftGen | A standalone tracked generator | Generators |
craftMatch | Exhaustive pattern matching | Pattern matching |
.pipe(...) | Program operators on a craft generator | Program operators |
catchTag, retry | Operators for .pipe(...) | Program operators |
Insertions
| Symbol | What it does | Page |
|---|---|---|
insertSelect | Derives a slice of a primitive | Selecting |
insertEntities | Entity collection storage and updates | Collections |
insertStoragePersister | Persists through the configured storage backend | Persistence |
insertReactOnMutation | Reloads / optimistically patches on a mutation | React on mutation |
insertPaginationPlaceholderData | Placeholder rows while a page loads | Pagination placeholder |
Forms
| Symbol | What it does | Page |
|---|---|---|
insertForm | Derives a form from a state | Forms |
insertFormAttributes | Validators, disable, hidden | Forms |
insertSelectFormTree | Targets a field sub-tree | Nested forms |
insertSubFormField | A nested sub-form | Nested forms |
insertFormSubmit | Wires submission to a mutation | Submitting |
insertNoopTypingAnchor | Type anchor required per field tree | Forms |
cRequired, cEmail, cMin/cMax, cMinLength/cMaxLength, cPattern | Built-in validators | Validators |
cValidate, cAsyncValidate | Custom and async validators | Validators |
Services and DI
| Symbol | What it does | Page |
|---|---|---|
craftService | Declares a named, scoped service | craftService |
toCraftService | Adapts an existing Angular dependency | Integrating |
abstract | Declares a contract with no implementation | Abstract services |
X.OmitInputs | Opts out of a service's input bindings | Public API |
onAppStart | Startup callback owned by a service | App start |
craftLazy | Defers a service's instantiation | Lazy services |
craftRegisterFor | Registry-driven service resolution | Register |
provideCraftTargetWrapper | Wraps craft targets at a provider boundary | Target wrapper |
provideTemplateTrace | Wraps effective template renders | Observability |
provideCraftRouterTrace | Wraps Router events and Craft route stages | Observability |
provideCraftHttpTrace | Wraps CraftHttpClient requests | Observability |
craftAppConfig | Application config with the routing graph | Routing setup |
Routing
| Symbol | What it does | Page |
|---|---|---|
craftRoute, craftRoutes | Declares typed routes and collections | Setup |
ValidateCascadeRoutesFile, CanRun | Compile-time DI check for a routes file | Setup |
RouteCheckedDI | Per-route O(1) variant of the check | Scaling routes |
.withParent, ParentRoutes, assertChildRouteMounts | Pins a child collection to its mount | Scaling routes |
withRetry | Retryable lazy loadComponent / loadChildren | Setup |
provideCraftRouter, provideCraftLoading | Router with craft loading features | Pending UI |
withErrorComponent, withRouteLoadError, withTransitionTimings | Router features | Route load errors |
CraftRouterOutlet | Non-blocking outlet | Pending UI |
craftRouterLink | Type-safe navigation target | Setup |
assertExhaustiveRouteExceptions | Exhaustiveness proof for route exceptions | Exceptions |
Exceptions
| Symbol | What it does | Page |
|---|---|---|
craftException | Creates a declared, typed exception | Exceptions |
craftExceptionHandler | Handles route exceptions | Exceptions |
.exceptions(), .hasException() | Reads a primitive's exceptions by origin | query |
globalError() | Delegates to the global error component | Global error component |
Reactivity
| Symbol | What it does | Page |
|---|---|---|
craftComputed | Tracked computed | craftComputed |
craftEffect | Tracked effect | craftEffect |
craftMethod | A tracked method on a primitive | craftMethod |
source$ | An imperative event source | source$ |
on$ | Binds a method to a source | on$ |
fromEventToSource$ | DOM event → source | fromEventToSource$ |
sourceFromEvent | Event-driven source helper | sourceFromEvent |
afterRecomputation | Runs after a recomputation settles | afterRecomputation |
HTTP and boundaries
| Symbol | What it does | Page |
|---|---|---|
CraftHttpClient | Tracked HTTP client with typed exceptions | query |
browserBoundary | Marks a service as a browser boundary | Browser boundaries |
Console | Yieldable console, overridable for tracing | Observability |
Testing
| Symbol | What it does | Page |
|---|---|---|
setupCraftServiceTestingByRegister | Sets up a service from a full register | Testing services |
setupCraftComponentTestingByRegister | Same, for a component + its GenDeps_* | Testing components |
boundaryOnly | Keeps the graph real, mocks boundaries | Browser boundaries |
mockHttpRequestForRoute | Mocks endpoints for a route | Browser boundaries |
ComponentTemplateOf, ComponentLogicOutputOf, SetupTestComponentTemplate | Resolves component logic and validates a template at compile time | Type-level tests |
TemplateHasElement, TemplateRendersNamedElementWhen, TemplateNamedElementRendersStateWhen, TemplateNamedElementDelegatesToContext, TemplateRenderAvailableActionWhen | Proves what a template renders and uses | Type-level tests |
Expect, Equal | Turns a type-level result into a compile-time assertion | Type-level tests |
Tooling
| Command / rule | What it does | Page |
|---|---|---|
npx craft route add | Scaffolds a typed route | Automation |
npx craft route split | Splits a flat collection | Scaling routes |
npx craft route verify | Verifies route DI, templates and exceptions | Automation |
craft-brand --root src/app | Generates and refreshes GenDeps_* | Brand config |
@craft-ng/dev-tools/eslint-rules | The ESLint rule set | ESLint rules |
| Template migrator | Migrates templates to craft components | Template migrator |