From 0ed48875695d6e692471e2e51599e3e243ab0598 Mon Sep 17 00:00:00 2001 From: Will Willems Date: Mon, 2 Sep 2019 13:53:04 +0200 Subject: [PATCH] Add missing type definitions for initialize method --- source-map.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source-map.d.ts b/source-map.d.ts index 24593915..c15b768e 100644 --- a/source-map.d.ts +++ b/source-map.d.ts @@ -78,6 +78,10 @@ export interface CodeWithSourceMap { map: SourceMapGenerator; } +export interface SourceMapConsumerInitialisationOptions { + "lib/mappings.wasm": string; +} + export interface SourceMapConsumer { /** * Compute the last column for each generated mapping. The last column is @@ -198,6 +202,14 @@ export interface SourceMapConsumerConstructor { new (rawSourceMap: RawIndexMap, sourceMapUrl?: SourceMapUrl): Promise; new (rawSourceMap: RawSourceMap | RawIndexMap | string, sourceMapUrl?: SourceMapUrl): Promise; + /** + * Set URL/ArrayBuffer for `lib/mappings.wasm` when using outside of Node + * + * @param opts + * Options for initialisation containing the URL or ArrayBuffer for lib/mappings.wasm + */ + initialize(options: SourceMapConsumerInitialisationOptions): void; + /** * Create a BasicSourceMapConsumer from a SourceMapGenerator. *