1 | import type { Nullable } from '@glimmer/interfaces';
|
2 | import type { PrecompileOptions } from '../parser/tokenizer-event-handlers';
|
3 | import type { SourceLocation, SourcePosition } from './location';
|
4 | import { SourceOffset, SourceSpan } from './span';
|
5 | export declare class Source {
|
6 | readonly source: string;
|
7 | readonly module: string;
|
8 | static from(source: string, options?: PrecompileOptions): Source;
|
9 | constructor(source: string, module?: string);
|
10 | /**
|
11 | * Validate that the character offset represents a position in the source string.
|
12 | */
|
13 | validate(offset: number): boolean;
|
14 | slice(start: number, end: number): string;
|
15 | offsetFor(line: number, column: number): SourceOffset;
|
16 | spanFor({ start, end }: Readonly<SourceLocation>): SourceSpan;
|
17 | hbsPosFor(offset: number): Nullable<SourcePosition>;
|
18 | charPosFor(position: SourcePosition): number | null;
|
19 | }
|