File: event.d.ts

package info (click to toggle)
cockpit 355-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 311,568 kB
  • sloc: javascript: 774,787; python: 40,655; ansic: 35,157; cpp: 11,141; sh: 3,512; makefile: 580; xml: 261
file content (55 lines) | stat: -rw-r--r-- 1,710 bytes parent folder | download | duplicates (9)
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
/** An event emitted by the child process. */
export type Event = StdoutEvent | StderrEvent | ExitEvent;
/** An event sent from the worker to the host. */
export type InternalEvent = InternalStdoutEvent | InternalStderrEvent | ExitEvent | ErrorEvent;
/** An event indicating that data has been emitted over stdout. */
export interface StdoutEvent {
    type: 'stdout';
    data: Buffer;
}
/** An event indicating that data has been emitted over stderr. */
export interface StderrEvent {
    type: 'stderr';
    data: Buffer;
}
/** An event indicating that process has exited. */
export interface ExitEvent {
    type: 'exit';
    /**
     * The exit code. This will be `undefined` if the subprocess was killed via
     * signal.
     */
    code?: number;
    /**
     * The signal that caused this process to exit. This will be `undefined` if
     * the subprocess exited normally.
     */
    signal?: NodeJS.Signals;
}
/**
 * The stdout event sent from the worker to the host. The structured clone
 * algorithm automatically converts `Buffer`s sent through `MessagePort`s to
 * `Uint8Array`s.
 */
export interface InternalStdoutEvent {
    type: 'stdout';
    data: Buffer | Uint8Array;
}
/**
 * The stderr event sent from the worker to the host. The structured clone
 * algorithm automatically converts `Buffer`s sent through `MessagePort`s to
 * `Uint8Array`s.
 */
export interface InternalStderrEvent {
    type: 'stderr';
    data: Buffer | Uint8Array;
}
/**
 * An error occurred when starting or closing the child process. This is only
 * used internally; the host will throw the error rather than returning it to
 * the caller.
 */
export interface ErrorEvent {
    type: 'error';
    error: Error;
}