createRecordType
Public function
Create a record type.
Example
const Book = createRecordType<Book>('book')
Signature
function createRecordType<R extends UnknownRecord>(
typeName: R['typeName'],
config: {
ephemeralKeys?: {
readonly [K in Exclude<keyof R, 'id' | 'typeName'>]: boolean
}
scope: RecordScope
validator?: StoreValidator<R>
}
): RecordType<R, keyof Omit<R, 'id' | 'typeName'>>
Parameters
Name | Description |
---|---|
|
The name of the type to create. |
|
|
Returns
RecordType<R, keyof Omit<R, 'id' | 'typeName'>>
References
UnknownRecord, StoreValidator, RecordType
Source