Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entity-aware type signature for getEntityRecord and getEntityRecords #41235

Merged
merged 9 commits into from
Jun 4, 2022
112 changes: 56 additions & 56 deletions docs/reference-guides/data/data-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ _Parameters_
- _state_ `State`: Data state.
- _action_ `string`: Action to check. One of: 'create', 'read', 'update', 'delete'.
- _resource_ `string`: REST resource to check, e.g. 'media' or 'posts'.
- _id_ `RecordKey`: Optional ID of the rest resource to check.
- _id_ `GenericRecordKey`: Optional ID of the rest resource to check.

_Returns_

Expand All @@ -39,9 +39,9 @@ Calling this may trigger an OPTIONS request to the REST API via the
_Parameters_

- _state_ `State`: Data state.
- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _recordId_ `RecordKey`: Record's id.
- _kind_ `Kind`: Entity kind.
- _name_ `Name`: Entity name.
- _recordId_ `GenericRecordKey`: Record's id.

_Returns_

Expand Down Expand Up @@ -70,8 +70,8 @@ _Parameters_

- _state_ `State`: State tree.
- _postType_ `string`: The type of the parent post.
- _postId_ `RecordKey`: The id of the parent post.
- _authorId_ `RecordKey`: The id of the author.
- _postId_ `GenericRecordKey`: The id of the parent post.
- _authorId_ `GenericRecordKey`: The id of the author.

_Returns_

Expand All @@ -88,7 +88,7 @@ _Parameters_

- _state_ `State`: State tree.
- _postType_ `string`: The type of the parent post.
- _postId_ `RecordKey`: The id of the parent post.
- _postId_ `GenericRecordKey`: The id of the parent post.

_Returns_

Expand Down Expand Up @@ -149,9 +149,9 @@ Returns the specified entity record, merged with its edits.
_Parameters_

- _state_ `State`: State tree.
- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _recordId_ `RecordKey`: Record ID.
- _kind_ `K`: Entity kind.
- _name_ `N`: Entity name.
- _recordId_ `KeyOf< K, N >`: Record ID.

_Returns_

Expand Down Expand Up @@ -179,7 +179,7 @@ Returns the loaded entities for the given kind.
_Parameters_

- _state_ `State`: Data state.
- _kind_ `string`: Entity kind.
- _kind_ `Kind`: Entity kind.

_Returns_

Expand All @@ -192,7 +192,7 @@ Returns the loaded entities for the given kind.
_Parameters_

- _state_ `State`: Data state.
- _kind_ `string`: Entity kind.
- _kind_ `Kind`: Entity kind.

_Returns_

Expand All @@ -207,8 +207,8 @@ Returns the entity config given its kind and name.
_Parameters_

- _state_ `State`: Data state.
- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _kind_ `Kind`: Entity kind.
- _name_ `Name`: Entity name.

_Returns_

Expand All @@ -221,8 +221,8 @@ Returns the entity config given its kind and name.
_Parameters_

- _state_ `State`: Data state.
- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _kind_ `Kind`: Entity kind.
- _name_ `Name`: Entity name.

_Returns_

Expand All @@ -237,14 +237,14 @@ entity object if it exists and is received.
_Parameters_

- _state_ `State`: State tree
- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _key_ `RecordKey`: Record's key
- _query_ `EntityQuery< any >`: Optional query.
- _kind_ `K`: Entity kind.
- _name_ `N`: Entity name.
- _key_ `KeyOf< R >`: Record's key
- _query_ Optional query.

_Returns_

- `EntityRecord | undefined`: Record.
- Record.

### getEntityRecordEdits

Expand All @@ -253,9 +253,9 @@ Returns the specified entity record's edits.
_Parameters_

- _state_ `State`: State tree.
- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _recordId_ `RecordKey`: Record ID.
- _kind_ `K`: Entity kind.
- _name_ `N`: Entity name.
- _recordId_ `KeyOf< K, N >`: Record ID.

_Returns_

Expand All @@ -272,9 +272,9 @@ They are defined in the entity's config.
_Parameters_

