-
Notifications
You must be signed in to change notification settings - Fork 203
/
Copy pathglobals.ts
186 lines (159 loc) · 3.9 KB
/
globals.ts
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/// <reference path="./typings/tsd.d.ts"/>
// From brackets plugin
/// <reference path="./typings/bluebird.d.ts"/>
/// <reference path="./typings/codemirror.d.ts"/>
/// <reference path="./typings/brackets.d.ts"/>
/// <reference path="./typings/mustache.d.ts"/>
/// <reference path="../views/views.d.ts"/>
/// <reference path="./typings/atompromise.d.ts"/>
/** Utility function to print stack trace from whereever */
declare function stack();
declare module NodeJS {
export interface Global {
stack: any;
ts: any;
}
}
interface Function {
name?: string; // exists for named function on node / atom / "good" browsers ;)
}
interface Error {
details?: any; // Really useful to have for debugging
}
// escape-html
declare module 'escape-html' {
function escape(html: string): string;
export = escape;
}
declare module 'detect-indent' {
function detectIndent (string: string): { amount: number; type?: string; indent: string };
export = detectIndent;
}
declare module 'xtend' {
function extend <T, U> (dest: T, src: U): T & U;
export = extend;
}
declare module 'atom-space-pen-views' {
import atom = require('atom');
export class SelectListView extends atom.SelectListView { }
export class ScrollView extends atom.ScrollView { }
export class View extends atom.View { }
export var $: JQueryStatic;
}
declare module 'basarat-text-buffer' {
var ctor: {
new (content: string): TextBuffer.ITextBuffer;
};
export = ctor;
}
interface EmitOutput {
sourceFileName: string;
outputFiles: string[];
success: boolean;
errors: CodeError[];
emitError: boolean;
}
interface BuildOutput {
outputs: EmitOutput[];
counts: {
inputFiles: number;
outputFiles: number;
errors: number;
emitErrors: number;
}
}
interface BuildUpdate {
builtCount: number;
totalCount: number;
errorCount: number;
firstError: boolean;
filePath: string;
errorsInFile: CodeError[];
}
interface CodeError {
filePath: string;
startPos: EditorPosition;
endPos: EditorPosition;
message: string;
preview: string;
}
interface EditorPosition {
line: number;
col: number;
}
interface CodeEdit {
start: EditorPosition;
end: EditorPosition;
newText: string;
}
/** Interfaces used by GotoHistory feature */
interface GotoPosition {
filePath: string;
line: number;
col: number;
}
interface TabWithGotoPositions {
lastPosition?: GotoPosition;
members: GotoPosition[];
}
/** Interfaces needed for file symbols view */
interface NavigationBarItem {
text: string;
kind: string;
kindModifiers: string;
position: EditorPosition;
indent: number;
bolded: boolean;
grayed: boolean;
}
/** for project symbols view */
interface NavigateToItem {
name: string;
kind: string;
filePath: string;
position: EditorPosition;
fileName: string;
}
/**
* used by semantic view
*/
interface SemanticTreeNode {
text: string;
kind: string;
kindModifiers: string;
start: EditorPosition;
end: EditorPosition;
subNodes: SemanticTreeNode[];
}
interface ReferenceDetails {
filePath: string;
position: EditorPosition
preview: string;
}
/** Used by AST display */
interface NodeDisplay {
kind: string;
children: NodeDisplay[];
pos: number;
end: number;
/** Represents how many parents it has */
depth: number;
/** If we had a flat structure this is where this item would belong */
nodeIndex: number;
/** Key Details I understand */
details?: any;
/** Best attempt serialization of original node
* I also remove `parent`
*/
rawJson: any;
}
/** Used by Dependency display */
interface FileDependency {
sourcePath: string;
targetPath: string;
}
/** Provided by the atom team */
interface String {
startsWith(str: string): boolean;
endsWith(str: string): boolean;
}