Skip to content

Commit

Permalink
Export SourceMapSegment tuple types (#158)
Browse files Browse the repository at this point in the history
`SourceMapSegment`s aren't really `number[]` types, they're tuples of 1, 4, or 5 numbers.

See the discussion we're having at rollup/rollup#2985 (comment)
  • Loading branch information
jridgewell authored and mourner committed Oct 4, 2019
1 parent 0c4d32f commit 60eae25
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.d.ts
Expand Up @@ -10,12 +10,17 @@ export interface SourceMapOptions {
includeContent: boolean;
}

export type SourceMapSegment =
| [number]
| [number, number, number, number]
| [number, number, number, number, number];

export interface DecodedSourceMap {
file: string;
sources: string[];
sourcesContent: string[];
names: string[];
mappings: number[][][];
mappings: SourceMapSegment[][];
}

export class SourceMap {
Expand Down

0 comments on commit 60eae25

Please sign in to comment.