Skip to content

Commit 29f7b95

Browse files
committed
Added typedoc api doc generation task, fixed jsdoc comments format. More jsdoc documentation update for ExchangeService
1 parent 07f2963 commit 29f7b95

21 files changed

+2357
-1195
lines changed

gulp.config.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = function() {
1212
ts: {
1313
// all typescript that we want to vet
1414
files: [
15-
'./src/**/*.ts',
15+
'./src/**/*.ts',
1616
],
1717
// all typescript that we want to vet
1818
testFiles: [
@@ -36,7 +36,12 @@ module.exports = function() {
3636
},
3737
typings: typings
3838
},
39-
39+
typedocFiles:[
40+
'./**/*.ts',
41+
'!./**/*.d.ts',
42+
'!./WebService.Extra.ts',
43+
'!./Microsoft.Exchange.WebServices.d__.ts',
44+
],
4045
build: './build/',
4146
root: root,
4247
source: 'src/',

gulpfile.js

+70-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ var gutil = require("gulp-util");
1414

1515
var colors = $.util.colors;
1616
var envenv = $.util.env;
17-
17+
var gulp_typedoc = require("gulp-typedoc");
18+
var typedoc = require('typedoc');
19+
1820

1921

2022
/**
@@ -248,4 +250,71 @@ function log(msg) {
248250
}
249251
}
250252

253+
/**
254+
* replace line [reflection.name = '"' + _this.basePath.trim(name) + '"';] with [reflection.name = _this.basePath.trim(name);] to avoid '"' in names
255+
*/
256+
gulp.task("typedocX", function() {
257+
process.chdir("./src/js/");
258+
return gulp
259+
.src(config.typedocFiles)
260+
.pipe(gulp_typedoc({
261+
// TypeScript options (see typescript docs)
262+
module: "commonjs",
263+
target: "es5",
264+
includeDeclarations: true,
265+
266+
// Output options (see typedoc docs)
267+
out: "./build/docs",
268+
//json: "./build/docs/file.json",
269+
270+
// TypeDoc options (see typedoc docs)
271+
name: "EWS JavaScript Api",
272+
theme: "default",
273+
//plugins: ["my", "plugins"],
274+
ignoreCompilerErrors: true,
275+
//version: true,
276+
}));
277+
});
278+
279+
280+
gulp.task("typedocFile", function() {
281+
var options = {
282+
target:"ES5",
283+
module:"commonjs",
284+
ignoreCompilerErrors:true,
285+
name:"Ews JavaScript Api",
286+
verbose:false,
287+
//entryPoint:'"Core/ExchangeService"',
288+
exclude: "**/*.d*.ts",
289+
excludeExternals:true,
290+
theme:"default",
291+
mode:"File",
292+
readme:"none"
293+
}
294+
var app = new typedoc.Application(options);
295+
return app.generateDocs(app.expandInputFiles(['.\\src\\js']), ".\\build\\docs\\FileMode");
296+
//return app.generateDocs(app.expandInputFiles(['.\\src\\js\\Core\\ServiceObjects\\Items']), ".\\build\\doc\\File");
297+
298+
});
299+
gulp.task("typedocModules", function() {
300+
var options = {
301+
target:"ES5",
302+
module:"commonjs",
303+
ignoreCompilerErrors:true,
304+
name:"Ews JavaScript Api",
305+
verbose:false,
306+
//entryPoint:'Core/ExchangeService',
307+
exclude: "**/*.d*.ts",
308+
excludeExternals:true,
309+
theme:"default",
310+
mode:"Modules" ,
311+
readme:"none"
312+
}
313+
var app = new typedoc.Application(options);
314+
return app.generateDocs(app.expandInputFiles(['.\\src\\js']), ".\\build\\docs\\ModulesMode");
315+
316+
});
317+
318+
gulp.task("typedoc",["typedocFile","typedocModules"]);
319+
251320
module.exports = gulp;

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@
4444
"gulp-nodemon": "^1.0.4",
4545
"gulp-replace": "^0.5.3",
4646
"gulp-task-listing": "^1.0.0",
47+
"gulp-typedoc": "^1.2.1",
4748
"gulp-uglify": "^1.0.1",
4849
"gulp-useref": "^1.0.2",
4950
"gulp-util": "^3.0.5",
5051
"mocha": "^2.2.5",
5152
"node-notifier": "^4.0.3",
5253
"q": "^1.0.1",
5354
"r": "0.0.5",
55+
"typedoc": "^0.3.12",
5456
"typescript": "^1.5.0-beta",
5557
"yargs": "^1.3.3"
5658
}

src/js/ComplexProperties/AttachmentCollection.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export class AttachmentCollection extends ComplexPropertyCollection<Attachment>
3636
/**
3737
* Adds a file attachment to the collection.
3838
*
39-
* @param {[string]} fileName The name of the file representing the content of the attachment.
40-
* @return {[FileAttachment]} A FileAttachment instance.
39+
* @param {string} fileName The name of the file representing the content of the attachment.
40+
* @return {FileAttachment} A FileAttachment instance.
4141
*/
4242
AddFileAttachment(fileName: string): FileAttachment { EwsLogging.DebugLog("AttachmentCollection.ts - AddFileAttachment : Not implemented."); return null; }
4343
//AddFileAttachment(name: string, fileName: string): FileAttachment{ throw new Error("AttachmentCollection.ts - AddFileAttachment : Not implemented.");}

src/js/Core/EwsServiceXmlWriter.ts

+33-33
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class EwsServiceXmlWriter {
4747
/**
4848
* Gets the xml created by EWS XMl Writer.
4949
*
50-
* @param {[boolean]} keep removes internal cache of XML data if false, otherwise keep the data.
50+
* @param {boolean} keep removes internal cache of XML data if false, otherwise keep the data.
5151
*/
5252
GetXML(keep: boolean = false): string {
5353
var returnVal = this.soapData.trim();
@@ -68,8 +68,8 @@ export class EwsServiceXmlWriter {
6868
/**
6969
* Pushes xml uri to internal tracker of used xml uris
7070
*
71-
* @param {[string]} prefix Prefix of uri.
72-
* @param {[string]} uri uri itself.
71+
* @param {string} prefix Prefix of uri.
72+
* @param {string} uri uri itself.
7373
*/
7474
private PushUris(prefix: string, uri: string): void {
7575

@@ -82,8 +82,8 @@ export class EwsServiceXmlWriter {
8282
/**
8383
* check if an uri exist in internal tracker
8484
*
85-
* @param {[string]} prefix Prefix of uri.
86-
* @param {[string]} uri uri itself.
85+
* @param {string} prefix Prefix of uri.
86+
* @param {string} uri uri itself.
8787
*/
8888
private CheckRootUri(prefix: string, uri: string): boolean {
8989
return this.rootUris.indexOf(prefix + ":" + uri) >= 0;
@@ -93,7 +93,7 @@ export class EwsServiceXmlWriter {
9393
/**
9494
* Initializes a new instance of the class.
9595
*
96-
* @param {[ExchangeServiceBase]} service The service.
96+
* @param {ExchangeServiceBase} service The service.
9797
*/
9898
constructor(service: ExchangeServiceBase) {
9999
this.service = service;
@@ -103,8 +103,8 @@ export class EwsServiceXmlWriter {
103103
/**
104104
* convert object to a string. transformed TryConvertObjectToString metho from c#
105105
*
106-
* @param {[any]} value The value.
107-
* @return {[string]} The string representation of value.
106+
* @param {any} value The value.
107+
* @return {string} The string representation of value.
108108
*/
109109
ConvertObjectToString(value: any): string {
110110
var strValue: string = null;
@@ -144,16 +144,16 @@ export class EwsServiceXmlWriter {
144144
/**
145145
* Writes the attribute value.
146146
*
147-
* @param {[string]} localName The local name of the attribute.
148-
* @param {[string]} stringValue The string value.
147+
* @param {string} localName The local name of the attribute.
148+
* @param {string} stringValue The string value.
149149
*/
150150
WriteAttributeString(localName: string, stringValue: string): void;
151151
/**
152152
* Writes the attribute value.
153153
*
154-
* @param {[string]} namespacePrefix The namespace prefix.
155-
* @param {[string]} localName The local name of the attribute.
156-
* @param {[string]} stringValue The string value.
154+
* @param {string} namespacePrefix The namespace prefix.
155+
* @param {string} localName The local name of the attribute.
156+
* @param {string} stringValue The string value.
157157
*/
158158
WriteAttributeString(namespacePrefix: string, localName: string, stringValue: string): void;
159159
WriteAttributeString(
@@ -190,24 +190,24 @@ export class EwsServiceXmlWriter {
190190
/**
191191
* Writes the attribute value. Does not emit empty string values.
192192
*
193-
* @param {[string]} localName The local name of the attribute.
194-
* @param {[any]} value The value.
193+
* @param {string} localName The local name of the attribute.
194+
* @param {any} value The value.
195195
*/
196196
WriteAttributeValue(localName: string, value: any): void;
197197
/**
198198
* Writes the attribute value. Optionally emits empty string values.
199199
*
200-
* @param {[string]} localName The local name of the attribute.
201-
* @param {[boolean]} alwaysWriteEmptyString Always emit the empty string as the value.
202-
* @param {[any]} value The value.
200+
* @param {string} localName The local name of the attribute.
201+
* @param {boolean} alwaysWriteEmptyString Always emit the empty string as the value.
202+
* @param {any} value The value.
203203
*/
204204
WriteAttributeValue(localName: string, alwaysWriteEmptyString: boolean, value: any): void;
205205
/**
206206
* Writes the attribute value.
207207
*
208-
* @param {[string]} namespacePrefix The namespace prefix.
209-
* @param {[string]} localName The local name of the attribute.
210-
* @param {[any]} value The value.
208+
* @param {string} namespacePrefix The namespace prefix.
209+
* @param {string} localName The local name of the attribute.
210+
* @param {any} value The value.
211211
*/
212212
WriteAttributeValue(namespacePrefix: string, localName: string, value: any): void;
213213
WriteAttributeValue(
@@ -250,7 +250,7 @@ export class EwsServiceXmlWriter {
250250
/**
251251
* Writes the base64-encoded element value.
252252
*
253-
* @param {[any]} buffer The buffer.
253+
* @param {any} buffer The buffer.
254254
*/
255255
WriteBase64ElementValue(buffer: any): void {
256256
this.WriteValue(base64Helper.btoa(buffer), null);
@@ -259,18 +259,18 @@ export class EwsServiceXmlWriter {
259259
/**
260260
* Writes the element value.
261261
*
262-
* @param {[XmlNamespace]} xmlNamespace The XML namespace.
263-
* @param {[string]} localName The local name of the element.
264-
* @param {[string]} displayName The name that should appear in the exception message when the value can not be serialized.
265-
* @param {[any]} value The value.
262+
* @param {XmlNamespace} xmlNamespace The XML namespace.
263+
* @param {string} localName The local name of the element.
264+
* @param {string} displayName The name that should appear in the exception message when the value can not be serialized.
265+
* @param {any} value The value.
266266
*/
267267
WriteElementValue(xmlNamespace: XmlNamespace, localName: string, value: any): void;
268268
/**
269269
* Writes the element value.
270270
*
271-
* @param {[XmlNamespace]} xmlNamespace The XML namespace.
272-
* @param {[string]} localName The local name of the element.
273-
* @param {[any]} value The value.
271+
* @param {XmlNamespace} xmlNamespace The XML namespace.
272+
* @param {string} localName The local name of the element.
273+
* @param {any} value The value.
274274
*/
275275
WriteElementValue(xmlNamespace: XmlNamespace, localName: string, displayName: string, value: any): void;
276276
WriteElementValue(
@@ -315,8 +315,8 @@ export class EwsServiceXmlWriter {
315315
/**
316316
* Writes the start element.
317317
*
318-
* @param {[XmlNamespace]} xmlNamespace The XML namespace.
319-
* @param {[string]} localName The local name of the element.
318+
* @param {XmlNamespace} xmlNamespace The XML namespace.
319+
* @param {string} localName The local name of the element.
320320
*/
321321
WriteStartElement(xmlNamespace: XmlNamespace, localName: string): void {
322322
this.CloseTag();
@@ -344,8 +344,8 @@ export class EwsServiceXmlWriter {
344344
/**
345345
* Writes string value.
346346
*
347-
* @param {[string]} value The value.
348-
* @param {[string]} name Element name (used for error handling)
347+
* @param {string} value The value.
348+
* @param {string} name Element name (used for error handling)
349349
*/
350350
WriteValue(value: string, name: string): any {
351351
//var closeElement = this.soapData.charAt(this.soapData.length - 1) !== ">";

0 commit comments

Comments
 (0)