Synonyms
host
Syntax
@external <NameOfExternal>
Overview
The @external
tag identifies a class, namespace, or module that is defined outside of the current
package. By using this tag, you can document your package's extensions to the external symbol, or
you can provide information about the external symbol to your package's users. You can also refer to
the external symbol's namepath in any other JSDoc tag.
The namepath for an external symbol always uses the prefix external:
(for example,
{@link external:Foo}
or @augments external:Foo
). However, you can omit this prefix from the
@external
tag.
Note: You should only add the @external
tag to the highest-level symbol that is defined
outside of your project. See "Documenting a nested external symbol" for an
example.
Examples
The following example shows how to document the built-in String
object as an external, along with
the new instance method external:String#rot13
:
The following example documents a new starfairy
function added to the external namespace
"jQuery.fn"
:
In the following example, the class EncryptedRequest
is documented as a subclass of the built-in
class XMLHttpRequest
:
You should only add the @external
tag to the highest-level symbol that is defined outside of your
project. In the following example, the documentation refers to the external class
security.TLS
. As a result, the @external
tag is used to document the external namespace
external:security
, but not the external class external:security.TLS
.