Options
All
  • Public
  • Public/Protected
  • All
Menu

Process Thrift file

class

ThriftParser

Hierarchy

  • ThriftParser

Index

Constructors

constructor

Properties

Private identifiers

identifiers: object

Type declaration

Private includes

includes: string[]

Methods

astToJson

  • astToJson(name: string, ast: IAstFile[]): ThriftFile.IJSON

astToType

  • astToType(ast: FunctionType, file: string): ThriftFile.IFieldType
  • Convert Type AST representation to JSON type

    Parameters

    • ast: FunctionType
    • file: string

    Returns ThriftFile.IFieldType

comments

  • comments(input: Comment[]): object | object

constToJson

  • constToJson(constant: ConstValue): any

fieldToJson

  • fieldToJson(field: FieldDefinition, file: string): ThriftFile.IField
  • Convert Field AST statement to JSON representation

    Parameters

    • field: FieldDefinition
    • file: string

    Returns ThriftFile.IField

funcToJson

  • funcToJson(func: FunctionDefinition, file: string): ThriftFile.IFunction
  • Convert Function AST statement to JSON representation

    Parameters

    • func: FunctionDefinition
    • file: string

    Returns ThriftFile.IFunction

ident

  • ident(input: Identifier): string

identToType

  • identToType(ast: Identifier, file: string): ThriftFile.IFieldType

parse

  • parse(filePath: string, callback: function): void
  • Parse Thrift file and return JSON representation

    Parameters

    • filePath: string
    • callback: function
        • (err: Error | null, data?: ThriftFile.IJSON): void
        • Parameters

          • err: Error | null
          • Optional data: ThriftFile.IJSON

          Returns void

    Returns void

parseThriftFiles

  • parseThriftFiles(filePath: string, includes: string[]): Promise<IAstFile[]>

Generated using TypeDoc