Skip to content
Draft
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dist/
tmp/
coverage/
lib/**/*.d.ts
lib/**/*.d.ts.map
.idea/
.vscode/
.DS_Store
Expand Down
18 changes: 9 additions & 9 deletions lib/Diagram.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ export default function Diagram(options, injector) {
*
* Resolves a diagram service.
*
* @template T
* @template {keyof ServiceMap} Name
*
* @param {string} name The name of the service to get.
* @param {Name} name The name of the service to get.
*
* @return {T}
* @return {ServiceMap[Name]}
*/
/**
* @overlord
Expand All @@ -161,7 +161,6 @@ export default function Diagram(options, injector) {
* @template T
*
* @param {string} name The name of the service to get.
* @param {true} strict If false, resolve missing services to null.
*
* @return {T}
*/
Expand All @@ -173,18 +172,19 @@ export default function Diagram(options, injector) {
* @template T
*
* @param {string} name The name of the service to get.
* @param {boolean} strict If false, resolve missing services to null.
* @param {true} strict If false, resolve missing services to null.
*
* @return {T|null}
* @return {T}
*/
/**
* Resolves a diagram service.
*
* @template {keyof ServiceMap} Name
* @template T
*
* @param {Name} name The name of the service to get.
* @param {string} name The name of the service to get.
* @param {boolean} strict If false, resolve missing services to null.
*
* @return {ServiceMap[Name]}
* @return {T|null}
*/
Diagram.prototype.get = function(name, strict) {
return this._injector.get(name, strict);
Expand Down
13 changes: 7 additions & 6 deletions lib/core/EventBus.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,15 @@ export default function EventBus() {
*
* Returning anything but `undefined` from a listener will stop the listener propagation.
*
* @template T
* @template {keyof EventMap} EventName
*
* @param {string|string[]} events to subscribe to
* @param {EventName} events to subscribe to
* @param {number} [priority=1000] listen priority
* @param {EventBusEventCallback<T>} callback
* @param {EventBusEventCallback<EventMap[EventName]>} callback
* @param {any} [that] callback context
*/
/**
*
* Register an event listener for events with the given name.
*
* The callback will be invoked with `event, ...additionalArguments`
Expand All @@ -166,11 +167,11 @@ export default function EventBus() {
*
* Returning anything but `undefined` from a listener will stop the listener propagation.
*
* @template {keyof EventMap} EventName
* @template T
*
* @param {EventName} events to subscribe to
* @param {string|string[]} events to subscribe to
* @param {number} [priority=1000] listen priority
* @param {EventBusEventCallback<EventMap[EventName]>} callback
* @param {EventBusEventCallback<T>} callback
* @param {any} [that] callback context
*/
EventBus.prototype.on = function(events, priority, callback, that) {
Expand Down
115 changes: 38 additions & 77 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"lint": "eslint .",
"dev": "npm test -- --auto-watch --no-single-run",
"generate-types": "run-s generate-types:*",
"generate-types:generate": "del-cli \"lib/**/*.d.ts\" && npx bio-dts -r lib",
"generate-types:generate": "del-cli \"lib/**/*.d.ts(.map)?\" && npx bio-dts -r lib --declarationMap",
"generate-types:test": "tsc --noEmit --noImplicitAny",
"test": "karma start",
"prepublishOnly": "run-s generate-types"
Expand Down Expand Up @@ -56,7 +56,7 @@
"@testing-library/preact": "^3.2.4",
"babel-loader": "^10.0.0",
"babel-plugin-istanbul": "^7.0.0",
"bio-dts": "^0.11.0",
"bio-dts": "^0.13.0",
"chai": "^4.5.0",
"del-cli": "^6.0.0",
"eslint": "^9.11.1",
Expand Down
Loading