Skip to content

Commit 97c512d

Browse files
committed
Fix: initAsync param can be string or URL
Signed-off-by: Danilo Bassi <[email protected]>
1 parent 2cb3d34 commit 97c512d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

index.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ let modPromise = null;
4747
/**
4848
* Loads and instantiates the WASM module asynchronously
4949
*
50-
* @param {URL} url - The URL to fetch the WebAssembly module from
50+
* @param {URL | string} url - The URL to fetch the WebAssembly module from
5151
* @returns {Promise<void>}
5252
*/
5353
async function loadModuleAsync(url) {
@@ -66,7 +66,7 @@ async function loadModuleAsync(url) {
6666
*
6767
* Returns a promise which will resolve once the other methods are ready.
6868
*
69-
* @param {URL} [url] - The URL to fetch the WebAssembly module from. If not provided, a default URL will be used.
69+
* @param {URL | string} [url] - The URL to fetch the WebAssembly module from. If not provided, a default URL will be used.
7070
* @returns {Promise<void>}
7171
*/
7272
async function initAsync(url = defaultURL) {

index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ export * from "./pkg/matrix_sdk_crypto_wasm.js";
4343
* Load the WebAssembly module in the background, if it has not already been loaded.
4444
*
4545
* Returns a promise which will resolve once the other methods are ready.
46-
* @param {URL} [url] - The URL to fetch the WebAssembly module from. If not provided, a default URL will be used.
46+
* @param {URL | string} [url] - The URL to fetch the WebAssembly module from. If not provided, a default URL will be used.
4747
* @returns {Promise<void>}
4848
*/
49-
export declare function initAsync(url?: URL): Promise<void>;
49+
export declare function initAsync(url?: URL | string): Promise<void>;
5050

5151
// The auto-generated typescript definitions are a good start, but could do with tightening up in a lot of areas.
5252
// The following is a manually-curated set of typescript definitions.

index.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ let modPromise = null;
5252
/**
5353
* Loads and instantiates the WASM module asynchronously
5454
*
55-
* @param {URL} url - The URL to fetch the WebAssembly module from
55+
* @param {URL | string} url - The URL to fetch the WebAssembly module from
5656
* @returns {Promise<void>}
5757
*/
5858
async function loadModuleAsync(url) {
@@ -71,7 +71,7 @@ async function loadModuleAsync(url) {
7171
*
7272
* Returns a promise which will resolve once the other methods are ready.
7373
*
74-
* @param {URL} [url] - The URL to fetch the WebAssembly module from. If not provided, a default URL will be used.
74+
* @param {URL | string} [url] - The URL to fetch the WebAssembly module from. If not provided, a default URL will be used.
7575
* @returns {Promise<void>}
7676
*/
7777
export async function initAsync(url = defaultURL) {

0 commit comments

Comments
 (0)