better auto-generated docs for Tldraw and TldrawEditor (#4012)
Simplify the types used by the props of the `Tldraw` and `TldrawEditor` components. This doesn't make the docs perfect, but it makes them quite a bit better than they were.  ### Change Type - [x] `sdk` — Changes the tldraw SDK - [x] `docs` — Changes to the documentation, examples, or templates. - [x] `improvement` — Improving existing features
This commit is contained in:
parent
8ac48877de
commit
4ccac5da96
8 changed files with 147 additions and 108 deletions
|
@ -4,18 +4,28 @@ import { TLAnyBindingUtilConstructor, checkBindings } from './defaultBindings'
|
|||
import { TLAnyShapeUtilConstructor, checkShapesAndAddCore } from './defaultShapes'
|
||||
|
||||
/** @public */
|
||||
export type TLStoreOptions = {
|
||||
export interface TLStoreBaseOptions {
|
||||
/** The initial data for the store. */
|
||||
initialData?: SerializedStore<TLRecord>
|
||||
|
||||
/** The default name for the store. */
|
||||
defaultName?: string
|
||||
id?: string
|
||||
} & (
|
||||
| {
|
||||
shapeUtils?: readonly TLAnyShapeUtilConstructor[]
|
||||
migrations?: readonly MigrationSequence[]
|
||||
bindingUtils?: readonly TLAnyBindingUtilConstructor[]
|
||||
}
|
||||
| { schema?: StoreSchema<TLRecord, TLStoreProps> }
|
||||
)
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export type TLStoreOptions = TLStoreBaseOptions &
|
||||
(
|
||||
| {
|
||||
id?: string
|
||||
shapeUtils?: readonly TLAnyShapeUtilConstructor[]
|
||||
migrations?: readonly MigrationSequence[]
|
||||
bindingUtils?: readonly TLAnyBindingUtilConstructor[]
|
||||
}
|
||||
| {
|
||||
id?: string
|
||||
schema?: StoreSchema<TLRecord, TLStoreProps>
|
||||
}
|
||||
)
|
||||
|
||||
/** @public */
|
||||
export type TLStoreEventInfo = HistoryEntry<TLRecord>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue