1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 12:47:58 +01:00

Use [foo] instead of foo[] consistently in source doc type annotations.

This commit is contained in:
Štěpán Němec
2011-07-22 12:33:36 +02:00
parent eca606fab2
commit cc03bfadf8
15 changed files with 51 additions and 51 deletions

View File

@@ -17,7 +17,7 @@
* E.g. an abbreviation with a LHS of "gop" and RHS of "Grand Old Party" will
* replace the former with the latter.
*
* @param {Mode[]} modes The modes in which this abbreviation is active.
* @param {[Mode]} modes The modes in which this abbreviation is active.
* @param {string} lhs The left hand side of the abbreviation; the text to
* be replaced.
* @param {string|function(nsIEditor):string} rhs The right hand side of
@@ -53,7 +53,7 @@ var Abbreviation = Class("Abbreviation", {
/**
* Returns true if this abbreviation is defined for all *modes*.
*
* @param {Mode[]} modes The modes to test.
* @param {[Mode]} modes The modes to test.
* @returns {boolean} The result of the comparison.
*/
modesEqual: function (modes) array.equals(this.modes, modes),
@@ -69,7 +69,7 @@ var Abbreviation = Class("Abbreviation", {
/**
* Returns true if this abbreviation is defined in any of *modes*.
*
* @param {Modes[]} modes The modes to test.
* @param {[Modes]} modes The modes to test.
* @returns {boolean} The result of the comparison.
*/
inModes: function (modes) modes.some(function (mode) this.inMode(mode), this),
@@ -135,7 +135,7 @@ var AbbrevHive = Class("AbbrevHive", Contexts.Hive, {
},
/**
* @property {Abbreviation[]} The list of the abbreviations merged from
* @property {[Abbreviation]} The list of the abbreviations merged from
* each mode.
*/
get merged() {
@@ -253,7 +253,7 @@ var Abbreviations = Module("abbreviations", {
*
* @param {Array} modes List of modes.
* @param {string} lhs The LHS of the abbreviation.
* @param {Hive[]} hives List of hives.
* @param {[Hive]} hives List of hives.
* @optional
*/
list: function (modes, lhs, hives) {

View File

@@ -47,7 +47,7 @@ var AutoCmdHive = Class("AutoCmdHive", Contexts.Hive, {
*
* @param {string} event The event name filter.
* @param {string} pattern The URL pattern filter.
* @returns {AutoCommand[]}
* @returns {[AutoCommand]}
*/
get: function (event, pattern) {
return this._store.filter(function (autoCmd) autoCmd.match(event, regexp));
@@ -89,7 +89,7 @@ var AutoCommands = Module("autocommands", {
*
* @param {string} event The event name filter.
* @param {string} regexp The URL pattern filter.
* @param {Hive[]} hives List of hives.
* @param {[Hive]} hives List of hives.
* @optional
*/
list: function (event, regexp, hives) {

View File

@@ -1306,7 +1306,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
* ['www.google.com/search?q=bla', 'www.osnews.com']
*
* @param {string} str
* @returns {string[]}
* @returns {[string]}
*/
parseURLs: function parseURLs(str) {
let urls;
@@ -1506,7 +1506,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
},
/**
* @property {Window[]} Returns an array of all the host application's
* @property {[Window]} Returns an array of all the host application's
* open windows.
*/
get windows() [win for (win in iter(services.windowMediator.getEnumerator("navigator:browser"))) if (win.dactyl)],

View File

@@ -12,8 +12,8 @@
* A class representing key mappings. Instances are created by the
* {@link Mappings} class.
*
* @param {Modes.Mode[]} modes The modes in which this mapping is active.
* @param {string[]} keys The key sequences which are bound to
* @param {[Modes.Mode]} modes The modes in which this mapping is active.
* @param {[string]} keys The key sequences which are bound to
* *action*.
* @param {string} description A short one line description of the key mapping.
* @param {function} action The action invoked by each key sequence.
@@ -44,7 +44,7 @@ var Map = Class("Map", {
name: Class.memoize(function () this.names[0]),
/** @property {string[]} All of this mapping's names (key sequences). */
/** @property {[string]} All of this mapping's names (key sequences). */
names: Class.memoize(function () this._keys.map(function (k) events.canonicalKeys(k))),
get toStringParams() [this.modes.map(function (m) m.name), this.names.map(String.quote)],
@@ -53,7 +53,7 @@ var Map = Class("Map", {
/** @property {number} A unique ID for this mapping. */
id: null,
/** @property {Modes.Mode[]} All of the modes for which this mapping applies. */
/** @property {[Modes.Mode]} All of the modes for which this mapping applies. */
modes: null,
/** @property {function (number)} The function called to execute this mapping. */
action: null,
@@ -156,8 +156,8 @@ var MapHive = Class("MapHive", Contexts.Hive, {
/**
* Adds a new key mapping.
*
* @param {Modes.Mode[]} modes The modes that this mapping applies to.
* @param {string[]} keys The key sequences which are bound to *action*.
* @param {[Modes.Mode]} modes The modes that this mapping applies to.
* @param {[string]} keys The key sequences which are bound to *action*.
* @param {string} description A description of the key mapping.
* @param {function} action The action invoked by each key sequence.
* @param {Object} extra An optional extra configuration hash.
@@ -348,8 +348,8 @@ var Mappings = Module("mappings", {
/**
* Adds a new default key mapping.
*
* @param {Modes.Mode[]} modes The modes that this mapping applies to.
* @param {string[]} keys The key sequences which are bound to *action*.
* @param {[Modes.Mode]} modes The modes that this mapping applies to.
* @param {[string]} keys The key sequences which are bound to *action*.
* @param {string} description A description of the key mapping.
* @param {function} action The action invoked by each key sequence.
* @param {Object} extra An optional extra configuration hash.
@@ -370,8 +370,8 @@ var Mappings = Module("mappings", {
/**
* Adds a new user-defined key mapping.
*
* @param {Modes.Mode[]} modes The modes that this mapping applies to.
* @param {string[]} keys The key sequences which are bound to *action*.
* @param {[Modes.Mode]} modes The modes that this mapping applies to.
* @param {[string]} keys The key sequences which are bound to *action*.
* @param {string} description A description of the key mapping.
* @param {function} action The action invoked by each key sequence.
* @param {Object} extra An optional extra configuration hash (see
@@ -399,7 +399,7 @@ var Mappings = Module("mappings", {
*
* @param {Modes.Mode} mode The mode to search.
* @param {string} prefix The map prefix string to match.
* @returns {Map[]}
* @returns {[Map]}
*/
getCandidates: function (mode, prefix)
this.hives.map(function (h) h.getCandidates(mode, prefix))
@@ -409,7 +409,7 @@ var Mappings = Module("mappings", {
* Lists all user-defined mappings matching *filter* for the specified
* *modes* in the specified *hives*.
*
* @param {Modes.Mode[]} modes An array of modes to search.
* @param {[Modes.Mode]} modes An array of modes to search.
* @param {string} filter The filter string to match. @optional
* @param {[MapHive]} hives The map hives to list. @optional
*/

View File

@@ -152,7 +152,7 @@ var Tabs = Module("tabs", {
get localStore() this.getLocalStore(),
/**
* @property {Object[]} The array of closed tabs for the current
* @property {[Object]} The array of closed tabs for the current
* session.
*/
get closedTabs() JSON.parse(services.sessionStore.getClosedTabData(window)),

View File

@@ -1510,7 +1510,7 @@ var array = Class("array", Array, {
* as such:
* [["a", "b"], ["c", "d"]] -> { a: "b", c: "d" }
*
* @param {Array[]} assoc
* @param {[Array]} assoc
* @... {string} 0 - Key
* @... 1 - Value
*/

View File

@@ -94,7 +94,7 @@ update(CommandOption, {
* A class representing Ex commands. Instances are created by
* the {@link Commands} class.
*
* @param {string[]} specs The names by which this command can be invoked.
* @param {[string]} specs The names by which this command can be invoked.
* These are specified in the form "com[mand]" where "com" is a unique
* command name prefix.
* @param {string} description A short one line description of the command.
@@ -209,19 +209,19 @@ var Command = Class("Command", {
complained: Class.memoize(function () ({})),
/**
* @property {string[]} All of this command's name specs. e.g., "com[mand]"
* @property {[string]} All of this command's name specs. e.g., "com[mand]"
*/
specs: null,
/** @property {string[]} All of this command's short names, e.g., "com" */
/** @property {[string]} All of this command's short names, e.g., "com" */
shortNames: null,
/**
* @property {string[]} All of this command's long names, e.g., "command"
* @property {[string]} All of this command's long names, e.g., "command"
*/
longNames: null,
/** @property {string} The command's canonical name. */
name: null,
/** @property {string[]} All of this command's long and short names. */
/** @property {[string]} All of this command's long and short names. */
names: null,
/** @property {string} This command's description, as shown in :listcommands */
@@ -464,7 +464,7 @@ var CommandHive = Class("CommandHive", Contexts.Hive, {
* Adds a new command to the builtin hive. Accessible only to core
* dactyl code. Plugins should use group.commands.add instead.
*
* @param {string[]} specs The names by which this command can be
* @param {[string]} specs The names by which this command can be
* invoked. The first name specified is the command's canonical
* name.
* @param {string} description A description of the command.
@@ -646,7 +646,7 @@ var Commands = Module("commands", {
*
* @param {string} filter Limits the list to those commands with a name
* matching this anchored substring.
* @param {Hive[]} hives List of hives.
* @param {[Hive]} hives List of hives.
* @optional
*/
list: function list(filter, hives) {

View File

@@ -105,7 +105,7 @@ var IO = Module("io", {
* found it is sourced. Only the first file found (per specified path) is
* sourced unless *all* is specified, then all found files are sourced.
*
* @param {string[]} paths An array of relative paths to source.
* @param {[string]} paths An array of relative paths to source.
* @param {boolean} all Whether all found files should be sourced.
*/
sourceFromRuntimePath: function sourceFromRuntimePath(paths, all) {
@@ -423,7 +423,7 @@ var IO = Module("io", {
* Runs an external program.
*
* @param {File|string} program The program to run.
* @param {string[]} args An array of arguments to pass to *program*.
* @param {[string]} args An array of arguments to pass to *program*.
*/
run: function (program, args, blocking) {
args = args || [];

View File

@@ -665,9 +665,9 @@ var JavaScript = Module("javascript", {
* time they are accessed, so they should be accessed
* judiciously.
*
* @param {function|function[]} funcs The functions for which to
* @param {function|[function]} funcs The functions for which to
* install the completers.
* @param {function[]} completers An array of completer
* @param {[function]} completers An array of completer
* functions.
*/
setCompleter: function (funcs, completers) {

View File

@@ -25,7 +25,7 @@ let ValueError = Class("ValueError", ErrorBase);
* A class representing configuration options. Instances are created by the
* {@link Options} class.
*
* @param {string[]} names The names by which this option is identified.
* @param {[string]} names The names by which this option is identified.
* @param {string} description A short one line description of the option.
* @param {string} type The option's value data type (see {@link Option#type}).
* @param {string} defaultValue The default value for this option.
@@ -100,14 +100,14 @@ var Option = Class("Option", {
* "charlist" or "stringlist" or else unchanged.
*
* @param {value} value The option value.
* @returns {value|string[]}
* @returns {value|[string]}
*/
parse: function parse(value) Option.dequote(value),
/**
* Returns *values* packed in the appropriate format for the option type.
*
* @param {value|string[]} values The option value.
* @param {value|[string]} values The option value.
* @returns {value}
*/
stringify: function stringify(vals) Commands.quote(vals),
@@ -118,7 +118,7 @@ var Option = Class("Option", {
*
* @param {number} scope The scope to return these values from (see
* {@link Option#scope}).
* @returns {value|string[]}
* @returns {value|[string]}
*/
get: function get(scope) {
if (scope) {
@@ -229,7 +229,7 @@ var Option = Class("Option", {
* Sets the option's value using the specified set *operator*.
*
* @param {string} operator The set operator.
* @param {value|string[]} values The value (or values) to apply.
* @param {value|[string]} values The value (or values) to apply.
* @param {number} scope The scope to apply this value to (see
* {@link #scope}).
* @param {boolean} invert Whether this is an invert boolean operation.
@@ -258,7 +258,7 @@ var Option = Class("Option", {
/** @property {string} The option's canonical name. */
name: null,
/** @property {string[]} All names by which this option is identified. */
/** @property {[string]} All names by which this option is identified. */
names: null,
/**
@@ -675,7 +675,7 @@ var Option = Class("Option", {
* Validates the specified *values* against values generated by the
* option's completer function.
*
* @param {value|string[]} values The value or array of values to validate.
* @param {value|[string]} values The value or array of values to validate.
* @returns {boolean}
*/
validateCompleter: function validateCompleter(values) {
@@ -825,7 +825,7 @@ var Options = Module("options", {
/**
* Adds a new option.
*
* @param {string[]} names All names for the option.
* @param {[string]} names All names for the option.
* @param {string} description A description of the option.
* @param {string} type The option type (see {@link Option#type}).
* @param {value} defaultValue The option's default value.

View File

@@ -125,7 +125,7 @@ var Services = Module("Services", {
*
* @param {string} name The service's cache key.
* @param {string} class The class's contract ID.
* @param {string|string[]} ifaces The interface or array of
* @param {string|[string]} ifaces The interface or array of
* interfaces implemented by this service.
* @param {string} meth The name of the function used to instantiate
* the service.
@@ -143,7 +143,7 @@ var Services = Module("Services", {
*
* @param {string} name The class's cache key.
* @param {string} class_ The class's contract ID.
* @param {nsISupports|nsISupports[]} ifaces The interface or array of
* @param {nsISupports|[nsISupports]} ifaces The interface or array of
* interfaces implemented by this class.
* @param {string} init Name of a property or method used to initialise the
* class. See {@link #_create}.

View File

@@ -363,7 +363,7 @@ var File = Class("File", {
*
* @param {boolean} sort Whether to sort the returned directory
* entries.
* @returns {nsIFile[]}
* @returns {[nsIFile]}
*/
readDirectory: function (sort) {
if (!this.isDirectory())

View File

@@ -22,7 +22,7 @@ const Library = Module("library", {
/**
* Returns an array of all the artist names in the main library.
*
* @returns {string[]}
* @returns {[string]}
*/
getArtists: function getArtists() this._toJSArray(this.MAIN_LIBRARY.getDistinctValuesForProperty(SBProperties.artistName)),
@@ -32,7 +32,7 @@ const Library = Module("library", {
* library.
*
* @param {string} artist The artist's name.
* @returns {string[]}
* @returns {[string]}
*/
getAlbums: function getAlbums(artist) {
let albums = this._toJSArray(this.MAIN_LIBRARY.getItemsByProperty(SBProperties.artistName, artist))
@@ -46,7 +46,7 @@ const Library = Module("library", {
*
* @param {string} artist The artist's name.
* @param {string} album The album's name.
* @returns {string[]}
* @returns {[string]}
*/
getTracks: function getTracks(artist, album) {
let properties = services.MutablePropertyArray();

View File

@@ -333,7 +333,7 @@ const Player = Module("player", {
/**
* Returns an array of all available playlists.
*
* @returns {sbIMediaList[]}
* @returns {[sbIMediaList]}
*/
getPlaylists: function getPlaylists() {
let mainLibrary = LibraryUtils.mainLibrary;
@@ -367,7 +367,7 @@ const Player = Module("player", {
/**
* Returns an array of all available media pages.
*
* @returns {sbIMediaPageInfo[]}
* @returns {[sbIMediaPageInfo]}
*/
getMediaPages: function getMediaPages() {
let list = SBGetBrowser().currentMediaPage.mediaListView.mediaList;

View File

@@ -129,7 +129,7 @@ const Mail = Module("mail", {
get currentFolder() gFolderTreeView.getSelectedFolders()[0],
/** @property {nsISmtpServer[]} The list of configured SMTP servers. */
/** @property {[nsISmtpServer]} The list of configured SMTP servers. */
get smtpServers() {
let servers = services.smtp.smtpServers;
let res = [];