Merge pull request #16805 from snitin315/fix/improve-source-types
Improve types for `webpack-sources` to match in webpack core.
This commit is contained in:
commit
796b51175c
|
@ -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;
|
||||
|
|
|
@ -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<T> extends Set<T> {
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue