UNPKG

837 BTypeScriptView Raw
1import {SourceLocation} from './source_location';
2
3/**
4 * A span of text within a source file.
5 *
6 * @category Logger
7 */
8export interface SourceSpan {
9 /** The beginning of this span, inclusive. */
10 start: SourceLocation;
11
12 /**
13 * The end of this span, exclusive.
14 *
15 * If {@link start} and {@link end} refer to the same location, the span has
16 * zero length and refers to the point immediately after {@link start} and
17 * before the next character.
18 */
19 end: SourceLocation;
20
21 /** The canonical URL of the file this span refers to. */
22 url?: URL;
23
24 /** The text covered by the span. */
25 text: string;
26
27 /**
28 * Text surrounding the span.
29 *
30 * If this is set, it must include only whole lines, and it must include at
31 * least all line(s) which are partially covered by this span.
32 */
33 context?: string;
34}