Comparing version 1.1.4 to 1.1.5
@@ -34,23 +34,30 @@ // Copyright 2021 Google LLC | ||
/** | ||
* @typedef {Function} RejectCallback | ||
* @param {Error} error - The error object passed to the callback. | ||
*/ | ||
* @typedef {Object.<string, string>} ArgsObject | ||
* @property {string} [key: string] - Any string key maps to an object | ||
* @property {string[]} _ - Array of strings, unnamed parameters | ||
* @description Parsed parameters result. | ||
*/ | ||
/** | ||
* @typedef {Function} ResolveCallback | ||
* @param {any} [param] - Optional callback any value | ||
*/ | ||
* @typedef {Function} RejectCallback | ||
* @param {Error} error - The error object passed to the callback. | ||
*/ | ||
/** | ||
* Creates a new SHDispatch object that represents a command to be executed. | ||
* | ||
* @typedef {Function} Shell | ||
* @property {function(Array, ...*): ProcessPromise} execute - The function to execute the command. | ||
* | ||
* @param {Array} pieces - An array of string literals from a template literal. | ||
* @param {...*} args - The values to be interpolated into the string literals. | ||
* @returns {SHDispatch} Trigger for the command. | ||
* @throws {Error} Throws an error if any of the string literals in `pieces` is undefined. | ||
* | ||
* @example | ||
* const command = await SH`echo 'Hello, world!'`.run(); | ||
*/ | ||
* @typedef {Function} ResolveCallback | ||
* @param {any} [param] - Optional callback any value | ||
*/ | ||
/** | ||
* Creates a new SHDispatch object that represents a command to be executed. | ||
* | ||
* @typedef {Function} Shell | ||
* @property {function(Array, ...*): ProcessPromise} execute - The function to execute the command. | ||
* | ||
* @param {Array} pieces - An array of string literals from a template literal. | ||
* @param {...*} args - The values to be interpolated into the string literals. | ||
* @returns {SHDispatch} Trigger for the command. | ||
* @throws {Error} Throws an error if any of the string literals in `pieces` is undefined. | ||
* | ||
* @example | ||
* const command = await SH`echo 'Hello, world!'`.run(); | ||
*/ | ||
@@ -263,3 +270,3 @@ /** | ||
* @param {string[]} args - An array of command-line arguments. | ||
* @returns {object} An object where: | ||
* @returns {ArgsObject} An object where: | ||
* - Each key corresponds to an argument that starts with `--`, | ||
@@ -266,0 +273,0 @@ * - The value is either the next argument or `true` if no value is provided, |
@@ -5,3 +5,3 @@ { | ||
"type": "module", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "Execute shell commands on Linux-based systems from javascript", | ||
@@ -8,0 +8,0 @@ "main": "lib/SH.js", |
@@ -0,1 +1,4 @@ | ||
export type ArgsObject = { | ||
[x: string]: ApiMethod; | ||
}; | ||
export type RejectCallback = Function; | ||
@@ -86,3 +89,3 @@ export type ResolveCallback = Function; | ||
* @param {string[]} args - An array of command-line arguments. | ||
* @returns {object} An object where: | ||
* @returns {ArgsObject} An object where: | ||
* - Each key corresponds to an argument that starts with `--`, | ||
@@ -92,26 +95,32 @@ * - The value is either the next argument or `true` if no value is provided, | ||
*/ | ||
export function parseArgs(args: string[]): object; | ||
export function parseArgs(args: string[]): ArgsObject; | ||
/** | ||
* @typedef {Function} RejectCallback | ||
* @param {Error} error - The error object passed to the callback. | ||
*/ | ||
* @typedef {Object.<string, ApiMethod>} ArgsObject | ||
* @property {string} [key: string] - Any string key maps to an object | ||
* @property {string[]} _ - Array of strings, unnamed parameters | ||
* @description Parse parameters result. | ||
*/ | ||
/** | ||
* @typedef {Function} ResolveCallback | ||
* @param {any} [param] - Optional callback any value | ||
*/ | ||
* @typedef {Function} RejectCallback | ||
* @param {Error} error - The error object passed to the callback. | ||
*/ | ||
/** | ||
* Creates a new SHDispatch object that represents a command to be executed. | ||
* | ||
* @typedef {Function} Shell | ||
* @property {function(Array, ...*): ProcessPromise} execute - The function to execute the command. | ||
* | ||
* @param {Array} pieces - An array of string literals from a template literal. | ||
* @param {...*} args - The values to be interpolated into the string literals. | ||
* @returns {SHDispatch} Trigger for the command. | ||
* @throws {Error} Throws an error if any of the string literals in `pieces` is undefined. | ||
* | ||
* @example | ||
* const command = await SH`echo 'Hello, world!'`.run(); | ||
*/ | ||
* @typedef {Function} ResolveCallback | ||
* @param {any} [param] - Optional callback any value | ||
*/ | ||
/** | ||
* Creates a new SHDispatch object that represents a command to be executed. | ||
* | ||
* @typedef {Function} Shell | ||
* @property {function(Array, ...*): ProcessPromise} execute - The function to execute the command. | ||
* | ||
* @param {Array} pieces - An array of string literals from a template literal. | ||
* @param {...*} args - The values to be interpolated into the string literals. | ||
* @returns {SHDispatch} Trigger for the command. | ||
* @throws {Error} Throws an error if any of the string literals in `pieces` is undefined. | ||
* | ||
* @example | ||
* const command = await SH`echo 'Hello, world!'`.run(); | ||
*/ | ||
/** | ||
* Determine a javascript type | ||
@@ -118,0 +127,0 @@ * |
51530
1138