Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/specs/doc/jsdoc_event/__test__.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"steps": [{
"args": "doc event.ts",
"output": "event.out",
"exitCode": 0
}, {
"args": "doc --json event.ts",
"output": "event.json.out",
"exitCode": 0
}]
}
128 changes: 128 additions & 0 deletions tests/specs/doc/jsdoc_event/event.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"version": 2,
"nodes": {
"file:///[WILDCARD]/event.ts": {
"symbols": [
{
"name": "Conn",
"declarations": [
{
"location": {
"filename": "file:///[WILDCARD]/event.ts",
"line": 6,
"col": 0,
"byteIndex": [WILDLINE]
},
"declarationKind": "export",
"jsDoc": {
"doc": "A connection that fires events when its state changes.\n",
"tags": [
{
"kind": "event",
"name": "open",
"doc": "Fired when the connection opens."
},
{
"kind": "event",
"name": "close",
"doc": "Fired when the connection closes."
}
]
},
"kind": "class",
"def": {
"methods": [
{
"jsDoc": {
"doc": "Open the connection.\n",
"tags": [
{
"kind": "fires",
"name": "Conn#open"
}
]
},
"name": "open",
"kind": "method",
"functionDef": {
"params": [],
"returnType": {
"repr": "void",
"kind": "keyword",
"value": "void"
},
"hasBody": true
},
"location": {
"filename": "file:///[WILDCARD]/event.ts",
"line": 12,
"col": 2,
"byteIndex": [WILDLINE]
}
},
{
"jsDoc": {
"doc": "Close the connection.\n",
"tags": [
{
"kind": "fires",
"name": "Conn#close"
}
]
},
"name": "close",
"kind": "method",
"functionDef": {
"params": [],
"returnType": {
"repr": "void",
"kind": "keyword",
"value": "void"
},
"hasBody": true
},
"location": {
"filename": "file:///[WILDCARD]/event.ts",
"line": 19,
"col": 2,
"byteIndex": [WILDLINE]
}
},
{
"jsDoc": {
"doc": "Subscribe to the upstream feed.\n",
"tags": [
{
"kind": "listens",
"name": "Conn#open"
}
]
},
"name": "subscribe",
"kind": "method",
"functionDef": {
"params": [],
"returnType": {
"repr": "void",
"kind": "keyword",
"value": "void"
},
"hasBody": true
},
"location": {
"filename": "file:///[WILDCARD]/event.ts",
"line": 26,
"col": 2,
"byteIndex": [WILDLINE]
}
}
],
"extends": "EventTarget"
}
}
]
}
]
}
}
}
25 changes: 25 additions & 0 deletions tests/specs/doc/jsdoc_event/event.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Defined in [WILDCARD]/event.ts:6:1

class Conn extends EventTarget
A connection that fires events when its state changes.

@event open
Fired when the connection opens.

@event close
Fired when the connection closes.


open(): void
Open the connection.

@fires Conn#open
close(): void
Close the connection.

@fires Conn#close
subscribe(): void
Subscribe to the upstream feed.

@listens Conn#open

28 changes: 28 additions & 0 deletions tests/specs/doc/jsdoc_event/event.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* A connection that fires events when its state changes.
*
* @event open - Fired when the connection opens.
* @event close - Fired when the connection closes.
*/
export class Conn extends EventTarget {
/**
* Open the connection.
*
* @fires Conn#open
*/
open(): void {}

/**
* Close the connection.
*
* @emits Conn#close
*/
close(): void {}

/**
* Subscribe to the upstream feed.
*
* @listens Conn#open
*/
subscribe(): void {}
}
Loading