Skip to content

Commit

Permalink
Enable TypeDoc (#26)
Browse files Browse the repository at this point in the history
* Enable TypeDoc

* No need to specify node_modules

* Remove unused TypeDoc plugin

* Add TypeDoc config

* Reorg typedoc.json

* And newline at EOF
  • Loading branch information
willeastcott authored Jun 15, 2024
1 parent 41a1892 commit fc76f58
Show file tree
Hide file tree
Showing 6 changed files with 164 additions and 38 deletions.
120 changes: 120 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,17 @@
"eslint": "^8.56.0",
"mocha": "^10.4.0",
"rollup": "^4.17.1",
"typedoc": "^0.25.13",
"typedoc-plugin-mdn-links": "^3.1.29",
"typedoc-plugin-missing-exports": "^2.3.0",
"typescript": "^5.4.5"
},
"scripts": {
"build": "rollup -c --environment target:all",
"build:es6": "rollup -c --environment target:es6",
"build:umd": "rollup -c --environment target:umd",
"build:types": "tsc --project ./tsconfig.json --declaration --emitDeclarationOnly --outDir types",
"docs": "typedoc",
"lint": "eslint --ext .js src rollup.config.js",
"publish:observer": "npm run build && npm run build:types && npm publish",
"test": "mocha"
Expand Down
2 changes: 0 additions & 2 deletions src/event-handle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* to add, remove, and invoke event handlers associated with specific event names. Each EventHandle
* is linked to an 'owner' object, typically an instance of the Events class, allowing for elegant
* event management and chaining.
*
* @ignore
*/
class EventHandle {
/**
Expand Down
32 changes: 16 additions & 16 deletions src/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import EventHandle from './event-handle.js';
/**
* @callback HandleEvent
* Callback used by {@link Events} and {@link EventHandle} functions. Note the callback is limited to 8 arguments.
* @param {*} [arg1] - First argument that is passed from caller.
* @param {*} [arg2] - Second argument that is passed from caller.
* @param {*} [arg3] - Third argument that is passed from caller.
* @param {*} [arg4] - Fourth argument that is passed from caller.
* @param {*} [arg5] - Fifth argument that is passed from caller.
* @param {*} [arg6] - Sixth argument that is passed from caller.
* @param {*} [arg7] - Seventh argument that is passed from caller.
* @param {*} [arg8] - Eighth argument that is passed from caller.
* @param {any} [arg1] - First argument that is passed from caller.
* @param {any} [arg2] - Second argument that is passed from caller.
* @param {any} [arg3] - Third argument that is passed from caller.
* @param {any} [arg4] - Fourth argument that is passed from caller.
* @param {any} [arg5] - Fifth argument that is passed from caller.
* @param {any} [arg6] - Sixth argument that is passed from caller.
* @param {any} [arg7] - Seventh argument that is passed from caller.
* @param {any} [arg8] - Eighth argument that is passed from caller.
*/

/**
Expand Down Expand Up @@ -84,14 +84,14 @@ class Events {

/**
* @param {string} name - Name
* @param {*} [arg0] - First argument
* @param {*} [arg1] - Second argument
* @param {*} [arg2] - Third argument
* @param {*} [arg3] - Fourth argument
* @param {*} [arg4] - Fifth argument
* @param {*} [arg5] - Sixth argument
* @param {*} [arg6] - Seventh argument
* @param {*} [arg7] - Eights argument
* @param {any} [arg0] - First argument
* @param {any} [arg1] - Second argument
* @param {any} [arg2] - Third argument
* @param {any} [arg3] - Fourth argument
* @param {any} [arg4] - Fifth argument
* @param {any} [arg5] - Sixth argument
* @param {any} [arg6] - Seventh argument
* @param {any} [arg7] - Eights argument
* @returns {Events} Self for chaining.
*/
emit(name, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
Expand Down
24 changes: 4 additions & 20 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
{
"compilerOptions": {
"noImplicitAny": true,
"allowJs": true,
"target": "es6",
"jsx": "react",
"lib": [
"es2019",
"dom",
"dom.iterable"
],
"esModuleInterop" : true,
"sourceMap": true,
"moduleResolution": "node"
},
"typedocOptions": {
"entryPoints": ["./src/index.js"],
"exclude": "**/node_modules/**",
"externalPattern": "**/node_modules/**",
"excludeInternal": false,
"excludePrivate": true,
"excludeNotDocumented": true,
"name": "Home",
"out": "typedocs",
"readme": "none",
"sort": "source-order"
"moduleResolution": "node",
"noImplicitAny": true,
"target": "es6"
},
"include": ["./src/index.js"],
"exclude": ["node_modules/**/*", "node_modules"]
"include": ["./src/index.js"]
}
20 changes: 20 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"entryPoints": [
"./src/index.js"
],
"excludeNotDocumented": true,
"name": "PlayCanvas Observer API Reference",
"navigationLinks": {
"Developer Site": "https://developer.playcanvas.com/",
"Blog": "https://blog.playcanvas.com/",
"Discord": "https://discord.gg/RSaMRzg",
"Forum": "https://forum.playcanvas.com/",
"GitHub": "https://github.com/playcanvas"
},
"placeInternalsInOwningModule": true,
"plugin": [
"typedoc-plugin-mdn-links",
"typedoc-plugin-missing-exports"
],
"readme": "none"
}

0 comments on commit fc76f58

Please sign in to comment.