- _state_ `State`: State tree.
- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _recordId_ `RecordKey`: Record ID.
- _kind_ `K`: Entity kind.
- _name_ `N`: Entity name.
- _recordId_ `KeyOf< K, N >`: Record ID.

_Returns_

Expand All @@ -287,13 +287,13 @@ Returns the Entity's records.
_Parameters_

- _state_ `State`: State tree
- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _query_ `EntityQuery< any >`: Optional terms query.
- _kind_ `K`: Entity kind.
- _name_ `N`: Entity name.
- _query_ Optional terms query.

_Returns_

- `Array< EntityRecord > | undefined`: Records.
- Records.

### getLastEntityDeleteError

Expand All @@ -302,9 +302,9 @@ Returns the specified entity record's last delete error.
_Parameters_

- _state_ `State`: State tree.
- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _recordId_ `RecordKey`: Record ID.
- _kind_ `Kind`: Entity kind.
- _name_ `Name`: Entity name.
- _recordId_ `GenericRecordKey`: Record ID.

_Returns_

Expand All @@ -317,9 +317,9 @@ Returns the specified entity record's last save error.
_Parameters_

- _state_ `State`: State tree.
- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _recordId_ `RecordKey`: Record ID.
- _kind_ `Kind`: Entity kind.
- _name_ `Name`: Entity name.
- _recordId_ `GenericRecordKey`: Record ID.

_Returns_

Expand All @@ -333,9 +333,9 @@ with its attributes mapped to their raw values.
_Parameters_

- _state_ `State`: State tree.
- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _key_ `RecordKey`: Record's key.
- _kind_ `K`: Entity kind.
- _name_ `N`: Entity name.
- _key_ `KeyOf< K, N >`: Record's key.

_Returns_

Expand Down Expand Up @@ -421,9 +421,9 @@ and false otherwise.
_Parameters_

- _state_ `State`: State tree.
- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _recordId_ `RecordKey`: Record ID.
- _kind_ `K`: Entity kind.
- _name_ `N`: Entity name.
- _recordId_ `KeyOf< K, N >`: Record ID.

_Returns_

Expand All @@ -437,9 +437,9 @@ or false otherwise.
_Parameters_

- _state_ `State`: State tree
- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _query_ `EntityQuery< any >`: Optional terms query.
- _kind_ `K`: Entity kind.
- _name_ `N`: Entity name.
- _query_ `EntityQuery< C >`: Optional terms query.

_Returns_

Expand All @@ -453,7 +453,7 @@ _Parameters_

- _state_ `State`: State tree.
- _postType_ `string`: The type of the parent post.
- _postId_ `RecordKey`: The id of the parent post.
- _postId_ `GenericRecordKey`: The id of the parent post.

_Returns_

Expand Down Expand Up @@ -492,9 +492,9 @@ Returns true if the specified entity record is autosaving, and false otherwise.
_Parameters_

- _state_ `State`: State tree.
- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _recordId_ `RecordKey`: Record ID.
- _kind_ `Kind`: Entity kind.
- _name_ `Name`: Entity name.
- _recordId_ `GenericRecordKey`: Record ID.

_Returns_

Expand All @@ -507,9 +507,9 @@ Returns true if the specified entity record is deleting, and false otherwise.
_Parameters_

- _state_ `State`: State tree.
- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _recordId_ `RecordKey`: Record ID.
- _kind_ `Kind`: Entity kind.
- _name_ `Name`: Entity name.
- _recordId_ `GenericRecordKey`: Record ID.

_Returns_

Expand Down Expand Up @@ -553,9 +553,9 @@ Returns true if the specified entity record is saving, and false otherwise.
_Parameters_

- _state_ `State`: State tree.
- _kind_ `string`: Entity kind.
- _name_ `string`: Entity name.
- _recordId_ `RecordKey`: Record ID.
- _kind_ `K`: Entity kind.
- _name_ `N`: Entity name.
- _recordId_ `KeyOf< K, N >`: Record ID.

_Returns_

Expand Down
Loading