-
Notifications
You must be signed in to change notification settings - Fork 0
Property
Anton edited this page Dec 26, 2019
·
23 revisions
Property: A property of a type.
| Name | Type & Description | Initial |
|---|---|---|
| constructor | new () => Property | |
| Constructor method. | ||
| name | string | - |
| The name of the property. | ||
| description | ?string | null |
| The description of the property. | ||
| type | string | * |
| The type of the property. | ||
| hasDefault | boolean | false |
| Whether the property has the default value. | ||
| default | ?(string | boolean | number) | null |
| The default value of the property. | ||
| optional | boolean | false |
| If the property is optional. | ||
| args | Array<!Arg> | null |
| Function properties can have arguments specified inside of their tags. | ||
| isParsedFunction | boolean | false |
| Whether the property is a function which was parsed. | ||
| aliases | !Array<string> | [] |
| What aliases the property has. | ||
| static | boolean | false |
When writing externs, this will prevent adding .prototype, e.g., Type.static instead of Type.prototype.static.
|
||
| examples | !Array<string> | [] |
| Examples that have been read. | ||
| parsed | _typedefsParser.Type | null |
| Whether the property is a function which was parsed. | ||
| toTypeScriptFunction | (getLinks: function(!_typedefsParser.Type): string) => string | |
|
If the function was a parsed function, returns TypeScript type. getLinks* function(!_typedefsParser.Type): string: Returns the string with links to other types.
|
||
There's a special type of property called an Fn. This one is created when properties are expressed with <fn> or <function> tags. However, when a property is declared using <prop> but with a function as its type, like <prop type="function()">, it's not an Fn. This will probably change in the future.
Fn extends Property: This is a property of a constructor/interface which is a function.
| Name | Type & Description | Initial |
|---|---|---|
| constructor | new () => Fn | |
| Constructor method. | ||
| isConstructor | boolean | false |
| If this property of a type is its constructor. | ||
| async | boolean | false |
| Whether this is an async function. | ||
| return | string | '' |
| The return of the function. | ||