@@ -8,113 +8,83 @@ npm install --save-dev @daybrush/jsdoc
8
8
## Support Typescript from version 0.3.0
9
9
* [ Scene.js Typescript API Documentation] ( http://daybrush.com/scenejs/release/latest/doc/index.html )
10
10
* [ fjx.js Typescript API Documentation] ( http://daybrush.com/fjx/release/latest/doc/index.html )
11
- * type
11
+ * [ InfiniteGrid Typescript API Documentation] ( https://naver.github.io/egjs-infinitegrid/release/latest/doc/ )
12
+
13
+ ### ``` name ``` and ``` type ``` can be omitted in function and method
14
+ * jsdoc
12
15
``` ts
13
- // jsdoc
14
16
/**
15
- * @typedef {() => void} A - description
16
17
*/
18
+ function a(a : Parameter1 , b : Parameter2 ): ReturnType {
19
+ }
20
+ ```
21
+ * result
17
22
18
- // for typescript
19
- /**
20
- * @typedef - description
21
- */
22
- export type A = () => void ;
23
+ ![ ] ( ./images/function-result.png )
24
+ ---
23
25
24
- ```
25
- * interface
26
- ``` ts
27
- // jsdoc
28
- /**
29
- * @typedef {TSInterface} A - description
30
- * @property {boolean} a
31
- * @property {string} a
32
- * @property {() => void} c
33
- */
26
+ ### ``` extends ``` and ``` implements ``` can be omitted from the class.
27
+ * jsdoc
34
28
35
- // for typescript
29
+ ``` ts
36
30
/**
37
- * @typedef - description
38
- */
39
- export interface A {
40
- a: boolean ;
41
- b: string ;
42
- c: () => void ;
31
+ */
32
+ export class A extends B implements a {
43
33
}
44
34
```
45
35
46
- * function
36
+ * result
47
37
48
- ``` ts
49
- // jsodc
50
- /**
51
- * @function
52
- * @param {A | C} a
53
- * @param {B} b
54
- * @param {C} c
55
- * @returns {C}
56
- */
57
- export function A(a , b ) {
58
38
59
- }
39
+ ![ ] ( ./images/class-result.png )
60
40
61
- // for typescript
62
- /**
63
- */
64
- export function A(a : C );
65
- export function A(a : A , b ; B ): C {
41
+ ---
66
42
67
- }
68
- ```
69
- * class method
43
+ ### Supports type declaration
44
+ * jsdoc
70
45
``` ts
71
- // jsdoc
72
46
/**
73
- * @extends B
74
- * @implements C
47
+ * @typedef
75
48
*/
76
- class A extends B {
77
- /**
78
- * @param {A} a
79
- * @param {B} b
80
- * @param {C} c
81
- */
82
- aaa(a , b , c ) {}
83
- }
49
+ export type a <T > = () => T ;
50
+ ```
84
51
85
- // for typescript
52
+ * result
53
+
54
+ ![ ] ( ./images/type-result.png )
55
+
56
+ ---
57
+ ### Supports interface declaration
58
+
59
+ * jsdoc
60
+ ``` ts
86
61
/**
62
+ * @typedef
87
63
*/
88
- class A extends B {
89
- /**
90
- */
91
- aaa(a : A , b : B , c : C ) {}
64
+ export interface a {
65
+ a: string ;
66
+ b: number ;
67
+ c: () => void ;
68
+ d(a : string , b : number ): void ;
69
+ (a : string , b : number ): void ;
70
+ [key : string ]: any ;
92
71
}
93
72
```
94
73
95
- * jsdoc.json
74
+ * result
75
+
76
+
77
+ ![ ] ( ./images/interface-result.png )
78
+
79
+ ---
80
+
81
+
82
+ ### jsdoc.json (Add ts extension to includePattern)
96
83
``` json
97
84
{
98
- "plugins" : [],
99
- "recurseDepth" : 10 ,
100
- "opts" : {
101
- "template" : " ./node_modules/daybrush-jsdoc-template" ,
102
- "destination" : " ./doc/"
103
- },
104
85
"source" : {
105
- "include" : [" ./src" , " README.md" ],
106
- "includePattern" : " (.+\\ .js(doc|x)?|.+\\ .ts(doc|x)?)$" ,
107
- "excludePattern" : " (^|\\ /|\\\\ )_"
108
- },
109
- "sourceType" : " module" ,
110
- "tags" : {
111
- "allowUnknownTags" : true ,
112
- "dictionaries" : [" jsdoc" ," closure" ]
86
+ "includePattern" : " .+\\ .(j|t)s(doc|x)?$" ,
113
87
},
114
- "templates" : {
115
- "cleverLinks" : false ,
116
- "monospaceLinks" : false
117
- }
118
88
}
119
89
```
120
90
0 commit comments