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