Members
LONGNAMES
LONGNAMES :string
Longnames that have a special meaning in JSDoc.
Type:
- string
Properties:
| Name | Type | Description |
|---|---|---|
ANONYMOUS |
string | Longname used for doclets that do not have a longname, such as anonymous functions. |
GLOBAL |
string | Longname that represents global scope. |
puncToScope
SCOPE :string
Names and punctuation marks that identify doclet scopes.
Type:
- string
Properties:
| Name | Type | Description |
|---|---|---|
NAMES |
string | |
PUNC |
string |
SCOPE
scopeToPunc
_
about
about
about
about
about
about
about
c
chunks
currentLongname
currentNameInfo
currentParent
currentParent
DEFAULT_SCOPE
description
description
DESCRIPTION
escape
hasAncestor
hasOwnProp
i
includeVariation
longname
longname
longname
longname
longname
longname
memberof
memberof
memberof
memberof
memberof
memberof
memberof
memberof
metaName
MODULE_NAMESPACE
name
name
name
name
nameInfo
nameInfo
options
p2
parts
parts
partsRegExp
previousName
previousName
processed
punc
puncAndName
puncAndNameIndex
puncToScope
REGEXP_DESCRIPTION
REGEXP_LEADING_SCOPE
REGEXP_NAME_DESCRIPTION
REGEXP_TRAILING_SCOPE
result
scope
scope
SCOPE_PUNC
SCOPE_PUNC_STRING
scopePunc
scopePunc
scopePunc
scopeToPunc
stringEnd
stringEnd
token
variation
variation
variation
Methods
applyNamespace(longname, ns) → {string}
Parameters:
| Name | Type | Description |
|---|---|---|
longname |
string | The full longname of the symbol. |
ns |
string | The namespace to be applied. |
Returns:
The longname with the namespace applied.
- Type
- string
combine()
getBasename(name) → {string}
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The symbol's longname. |
Returns:
The symbol's basename.
- Type
- string
hasAncestor(parent, child) → {boolean}
Check whether a parent longname is an ancestor of a child longname.
Parameters:
| Name | Type | Description |
|---|---|---|
parent |
string | The parent longname. |
child |
string | The child longname. |
Returns:
`true` if the parent is an ancestor of the child; otherwise, `false`.
- Type
- boolean
longnamesToTree(longnames, doclets) → {Object}
Convert an array of doclet longnames into a tree structure, optionally attaching doclets to the
tree.
Each level of the tree is an object with the following properties:
+ `longname {string}`: The longname.
+ `memberof {string?}`: The memberof.
+ `scope {string?}`: The longname's scope, represented as a punctuation mark (for example, `#`
for instance and `.` for static).
+ `name {string}`: The short name.
+ `doclet {Object?}`: The doclet associated with the longname, or `null` if the doclet was not
provided.
+ `children {Object?}`: The children of the current longname. Not present if there are no
children.
For example, suppose you have the following array of doclet longnames:
```js
[
"module:a",
"module:a/b",
"myNamespace",
"myNamespace.Foo",
"myNamespace.Foo#bar"
]
```
This method converts these longnames to the following tree:
```js
{
"module:a": {
"longname": "module:a",
"memberof": "",
"scope": "",
"name": "module:a",
"doclet": null,
"children": {
"/b": {
"longname": "module:a/b",
"memberof": "module:a",
"scope": "/",
"name": "b",
"doclet": null
}
}
},
"myNamespace": {
"longname": "myNamespace",
"memberof": "",
"scope": "",
"name": "myNamespace",
"doclet": null,
"children": {
".Foo": {
"longname": "myNamespace.Foo",
"memberof": "myNamespace",
"scope": ".",
"name": "Foo",
"doclet": null,
"children": {
"#bar": {
"longname": "myNamespace.Foo#bar",
"memberof": "myNamespace.Foo",
"scope": "#",
"name": "bar",
"doclet": null
}
}
}
}
}
}
```
Parameters:
| Name | Type | Description |
|---|---|---|
longnames |
Array.<string> | The longnames to convert into a tree. |
doclets |
Object.<string, module:jsdoc/doclet.Doclet> | The doclets to attach to a tree. Each property should be the longname of a doclet, and each value should be the doclet for that longname. |
Returns:
A tree with information about each longname in the format shown above.
- Type
- Object
resolve(doclet)
Resolves the longname, memberof, variation and name values of the given doclet.
Parameters:
| Name | Type | Description |
|---|---|---|
doclet |
module:jsdoc/doclet.Doclet |
shorten(longname, forcedMemberof) → {object}
Given a longname like "a.b#c(2)", slice it up into an object containing the memberof, the scope,
the name, and variation.
Parameters:
| Name | Type | Description |
|---|---|---|
longname |
string | |
forcedMemberof |
string |
Returns:
Representing the properties of the given name.
- Type
- object
splitName(nameDesc) → {object}
Split a string that starts with a name and ends with a description into its parts.
Parameters:
| Name | Type | Description |
|---|---|---|
nameDesc |
string |
Returns:
Hash with "name" and "description" properties.
- Type
- object
stripNamespace()
stripVariation()
atomize()
nameIsLongname()
splitLongname()
splitNameMatchingBrackets(nameDesc) → {object}
Split a string that starts with a name and ends with a description into its parts. Allows the
defaultvalue (if present) to contain brackets. If the name is found to have mismatched brackets,
null is returned.
Parameters:
| Name | Type | Description |
|---|---|---|
nameDesc |
string |
Returns:
Hash with "name" and "description" properties.
- Type
- object