@molecule/app-react-native 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -72
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-10-
|
|
6
|
+
Generated: 2026-10-26T04:14:39.672Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-react-native
|
|
@@ -1959,7 +1959,10 @@ Pass the same generics the client was created with —
|
|
|
1959
1959
|
the app's own fields.
|
|
1960
1960
|
|
|
1961
1961
|
```typescript
|
|
1962
|
-
function useAuthClient
|
|
1962
|
+
function useAuthClient<
|
|
1963
|
+
T = unknown,
|
|
1964
|
+
TRegister extends RegisterExtraShape<TRegister> = Record<never, never>,
|
|
1965
|
+
>(): AuthClient<T, TRegister>
|
|
1963
1966
|
```
|
|
1964
1967
|
|
|
1965
1968
|
**Returns:** The auth client from context
|
|
@@ -1989,7 +1992,10 @@ call (and `requestBody` receives the same payload). Without it, `register`
|
|
|
1989
1992
|
accepts only the base fields.
|
|
1990
1993
|
|
|
1991
1994
|
```typescript
|
|
1992
|
-
function useAuth
|
|
1995
|
+
function useAuth<
|
|
1996
|
+
T = unknown,
|
|
1997
|
+
TRegister extends RegisterExtraShape<TRegister> = Record<never, never>,
|
|
1998
|
+
>(options?: UseAuthOptions): UseAuthResult<T, TRegister>
|
|
1993
1999
|
```
|
|
1994
2000
|
|
|
1995
2001
|
- `options` — Hook options
|
|
@@ -2001,7 +2007,7 @@ function useAuth(options?: UseAuthOptions): UseAuthResult<T, TRegister>
|
|
|
2001
2007
|
Hook to get just the authenticated user.
|
|
2002
2008
|
|
|
2003
2009
|
```typescript
|
|
2004
|
-
function useUser(): T | null
|
|
2010
|
+
function useUser<T = unknown>(): T | null
|
|
2005
2011
|
```
|
|
2006
2012
|
|
|
2007
2013
|
**Returns:** The authenticated user or null
|
|
@@ -2163,7 +2169,7 @@ wires a form library once (`setProvider` from `@molecule/app-forms`) and
|
|
|
2163
2169
|
every form picks it up. Passing `createForm` overrides that for one form.
|
|
2164
2170
|
|
|
2165
2171
|
```typescript
|
|
2166
|
-
function useForm(options?: UseFormOptions<T>): UseFormResult<T>
|
|
2172
|
+
function useForm<T extends Record<string, unknown>>(options?: UseFormOptions<T>): UseFormResult<T>
|
|
2167
2173
|
```
|
|
2168
2174
|
|
|
2169
2175
|
- `options` — Form options. `defaultValues`, `mode` and the form-level `validate` are forwarded to the provider; omit the options entirely for a form whose fields are registered with their own defaults.
|
|
@@ -2175,7 +2181,10 @@ function useForm(options?: UseFormOptions<T>): UseFormResult<T>
|
|
|
2175
2181
|
Hook to watch a specific field value.
|
|
2176
2182
|
|
|
2177
2183
|
```typescript
|
|
2178
|
-
function useWatch
|
|
2184
|
+
function useWatch<T extends Record<string, unknown>, K extends keyof T>(
|
|
2185
|
+
form: FormController<T>,
|
|
2186
|
+
name: K,
|
|
2187
|
+
): T[K]
|
|
2179
2188
|
```
|
|
2180
2189
|
|
|
2181
2190
|
- `form` — Form controller
|
|
@@ -2188,7 +2197,10 @@ function useWatch(form: FormController<T>, name: K): T[K]
|
|
|
2188
2197
|
Hook to get field-level state.
|
|
2189
2198
|
|
|
2190
2199
|
```typescript
|
|
2191
|
-
function useFieldState
|
|
2200
|
+
function useFieldState<T extends Record<string, unknown>>(
|
|
2201
|
+
form: FormController<T>,
|
|
2202
|
+
name: keyof T,
|
|
2203
|
+
): FieldState<T[keyof T]>
|
|
2192
2204
|
```
|
|
2193
2205
|
|
|
2194
2206
|
- `form` — Form controller
|
|
@@ -2220,7 +2232,7 @@ the client does replace `execute` (it selects a different request) and
|
|
|
2220
2232
|
re-runs such an effect.
|
|
2221
2233
|
|
|
2222
2234
|
```typescript
|
|
2223
|
-
function useHttp(
|
|
2235
|
+
function useHttp<T>(
|
|
2224
2236
|
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',
|
|
2225
2237
|
url: string,
|
|
2226
2238
|
options?: UseHttpOptions<T>,
|
|
@@ -2238,7 +2250,7 @@ function useHttp(
|
|
|
2238
2250
|
Hook for GET requests.
|
|
2239
2251
|
|
|
2240
2252
|
```typescript
|
|
2241
|
-
function useGet(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2253
|
+
function useGet<T>(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2242
2254
|
```
|
|
2243
2255
|
|
|
2244
2256
|
- `url` — Request URL to fetch from.
|
|
@@ -2251,7 +2263,7 @@ function useGet(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
|
2251
2263
|
Hook for POST requests.
|
|
2252
2264
|
|
|
2253
2265
|
```typescript
|
|
2254
|
-
function usePost(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2266
|
+
function usePost<T>(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2255
2267
|
```
|
|
2256
2268
|
|
|
2257
2269
|
- `url` — Request URL to post to.
|
|
@@ -2264,7 +2276,7 @@ function usePost(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
|
2264
2276
|
Hook for PUT requests.
|
|
2265
2277
|
|
|
2266
2278
|
```typescript
|
|
2267
|
-
function usePut(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2279
|
+
function usePut<T>(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2268
2280
|
```
|
|
2269
2281
|
|
|
2270
2282
|
- `url` — Request URL to send the PUT request to.
|
|
@@ -2277,7 +2289,7 @@ function usePut(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
|
2277
2289
|
Hook for PATCH requests.
|
|
2278
2290
|
|
|
2279
2291
|
```typescript
|
|
2280
|
-
function usePatch(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2292
|
+
function usePatch<T>(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2281
2293
|
```
|
|
2282
2294
|
|
|
2283
2295
|
- `url` — Request URL to send the PATCH request to.
|
|
@@ -2290,7 +2302,7 @@ function usePatch(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
|
2290
2302
|
Hook for DELETE requests.
|
|
2291
2303
|
|
|
2292
2304
|
```typescript
|
|
2293
|
-
function useDelete(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2305
|
+
function useDelete<T>(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2294
2306
|
```
|
|
2295
2307
|
|
|
2296
2308
|
- `url` — Request URL of the resource to delete.
|
|
@@ -2353,7 +2365,7 @@ no separate `useRegister` hook. Use `usePromise(register)` when the form
|
|
|
2353
2365
|
needs the same pending/error tracking as this login hook.
|
|
2354
2366
|
|
|
2355
2367
|
```typescript
|
|
2356
|
-
function useLogin(): UseLoginReturn<T>
|
|
2368
|
+
function useLogin<T = unknown>(): UseLoginReturn<T>
|
|
2357
2369
|
```
|
|
2358
2370
|
|
|
2359
2371
|
**Returns:** Login state and action
|
|
@@ -2448,7 +2460,7 @@ the clean baseline; edits made while saving remain dirty. No request is made
|
|
|
2448
2460
|
for a patch with no fields. A failed request retains the edits and shared user.
|
|
2449
2461
|
|
|
2450
2462
|
```typescript
|
|
2451
|
-
function useProfileForm(
|
|
2463
|
+
function useProfileForm<TUser, TValues extends Record<string, unknown>>(
|
|
2452
2464
|
options: UseProfileFormOptions<TUser, TValues>,
|
|
2453
2465
|
): UseProfileFormResult<TUser, TValues>
|
|
2454
2466
|
```
|
|
@@ -2506,7 +2518,7 @@ function useLocation(): RouteLocation
|
|
|
2506
2518
|
Hook to get route parameters.
|
|
2507
2519
|
|
|
2508
2520
|
```typescript
|
|
2509
|
-
function useParams(): T
|
|
2521
|
+
function useParams<T extends Record<string, string> = RouteParams>(): T
|
|
2510
2522
|
```
|
|
2511
2523
|
|
|
2512
2524
|
**Returns:** The current route parameters
|
|
@@ -2516,7 +2528,7 @@ function useParams(): T
|
|
|
2516
2528
|
Hook to get query parameters.
|
|
2517
2529
|
|
|
2518
2530
|
```typescript
|
|
2519
|
-
function useQuery(): T
|
|
2531
|
+
function useQuery<T extends QueryParams = QueryParams>(): T
|
|
2520
2532
|
```
|
|
2521
2533
|
|
|
2522
2534
|
**Returns:** The current query parameters
|
|
@@ -2549,7 +2561,10 @@ function useIsActive(path: string, exact?: boolean): boolean
|
|
|
2549
2561
|
Hook for user registration with async state tracking.
|
|
2550
2562
|
|
|
2551
2563
|
```typescript
|
|
2552
|
-
function useSignup
|
|
2564
|
+
function useSignup<
|
|
2565
|
+
T = unknown,
|
|
2566
|
+
TRegister extends RegisterExtraShape<TRegister> = Record<never, never>,
|
|
2567
|
+
>(): UseSignupReturn<T, TRegister>
|
|
2553
2568
|
```
|
|
2554
2569
|
|
|
2555
2570
|
**Returns:** Signup state and action
|
|
@@ -2569,7 +2584,10 @@ function useStorageProvider(): StorageProvider
|
|
|
2569
2584
|
Hook to manage a single storage value with React state sync.
|
|
2570
2585
|
|
|
2571
2586
|
```typescript
|
|
2572
|
-
function useStorageValue
|
|
2587
|
+
function useStorageValue<T>(
|
|
2588
|
+
key: string,
|
|
2589
|
+
options?: UseStorageValueOptions<T>,
|
|
2590
|
+
): UseStorageValueResult<T>
|
|
2573
2591
|
```
|
|
2574
2592
|
|
|
2575
2593
|
- `key` — Storage key
|
|
@@ -2621,7 +2639,7 @@ the state context. A store minted outside the `state` bond — the direct
|
|
|
2621
2639
|
therefore as valid here as one `@molecule/app-state`'s `createStore()` made.
|
|
2622
2640
|
|
|
2623
2641
|
```typescript
|
|
2624
|
-
function useStore(store: Store<T>, options?: UseStoreOptions<T, S>): S
|
|
2642
|
+
function useStore<T, S = T>(store: Store<T>, options?: UseStoreOptions<T, S>): S
|
|
2625
2643
|
```
|
|
2626
2644
|
|
|
2627
2645
|
- `store` — The store to subscribe to
|
|
@@ -2634,7 +2652,7 @@ function useStore(store: Store<T>, options?: UseStoreOptions<T, S>): S
|
|
|
2634
2652
|
Hook to get the store's setState function.
|
|
2635
2653
|
|
|
2636
2654
|
```typescript
|
|
2637
|
-
function useSetStore(store: Store<T>):
|
|
2655
|
+
function useSetStore<T>(store: Store<T>): Store<T>['setState']
|
|
2638
2656
|
```
|
|
2639
2657
|
|
|
2640
2658
|
- `store` — The store to get setState from
|
|
@@ -2646,7 +2664,7 @@ function useSetStore(store: Store<T>): (partial: Partial<T> | ((state: T) => Par
|
|
|
2646
2664
|
Hook to create a bound action for a store.
|
|
2647
2665
|
|
|
2648
2666
|
```typescript
|
|
2649
|
-
function useStoreAction(
|
|
2667
|
+
function useStoreAction<T, Args extends unknown[], R>(
|
|
2650
2668
|
store: Store<T>,
|
|
2651
2669
|
action: (setState: Store<T>['setState'], getState: Store<T>['getState']) => (...args: Args) => R,
|
|
2652
2670
|
): (...args: Args) => R
|
|
@@ -2702,7 +2720,7 @@ function useThemeMode(): 'light' | 'dark'
|
|
|
2702
2720
|
Hook to get theme colors.
|
|
2703
2721
|
|
|
2704
2722
|
```typescript
|
|
2705
|
-
function useThemeColors():
|
|
2723
|
+
function useThemeColors(): Theme['colors']
|
|
2706
2724
|
```
|
|
2707
2725
|
|
|
2708
2726
|
**Returns:** The current theme colors
|
|
@@ -2863,10 +2881,7 @@ function useWorkspace(): UseWorkspaceResult
|
|
|
2863
2881
|
Provider for state management.
|
|
2864
2882
|
|
|
2865
2883
|
```typescript
|
|
2866
|
-
function StateProvider({
|
|
2867
|
-
provider,
|
|
2868
|
-
children,
|
|
2869
|
-
}: StateProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2884
|
+
function StateProvider({ provider, children }: StateProviderProps): React.ReactElement
|
|
2870
2885
|
```
|
|
2871
2886
|
|
|
2872
2887
|
- `props` — Component props (see {@link StateProviderProps}).
|
|
@@ -2878,10 +2893,7 @@ function StateProvider({
|
|
|
2878
2893
|
Provider for authentication.
|
|
2879
2894
|
|
|
2880
2895
|
```typescript
|
|
2881
|
-
function AuthProvider({
|
|
2882
|
-
client,
|
|
2883
|
-
children,
|
|
2884
|
-
}: AuthProviderProps<T>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2896
|
+
function AuthProvider<T = unknown>({ client, children }: AuthProviderProps<T>): React.ReactElement
|
|
2885
2897
|
```
|
|
2886
2898
|
|
|
2887
2899
|
- `props` — Component props (see {@link AuthProviderProps}).
|
|
@@ -2893,10 +2905,7 @@ function AuthProvider({
|
|
|
2893
2905
|
Provider for theming.
|
|
2894
2906
|
|
|
2895
2907
|
```typescript
|
|
2896
|
-
function ThemeProvider({
|
|
2897
|
-
provider,
|
|
2898
|
-
children,
|
|
2899
|
-
}: ThemeProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2908
|
+
function ThemeProvider({ provider, children }: ThemeProviderProps): React.ReactElement
|
|
2900
2909
|
```
|
|
2901
2910
|
|
|
2902
2911
|
- `props` — Component props (see {@link ThemeProviderProps}).
|
|
@@ -2908,10 +2917,7 @@ function ThemeProvider({
|
|
|
2908
2917
|
Provider for routing.
|
|
2909
2918
|
|
|
2910
2919
|
```typescript
|
|
2911
|
-
function RouterProvider({
|
|
2912
|
-
router,
|
|
2913
|
-
children,
|
|
2914
|
-
}: RouterProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2920
|
+
function RouterProvider({ router, children }: RouterProviderProps): React.ReactElement
|
|
2915
2921
|
```
|
|
2916
2922
|
|
|
2917
2923
|
- `props` — Component props (see {@link RouterProviderProps}).
|
|
@@ -2923,10 +2929,7 @@ function RouterProvider({
|
|
|
2923
2929
|
Provider for internationalization.
|
|
2924
2930
|
|
|
2925
2931
|
```typescript
|
|
2926
|
-
function I18nProvider({
|
|
2927
|
-
provider,
|
|
2928
|
-
children,
|
|
2929
|
-
}: I18nProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2932
|
+
function I18nProvider({ provider, children }: I18nProviderProps): React.ReactElement
|
|
2930
2933
|
```
|
|
2931
2934
|
|
|
2932
2935
|
- `props` — Component props (see {@link I18nProviderProps}).
|
|
@@ -2938,10 +2941,7 @@ function I18nProvider({
|
|
|
2938
2941
|
Provider for HTTP client.
|
|
2939
2942
|
|
|
2940
2943
|
```typescript
|
|
2941
|
-
function HttpProvider({
|
|
2942
|
-
client,
|
|
2943
|
-
children,
|
|
2944
|
-
}: HttpProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2944
|
+
function HttpProvider({ client, children }: HttpProviderProps): React.ReactElement
|
|
2945
2945
|
```
|
|
2946
2946
|
|
|
2947
2947
|
- `props` — Component props (see {@link HttpProviderProps}).
|
|
@@ -2953,10 +2953,7 @@ function HttpProvider({
|
|
|
2953
2953
|
Provider for storage.
|
|
2954
2954
|
|
|
2955
2955
|
```typescript
|
|
2956
|
-
function StorageProvider({
|
|
2957
|
-
provider,
|
|
2958
|
-
children,
|
|
2959
|
-
}: StorageProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2956
|
+
function StorageProvider({ provider, children }: StorageProviderProps): React.ReactElement
|
|
2960
2957
|
```
|
|
2961
2958
|
|
|
2962
2959
|
- `props` — Component props (see {@link StorageProviderProps}).
|
|
@@ -2968,10 +2965,7 @@ function StorageProvider({
|
|
|
2968
2965
|
Provider for logging.
|
|
2969
2966
|
|
|
2970
2967
|
```typescript
|
|
2971
|
-
function LoggerProvider({
|
|
2972
|
-
provider,
|
|
2973
|
-
children,
|
|
2974
|
-
}: LoggerProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2968
|
+
function LoggerProvider({ provider, children }: LoggerProviderProps): React.ReactElement
|
|
2975
2969
|
```
|
|
2976
2970
|
|
|
2977
2971
|
- `props` — Component props (see {@link LoggerProviderProps}).
|
|
@@ -2983,10 +2977,7 @@ function LoggerProvider({
|
|
|
2983
2977
|
Provider for AI chat.
|
|
2984
2978
|
|
|
2985
2979
|
```typescript
|
|
2986
|
-
function ChatProvider({
|
|
2987
|
-
provider,
|
|
2988
|
-
children,
|
|
2989
|
-
}: ChatProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2980
|
+
function ChatProvider({ provider, children }: ChatProviderProps): React.ReactElement
|
|
2990
2981
|
```
|
|
2991
2982
|
|
|
2992
2983
|
- `props` — Component props (see {@link ChatProviderProps}).
|
|
@@ -2998,10 +2989,7 @@ function ChatProvider({
|
|
|
2998
2989
|
Provider for IDE workspace.
|
|
2999
2990
|
|
|
3000
2991
|
```typescript
|
|
3001
|
-
function WorkspaceProvider({
|
|
3002
|
-
provider,
|
|
3003
|
-
children,
|
|
3004
|
-
}: WorkspaceProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2992
|
+
function WorkspaceProvider({ provider, children }: WorkspaceProviderProps): React.ReactElement
|
|
3005
2993
|
```
|
|
3006
2994
|
|
|
3007
2995
|
- `props` — Component props (see {@link WorkspaceProviderProps}).
|
|
@@ -3013,10 +3001,7 @@ function WorkspaceProvider({
|
|
|
3013
3001
|
Provider for code editor.
|
|
3014
3002
|
|
|
3015
3003
|
```typescript
|
|
3016
|
-
function EditorProvider({
|
|
3017
|
-
provider,
|
|
3018
|
-
children,
|
|
3019
|
-
}: EditorProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
3004
|
+
function EditorProvider({ provider, children }: EditorProviderProps): React.ReactElement
|
|
3020
3005
|
```
|
|
3021
3006
|
|
|
3022
3007
|
- `props` — Component props (see {@link EditorProviderProps}).
|
|
@@ -3028,10 +3013,7 @@ function EditorProvider({
|
|
|
3028
3013
|
Provider for live preview.
|
|
3029
3014
|
|
|
3030
3015
|
```typescript
|
|
3031
|
-
function PreviewProvider({
|
|
3032
|
-
provider,
|
|
3033
|
-
children,
|
|
3034
|
-
}: PreviewProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
3016
|
+
function PreviewProvider({ provider, children }: PreviewProviderProps): React.ReactElement
|
|
3035
3017
|
```
|
|
3036
3018
|
|
|
3037
3019
|
- `props` — Component props (see {@link PreviewProviderProps}).
|
|
@@ -3063,7 +3045,7 @@ function MoleculeProvider({
|
|
|
3063
3045
|
workspace,
|
|
3064
3046
|
editor,
|
|
3065
3047
|
preview,
|
|
3066
|
-
}: MoleculeProviderProps): React.ReactElement
|
|
3048
|
+
}: MoleculeProviderProps): React.ReactElement
|
|
3067
3049
|
```
|
|
3068
3050
|
|
|
3069
3051
|
- `props` — Component props (see {@link MoleculeProviderProps}) — each service is optional, and ONLY the services passed are provided to the tree.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-react-native",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "React Native framework bindings for molecule.dev",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-react-native",
|
|
6
6
|
"type": "module",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"directory": "packages/app/frameworks/react-native"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@molecule/app-react": "2.0.
|
|
36
|
+
"@molecule/app-react": "2.0.1",
|
|
37
37
|
"@types/node": "26.6.5",
|
|
38
38
|
"react": "19.3.1",
|
|
39
39
|
"typescript": "6.0.3",
|