@creditkarma/thrift-parser
Version:
A parser for Thrift written in TypeScript
26 lines (25 loc) • 3.01 kB
TypeScript
import { BaseType, BooleanLiteral, Comment, ConstList, ConstMap, ConstValue, DoubleConstant, ExponentialLiteral, FieldDefinition, FieldID, FieldRequired, FieldType, FloatLiteral, FunctionType, HexLiteral, Identifier, IntConstant, IntegerLiteral, KeywordType, ListType, MapType, ParseError, PropertyAssignment, ScanError, SetType, StringLiteral, StructDefinition, SyntaxType, TextLocation, TextPosition, Token } from './types';
export declare function createParseError(message: string, loc: TextLocation): ParseError;
export declare function createScanError(message: string, loc: TextLocation): ScanError;
export declare function createTextLocation(start: TextPosition, end: TextPosition): TextLocation;
export declare function createTextPosition(line: number, column: number, index: number): TextPosition;
export declare function createToken(type: SyntaxType, text: string, loc: TextLocation): Token;
export declare function createIdentifier(value: string, loc: TextLocation): Identifier;
export declare function creataePropertyAssignment(name: ConstValue, initializer: ConstValue, loc: TextLocation): PropertyAssignment;
export declare function createFieldDefinition(name: Identifier, fieldID: FieldID, requiredness: FieldRequired, fieldType: FunctionType, loc: TextLocation, defaultValue?: ConstValue, comments?: Array<Comment>): FieldDefinition;
export declare function createFieldID(value: number, loc: TextLocation): FieldID;
export declare function createStructDefinition(name: Identifier, fields: Array<FieldDefinition>, loc: TextLocation, comments?: Array<Comment>): StructDefinition;
export declare function createStringLiteral(value: string, loc: TextLocation): StringLiteral;
export declare function createIntegerLiteral(value: string, loc: TextLocation): IntegerLiteral;
export declare function createHexLiteral(value: string, loc: TextLocation): HexLiteral;
export declare function createFloatLiteral(value: string, loc: TextLocation): FloatLiteral;
export declare function createExponentialLiteral(value: string, loc: TextLocation): ExponentialLiteral;
export declare function createIntConstant(value: IntegerLiteral | HexLiteral, loc: TextLocation): IntConstant;
export declare function createDoubleConstant(value: FloatLiteral | ExponentialLiteral, loc: TextLocation): DoubleConstant;
export declare function createBooleanLiteral(value: boolean, loc: TextLocation): BooleanLiteral;
export declare function createKeywordFieldType(type: KeywordType, loc: TextLocation): BaseType;
export declare function createMapFieldType(keyType: FieldType, valueType: FieldType, loc: TextLocation): MapType;
export declare function createSetFieldType(valueType: FieldType, loc: TextLocation): SetType;
export declare function createListFieldType(valueType: FieldType, loc: TextLocation): ListType;
export declare function createConstMap(properties: Array<PropertyAssignment>, loc: TextLocation): ConstMap;
export declare function createConstList(elements: Array<ConstValue>, loc: TextLocation): ConstList;