Skip to content

Commit 2663398

Browse files
grzywaczekgrixu
andauthored
📝 docs: add data doc (#33)
Co-authored-by: Mateusz Gostański <[email protected]>
1 parent 78c89fe commit 2663398

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/data.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Identifier - unique identifier specified by the user, providing its key from TSchema or a function resolving it.
2+
3+
The `ResolveIdentifier` type is intended to specify the type of identifier in the Schema uniquely.
4+
5+
If the identifier has not been specified by the user, the DefaultIdentifier will be returned as a fallback to `string`.
6+
7+
If specified, it must be a key in the Schema or a function generating the identifier. In the case of being a key, the returned identifier will be of the corresponding value type.
8+
9+
If it is a function, the type will match the type returned from the function.
10+
11+
| Identifier | Resolved type |
12+
|------------|--------------------|
13+
| `undefined`| `string` |
14+
| `keyof Schema` | `Schema[key]` |
15+
| `(data: Schema) => Foo` | `Foo` |
16+
17+
The UpdateEntityInput type is used in functions updating data and aims to secure against updating the identifier to ensure data integrity.

0 commit comments

Comments
 (0)