Skip to content

Commit

Permalink
[client] Typings: Fix patch() signature not accepting patch instance (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed May 27, 2020
1 parent a201958 commit 77f7539
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/@sanity/client/sanityClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,21 @@ export class Transaction {
delete(documentId: string): this

/**
* Performs a patch on the given document ID. Can either be a builder function, a prepared Patch instance or an object of patch operations.
* Performs a patch on the given document ID. Can either be a builder function or an object of patch operations.
* The operation is added to the current transaction, ready to be commited by `commit()`
*
* @param documentId Document ID to perform the patch operation on
* @param patchOps Operations to perform, or a builder function
*/
patch(documentId: string, patchOps?: PatchBuilder | Patch | PatchOperations): this
patch(documentId: string, patchOps?: PatchBuilder | PatchOperations): this

/**
* Adds the given patch instance to the transaction.
* The operation is added to the current transaction, ready to be commited by `commit()`
*
* @param patch Patch to execute
*/
patch(patch: Patch): this

/**
* Set or gets the ID of this transaction.
Expand Down

0 comments on commit 77f7539

Please sign in to comment.