|
| 1 | +/** |
| 2 | + * OPTIONAL: console.error is called by default if verbose: true. |
| 3 | + * |
| 4 | + * Your own custom logging function called with helpful warning/error |
| 5 | + * messages from the internal validators. Only used if verbose: true. |
| 6 | + * |
| 7 | + * @callback {Function} CUSTOMLOGGER |
| 8 | + * @param {string} message The human readable warning/error message |
| 9 | + * @param {object} [error] Sometimes an error or options object is passed |
| 10 | + * @return {void} |
| 11 | + */ |
| 12 | + |
| 13 | +/** |
| 14 | + * @typedef {object} WINDOWS |
| 15 | + * @property {string} filePath The target the shortcut points to. |
| 16 | + * @property {string} [outputPath] Path where shortcut will be placed. Defaults to user's desktop. |
| 17 | + * @property {string} [name] Name of the shortcut file. |
| 18 | + * @property {string} [comment] Metadata file "comment" property. Description of what the shortcut would open. |
| 19 | + * @property {string} [icon] Image shown on the shortcut icon. You can also pass in an index if file contains multiple icons, like `'C:\\file.exe,0'` |
| 20 | + * @property {string} [arguments] Additional arguments passed in to the end of your target `filePath`. |
| 21 | + * @property {string} [windowMode="normal"] How the window should be displayed by default. Valid inputs: 'normal', 'maximized', 'minimized'. Defaults to 'normal'. |
| 22 | + * @property {string} [hotkey] A global hotkey to associate to opening this shortcut, like 'CTRL+ALT+F'. |
| 23 | + * @property {string} [workingDirectory] The working directory for the shortcut when it launches, must be a valid path to a folder. |
| 24 | + * @property {string} [VBScriptPath] This is an advanced option specifically and only for projects packaged with `pkg`. |
| 25 | + * [See documentation](https://github.com/nwutils/create-desktop-shortcuts#windows-settings). |
| 26 | + */ |
| 27 | + |
| 28 | +/** |
| 29 | + * @typedef {object} LINUX |
| 30 | + * @property {string} filePath The target the shortcut points to. |
| 31 | + * @property {string} [outputPath] Path where shortcut will be placed. Defaults to user's desktop. |
| 32 | + * @property {string} [name] Name of the shortcut file. |
| 33 | + * @property {string} [comment] Metadata file "comment" property. Description of what the shortcut would open. |
| 34 | + * @property {string} [icon] Image shown on the shortcut icon. Preferably a 256x256 PNG. |
| 35 | + * @property {string} [type] Type of shortcut. Valid inputs: 'Link', 'Directory', 'Application'. |
| 36 | + * @property {boolean} [terminal=false] If true, will run in a terminal. |
| 37 | + * @property {boolean} [chmod=true] If true, will apply a `chmod +x` (755) to the shortcut after creation to allow execution permission. |
| 38 | + * @property {string} [arguments] Additional arguments passed in to the end of your target `filePath`. |
| 39 | + */ |
| 40 | + |
| 41 | +/** |
| 42 | + * @typedef {object} OSX |
| 43 | + * @property {string} filePath The target the shortcut points to. |
| 44 | + * @property {string} [outputPath] Path where shortcut will be placed. Defaults to user's desktop. |
| 45 | + * @property {string} [name] Name of the shortcut file. |
| 46 | + * @property {boolean} [overwrite=false] If true, will replace any existing file in the `outputPath` with matching `name`. |
| 47 | + * [See documentation](https://github.com/nwutils/create-desktop-shortcuts#osx-settings). |
| 48 | + */ |
| 49 | + |
| 50 | +/** |
| 51 | + * @typedef {object} OPTIONS |
| 52 | + * @property {boolean} [onlyCurrentOS=true] Only create a shortcut for the current OS even if other OS's are passed in. |
| 53 | + * @property {boolean} [verbose=true] Logs out helpful warnings/errors using `customLogger` or console.error. |
| 54 | + * @property {CUSTOMLOGGER} [customLogger] Called (if verbose: true) with helpful warning/error messages from internal validators. |
| 55 | + * @property {WINDOWS} [windows] Windows shortcut settings. |
| 56 | + * @property {LINUX} [linux] Linux shortcut settings. |
| 57 | + * @property {OSX} [osx] OSX shortcut settings. |
| 58 | + */ |
| 59 | + |
| 60 | +/** |
| 61 | + * @type {OPTIONS} |
| 62 | + */ |
| 63 | +let OPTIONS; |
| 64 | + |
| 65 | +module.exports = { |
| 66 | + OPTIONS |
| 67 | +}; |
0 commit comments