Json
What crosses the host boundary as data: JSON values, checked again at run time.
Usage
Type plain data passed to native code.
// Type plain data passed to native code.
import { defineModule, fn, type Json } from 'kuito';
// modules/analytics/analytics.ts: an event's properties cross as JSON,
// checked again on the native side.
export default defineModule('Analytics', {
track: fn.background<(name: string, properties: Json) => Promise<void>>(),
ios: { class: 'AnalyticsModule' },
android: { class: 'com.example.myapp.modules.analytics.AnalyticsModule' },
});Type declaration
export type Json =
| string
| number
| boolean
| null
| readonly Json[]
| { readonly [key: string]: Json };Type
string | number | boolean | readonly Json[] | { readonly [key: string]: Json;}Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.