UNPKG

2.61 kBTypeScriptView Raw
1import { PresentArray } from '@glimmer/interfaces';
2import { SourceSpan } from './span';
3export interface SourceLocation {
4 start: SourcePosition;
5 end: SourcePosition;
6}
7export interface SourcePosition {
8 /** >= 1 */
9 line: number;
10 /** >= 0 */
11 column: number;
12}
13export declare const UNKNOWN_POSITION: Readonly<{
14 readonly line: 1;
15 readonly column: 0;
16}>;
17export declare const SYNTHETIC_LOCATION: Readonly<{
18 readonly source: "(synthetic)";
19 readonly start: Readonly<{
20 readonly line: 1;
21 readonly column: 0;
22 }>;
23 readonly end: Readonly<{
24 readonly line: 1;
25 readonly column: 0;
26 }>;
27}>;
28/** @deprecated */
29export declare const SYNTHETIC: Readonly<{
30 readonly source: "(synthetic)";
31 readonly start: Readonly<{
32 readonly line: 1;
33 readonly column: 0;
34 }>;
35 readonly end: Readonly<{
36 readonly line: 1;
37 readonly column: 0;
38 }>;
39}>;
40export declare const TEMPORARY_LOCATION: Readonly<{
41 readonly source: "(temporary)";
42 readonly start: Readonly<{
43 readonly line: 1;
44 readonly column: 0;
45 }>;
46 readonly end: Readonly<{
47 readonly line: 1;
48 readonly column: 0;
49 }>;
50}>;
51export declare const NON_EXISTENT_LOCATION: Readonly<{
52 readonly source: "(nonexistent)";
53 readonly start: Readonly<{
54 readonly line: 1;
55 readonly column: 0;
56 }>;
57 readonly end: Readonly<{
58 readonly line: 1;
59 readonly column: 0;
60 }>;
61}>;
62export declare const BROKEN_LOCATION: Readonly<{
63 readonly source: "(broken)";
64 readonly start: Readonly<{
65 readonly line: 1;
66 readonly column: 0;
67 }>;
68 readonly end: Readonly<{
69 readonly line: 1;
70 readonly column: 0;
71 }>;
72}>;
73export declare type LocatedWithSpan = {
74 offsets: SourceSpan;
75};
76export declare type LocatedWithOptionalSpan = {
77 offsets: SourceSpan | null;
78};
79export declare type LocatedWithPositions = {
80 loc: SourceLocation;
81};
82export declare type LocatedWithOptionalPositions = {
83 loc?: SourceLocation;
84};
85export declare function isLocatedWithPositionsArray(location: LocatedWithOptionalPositions[]): location is PresentArray<LocatedWithPositions>;
86export declare function isLocatedWithPositions(location: LocatedWithOptionalPositions): location is LocatedWithPositions;
87export declare type HasSourceLocation = SourceLocation | LocatedWithPositions | PresentArray<LocatedWithPositions>;
88export declare type MaybeHasSourceLocation = null | LocatedWithOptionalPositions | LocatedWithOptionalPositions[];
89//# sourceMappingURL=location.d.ts.map
\No newline at end of file