Skip to content

Commit

Permalink
feat: add types (#12)
Browse files Browse the repository at this point in the history
This makes it possible to use process-on-spawn in a typescript context
more easily.
  • Loading branch information
isaacs authored Nov 13, 2024
1 parent 65e372b commit 821d4f4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/// <reference types="node" />
export namespace ProcessOnSpawn {
export interface SpawnOptions {
env: NodeJS.ProcessEnv
cwd: string
execPath: string
args: ReadonlyArray<string>
detached: boolean
uid?: number
gid?: number
windowsVerbatimArguments: boolean
windowsHide: boolean
}
export type Handler = (opts: SpawnOptions) => any
}
export function addListener(fn: ProcessOnSpawn.Handler): void
export function prependListener(fn: ProcessOnSpawn.Handler): void
export function removeListener(fn: ProcessOnSpawn.Handler): void
export function removeAllListeners(): void
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"fromentries": "^1.2.0"
},
"devDependencies": {
"@types/node": "^20.1.3",
"c8": "^7.0.0",
"if-ver": "^1.1.0",
"standard-version": "^8.0.0",
Expand Down

0 comments on commit 821d4f4

Please sign in to comment.