✨ feat(index.d.ts): add ExecPackage interface for command execution with options
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
27
index.d.ts
vendored
27
index.d.ts
vendored
@@ -685,6 +685,33 @@ declare global {
|
||||
stringify(json: any): string
|
||||
}
|
||||
|
||||
interface ExecPackage {
|
||||
command(cmd: string, options?: {
|
||||
args?: string[]
|
||||
stdin?: string
|
||||
dir?: string
|
||||
env?: string[]
|
||||
timeout?: number
|
||||
returnObject?: boolean
|
||||
combineOutput?: boolean
|
||||
}): string
|
||||
|
||||
command<T extends {
|
||||
args?: string[]
|
||||
stdin?: string
|
||||
dir?: string
|
||||
env?: string[]
|
||||
timeout?: number
|
||||
returnObject?: boolean
|
||||
combineOutput?: boolean
|
||||
}>(cmd: string, options: T):
|
||||
T['returnObject'] extends true
|
||||
? T['combineOutput'] extends true
|
||||
? { output: string; exitCode: number }
|
||||
: { stdout: string; stderr: string; exitCode: number }
|
||||
: string
|
||||
}
|
||||
|
||||
export interface HookContext
|
||||
extends GetHookData,
|
||||
GetHookGetOnlyData,
|
||||
|
||||
Reference in New Issue
Block a user