소스 검색

Fix typedoc

sebavan 6 년 전
부모
커밋
03a843778a

+ 26 - 18
Tools/Gulp/helpers/gulp-validateTypedoc.js

@@ -305,22 +305,25 @@ Validate.prototype.validateTypedocNamespace = function (namespace) {
                                         "Unrecognized tag " + tags + " at " + signatureNode.name + " (id: " + signatureNode.id + ") in " + containerNode.name + " (id: " + containerNode.id + ")", Validate.position(childNode));
                                 }
 
-                                if (signatureNode.type.name !== "void" && signatureNode.comment && !signatureNode.comment.returns) {
-                                    this.errorCallback(containerNode.name,
-                                        signatureNode.name,
-                                        childNode.kindString,
-                                        "Comments",
-                                        "MissingReturn",
-                                        "No Return Comment at " + signatureNode.name + " (id: " + signatureNode.id + ") in " + containerNode.name + " (id: " + containerNode.id + ")", Validate.position(childNode));
-                                }
-
-                                if (signatureNode.type.name === "void" && signatureNode.comment && signatureNode.comment.returns) {
-                                    this.errorCallback(containerNode.name,
-                                        signatureNode.name,
-                                        childNode.kindString,
-                                        "Comments",
-                                        "UselessReturn",
-                                        "No Return Comment Needed at " + signatureNode.name + " (id: " + signatureNode.id + ") in " + containerNode.name + " (id: " + containerNode.id + ")", Validate.position(childNode));
+                                if (signatureNode.kindString !== "Constructor" && 
+                                    signatureNode.kindString !== "Constructor signature") {
+                                    if (signatureNode.type.name !== "void" && signatureNode.comment && !signatureNode.comment.returns) {
+                                        this.errorCallback(containerNode.name,
+                                            signatureNode.name,
+                                            childNode.kindString,
+                                            "Comments",
+                                            "MissingReturn",
+                                            "No Return Comment at " + signatureNode.name + " (id: " + signatureNode.id + ") in " + containerNode.name + " (id: " + containerNode.id + ")", Validate.position(childNode));
+                                    }
+    
+                                    if (signatureNode.type.name === "void" && signatureNode.comment && signatureNode.comment.returns) {
+                                        this.errorCallback(containerNode.name,
+                                            signatureNode.name,
+                                            childNode.kindString,
+                                            "Comments",
+                                            "UselessReturn",
+                                            "No Return Comment Needed at " + signatureNode.name + " (id: " + signatureNode.id + ") in " + containerNode.name + " (id: " + containerNode.id + ")", Validate.position(childNode));
+                                    }
                                 }
                             }
 
