Skip to content

Commit

Permalink
Updates the types of proposed API relying on DOM
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Jan 20, 2025
1 parent a924a45 commit 1d0aa23
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/api.proposed.jupyterSettings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ declare module './api' {
export interface JupyterServerConnectionInformation {
/**
* The `fetch` method to use.
*/
readonly fetch?: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
* The types of the parameters are not defined so as to avoid enforcing the use of `DOM` in `tsconfig.json`.
* The signature of this method matches the `fetch` method in the browser.
* https://developer.mozilla.org/en-US/docs/Web/API/Window/fetch
* fetch(input: RequestInfo, init?: RequestInit) =>Promise<Response>;
*/
readonly fetch?: (input: any, init?: any) => Promise<any>;
/**
* The `WebSocket` object constructor.
* This matches the `WebSocket` object in the browser.
* https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
* `typeof WebSocket`, made `any` so that `DOM` is not required in tsconfig for those not using this.
*/
readonly WebSocket?: typeof WebSocket;
readonly WebSocket?: any;
}
}

0 comments on commit 1d0aa23

Please sign in to comment.