UNPKG

ti-el

Version:
62 lines (50 loc) 1.01 kB
// @flow import type { TLProgram } from './ast' export type Location = { line: number, column: number, offset: number } export type LocationRange = { start: Location, end: Location } declare export class SyntaxError { line: number; column: number; offset: number; location: LocationRange; expected: any[]; found: any; name: string; message: string; } export type ParserOptions = { startRule?: string, tracer?: any, [key: string]: any } declare export function parse(str: string, options?: ParserOptions): TLProgram export type Parameter = { name: string, type: string, vector: number, description: string } export type BaseClass = { name: string, description: string } export type TdClass = { line: number, name: string, kind: 'function' | 'constructor', description: string, parameters: Parameter[], result: string } export type TldocOutput = { baseClasses: BaseClass[], classes: TdClass[] } declare export function tldoc(input: string): TldocOutput