• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17* JsDocTest on namespace
18*
19* @JsDocRecord1 comments
20* @JsDocRecord2 { JsDocRecord1 param } comments
21* @JsDocRecord3 {} comments
22*/
23namespace ns {
24  /**
25  * JsDocTest on interface.
26  *
27  * @JsDocRecord1 comments
28  * @JsDocRecord2 { JsDocRecord1 param } comments
29  * @JsDocRecord3 {} comments
30  */
31  export interface itfc1 {
32    /**
33    * JsDocTest on method.
34    *
35    * @JsDocRecord1 comments
36    * @JsDocRecord2 { JsDocRecord1 'param' } comments
37    * @JsDocRecord3 {} comments
38    */
39    foo():void
40
41    /**
42    * JsDocTest on prop.
43    *
44    * @JsDocRecord1 comments
45    * @JsDocRecord2 { JsDocRecord1 'param' } comments
46    * @JsDocRecord3 {} comments
47    */
48    prop:number
49  }
50
51  /**
52  * JsDocTest on class.
53  *
54  * @JsDocRecord1 comments
55  * @JsDocRecord2 { JsDocRecord1 param } comments
56  * @JsDocRecord3 {} comments
57  */
58  export class cls {
59    /**
60    * JsDocTest on method.
61    *
62    * @JsDocRecord1 comments
63    * @JsDocRecord2 { JsDocRecord1 'param' } comments
64    * @JsDocRecord3 {} comments
65    */
66    foo():void {}
67
68    /**
69    * JsDocTest on prop.
70    *
71    * @JsDocRecord1 comments
72    * @JsDocRecord2 { JsDocRecord1 'param' } comments
73    * @JsDocRecord3 {} comments
74    */
75    prop:number
76  }
77
78  /**
79  * JsDocTest on namespace
80  *
81  * @JsDocRecord1 comments
82  * @JsDocRecord2 { JsDocRecord1 param } comments
83  * @JsDocRecord3 {} comments
84  */
85  namespace ns_inner {}
86}
87
88/**
89 * JsDocTest on interface.
90 *
91 * @JsDocRecord1 comments
92 * @JsDocRecord2 { JsDocRecord1 param } comments
93 * @JsDocRecord3 {} comments
94 */
95export interface itfc1 {
96  /**
97  * JsDocTest on method.
98  *
99  * @JsDocRecord1 comments
100  * @JsDocRecord2 { JsDocRecord1 'param' } comments
101  * @JsDocRecord3 {} comments
102  */
103  foo():void
104
105  /**
106  * JsDocTest on prop.
107  *
108  * @JsDocRecord1 comments
109  * @JsDocRecord2 { JsDocRecord1 'param' } comments
110  * @JsDocRecord3 {} comments
111  */
112  prop:number
113}
114
115
116
117/**
118 * JsDocTest on class.
119 *
120 * @JsDocRecord1 comments
121 * @JsDocRecord2 { JsDocRecord1 param } comments
122 * @JsDocRecord3 {} comments
123 */
124export class cls {
125  /**
126  * JsDocTest on method.
127  *
128  * @JsDocRecord1 comments
129  * @JsDocRecord2 { JsDocRecord1 'param' } comments
130  * @JsDocRecord3 {} comments
131  */
132  foo():void {}
133
134  /**
135  * JsDocTest on prop.
136  *
137  * @JsDocRecord1 comments
138  * @JsDocRecord2 { JsDocRecord1 'param' } comments
139  * @JsDocRecord3 {} comments
140  */
141  prop:number
142}
143
144/**
145* JsDocTest on arrow function.
146*
147* @JsDocRecord1 comments
148* @JsDocRecord2 { JsDocRecord1 'param' } comments
149* @JsDocRecord3 {} comments
150*/
151let arrowFunc:() => void = ():void => {}
152
153/**
154* JsDocTest on function decl.
155*
156* @JsDocRecord1 comments
157* @JsDocRecord2 { JsDocRecord1 'param' } comments
158* @JsDocRecord3 {} comments
159*/
160function testFunc():void {}
161
162/**
163* JsDocTest on typeAlias.
164*
165* @JsDocRecord1 comments
166* @JsDocRecord2 { JsDocRecord1 'param' } comments
167* @JsDocRecord3 {} comments
168*/
169type xx =
170/**
171* @xx {xx} xx
172*/
173'somexx'
174/**
175* @xx {xx} xx
176*/
177| 'somexx2'
178/**
179* @xx {xx} xx
180*/
181| 'somexx3'
182
183function main() {
184  /**
185  * JsDocTest on arrow variable decl.
186  *
187  * @JsDocRecord1 comments
188  * @JsDocRecord2 { JsDocRecord1 'param' } comments
189  * @JsDocRecord3 {} comments
190  */
191  let val:string = "ssss"
192  assertTrue(true);
193  assertEQ(val, "ssss")
194}