@phosphor/commands
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -70,3 +70,4 @@ import { ReadonlyJSONObject } from '@phosphor/coreutils'; | ||
* | ||
* @param id - The id of the command which has changed. | ||
* @param id - The id of the command which has changed. If more than | ||
* one command has changed, this argument should be omitted. | ||
* | ||
@@ -82,3 +83,3 @@ * @throws An error if the given `id` is not registered. | ||
*/ | ||
notifyCommandChanged(id: string): void; | ||
notifyCommandChanged(id?: string): void; | ||
/** | ||
@@ -488,8 +489,10 @@ * Get the display label for a specific command. | ||
* The id of the associated command. | ||
* | ||
* This will be `undefined` when the type is `'many-changed'`. | ||
*/ | ||
readonly id: string; | ||
readonly id: string | undefined; | ||
/** | ||
* Whether the command was added, removed, or changed. | ||
*/ | ||
readonly type: 'added' | 'removed' | 'changed'; | ||
readonly type: 'added' | 'removed' | 'changed' | 'many-changed'; | ||
} | ||
@@ -496,0 +499,0 @@ /** |
@@ -138,3 +138,4 @@ "use strict"; | ||
* | ||
* @param id - The id of the command which has changed. | ||
* @param id - The id of the command which has changed. If more than | ||
* one command has changed, this argument should be omitted. | ||
* | ||
@@ -151,6 +152,6 @@ * @throws An error if the given `id` is not registered. | ||
CommandRegistry.prototype.notifyCommandChanged = function (id) { | ||
if (!(id in this._commands)) { | ||
if (id !== undefined && !(id in this._commands)) { | ||
throw new Error("Command '" + id + "' is not registered."); | ||
} | ||
this._commandChanged.emit({ id: id, type: 'changed' }); | ||
this._commandChanged.emit({ id: id, type: id ? 'changed' : 'many-changed' }); | ||
}; | ||
@@ -157,0 +158,0 @@ /** |
{ | ||
"name": "@phosphor/commands", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "PhosphorJS - Commands", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58988
1569