Skip to content

Commit

Permalink
Comments (155)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Nov 13, 2024
1 parent 327abcf commit 4e3358c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/dh/dhc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ declare global {
}
}

/**
* Download the DH Core jsapi from a running server and return the `dh` object.
* @param serverUrl URL of the DH Core server to download the api from.
* @param storageDir Directory to store downloaded jsapi files.
* @returns A promise that resolves to the DH Core jsapi.
*/
export async function getDhc(
serverUrl: URL,
storageDir: string
Expand Down
12 changes: 11 additions & 1 deletion src/dh/dhe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ declare global {
const iris: DheType;
}

/**
* Download the DHE jsapi from a running server and return the global `iris` object.
* @param serverUrl URL of the DHE server to download the api from.
* @param storageDir Directory to store downloaded jsapi files.
* @returns A promise that resolves to the DHE jsapi.
*/
export async function getDhe(
serverUrl: URL,
storageDir: string
Expand Down Expand Up @@ -277,8 +283,12 @@ export async function getWorkerInfoFromQuery(
};
}

/**
* Polyfill some things needed by the DHE jsapi. The need for this should go
* away once DH-17942 is completed and the jsapi no longer relies on `window`
* or `self`.
*/
export function polyfillDhe(): void {
// These will eventually not be needed once JSAPI is updated to not rely on `window` and `self`.
// @ts-ignore
globalThis.self = globalThis;
// @ts-ignore
Expand Down

0 comments on commit 4e3358c

Please sign in to comment.