source: trip-planner-front/node_modules/source-map-js/source-map.d.ts@ 1ad8e64

Last change on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 3.0 KB
Line 
1export interface StartOfSourceMap {
2 file?: string;
3 sourceRoot?: string;
4}
5
6export interface RawSourceMap extends StartOfSourceMap {
7 version: string;
8 sources: string[];
9 names: string[];
10 sourcesContent?: string[];
11 mappings: string;
12}
13
14export interface Position {
15 line: number;
16 column: number;
17}
18
19export interface LineRange extends Position {
20 lastColumn: number;
21}
22
23export interface FindPosition extends Position {
24 // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND
25 bias?: number;
26}
27
28export interface SourceFindPosition extends FindPosition {
29 source: string;
30}
31
32export interface MappedPosition extends Position {
33 source: string;
34 name?: string;
35}
36
37export interface MappingItem {
38 source: string;
39 generatedLine: number;
40 generatedColumn: number;
41 originalLine: number;
42 originalColumn: number;
43 name: string;
44}
45
46export class SourceMapConsumer {
47 static GENERATED_ORDER: number;
48 static ORIGINAL_ORDER: number;
49
50 static GREATEST_LOWER_BOUND: number;
51 static LEAST_UPPER_BOUND: number;
52
53 constructor(rawSourceMap: RawSourceMap);
54 computeColumnSpans(): void;
55 originalPositionFor(generatedPosition: FindPosition): MappedPosition;
56 generatedPositionFor(originalPosition: SourceFindPosition): LineRange;
57 allGeneratedPositionsFor(originalPosition: MappedPosition): Position[];
58 hasContentsOfAllSources(): boolean;
59 sourceContentFor(source: string, returnNullOnMissing?: boolean): string;
60 eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;
61}
62
63export interface Mapping {
64 generated: Position;
65 original: Position;
66 source: string;
67 name?: string;
68}
69
70export class SourceMapGenerator {
71 constructor(startOfSourceMap?: StartOfSourceMap);
72 static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator;
73 addMapping(mapping: Mapping): void;
74 setSourceContent(sourceFile: string, sourceContent: string): void;
75 applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void;
76 toString(): string;
77}
78
79export interface CodeWithSourceMap {
80 code: string;
81 map: SourceMapGenerator;
82}
83
84export class SourceNode {
85 constructor();
86 constructor(line: number, column: number, source: string);
87 constructor(line: number, column: number, source: string, chunk?: string, name?: string);
88 static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode;
89 add(chunk: string): void;
90 prepend(chunk: string): void;
91 setSourceContent(sourceFile: string, sourceContent: string): void;
92 walk(fn: (chunk: string, mapping: MappedPosition) => void): void;
93 walkSourceContents(fn: (file: string, content: string) => void): void;
94 join(sep: string): SourceNode;
95 replaceRight(pattern: string, replacement: string): SourceNode;
96 toString(): string;
97 toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap;
98}
Note: See TracBrowser for help on using the repository browser.