Skip to content

Commit 2393473

Browse files
committed
Add intellisense for hook names
1 parent 0284121 commit 2393473

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

.changeset/long-bananas-rhyme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@bluecadet/launchpad": patch
3+
---
4+
5+
Add intellisense for hook names

packages/launchpad/lib/command-hooks.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33
*/
44

55
/**
6-
* @typedef {Object<string, Array<string>>} HookMapping
6+
* @typedef {'startup' | 'update-content' | 'start-apps' | 'shutdown' | 'stop-apps'} LaunchpadCommand
7+
*/
8+
9+
/**
10+
* @typedef {`pre-${LaunchpadCommand}` | `post-${LaunchpadCommand}`} LaunchpadHook
11+
*/
12+
13+
/**
14+
* @typedef {{[K in LaunchpadHook]?: string[]}} HookMapping
715
* @example
816
* {
917
* "pre-startup": ["taskkill /im explorer.exe"],
@@ -17,7 +25,7 @@ export class CommandHooks {
1725
*/
1826
constructor(hooks = {}) {
1927
/**
20-
* Formant: pre-<command>
28+
* Format: pre-<command>
2129
* @type {Array<ExecHook>}
2230
*/
2331
this.preHooks = [];

0 commit comments

Comments
 (0)