From c85ce4cb5288269b14fa221c1f8bf32f08435a76 Mon Sep 17 00:00:00 2001 From: Guillaume Grossetie Date: Thu, 2 Jan 2020 22:49:41 +0100 Subject: [PATCH] resolves #108 generate dtslint compliant code --- src/create_helpers.ts | 87 +++++++++++++++++--- src/typings/jsdoc.d.ts | 2 +- test/expected/class_all.d.ts | 135 ++++++------------------------- test/expected/enum_all.d.ts | 2 - test/expected/function_all.d.ts | 31 ------- test/expected/interface_all.d.ts | 56 +------------ test/expected/module.d.ts | 15 ++-- test/expected/namespace_all.d.ts | 71 ++-------------- test/expected/property_all.d.ts | 46 ++--------- test/expected/typedef_all.d.ts | 74 +++++++---------- 10 files changed, 150 insertions(+), 369 deletions(-) diff --git a/src/create_helpers.ts b/src/create_helpers.ts index b93e2e1..da4679f 100644 --- a/src/create_helpers.ts +++ b/src/create_helpers.ts @@ -67,24 +67,89 @@ function validateModuleChildren(children?: ts.Node[]) } } +function formatMultilineComment(comment: string): string { + return comment.split('\n').join('\n * '); +} + +function handlePropsComment(props: IDocletProp[], jsdocTagName: String): string[] { + return props.map(prop => { + if (prop.description) { + let name; + if (prop.optional) { + if (prop.defaultvalue !== undefined) { + name = `[${prop.name} = ${prop.defaultvalue}]`; + } else { + name = `[${prop.name}]`; + } + } else { + name = prop.name; + } + const description = ` - ${formatMultilineComment(prop.description)}`; + return `\n * @${jsdocTagName} ${name}${description}` + } + return '' + }).filter(value => value !== '') +} + +function handleReturnsComment(doclet: IDocletBase): string[] { + if ('returns' in doclet) { + return (doclet['returns'] as IDocletReturn[]).map(ret => { + if (ret.description) { + return `\n * @returns ${formatMultilineComment(ret.description)}`; + } + return ''; + }).filter(value => value !== ''); + } + return [] +} + +function handleExamplesComment(doclet: IDocletBase): string[] { + if (doclet.examples !== undefined) { + return doclet.examples.map(example => { + return `\n * @example + * ${formatMultilineComment(example)}`; + }); + } + return []; +} + +function handleParamsComment(doclet: IDocletBase): string[] { + if ('params' in doclet) { + return handlePropsComment((doclet['params'] as IDocletProp[]), 'param'); + } + return [] +} + +function handlePropertiesComment(doclet: IDocletBase): string[] { + if (doclet.properties && (!('isEnum' in doclet) || (doclet['isEnum'] === false))) { + return handlePropsComment(doclet.properties, 'property'); + } + return [] +} + function handleComment(doclet: IDocletBase, node: T): T { if (doclet.comment && doclet.comment.length > 4) { - let comment = doclet.comment; - - // remove '/*' and '*/' - comment = comment.substring(2, doclet.comment.length - 2); - - // remove ' *' leading spaces - comment = comment.replace(/[ \t]+\*/g, ' *'); + let description = ''; + if (doclet.description) { + description = `\n * ${formatMultilineComment(doclet.description)}`; + } else if ('classdesc' in doclet) { + description = `\n * ${formatMultilineComment((doclet['classdesc'] as string))}`; + } + const examples = handleExamplesComment(doclet); + const properties = handlePropertiesComment(doclet); + const params = handleParamsComment(doclet); + const returns = handleReturnsComment(doclet); - // remove trailing spacesgit dif - comment = comment.trim() + '\n '; + if (description || examples.length > 0 || properties.length > 0 || params.length > 0 || returns.length > 0) { + let comment = `*${description}${examples.join('')}${properties.join('')}${params.join('')}${returns.join('')} + `; - const kind = ts.SyntaxKind.MultiLineCommentTrivia; + const kind = ts.SyntaxKind.MultiLineCommentTrivia; - ts.addSyntheticLeadingComment(node, kind, comment, true); + ts.addSyntheticLeadingComment(node, kind, comment, true); + } } return node; diff --git a/src/typings/jsdoc.d.ts b/src/typings/jsdoc.d.ts index 5a736a2..60050e7 100644 --- a/src/typings/jsdoc.d.ts +++ b/src/typings/jsdoc.d.ts @@ -77,7 +77,7 @@ declare interface IDocletBase { memberof?: string; see?: string; access?: ('public' | 'private' | 'protected'); - examples?: string; + examples?: string[]; deprecated?: string; defaultvalue?: string; comment?: string; diff --git a/test/expected/class_all.d.ts b/test/expected/class_all.d.ts index 55a91cb..b900606 100644 --- a/test/expected/class_all.d.ts +++ b/test/expected/class_all.d.ts @@ -1,52 +1,21 @@ -/** - * @this OtherThing - */ declare function doStuff(): void; -/** - * @class - * @abstract - */ declare class OtherThing { - /** - * - */ copy(): void; } -/** - * - */ declare class Stuff { - /** - * - */ doStuff(): void; } -/** - * - */ declare class Things { - /** - * - */ doThings(): void; - /** - * @method Things#[foobar1] - */ foobar1?(): void; - /** - * @type {Number} - * @name Things#[foobar2] - */ foobar2?: number; } /** * Deep class #1 - * - * @class */ declare class DeepClass1 { constructor(); @@ -55,8 +24,6 @@ declare class DeepClass1 { declare namespace DeepClass1 { /** * Deep class #2 - * - * @class */ class DeepClass2 { constructor(); @@ -64,8 +31,6 @@ declare namespace DeepClass1 { namespace DeepClass2 { /** * Deep class #3 - * - * @class */ class DeepClass3 { constructor(); @@ -73,8 +38,6 @@ declare namespace DeepClass1 { namespace DeepClass3 { /** * Deep class #4 - * - * @class */ class DeepClass4 { constructor(); @@ -83,35 +46,24 @@ declare namespace DeepClass1 { } } -/** @module util - */ declare module "util" { - /** - * @class MyClass - * @param {string} message - * @returns {MyClass} - */ class MyClass { constructor(message: string); - /** @type {string} - */ message: string; } /** * GitGraph - * @class GitGraph - * @param {object} options - GitGraph options - * @param {string} [options.elementId = "gitGraph"] - Id of the canvas container - * @param {Template|string|object} [options.template] - Template of the graph - * @param {string} [options.author = "Sergio Flores "] - Default author for commits - * @param {string} [options.mode = (null|"compact")] - Display mode - * @param {HTMLElement} [options.canvas] - DOM canvas (ex: document.getElementById("id")) - * @param {string} [options.orientation = ("vertical-reverse"|"horizontal"|"horizontal-reverse")] - Graph orientation - * @param {boolean} [options.reverseArrow = false] - Make arrows point to ancestors if true - * @param {number} [options.initCommitOffsetX = 0] - Add custom offsetX to initial commit. - * @param {number} [options.initCommitOffsetY = 0] - Add custom offsetY to initial commit. - * @param {HTMLElement} [options.tooltipContainer = document.body] - HTML Element containing tooltips in compact mode. - * @this GitGraph + * @param options - GitGraph options + * @param [options.elementId = "gitGraph"] - Id of the canvas container + * @param [options.template] - Template of the graph + * @param [options.author = "Sergio Flores "] - Default author for commits + * @param [options.mode = (null|"compact")] - Display mode + * @param [options.canvas] - DOM canvas (ex: document.getElementById("id")) + * @param [options.orientation = ("vertical-reverse"|"horizontal"|"horizontal-reverse")] - Graph orientation + * @param [options.reverseArrow = false] - Make arrows point to ancestors if true + * @param [options.initCommitOffsetX = 0] - Add custom offsetX to initial commit. + * @param [options.initCommitOffsetY = 0] - Add custom offsetY to initial commit. + * @param [options.tooltipContainer = document.body] - HTML Element containing tooltips in compact mode. */ class GitGraph { constructor(options: { @@ -127,130 +79,89 @@ declare module "util" { tooltipContainer?: HTMLElement; }); } - /** - * @typedef Something - * @type boolean - */ type Something = boolean; interface MyThing extends Stuff, Things { } - /** - * @class MyThing - * @extends OtherThing - * @mixes Stuff - * @mixes Things - */ class MyThing extends OtherThing implements Stuff, Things { /** * Derp or something. - * - * @member {string} - * @readonly */ readonly derp: string; - /** - * @member {Object>} - */ map: { [key: string]: (number | string)[]; }; - /** - * @member {Array>>>} - */ superArray: string[][][][][]; - /** - * @member {Array} - */ simpleArray: any[]; /** * Creates a new thing. - * - * @param {!FoobarNS.CircleOptions} opts - Namespace test! - * @return {MyThing} the new thing. + * @param opts - Namespace test! + * @returns the new thing. */ static create(opts: FoobarNS.CircleOptions): MyThing; /** * Gets a Promise that will resolve with an Object, or reject with OtherThing - * - * @return {Promise} The Promise + * @returns The Promise */ promiseMe(): Promise; /** * Gets a Promise that will resolve with an array of OtherThings - * - * @return {Promise>} The Promise + * @returns The Promise */ promiseYou(): Promise; /** * Gets a Promise that will resolve with a bunch of possible types - * - * @return {Promise|Object|number|string>} The Promise + * @returns The Promise */ promiseFoo(): Promise; /** * Gets a Promise that will resolve with an object with complex properties - * - * @return {Promise<{newChannels: Channel[], foo: Bar}>} The Promise + * @returns The Promise */ promiseBar(): Promise<{ newChannels: Channel[]; foo: Bar; }>; /** * Gets a Promise that will resolve with a generic function - * - * @return {Promise} The Promise + * @returns The Promise */ promiseGenericFunc(): Promise<(...params: any[]) => void>; /** * Gets a Promise that will resolve with a function with no arguments * that returns a string. - * - * @return {Promise} The Promise + * @returns The Promise */ promiseStringFunc(): Promise<(...params: any[]) => string>; /** * Gets a Promise that will resolve with a function with lots of arguments * that returns an object. - * - * @return {Promise, object, number, string): object>} The Promise + * @returns The Promise */ promiseLotsArgsFunc(): Promise<(arg0: OtherThing[], arg1: object, arg2: number, arg3: string) => object>; /** * Gets a Promise that will resolve with a function with lots of arguments * that returns the default type. - * - * @return {Promise, object, number, string)>} The Promise + * @returns The Promise */ promiseDefaultRetFunc(): Promise<(arg0: OtherThing[], arg1: object, arg2: number, arg3: string) => void>; /** * A param that is a function * Note: doesn't matter what I put, a @param only gets "FUNCTION" from jsdoc - * @param {function(number): object} */ takeFuncParam(f: (...params: any[]) => any): void; /** * A param that is a complex function * Note: doesn't matter what I put, a @param only gets "FUNCTION" from jsdoc - * @param {function(Array., object, number): object} */ takeFuncParamComplex(f: (...params: any[]) => any): void; /** - * - * @param {GitGraphOptions} options - GitGraph options + * @param options - GitGraph options */ objParam(options: GitGraphOptions): void; /** * Gets derp. - * - * @member {string} */ D: string; - /** - * @member {number} - * @static - */ static me: number; /** - * @param {OtherThing} other - To copy from. - * @override + * @param other - To copy from. */ copy(other: OtherThing): void; } diff --git a/test/expected/enum_all.d.ts b/test/expected/enum_all.d.ts index 127aded..0ad16e8 100644 --- a/test/expected/enum_all.d.ts +++ b/test/expected/enum_all.d.ts @@ -1,7 +1,5 @@ /** * Enum for tri-state values. - * @readonly - * @enum {number} */ declare enum triState { TRUE = 1, diff --git a/test/expected/function_all.d.ts b/test/expected/function_all.d.ts index 87754eb..5402f77 100644 --- a/test/expected/function_all.d.ts +++ b/test/expected/function_all.d.ts @@ -1,43 +1,12 @@ -/** - * - * @param {number} [a=10] - * @param {Object} input - * @param {number} input.x - * @param {number} input.y - */ declare function test1(a?: number, input: { x: number; y: number; }): void; -/** - * - * @param {Array<*>} x - * @param {Array.<*>} y - * @param {Array} z - * @param {Array} w - */ declare function test2(x: any[], y: any[], z: any[], w: any[][]): void; -/** - * @class - */ declare class Test12345 { - /** - * @function - * @memberof Test12345 - * @name f - * @return {number[]} - */ static f(): number[]; - /** - * @function - * @memberof Test12345 - * @variation 1 - * @name f - * @param {string} key - * @return {number} - */ static f(key: string): number; } diff --git a/test/expected/interface_all.d.ts b/test/expected/interface_all.d.ts index 8983a3c..85e77b9 100644 --- a/test/expected/interface_all.d.ts +++ b/test/expected/interface_all.d.ts @@ -1,82 +1,28 @@ declare namespace Color { - /** - * @function Color.staticMethod1 - */ function staticMethod1(): void; - /** - * @function - * @static - */ function staticMethod2(): void; - /** - * @member {Number} Color.staticMember1 - */ var staticMember1: number; - /** - * @member {Boolean} - * @static - */ var staticMember2: boolean; - /** - * @type {String} - * @name Color.staticMember3 - */ var staticMember3: string; - /** - * @type {Object} - * @static - */ var staticMember4: any; } /** * Interface for classes that represent a color. - * - * @interface */ declare interface Color { - /** - * @function - */ instanceMethod(): void; - /** - * @member {Number} - */ instanceMember: number; /** * Get the color as an array of red, green, and blue values, represented as * decimal numbers between 0 and 1. - * - * @returns {Array} An array containing the red, green, and blue values, + * @returns An array containing the red, green, and blue values, * in that order. */ rgb(): number[]; - /** - * @function - * @name [foobar1] - * @memberof Color# - */ foobar1?(): void; - /** - * @function [foobar2] - * @memberof Color# - */ foobar2?(): void; - /** - * @type {Boolean} - * @name [foobar3] - * @memberof Color# - */ foobar3?: boolean; - /** - * @member {String} - * @name [foobar4] - * @memberof Color# - */ foobar4?: string; - /** - * @member {Object} [foobar5] - * @memberof Color# - */ foobar5?: any; } diff --git a/test/expected/module.d.ts b/test/expected/module.d.ts index 1bd7503..6719f6b 100644 --- a/test/expected/module.d.ts +++ b/test/expected/module.d.ts @@ -1,12 +1,7 @@ -/** @module array-to-object-keys - */ declare module "array-to-object-keys" { /** - * @typedef valueGenerator - * @type {function} - * @param {string} value The original array entry - * @param {number} index The index of the array entry (starts at 0) - * @returns {*} + * @param value - The original array entry + * @param index - The index of the array entry (starts at 0) */ type valueGenerator = (value: string, index: number) => any; /** @@ -20,9 +15,9 @@ declare module "array-to-object-keys" { * @example * arrayToObjectKeys(["a", "b"], (key, index) => `value for ${key} #${index + 1}`) * // {a: "value for a #1", b: "value for b #2"} - * @param {string[]} array Keys for the generated object - * @param {valueGenerator|*} [valueGenerator=null] Optional function that sets the object values based on key and index - * @returns {Object} A generated object based on the array input + * @param array - Keys for the generated object + * @param [valueGenerator = null] - Optional function that sets the object values based on key and index + * @returns A generated object based on the array input */ function arrayToObjectKeys(array: string[], valueGenerator?: valueGenerator | any): { [key: string]: any; diff --git a/test/expected/namespace_all.d.ts b/test/expected/namespace_all.d.ts index eb884e8..e6baaa7 100644 --- a/test/expected/namespace_all.d.ts +++ b/test/expected/namespace_all.d.ts @@ -1,21 +1,13 @@ -/** - * @namespace FoobarNS - */ declare namespace FoobarNS { /** - * @classdesc * A Foo. - * - * @constructor - * @template T */ class Foo { /** * A generic method. - * @param {FoobarNS.Foo.FCallback} f A function. - * @param [opt_this=10] An object. - * @param {number[]|object} [opt_2=10] An object. - * @template S + * @param f - A function. + * @param [opt_this = 10] - An object. + * @param [opt_2 = 10] - An object. */ f(f: FoobarNS.Foo.FCallback, opt_this?: any, opt_2?: number[] | { [key: number]: string[]; @@ -23,22 +15,14 @@ declare namespace FoobarNS { } namespace Foo { /** - * @callback FCallback - * @this S - * @memberof FoobarNS.Foo - * @param {T} first - The first param. - * @param {number} second - The second param. - * @param {T[]} third - The third param. - * @returns {*} + * @param first - The first param. + * @param second - The second param. + * @param third - The third param. */ type FCallback = (this: S, first: T, second: number, third: T[]) => any; } /** - * @classdesc * A Bar. - * - * @constructor - * @extends FoobarNS.Foo */ class Bar extends FoobarNS.Foo { /** @@ -46,67 +30,26 @@ declare namespace FoobarNS { */ f(): void; } - /** - * @interface - */ interface CircleOptions { /** * Circle radius. - * @type {number} */ radius: number; } /** - * @classdesc * Set circle style for vector features. - * - * @constructor - * @param {FoobarNS.CircleOptions=} opt_options Options. + * @param [opt_options] - Options. */ class Circle { constructor(opt_options?: FoobarNS.CircleOptions); } - /** - * @member {Number} - */ var helloWorld1: number; - /** - * @type {Boolean} - */ var helloWorld2: boolean; - /** - * @constant - * @type {String} - */ const helloWorld3: string; - /** - * @constant - * @type {Number} - */ const helloWorld4: number; - /** - * @constant - * @type {Boolean} - */ const helloWorld5: boolean; - /** - * @constant - * @type {Object} - */ const helloWorld6: any; - /** - * @constant - * @type {String} - */ const helloWorld7 = "test"; - /** - * @constant - * @type {Number} - */ const helloWorld8 = 1.2345; - /** - * @constant - * @type {Boolean} - */ const helloWorld9 = true; } diff --git a/test/expected/property_all.d.ts b/test/expected/property_all.d.ts index 0e43de7..0bc4dda 100644 --- a/test/expected/property_all.d.ts +++ b/test/expected/property_all.d.ts @@ -1,6 +1,5 @@ /** - * @class - * @property {String} myProp foobar + * @property myProp - foobar */ declare class PropTest1 { /** @@ -9,42 +8,25 @@ declare class PropTest1 { myProp: string; } -/** - * @class - * @property {Number} myProp - */ declare class PropTest2 { - /** - * @name PropTest2#otherProp - * @type {Number} - */ otherProp: number; myProp: number; } -/** - * @class - * @property {Boolean} myProp - */ declare class PropTest3 { /** - * @name PropTest3#myProp - * @type {Boolean} - * @description duplicate + * duplicate */ myProp: boolean; /** - * @name PropTest3#myProp - * @type {Boolean} - * @description duplicate + * duplicate */ myProp: boolean; myProp: boolean; } /** - * @constructor - * @property {String} myProp foobar + * @property myProp - foobar */ declare class PropTest4 { constructor(); @@ -54,36 +36,20 @@ declare class PropTest4 { myProp: string; } -/** - * @constructor - * @property {Number} myProp - */ declare class PropTest5 { constructor(); - /** - * @name PropTest5#otherProp - * @type {Number} - */ otherProp: number; myProp: number; } -/** - * @constructor - * @property {Boolean} myProp - */ declare class PropTest6 { constructor(); /** - * @name PropTest6#myProp - * @type {Boolean} - * @description duplicate + * duplicate */ myProp: boolean; /** - * @name PropTest6#myProp - * @type {Boolean} - * @description duplicate + * duplicate */ myProp: boolean; myProp: boolean; diff --git a/test/expected/typedef_all.d.ts b/test/expected/typedef_all.d.ts index 677e786..5eaee90 100644 --- a/test/expected/typedef_all.d.ts +++ b/test/expected/typedef_all.d.ts @@ -1,9 +1,8 @@ /** * The complete Triforce, or one or more components of the Triforce. - * @typedef {object} Triforce - * @property {boolean} hasCourage - Indicates whether the Courage component is present. - * @property {boolean} hasPower - Indicates whether the Power component is present. - * @property {boolean} hasWisdom - Indicates whether the Wisdom component is present. + * @property hasCourage - Indicates whether the Courage component is present. + * @property hasPower - Indicates whether the Power component is present. + * @property hasWisdom - Indicates whether the Wisdom component is present. */ declare type Triforce = { hasCourage: boolean; @@ -13,15 +12,9 @@ declare type Triforce = { /** * The complete Triforce, or one or more components of the Triforce. - * @typedef Anon - * @property {boolean} hasCourage - Indicates whether the Courage component is present. - * @property {boolean} hasPower - Indicates whether the Power component is present. - * @property {boolean} hasWisdom - Indicates whether the Wisdom component is present. - * @property {object} thing - * @property {object} thing.a - * @property {object} thing.a.b - * @property {object} thing.a.b.c - * @property {number} thing.b + * @property hasCourage - Indicates whether the Courage component is present. + * @property hasPower - Indicates whether the Power component is present. + * @property hasWisdom - Indicates whether the Wisdom component is present. */ declare type Anon = { hasCourage: boolean; @@ -38,18 +31,16 @@ declare type Anon = { }; /** - * - * @typedef {object} GitGraphOptions - * @property {string} [elementId = "gitGraph"] - Id of the canvas container - * @property {Template|string|Object} [template] - Template of the graph - * @property {string} [author = "Sergio Flores "] - Default author for commits - * @property {string} [mode = (null|"compact")] - Display mode - * @property {HTMLElement} [canvas] - DOM canvas (ex: document.getElementById("id")) - * @property {string} [orientation = ("vertical-reverse"|"horizontal"|"horizontal-reverse")] - Graph orientation - * @property {boolean} [reverseArrow = false] - Make arrows point to ancestors if true - * @property {number} [initCommitOffsetX = 0] - Add custom offsetX to initial commit. - * @property {number} [initCommitOffsetY = 0] - Add custom offsetY to initial commit. - * @property {HTMLElement} [tooltipContainer = document.body] - HTML Element containing tooltips in compact mode. + * @property [elementId = "gitGraph"] - Id of the canvas container + * @property [template] - Template of the graph + * @property [author = "Sergio Flores "] - Default author for commits + * @property [mode = (null|"compact")] - Display mode + * @property [canvas] - DOM canvas (ex: document.getElementById("id")) + * @property [orientation = ("vertical-reverse"|"horizontal"|"horizontal-reverse")] - Graph orientation + * @property [reverseArrow = false] - Make arrows point to ancestors if true + * @property [initCommitOffsetX = 0] - Add custom offsetX to initial commit. + * @property [initCommitOffsetY = 0] - Add custom offsetY to initial commit. + * @property [tooltipContainer = document.body] - HTML Element containing tooltips in compact mode. */ declare type GitGraphOptions = { elementId?: string; @@ -66,44 +57,41 @@ declare type GitGraphOptions = { /** * A number, or a string containing a number. - * @typedef {(number|string)} NumberLike */ declare type NumberLike = number | string; /** - * @typedef {Object} PatternOptions - * - * @property {Object} pattern Holds a pattern definition. - * @property {String} pattern.image URL to an image to use as the pattern. - * @property {Number} pattern.width Width of the pattern. For images this is + * @property pattern - Holds a pattern definition. + * @property pattern.image - URL to an image to use as the pattern. + * @property pattern.width - Width of the pattern. For images this is * automatically set to the width of the element bounding box if not supplied. * For non-image patterns the default is 32px. Note that automatic resizing of * image patterns to fill a bounding box dynamically is only supported for * patterns with an automatically calculated ID. - * @property {Number} pattern.height Analogous to pattern.width. - * @property {Number} pattern.aspectRatio For automatically calculated width and + * @property pattern.height - Analogous to pattern.width. + * @property pattern.aspectRatio - For automatically calculated width and * height on images, it is possible to set an aspect ratio. The image will be * zoomed to fill the bounding box, maintaining the aspect ratio defined. - * @property {Number} pattern.x Horizontal offset of the pattern. Defaults to 0. - * @property {Number} pattern.y Vertical offset of the pattern. Defaults to 0. - * @property {Object|String} pattern.path Either an SVG path as string, or an + * @property pattern.x - Horizontal offset of the pattern. Defaults to 0. + * @property pattern.y - Vertical offset of the pattern. Defaults to 0. + * @property pattern.path - Either an SVG path as string, or an * object. As an object, supply the path string in the `path.d` property. Other * supported properties are standard SVG attributes like `path.stroke` and * `path.fill`. If a path is supplied for the pattern, the `image` property is * ignored. - * @property {String} pattern.color Pattern color, used as default path stroke. - * @property {Number} pattern.opacity Opacity of the pattern as a float value + * @property pattern.color - Pattern color, used as default path stroke. + * @property pattern.opacity - Opacity of the pattern as a float value * from 0 to 1. - * @property {String} pattern.id ID to assign to the pattern. This is + * @property pattern.id - ID to assign to the pattern. This is * automatically computed if not added, and identical patterns are reused. To * refer to an existing pattern for a Highcharts color, use * `color: "url(#pattern-id)"`. - * @property {Object|Boolean} animation Animation options for the image pattern + * @property animation - Animation options for the image pattern * loading. * Note: doesn't matter what I put, a @property only gets "FUNCTION" from jsdoc - * @property {function(number): void} rotate Rotates the pattern by degrees - * @property {function} wiggle Wiggles the pattern (default function) - * @property {function(string, number): Promise} wobble Wobbles the pattern + * @property rotate - Rotates the pattern by degrees + * @property wiggle - Wiggles the pattern (default function) + * @property wobble - Wobbles the pattern * (complex function) */ declare type PatternOptions = {