Skip to content

Commit

Permalink
fix evanw#2388: allow consuming types without dom types
Browse files Browse the repository at this point in the history
Currently the TypeScript types for esbuild depend on the DOM types.
However, esbuild itself does not depend on the DOM.

This change uses type augmentation to make the type error go away, while
keeping backwards support for use with the DOM types.

Closes evanw#2388
  • Loading branch information
remcohaszing committed Mar 5, 2024
1 parent cc74e60 commit 6f2f66d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,12 @@ export declare function analyzeMetafileSync(metafile: Metafile | string, options
*/
export declare function initialize(options: InitializeOptions): Promise<void>

declare global {
namespace WebAssembly {
interface Module {}
}
}

export interface InitializeOptions {
/**
* The URL of the "esbuild.wasm" file. This must be provided when running
Expand Down

0 comments on commit 6f2f66d

Please sign in to comment.