1 | import { MessageFormatElement } from './types';
|
2 | export interface IFilePosition {
|
3 | offset: number;
|
4 | line: number;
|
5 | column: number;
|
6 | }
|
7 | export interface IFileRange {
|
8 | start: IFilePosition;
|
9 | end: IFilePosition;
|
10 | }
|
11 | export interface ILiteralExpectation {
|
12 | type: "literal";
|
13 | text: string;
|
14 | ignoreCase: boolean;
|
15 | }
|
16 | export interface IClassParts extends Array<string | IClassParts> {
|
17 | }
|
18 | export interface IClassExpectation {
|
19 | type: "class";
|
20 | parts: IClassParts;
|
21 | inverted: boolean;
|
22 | ignoreCase: boolean;
|
23 | }
|
24 | export interface IAnyExpectation {
|
25 | type: "any";
|
26 | }
|
27 | export interface IEndExpectation {
|
28 | type: "end";
|
29 | }
|
30 | export interface IOtherExpectation {
|
31 | type: "other";
|
32 | description: string;
|
33 | }
|
34 | export declare type Expectation = ILiteralExpectation | IClassExpectation | IAnyExpectation | IEndExpectation | IOtherExpectation;
|
35 | export declare class SyntaxError extends Error {
|
36 | static buildMessage(expected: Expectation[], found: string | null): string;
|
37 | message: string;
|
38 | expected: Expectation[];
|
39 | found: string | null;
|
40 | location: IFileRange;
|
41 | name: string;
|
42 | constructor(message: string, expected: Expectation[], found: string | null, location: IFileRange);
|
43 | }
|
44 | export interface IParseOptions {
|
45 | filename?: string;
|
46 | startRule?: string;
|
47 | tracer?: any;
|
48 | [key: string]: any;
|
49 | }
|
50 | export declare type ParseFunction = (input: string, options?: IParseOptions) => MessageFormatElement[];
|
51 | export declare const pegParse: ParseFunction;
|
52 |
|
\ | No newline at end of file |