UNPKG

762 BTypeScriptView Raw
1import type { Option } from '@glimmer/interfaces';
2import { SourceLocation, SourcePosition } from './location';
3import { SourceOffset, SourceSpan } from './span';
4export declare class Source {
5 readonly source: string;
6 readonly module: string;
7 constructor(source: string, module?: string);
8 /**
9 * Validate that the character offset represents a position in the source string.
10 */
11 check(offset: number): boolean;
12 slice(start: number, end: number): string;
13 offsetFor(line: number, column: number): SourceOffset;
14 spanFor({ start, end }: Readonly<SourceLocation>): SourceSpan;
15 hbsPosFor(offset: number): Option<SourcePosition>;
16 charPosFor(position: SourcePosition): number | null;
17}
18//# sourceMappingURL=source.d.ts.map
\No newline at end of file