Usage

Type plain data passed to native code.

tsx
// 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

ts
export type Json =
  | string
  | number
  | boolean
  | null
  | readonly Json[]
  | { readonly [key: string]: Json };

Type

ts
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.