@@ -118,13 +118,8 @@ import React from 'react';
118118import * as UiReact from ' tinybase/ui-react/with-schemas' ;
119119import {createStore } from ' tinybase/with-schemas' ;
120120
121- const tablesSchema = {
122- pets: {species: {type: ' string' }},
123- } as const ;
124- const valuesSchema = {
125- employees: {type: ' number' },
126- open: {type: ' boolean' , default: false },
127- } as const ;
121+ const tablesSchema = {pets: {species: {type: ' string' }}} as const ;
122+ const valuesSchema = {employees: {type: ' number' }} as const ;
128123
129124// Cast the whole module to be schema-based with WithSchemas:
130125const UiReactWithSchemas = UiReact as UiReact .WithSchemas <
@@ -151,17 +146,16 @@ following to explicitly load code and types from different folders:
151146// code
152147import React from ' react' ;
153148import * as UiReact from ' tinybase/ui-react' ;
154- import type {WithSchemas } from ' tinybase/ui-react/with-schemas' ;
155149// types
156- import {TablesSchema , ValuesSchema , createStore } from ' tinybase/with-schemas' ;
150+ import type {WithSchemas } from ' tinybase/ui-react/with-schemas' ;
151+ import type {
152+ TablesSchema ,
153+ ValuesSchema ,
154+ createStore ,
155+ } from ' tinybase/with-schemas' ;
157156
158- const tablesSchema = {
159- pets: {species: {type: ' string' }},
160- } as const ;
161- const valuesSchema = {
162- employees: {type: ' number' },
163- open: {type: ' boolean' , default: false },
164- } as const ;
157+ const tablesSchema = {pets: {species: {type: ' string' }}} as const ;
158+ const valuesSchema = {employees: {type: ' number' }} as const ;
165159
166160const UiReactWithSchemas = UiReact as unknown as WithSchemas <
167161 [typeof tablesSchema , typeof valuesSchema ]
@@ -170,6 +164,29 @@ const UiReactWithSchemas = UiReact as unknown as WithSchemas<
170164// ...
171165```
172166
167+ ## Using the ` omni ` module
168+
169+ You may also need to use the ` unknown as ` cast when using the ` omni ` module,
170+ since it exports both the ui-react module and ui-react-dom module, and you will
171+ need to distinguish them:
172+
173+ ``` tsx yolo
174+ import * as Omni from ' tinybase/omni' ;
175+ import type {
176+ UiReactDomWithSchemas ,
177+ UiReactWithSchemas ,
178+ } from ' tinybase/omni/with-schemas' ;
179+
180+ const tablesSchema = {pets: {species: {type: ' string' }}} as const ;
181+ const valuesSchema = {employees: {type: ' number' }} as const ;
182+ type Schemas = [typeof tablesSchema , typeof valuesSchema ];
183+
184+ const {useCell, useValue} = Omni as unknown as UiReactWithSchemas <Schemas >;
185+ const {EditableCellView} = Omni as unknown as UiReactDomWithSchemas <Schemas >;
186+
187+ // ...
188+ ```
189+
173190## Multiple Stores
174191
175192In the case that you have multiple Store objects with different schemas, you
0 commit comments