-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js.flow
61 lines (50 loc) · 1009 Bytes
/
index.js.flow
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// @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