@@ -371,7 +374,6 @@ Validate.prototype.validateTags = function (node) {
  * Validate that a JSON node has the correct TypeDoc comments
  */
 Validate.prototype.validateComment = function (node) {
-
     // Return-only methods are allowed to just have a @return tag
     if ((node.kindString === "Call signature" || node.kindString === "Accessor") && !node.parameters && node.comment && node.comment.returns) {
         return true;
@@ -395,7 +397,7 @@ Validate.prototype.validateComment = function (node) {
     // Check comments.
     if (node.comment) {
         if (node.comment.text || node.comment.shortText) {
-            return true;
+            return node.kindString !== "Constructor";
         }
 
         return false;
@@ -428,6 +430,12 @@ Validate.prototype.validateParameters = function (containerNode, method, signatu
         }
 
         if (this.validateNamingConvention && !Validate.camelCase.test(parametersNode.name)) {
+            if (containerNode.kindString === "Constructor" ||
+                containerNode.kindString !== "Constructor signature") {
+                    if (Validate.underscoreCamelCase.test(parametersNode.name)) {
+                        continue;
+                    }
+                }
             this.errorCallback([containerNode.name, method.kindString, signature.name],
                 parametersNode.name,
                 parametersNode.kindString,

+ 1 - 1
src/Animations/animation.ts

@@ -481,7 +481,7 @@ export class Animation {
      * @param framePerSecond The frames per second of the animation
      * @param dataType The data type of the animation
      * @param loopMode The loop mode of the animation
-     * @param enableBlendings Specifies if blending should be enabled
+     * @param enableBlending Specifies if blending should be enabled
      */
     constructor(
         /**Name of the animation */

+ 1 - 0
src/Audio/sound.ts

@@ -122,6 +122,7 @@ export class Sound {
     * Create a sound and attach it to a scene
     * @param name Name of your sound
     * @param urlOrArrayBuffer Url to the sound to load async or ArrayBuffer, it also works with MediaStreams
+    * @param scene defines the scene the sound belongs to
     * @param readyToPlayCallback Provide a callback function if you'd like to load your code once the sound is ready to be played
     * @param options Objects to provide with the current available options: autoplay, loop, volume, spatialSound, maxDistance, rolloffFactor, refDistance, distanceModel, panningModel, streaming
     */

+ 1 - 1
src/Bones/boneLookController.ts

@@ -142,7 +142,7 @@ export class BoneLookController {
      * @param mesh the mesh that the bone belongs to
      * @param bone the bone that will be looking to the target
      * @param target the target Vector3 to look at
-     * @param settings optional settings:
+     * @param options optional settings:
      * * maxYaw: the maximum angle the bone will yaw to
      * * minYaw: the minimum angle the bone will yaw to
      * * maxPitch: the maximum angle the bone will pitch to

+ 2 - 2
src/Events/clipboardEvents.ts

@@ -22,8 +22,8 @@ export class ClipboardEventTypes {
 export class ClipboardInfo {
     /**
      *Creates an instance of ClipboardInfo.
-     * @param {number} type
-     * @param {ClipboardEvent} event
+     * @param type Defines the type of event (BABYLON.ClipboardEventTypes)
+     * @param event Defines the related dom event
      */
     constructor(
         /**

+ 1 - 1
src/Helpers/environmentHelper.ts

@@ -331,7 +331,7 @@ export class EnvironmentHelper {
 
     /**
      * constructor
-     * @param options
+     * @param options Defines the options we want to customize the helper
      * @param scene The scene to add the material to
      */
     constructor(options: Partial<IEnvironmentHelperOptions>, scene: Scene) {

+ 2 - 1
src/Maths/math.ts

@@ -6679,6 +6679,7 @@ export class Angle {
 
     /**
      * Creates an Angle object of "radians" radians (float).
+     * @param radians the angle in radians
      */
     constructor(radians: number) {
         this._radians = radians;
@@ -6962,7 +6963,7 @@ export class Path3D {
     * Creates a Path3D. A Path3D is a logical math object, so not a mesh.
     * please read the description in the tutorial : https://doc.babylonjs.com/how_to/how_to_use_path3d
     * @param path an array of Vector3, the curve axis of the Path3D
-    * @param normal (options) Vector3, the first wanted normal to the curve. Ex (0, 1, 0) for a vertical normal.
+    * @param firstNormal (options) Vector3, the first wanted normal to the curve. Ex (0, 1, 0) for a vertical normal.
     * @param raw (optional, default false) : boolean, if true the returned Path3D isn't normalized. Useful to depict path acceleration or speed.
     */
     constructor(

+ 1 - 0
src/Meshes/polygonMesh.ts

@@ -174,6 +174,7 @@ export class PolygonMeshBuilder {
      * @param name name of the builder
      * @param contours Path of the polygon
      * @param scene scene to add to
+     * @param earcutInjection can be used to inject your own earcut reference
      */
     constructor(name: string, contours: Path2 | Vector2[] | any, scene: Scene, earcutInjection = earcut) {
         this.bjsEarcut = earcutInjection;

+ 1 - 0
src/Morph/morphTarget.ts

@@ -79,6 +79,7 @@ export class MorphTarget implements IAnimatable {
      * Creates a new MorphTarget
      * @param name defines the name of the target
      * @param influence defines the influence to use
+     * @param scene defines the scene the morphtarget belongs to
      */
     public constructor(
         /** defines the name of the target */

+ 1 - 1
src/Particles/EmitterTypes/coneParticleEmitter.ts

@@ -65,7 +65,7 @@ export class ConeParticleEmitter implements IParticleEmitterType {
     /**
      * Creates a new instance ConeParticleEmitter
      * @param radius the radius of the emission cone (1 by default)
-     * @param angles the cone base angle (PI by default)
+     * @param angle the cone base angle (PI by default)
      * @param directionRandomizer defines how much to randomize the particle direction [0-1] (default is 0)
      */
     constructor(radius = 1, angle = Math.PI,

+ 1 - 0
src/Particles/solidParticle.ts

@@ -131,6 +131,7 @@ export class SolidParticle {
      * @param model (ModelShape) is a reference to the model shape on what the particle is designed.
      * @param shapeId (integer) is the model shape identifier in the SPS.
      * @param idxInShape (integer) is the index of the particle in the current model (ex: the 10th box of addShape(box, 30))
+     * @param sps defines the sps it is associated to
      * @param modelBoundingInfo is the reference to the model BoundingInfo used for intersection computations.
      */
     constructor(particleIndex: number, positionIndex: number, indiceIndex: number, model: Nullable<ModelShape>, shapeId: number, idxInShape: number, sps: SolidParticleSystem, modelBoundingInfo: Nullable<BoundingInfo> = null) {

+ 7 - 6
src/Particles/solidParticleSystem.ts

@@ -118,12 +118,13 @@ export class SolidParticleSystem implements IDisposable {
      * Creates a SPS (Solid Particle System) object.
      * @param name (String) is the SPS name, this will be the underlying mesh name.
      * @param scene (Scene) is the scene in which the SPS is added.
-     * @param updatable (optional boolean, default true) : if the SPS must be updatable or immutable.
-     * @param isPickable (optional boolean, default false) : if the solid particles must be pickable.
-     * @param enableDepthSort (optional boolean, default false) : if the solid particles must be sorted in the geometry according to their distance to the camera.
-     * @param particleIntersection (optional boolean, default false) : if the solid particle intersections must be computed.
-     * @param boundingSphereOnly (optional boolean, default false) : if the particle intersection must be computed only with the bounding sphere (no bounding box computation, so faster).
-     * @param bSphereRadiusFactor (optional float, default 1.0) : a number to multiply the boundind sphere radius by in order to reduce it for instance.
+     * @param options defines the options of the sps e.g.
+     * * updatable (optional boolean, default true) : if the SPS must be updatable or immutable.
+     * * isPickable (optional boolean, default false) : if the solid particles must be pickable.
+     * * enableDepthSort (optional boolean, default false) : if the solid particles must be sorted in the geometry according to their distance to the camera.
+     * * particleIntersection (optional boolean, default false) : if the solid particle intersections must be computed.
+     * * boundingSphereOnly (optional boolean, default false) : if the particle intersection must be computed only with the bounding sphere (no bounding box computation, so faster).
+     * * bSphereRadiusFactor (optional float, default 1.0) : a number to multiply the boundind sphere radius by in order to reduce it for instance.
      * @example bSphereRadiusFactor = 1.0 / Math.sqrt(3.0) => the bounding sphere exactly matches a spherical mesh.
      */
     constructor(name: string, scene: Scene, options?: { updatable?: boolean; isPickable?: boolean; enableDepthSort?: boolean; particleIntersection?: boolean; boundingSphereOnly?: boolean; bSphereRadiusFactor?: number }) {

+ 1 - 1
src/Rendering/edgesRenderer.ts

@@ -169,7 +169,7 @@ export class EdgesRenderer implements IEdgesRenderer {
      * Beware when you use this class with complex objects as the adjacencies computation can be really long
      * @param  source Mesh used to create edges
      * @param  epsilon sum of angles in adjacency to check for edge
-     * @param  checkVerticesInsteadOfIndices
+     * @param  checkVerticesInsteadOfIndices bases the edges detection on vertices vs indices
      * @param  generateEdgesLines - should generate Lines or only prepare resources.
      */
     constructor(source: AbstractMesh, epsilon = 0.95, checkVerticesInsteadOfIndices = false, generateEdgesLines = true) {

+ 1 - 0
src/scene.ts

@@ -1286,6 +1286,7 @@ export class Scene extends AbstractScene implements IAnimatable {
     /**
      * Creates a new Scene
      * @param engine defines the engine to use to render this scene
+     * @param options defines the scene options
      */
     constructor(engine: Engine, options?: SceneOptions) {
         super();