Skip to content

Commit

Permalink
fix: update types for picker:oauth:* events (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoehnelt authored Feb 15, 2025
1 parent 646d0e2 commit 869690f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,13 @@ by using the component attributes mapped to the corresponding methods of

#### Events

| Name | Type | Description |
| ----------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `picker:oauth:error` | `google.accounts.oauth2.ClientConfigError` | Triggered when an error occurs in the OAuth flow. See the [error guide](https://developers.google.com/identity/oauth2/web/guides/error). |
| `picker:oauth:response` | `google.accounts.oauth2.ClientConfigError` | Triggered when an OAuth flow completes. See the [token model guide](https://developers.google.com/identity/oauth2/web/guides/use-token-model). |
| `picker:canceled` | `google.picker.ResponseObject` | Triggered when the user cancels the picker dialog. See [`ResponseObject`](https://developers.google.com/drive/picker/reference/picker.responseobject). |
| `picker:picked` | `google.picker.ResponseObject` | Triggered when the user picks one or more items. See [`ResponseObject`](https://developers.google.com/drive/picker/reference/picker.responseobject). |
| `picker:error` | `google.picker.ResponseObject` | Triggered when an error occurs. See [`ResponseObject`](https://developers.google.com/drive/picker/reference/picker.responseobject). |
| Name | Type | Description |
| ----------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `picker:oauth:error` | `google.accounts.oauth2.ClientConfigError\|google.accounts.oauth2.TokenResponse` | Triggered when an error occurs in the OAuth flow. See the [error guide](https://developers.google.com/identity/oauth2/web/guides/error). Note that the `TokenResponse` object can have error fields. |
| `picker:oauth:response` | `google.accounts.oauth2.TokenResponse` | Triggered when an OAuth flow completes. See the [token model guide](https://developers.google.com/identity/oauth2/web/guides/use-token-model). |
| `picker:canceled` | `google.picker.ResponseObject` | Triggered when the user cancels the picker dialog. See [`ResponseObject`](https://developers.google.com/drive/picker/reference/picker.responseobject). |
| `picker:picked` | `google.picker.ResponseObject` | Triggered when the user picks one or more items. See [`ResponseObject`](https://developers.google.com/drive/picker/reference/picker.responseobject). |
| `picker:error` | `google.picker.ResponseObject` | Triggered when an error occurs. See [`ResponseObject`](https://developers.google.com/drive/picker/reference/picker.responseobject). |

#### Slots

Expand Down
6 changes: 3 additions & 3 deletions custom-elements.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@
{
"name": "picker:oauth:error",
"type": {
"text": "google.accounts.oauth2.ClientConfigError"
"text": "google.accounts.oauth2.ClientConfigError|google.accounts.oauth2.TokenResponse"
},
"description": "Triggered when an error occurs in the OAuth flow. See the [error guide](https://developers.google.com/identity/oauth2/web/guides/error)."
"description": "Triggered when an error occurs in the OAuth flow. See the [error guide](https://developers.google.com/identity/oauth2/web/guides/error). Note that the `TokenResponse` object can have error fields."
},
{
"name": "picker:authenticated",
Expand All @@ -292,7 +292,7 @@
{
"name": "picker:oauth:response",
"type": {
"text": "google.accounts.oauth2.ClientConfigError"
"text": "google.accounts.oauth2.TokenResponse"
},
"description": "Triggered when an OAuth flow completes. See the [token model guide](https://developers.google.com/identity/oauth2/web/guides/use-token-model)."
},
Expand Down
4 changes: 2 additions & 2 deletions src/drive-picker/drive-picker-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ declare global {
* @fires {google.picker.ResponseObject} picker:canceled - Triggered when the user cancels the picker dialog. See [`ResponseObject`](https://developers.google.com/drive/picker/reference/picker.responseobject).
* @fires {google.picker.ResponseObject} picker:picked - Triggered when the user picks one or more items. See [`ResponseObject`](https://developers.google.com/drive/picker/reference/picker.responseobject).
* @fires {google.picker.ResponseObject} picker:error - Triggered when an error occurs. See [`ResponseObject`](https://developers.google.com/drive/picker/reference/picker.responseobject).
* @fires {google.accounts.oauth2.ClientConfigError} picker:oauth:error - Triggered when an error occurs in the OAuth flow. See the [error guide](https://developers.google.com/identity/oauth2/web/guides/error).
* @fires {google.accounts.oauth2.ClientConfigError} picker:oauth:response - Triggered when an OAuth flow completes. See the [token model guide](https://developers.google.com/identity/oauth2/web/guides/use-token-model).
* @fires {google.accounts.oauth2.ClientConfigError|google.accounts.oauth2.TokenResponse} picker:oauth:error - Triggered when an error occurs in the OAuth flow. See the [error guide](https://developers.google.com/identity/oauth2/web/guides/error). Note that the `TokenResponse` object can have error fields.
* @fires {google.accounts.oauth2.TokenResponse} picker:oauth:response - Triggered when an OAuth flow completes. See the [token model guide](https://developers.google.com/identity/oauth2/web/guides/use-token-model).
*
* @slot - The default slot contains View elements to display in the picker.
* Each View element should implement a property `view` of type
Expand Down

0 comments on commit 869690f

Please sign in to comment.