Skip to content

Commit

Permalink
added comment about type
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmorris committed Sep 2, 2020
1 parent c9deb85 commit 1f641c3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ type AlertSavedObjectsCreateOptions = Omit<SavedObjectsCreateOptions, 'id' | 'ov
type AlertSavedObjectsUpdateOptions = Omit<SavedObjectsCreateOptions, 'id' | 'overwrite'> &
Pick<Required<SavedObjectsCreateOptions>, 'id' | 'overwrite'>;

/**
* This type ensures that:
* 1. We never accidentally call `update`
* 2. We always specify `overwrite` when call `create` _with_ an `id`.
*/
export type SavedObjectsClientWithoutUpdates = Omit<
SavedObjectsClientContract,
'create' | 'update' | 'bulkUpdate'
Expand Down

0 comments on commit 1f641c3

Please sign in to comment.