Skip to content

Commit 83a7ea5

Browse files
committed
Fix up JSDocs, and make compat with closure
1 parent 1db7f30 commit 83a7ea5

Some content is hidden

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

44 files changed

+307
-283
lines changed

.jscsrc

+11
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,16 @@
2121
"validateParameterSeparator": ", ",
2222
"disallowMultipleVarDecl": {
2323
"allExcept": ["undefined"]
24+
},
25+
"jsDoc": {
26+
"checkTypes": "strictNativeCase",
27+
"checkParamExistence": true,
28+
"checkParamNames": true,
29+
"requireParamTypes": true,
30+
"checkRedundantParams": true,
31+
"checkReturnTypes": true,
32+
"checkRedundantReturns": true,
33+
"requireReturnTypes": true,
34+
"checkTypes": true
2435
}
2536
}

src/core/Debug.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function Debug() {
8282
}
8383
/**
8484
* This method will allow you send log messages to either the browser's console and/or dispatch an event to capture at the media player level.
85-
* @param arguments The message you want to log. The Arguments object is supported for this method so you can send in comma separated logging items.
85+
* @param {...*} arguments The message you want to log. The Arguments object is supported for this method so you can send in comma separated logging items.
8686
* @memberof module:Debug
8787
* @instance
8888
*/
@@ -124,4 +124,4 @@ function Debug() {
124124
}
125125

126126
Debug.__dashjs_factory_name = 'Debug';
127-
export default FactoryMaker.getSingletonFactory(Debug);
127+
export default FactoryMaker.getSingletonFactory(Debug);

