diff --git a/declarations.d.ts b/declarations.d.ts index a3066e990..beb84bef9 100644 --- a/declarations.d.ts +++ b/declarations.d.ts @@ -246,10 +246,20 @@ declare module "@webassemblyjs/ast" { declare module "webpack-sources" { export type MapOptions = { columns?: boolean; module?: boolean }; + export type RawSourceMap = { + version: number; + sources: string[]; + names: string[]; + sourceRoot?: string; + sourcesContent?: string[]; + mappings: string; + file: string; + }; + export abstract class Source { size(): number; - map(options?: MapOptions): Object; + map(options?: MapOptions): RawSourceMap | null; sourceAndMap(options?: MapOptions): { source: string | Buffer; diff --git a/types.d.ts b/types.d.ts index 78da415cf..44cd3b9f8 100644 --- a/types.d.ts +++ b/types.d.ts @@ -9358,6 +9358,15 @@ declare class RawSource extends Source { constructor(source: string | Buffer, convertToString?: boolean); isBuffer(): boolean; } +declare interface RawSourceMap { + version: number; + sources: string[]; + names: string[]; + sourceRoot?: string; + sourcesContent?: string[]; + mappings: string; + file: string; +} declare class ReadFileCompileWasmPlugin { constructor(options?: any); options: any; @@ -11104,7 +11113,7 @@ declare abstract class SortableSet extends Set { declare class Source { constructor(); size(): number; - map(options?: MapOptions): Object; + map(options?: MapOptions): null | RawSourceMap; sourceAndMap(options?: MapOptions): { source: string | Buffer; map: Object }; updateHash(hash: Hash): void; source(): string | Buffer;