-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
general.ts
43 lines (34 loc) · 1.05 KB
/
general.ts
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
export type { ErrorWithDiff, ParsedStack } from '@vitest/runner/utils'
export type Awaitable<T> = T | PromiseLike<T>
export type Nullable<T> = T | null | undefined
export type Arrayable<T> = T | Array<T>
export type ArgumentsType<T> = T extends (...args: infer U) => any ? U : never
export type MutableArray<T extends readonly any[]> = { -readonly [k in keyof T]: T[k] }
export interface Constructable {
new (...args: any[]): any
}
export interface ModuleCache {
promise?: Promise<any>
exports?: any
code?: string
}
export interface EnvironmentReturn {
teardown: (global: any) => Awaitable<void>
}
export interface Environment {
name: string
setup(global: any, options: Record<string, any>): Awaitable<EnvironmentReturn>
}
export interface UserConsoleLog {
content: string
type: 'stdout' | 'stderr'
taskId?: string
time: number
size: number
}
export interface ModuleGraphData {
graph: Record<string, string[]>
externalized: string[]
inlined: string[]
}
export type OnServerRestartHandler = (reason?: string) => Promise<void> | void