1 | /**
|
---|
2 | * Copyright 2019 The AMP HTML Authors. All Rights Reserved.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 | import type OriginalSource from './original-source';
|
---|
17 | import type { DecodedSourceMap, SourceMapSegmentObject } from './types';
|
---|
18 | declare type Sources = OriginalSource | SourceMapTree;
|
---|
19 | /**
|
---|
20 | * SourceMapTree represents a single sourcemap, with the ability to trace
|
---|
21 | * mappings into its child nodes (which may themselves be SourceMapTrees).
|
---|
22 | */
|
---|
23 | export default class SourceMapTree {
|
---|
24 | map: DecodedSourceMap;
|
---|
25 | sources: Sources[];
|
---|
26 | private lastLine;
|
---|
27 | private lastColumn;
|
---|
28 | private lastIndex;
|
---|
29 | constructor(map: DecodedSourceMap, sources: Sources[]);
|
---|
30 | /**
|
---|
31 | * traceMappings is only called on the root level SourceMapTree, and begins
|
---|
32 | * the process of resolving each mapping in terms of the original source
|
---|
33 | * files.
|
---|
34 | */
|
---|
35 | traceMappings(): DecodedSourceMap;
|
---|
36 | /**
|
---|
37 | * traceSegment is only called on children SourceMapTrees. It recurses down
|
---|
38 | * into its own child SourceMapTrees, until we find the original source map.
|
---|
39 | */
|
---|
40 | traceSegment(line: number, column: number, name: string): SourceMapSegmentObject | null;
|
---|
41 | }
|
---|
42 | export {};
|
---|