API
Réactivité, mouvement, gestes, navigation, les espaces de noms des modules natifs, les globales Web API, la configuration de l'app et chaque type exporté.
État et données asynchrones 12
A signal derived from the signals fn reads: computed on first read, and
again only once one of them changed.
Auto-tracks signals read synchronously and retracks on subsequent updates.
inheritfunctionCalled while a component sets up: the value the nearest component above it
provides for key, or the key's fallback, as a signal its JSX follows.
A value descendants inherit, as a CSS property is inherited.
onCleanupfunctionRegisters fn to run when the component's instance is disposed, without running it on mount.
Runs after a successful native mount; cleaned up and re-run on accepted refresh.
providefunctionCalled while a component sets up: its descendants inherit value for
key.
Loads data for a component once it has mounted, with its progress, result and error as signals and refresh() to load it again.
A signal.
storefunctionA store over initial, which it wraps rather than copies: every path is a
signal.
Makes a Task running work on demand with an abort signal, under a replace or drop policy.
Runs fn when a signal, or what source reads, changes; with immediate,
once at the start too.
Stockage, bases de données et fichiers 5
Use db for structured offline records that need filtering, sorting and reactive counts. Queries return read-only signals that update after table writes.
Read, write and transfer filesnamespaceUse fileSystem for documents, cached downloads and media files in the app sandbox. Use storage or db for structured app state.
Store small secretsnamespaceUse secureStore for tokens or other small string secrets. Use storage or db for general app data; use persisted with secure enabled for a reactive secret.
Save local datanamespaceChoose storage by how the data is used: persisted signals for preferences, typed database tables for collections, string storage for explicit key/value access, and secureStore for secrets.
persistedfunctionA signal whose value survives the app's restarts.
HTTP, URL et API Web 7
Resolves at the response's head; see docs/web-apis.md for what it doesn't do.
global.HeadersvalueNames are case-insensitive and iterate lowercased, sorted.
global.URLvalueWHATWG URL without internationalized domain names; see docs/web-apis.md.
global.URLSearchParamsvalueThe URLSearchParams constructor Kuito's runtime provides, taking a query string, pairs, a record or another instance.
A WebSocket connection, for messages a server pushes to the app as they happen.
Open URLs and handle incoming linksnamespaceOpen external websites or apps, and receive URLs that launched or returned to your app. Use typed routes for navigation between your own screens.
Respond to connectivity changesnamespaceShow an offline hint or defer a large download using the platform network state. Always handle the actual request result as well.
Utilitaires JavaScript 13
Makes a signal and cancels whatever it was given to, a fetch or a task, with an optional reason.
Cancels a fetch or other work it is given to; AbortSignal.timeout() makes one that fires after a delay.
Cancels an id from setInterval or setTimeout, which share ids; undefined is ignored.
Cancels an id from setTimeout or setInterval, which share ids; undefined is ignored.
Every entry reaches the LogBox and the kuito dev terminal; see docs/logbox.md.
The platform's CSPRNG, with getRandomValues and randomUUID; no SubtleCrypto.
now() is milliseconds since the app's JS runtime started, on a monotonic clock.
Runs callback in the microtask queue, before the next task.
Shares ids with setTimeout: clearTimeout and clearInterval cancel either.
global.setTimeoutfunctionRuns callback with args after delay milliseconds and returns an id clearTimeout cancels.
Deep copy with cycles; functions and symbols throw a DataCloneError.
global.TextDecodervalueUTF-8 only; invalid bytes decode as U+FFFD.
global.TextEncodervalueTurns strings into UTF-8 bytes, for hashing, uploading or writing them.
Mouvement et animation 18
source, kept between min and max.
Keep moving at velocity, slowing down until it stops or meets the clamp.
Start after ms.
Cubic-bezier curves, the same data the CSS compiler emits for transition.
Enters from transparent, leaves to transparent.
interpolatefunctionsource mapped from input to output, piece by piece: numbers, or hex
colors channel by channel.
Stops by percentage, as CSS @keyframes: values for one prop make an
animation, objects of props make an effect.
Create an instance-local motion value during component initialization.
parallelfunctionEffects at once: parallel(a, b) is a.and(b).
Run animation again and again, forever by default.
Create, during component initialization, the motion values a Scroll or a
List moves as it scrolls; give it to one view's motion prop.
One after another.
sheetMotionfunctionCreate, during component initialization, the motion values a Sheet moves; give it to one Sheet's motion prop.
Moves by distance (24 by default) in its direction: slide.up(12) enters
rising 12 into place and leaves rising 12 away.
With a spring; it keeps the velocity of what it interrupts.
staggerfunctionEffects at once, each each ms after the one before.
Along a curve: 300ms ease-in-out by default; a number is the duration.
zoomfunctionGrows from scale (0.85 by default) as it enters, shrinks to it as it leaves.
Gestes 10
A quick swipe in a direction.
longPressfunctionA press held for after milliseconds.
Each in turn: a gesture waits for the ones before it to fail, so
orElse(tap({ count: 2 }), tap()) is a double tap, or else a tap.
A drag; axis keeps it to one direction.
Two fingers apart or together: scale.
The first to activate wins; the others fail.
rotatefunctionTwo fingers turning: rotation, in degrees.
One tap, or count in a row.
All may be active at once: pinch and rotate a photo together.
touchesfunctionRaw touches: where the first finger is (x, y) from the moment it lands.
Dialogues, partage et retours 6
Use the clipboard for user-requested copy and paste actions, such as copying a code or inserting a shared URL.
Add touch feedbacknamespaceUse haptics to confirm selection, communicate success or failure, or reinforce a physical-feeling interaction.
Choose an action with actionSheetfunctionOffer a short list of actions in a system action sheet. Use it for choosing what to do with an item; use ContextMenu when the actions should be attached to a long-press target.
Ask for confirmation with alert and promptfunctionShow a system alert for a decision that interrupts the current task. Use prompt for a short text response; use a screen or Sheet for a larger form.
promptfunctionShows an alert with a text field (docs/alert.md) and resolves with the button the user picked and what they typed, or null when they dismissed it.
Share content with another appfunctionOpen the platform share sheet for text, URLs or a file. Use it when the user chooses where content should go.
Caméra, audio et vidéo 7
Use a native audio player for music, podcasts or sound clips, and a recorder for voice notes. Playback and recording expose reactive state and native motion clocks.
fontsnamespaceLoads font files at run time, for families the app does not bundle through kuito.config.ts.
Works with the images an Image shows, ahead of showing them.
Pick or capture medianamespaceUse the system media picker when the user should select a photo or video. Use capture for the system camera UI; use Camera for an embedded preview you control.
cameraReffunctionMakes a CameraRef while a component sets up: a Camera ref whose ready and error signals follow the view's events.
Creates a VideoRef while a component sets up: a Video ref with playback state signals and time/duration motion values.
Creates a WebViewRef while a component sets up: a WebView ref with url, title, loading and history signals.
Autorisations, localisation et notifications 4
Ask the operating system to run occasional work while your app is not in front. Use it for opportunistic sync or maintenance, not an exact timer.
Find and follow the device locationnamespaceRequest a position for nearby results, follow movement on an active screen, or register background updates for a feature that needs them.
Schedule and receive notificationsnamespaceUse local notifications for reminders and iOS remote push for server-originated updates. A notification can open a specific screen through its URL.
Request device permissionsnamespaceCheck access before a feature needs it, explain why it helps, and handle denial without trapping the user. Use the shared permissions API for camera, microphone, photos, location and notifications.
État de l’application et appareil 8
Refresh data when the app becomes active, pause foreground work in the background, and release expendable caches on memory warnings.
Follow light mode and text sizenamespaceRead the system color scheme and font scale. Use these signals when JavaScript behavior must follow appearance; use CSS media queries for most visual styling.
Adjust screen brightnessnamespaceSet app-scoped screen brightness for a reader, scanner or presentation, then restore the system setting when that mode ends.
Read device informationnamespaceUse device metadata for support diagnostics and platform-specific presentation. These fields describe the device and operating system; they are not a stable user identity.
keyboardnamespaceFollows the software keyboard, for layouts and animations that react to it, and dismisses it.
splashnamespaceControls the native launch screen: keep it up while the app loads, hide it, or pick the look of the next launch.
Adapt to the windownamespaceRead the current window size, insets, orientation and width class. Use these signals for behavior that depends on available space.
Keep a foreground screen awakefunctionPrevent automatic display sleep for an active reader, navigation session or presentation.
Accessibilité et langues 2
Adapts the app to assistive technology: whether a screen reader runs or the user prefers reduced motion, and speaking or moving focus for them.
Translate messages and respect localenamespaceUse localization for the user’s language order, calendars and clock preferences. Use message catalogs for UI strings and Intl for numbers and dates.
Éléments, événements et styles 4
An event an app makes and dispatches through a view's element, with a payload of its own, for signalling between components without props.
platformvalue'ios' or 'android', fixed when the app is compiled: each platform gets
its own bundle, and a branch on platform for the other one is dropped
from it (docs/styles.md#platforms
Makes a stable ElementRef to a native view while a component sets up; current holds the handle.
Compiler-only StyleX-inspired declarations: each named style becomes a class name, its variants picked by data attributes in the class list, `class={[sheet.card, { size: 'large' }]
Étendre avec du code natif 5
A native module: name is what Swift and Kotlin implement as <name>Spec.
Declares an event the platform sends while JavaScript listens:
levelChanged: event<{ level: number }>().
Declares a module function and the thread it runs on: fn.sync<() => number>().
Declares platform state an app reads as a signal: level: live<number>().
Declares the view a module contributes, rendered in JSX:
view: view<SliderProps>({ events: ['change'] }).
Configuration de l'app 4
The UIBackgroundModes values ios.backgroundModes accepts, from audio and location to push-to-talk.
Checks value is Info.plist data; fail reports the key at fault.
The config file exported, for environment: what it declares is
untrusted until here.
The shells' own behavior: a setting left at its default writes nothing.
Tester et déboguer 14
Moves the test's clock on by ms: timers fire and animations step, a frame at a time.
Node's strict assertions, typed for a Kuito test file, for checking what the app shows and did.
tests.choosefunctionPicks a moment in the DatePicker view is, or an option or item by its label in a Select, SegmentedControl or ContextMenu, as a user does.
Runs interaction once the app has settled, settles what it started, and
returns what it cost the main thread in counts (docs/testing.md#cost-budgets):
`(await costOf(() => press(
Groups related tests under one name, as Node's test runner does.
tests.pressfunctionTaps view, or the Pressable, Button or Toggle it is in.
Renders tree (<App />) as the screen's only root, with the platform
options describe, and resolves once the app has settled: its requests
answered, its timers due now run and
Replays a recording a device saved on the headless host, for a golden test that the layout still matches the device's.
tests.screenvalueQueries over what the last render shows.
tests.scrollfunctionScrolls the Scroll or list view is in to offset, in points.
Declares one test, as Node's test runner does, run by kuito test on the headless host.
A view of the headless tree, as a query finds it.
tests.typefunctionTypes text into the TextField view is.
Queries over the views inside view.