Skip to content

Commit 15df42d

Browse files
Move models to own namespace
1 parent 9aa72ef commit 15df42d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+6585
-6426
lines changed

bin/typedoc.d.ts

Lines changed: 183 additions & 183 deletions
Large diffs are not rendered by default.

bin/typedoc.js

Lines changed: 6025 additions & 5866 deletions
Large diffs are not rendered by default.

gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ module.exports = function(grunt)
8484
FS.readdirSync(Path.join(base)).forEach(function(directory) {
8585
var path = Path.join(base, directory);
8686
if (!FS.lstatSync(path).isDirectory()) return;
87-
TypeDoc.resetReflectionID();
87+
TypeDoc.models.resetReflectionID();
8888

8989
var src = app.expandInputFiles([path]);
9090
var out = Path.join(base, directory, 'specs.json');

src/td/Application.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ module td
314314
* @param src A list of source that should be compiled and converted.
315315
* @returns An instance of ProjectReflection on success, NULL otherwise.
316316
*/
317-
public convert(src:string[]):ProjectReflection {
317+
public convert(src:string[]):models.ProjectReflection {
318318
this.logger.writeln('Using TypeScript %s from %s', this.getTypeScriptVersion(), tsPath);
319319

320320
var result = this.converter.convert(src);
@@ -335,7 +335,7 @@ module td
335335
/**
336336
* @param project The project the documentation should be generated for.
337337
*/
338-
public generateDocs(project:ProjectReflection, out:string):boolean;
338+
public generateDocs(project:models.ProjectReflection, out:string):boolean;
339339

340340
/**
341341
* Run the documentation generator for the given set of files.
@@ -344,7 +344,7 @@ module td
344344
* @returns TRUE if the documentation could be generated successfully, otherwise FALSE.
345345
*/
346346
public generateDocs(input:any, out:string):boolean {
347-
var project = input instanceof ProjectReflection ? input : this.convert(input);
347+
var project = input instanceof models.ProjectReflection ? input : this.convert(input);
348348
if (!project) return false;
349349

350350
out = Path.resolve(out);
@@ -367,7 +367,7 @@ module td
367367
/**
368368
* @param project The project that should be converted.
369369
*/
370-
public generateJson(project:ProjectReflection, out:string):boolean;
370+
public generateJson(project:models.ProjectReflection, out:string):boolean;
371371

372372
/**
373373
* Run the converter for the given set of files and write the reflections to a json file.
@@ -376,7 +376,7 @@ module td
376376
* @returns TRUE if the json file could be written successfully, otherwise FALSE.
377377
*/
378378
public generateJson(input:any, out:string):boolean {
379-
var project = input instanceof ProjectReflection ? input : this.convert(input);
379+
var project = input instanceof models.ProjectReflection ? input : this.convert(input);
380380
if (!project) return false;
381381

382382
out = Path.resolve(out);

src/td/converter/Context.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ module td.converter
2323
/**
2424
* The project that is currently processed.
2525
*/
26-
project:ProjectReflection;
26+
project:models.ProjectReflection;
2727

2828
/**
2929
* The scope or parent reflection that is currently processed.
3030
*/
31-
scope:Reflection;
31+
scope:models.Reflection;
3232

3333
/**
3434
* Is the current source file marked as being external?
@@ -43,12 +43,12 @@ module td.converter
4343
/**
4444
* The currently set type parameters.
4545
*/
46-
typeParameters:ts.Map<Type>;
46+
typeParameters:ts.Map<models.Type>;
4747

4848
/**
4949
* The currently set type arguments.
5050
*/
51-
typeArguments:Type[];
51+
typeArguments:models.Type[];
5252

5353
/**
5454
* Is the converter in inheritance mode?
@@ -89,7 +89,7 @@ module td.converter
8989
this.fileNames = fileNames;
9090
this.checker = checker;
9191

92-
var project = new ProjectReflection(this.getOptions().name);
92+
var project = new models.ProjectReflection(this.getOptions().name);
9393
this.project = project;
9494
this.scope = project;
9595

@@ -153,7 +153,7 @@ module td.converter
153153
* @param node The node the given reflection was resolved from.
154154
* @param symbol The symbol the given reflection was resolved from.
155155
*/
156-
registerReflection(reflection:Reflection, node:ts.Node, symbol?:ts.Symbol) {
156+
registerReflection(reflection:models.Reflection, node:ts.Node, symbol?:ts.Symbol) {
157157
this.project.reflections[reflection.id] = reflection;
158158

159159
var id = this.getSymbolID(symbol ? symbol : node.symbol);
@@ -172,7 +172,7 @@ module td.converter
172172
* @param reflection The triggering reflection.
173173
* @param node The triggering TypeScript node if available.
174174
*/
175-
trigger(name:string, reflection:Reflection, node?:ts.Node) {
175+
trigger(name:string, reflection:models.Reflection, node?:ts.Node) {
176176
this.converter.dispatch(name, this, reflection, node);
177177
}
178178

@@ -218,27 +218,27 @@ module td.converter
218218
/**
219219
* @param callback The callback function that should be executed with the changed context.
220220
*/
221-
public withScope(scope:Reflection, callback:Function);
221+
public withScope(scope:models.Reflection, callback:Function);
222222

223223
/**
224224
* @param parameters An array of type parameters that should be set on the context while the callback is invoked.
225225
* @param callback The callback function that should be executed with the changed context.
226226
*/
227-
public withScope(scope:Reflection, parameters:ts.NodeArray<ts.TypeParameterDeclaration>, callback:Function);
227+
public withScope(scope:models.Reflection, parameters:ts.NodeArray<ts.TypeParameterDeclaration>, callback:Function);
228228

229229
/**
230230
* @param parameters An array of type parameters that should be set on the context while the callback is invoked.
231231
* @param preserve Should the currently set type parameters of the context be preserved?
232232
* @param callback The callback function that should be executed with the changed context.
233233
*/
234-
public withScope(scope:Reflection, parameters:ts.NodeArray<ts.TypeParameterDeclaration>, preserve:boolean, callback:Function);
234+
public withScope(scope:models.Reflection, parameters:ts.NodeArray<ts.TypeParameterDeclaration>, preserve:boolean, callback:Function);
235235

236236
/**
237237
* Run the given callback with the scope of the context set to the given reflection.
238238
*
239239
* @param scope The reflection that should be set as the scope of the context while the callback is invoked.
240240
*/
241-
public withScope(scope:Reflection, ...args) {
241+
public withScope(scope:models.Reflection, ...args) {
242242
if (!scope || !args.length) return;
243243
var callback = args.pop();
244244
var parameters = args.shift();
@@ -266,7 +266,7 @@ module td.converter
266266
* @param typeArguments The type arguments that apply while inheriting the given node.
267267
* @return The resulting reflection / the current scope.
268268
*/
269-
inherit(baseNode:ts.Node, typeArguments?:ts.NodeArray<ts.TypeNode>):Reflection {
269+
inherit(baseNode:ts.Node, typeArguments?:ts.NodeArray<ts.TypeNode>):models.Reflection {
270270
var wasInherit = this.isInherit;
271271
var oldInherited = this.inherited;
272272
var oldInheritParent = this.inheritParent;
@@ -275,8 +275,8 @@ module td.converter
275275
this.inheritParent = baseNode;
276276
this.inherited = [];
277277

278-
var target = <ContainerReflection>this.scope;
279-
if (!(target instanceof ContainerReflection)) {
278+
var target = <models.ContainerReflection>this.scope;
279+
if (!(target instanceof models.ContainerReflection)) {
280280
throw new Error('Expected container reflection');
281281
}
282282

@@ -309,8 +309,8 @@ module td.converter
309309
* @param preserve Should the currently set type parameters of the context be preserved?
310310
* @returns The resulting type mapping.
311311
*/
312-
private extractTypeParameters(parameters:ts.NodeArray<ts.TypeParameterDeclaration>, preserve?:boolean):ts.Map<Type> {
313-
var typeParameters:ts.Map<Type> = {};
312+
private extractTypeParameters(parameters:ts.NodeArray<ts.TypeParameterDeclaration>, preserve?:boolean):ts.Map<models.Type> {
313+
var typeParameters:ts.Map<models.Type> = {};
314314

315315
if (preserve) {
316316
for (var key in this.typeParameters) {

src/td/converter/Converter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module td.converter
4646
/**
4747
* The resulting project reflection.
4848
*/
49-
project:ProjectReflection;
49+
project:models.ProjectReflection;
5050
}
5151

5252

@@ -84,7 +84,7 @@ module td.converter
8484
* @param reflection The reflection that is currently processed.
8585
* @param node The node that is currently processed if available.
8686
*/
87-
(context:Context, reflection:Reflection, node?:ts.Node):void;
87+
(context:Context, reflection:models.Reflection, node?:ts.Node):void;
8888
}
8989

9090

@@ -99,7 +99,7 @@ module td.converter
9999
* @param context The context object describing the current state the converter is in.
100100
* @param reflection The reflection that is currently resolved.
101101
*/
102-
(context:Context, reflection:Reflection):void;
102+
(context:Context, reflection:models.Reflection):void;
103103
}
104104

105105

@@ -316,7 +316,7 @@ module td.converter
316316
* @param context The context object describing the current state the converter is in.
317317
* @returns The final project reflection.
318318
*/
319-
private resolve(context:Context):ProjectReflection {
319+
private resolve(context:Context):models.ProjectReflection {
320320
this.dispatch(Converter.EVENT_RESOLVE_BEGIN, context);
321321
var project = context.project;
322322

0 commit comments

Comments
 (0)