src/core/FactoryMaker.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* POSSIBILITY OF SUCH DAMAGE.
3030
*/
3131
/**
32-
* @Module FactoryMaker
32+
* @module FactoryMaker
3333
*/
3434
let FactoryMaker = (function () {
3535

@@ -49,8 +49,8 @@ let FactoryMaker = (function () {
4949
* this.factory.getSingletonInstance(this.context, 'VideoModel')
5050
* will return the video model for use in the extended object.
5151
*
52-
* @param context {Object} injected into extended object as this.context
53-
* @param className {String} string name found in all dash.js objects
52+
* @param {Object} context - injected into extended object as this.context
53+
* @param {string} className - string name found in all dash.js objects
5454
* with name __dashjs_factory_name Will be at the bottom. Will be the same as the object's name.
5555
* @returns {*} Context aware instance of specified singleton name.
5656
* @memberof module:FactoryMaker
@@ -69,9 +69,9 @@ let FactoryMaker = (function () {
6969
/**
7070
* Use this method to add an singleton instance to the system. Useful for unit testing to mock objects etc.
7171
*
72-
* @param context
73-
* @param className
74-
* @param instance
72+
* @param {Object} context
73+
* @param {string} className
74+
* @param {Object} instance
7575
* @memberof module:FactoryMaker
7676
* @instance
7777
*/
@@ -166,4 +166,4 @@ let FactoryMaker = (function () {
166166

167167
}());
168168

169-
export default FactoryMaker;
169+
export default FactoryMaker;

src/dash/DashMetrics.js

+23-23
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import DashManifestModel from './models/DashManifestModel.js';
3535
import FactoryMaker from '../core/FactoryMaker.js';
3636

3737
/**
38-
* @Module DashMetrics
38+
* @module DashMetrics
3939
*/
4040
function DashMetrics() {
4141

@@ -60,8 +60,8 @@ function DashMetrics() {
6060

6161
/**
6262
*
63-
* @param representationId
64-
* @param periodIdx
63+
* @param {string} representationId
64+
* @param {number} periodIdx
6565
* @returns {*}
6666
*/
6767
function getIndexForRepresentation(representationId, periodIdx) {
@@ -76,9 +76,9 @@ function DashMetrics() {
7676
/**
7777
* This method returns the current max index based on what is defined in the MPD.
7878
*
79-
* @param bufferType - String 'audio' or 'video',
80-
* @param periodIdx - Make sure this is the period index not id
81-
* @return int
79+
* @param {string} bufferType - String 'audio' or 'video',
80+
* @param {number} periodIdx - Make sure this is the period index not id
81+
* @return {number}
8282
* @memberof module:DashMetrics
8383
* @instance
8484
*/
@@ -95,9 +95,9 @@ function DashMetrics() {
9595
* This method returns the current max index correlated to the max allowed bitrate
9696
* explicitly set via the MediaPlayer's API setMaxAllowedBitrateFor.
9797
*
98-
* @param bufferType - String 'audio' or 'video',
99-
* @param periodId - Make sure this is the period id not index.
100-
* @return int
98+
* @param {string} bufferType - String 'audio' or 'video',
99+
* @param {number} periodId - Make sure this is the period id not index.
100+
* @return {number}
101101
* @see {@link module:MediaPlayer#setMaxAllowedBitrateFor setMaxAllowedBitrateFor()}
102102
* @see {@link DashMetrics#getMaxIndexForBufferType getMaxIndexForBufferType()}
103103
* @memberof module:DashMetrics
@@ -115,7 +115,7 @@ function DashMetrics() {
115115
}
116116

117117
/**
118-
* @param metrics
118+
* @param {MetricsList} metrics
119119
* @returns {*}
120120
* @memberof module:DashMetrics
121121
* @instance
@@ -142,7 +142,7 @@ function DashMetrics() {
142142
}
143143

144144
/**
145-
* @param metrics
145+
* @param {MetricsList} metrics
146146
* @returns {*}
147147
* @memberof module:DashMetrics
148148
* @instance
@@ -161,7 +161,7 @@ function DashMetrics() {
161161
}
162162

163163
/**
164-
* @param metrics
164+
* @param {MetricsList} metrics
165165
* @returns {number}
166166
* @memberof module:DashMetrics
167167
* @instance
@@ -180,7 +180,7 @@ function DashMetrics() {
180180
}
181181

182182
/**
183-
* @param metrics
183+
* @param {MetricsList} metrics
184184
* @returns {null|*|vo}
185185
* @memberof module:DashMetrics
186186
* @instance
@@ -190,7 +190,7 @@ function DashMetrics() {
190190
}
191191

192192
/**
193-
* @param metrics
193+
* @param {MetricsList} metrics
194194
* @returns {*}
195195
* @memberof module:DashMetrics
196196
* @instance
@@ -224,7 +224,7 @@ function DashMetrics() {
224224
}
225225

226226
/**
227-
* @param metrics
227+
* @param {MetricsList} metrics
228228
* @returns {*}
229229
* @memberof module:DashMetrics
230230
* @instance
@@ -238,7 +238,7 @@ function DashMetrics() {
238238
}
239239

240240
/**
241-
* @param metrics
241+
* @param {MetricsList} metrics
242242
* @returns {*}
243243
* @memberof module:DashMetrics
244244
* @instance
@@ -263,7 +263,7 @@ function DashMetrics() {
263263
}
264264

265265
/**
266-
* @param metrics
266+
* @param {MetricsList} metrics
267267
* @returns {*}
268268
* @memberof module:DashMetrics
269269
* @instance
@@ -289,7 +289,7 @@ function DashMetrics() {
289289
}
290290

291291
/**
292-
* @param metrics
292+
* @param {MetricsList} metrics
293293
* @returns {*}
294294
* @memberof module:DashMetrics
295295
* @instance
@@ -315,7 +315,7 @@ function DashMetrics() {
315315
}
316316

317317
/**
318-
* @param metrics
318+
* @param {MetricsList} metrics
319319
* @returns {*}
320320
* @memberof module:DashMetrics
321321
* @instance
@@ -341,8 +341,8 @@ function DashMetrics() {
341341
}
342342

343343
/**
344-
* @param metrics
345-
* @param id
344+
* @param {MetricsList} metrics
345+
* @param {string} id
346346
* @returns {*}
347347
* @memberof module:DashMetrics
348348
* @instance
@@ -372,8 +372,8 @@ function DashMetrics() {
372372
}
373373

374374
/**
375-
* @param metrics
376-
* @param id
375+
* @param {MetricsList} metrics
376+
* @param {string} id
377377
* @returns {*}
378378
* @memberof module:DashMetrics
379379
* @instance

0 commit comments

Comments
 (0)