UNPKG

1.82 kBPlain TextView Raw
1import {State} from './const';
2
3export type ProcessScale = number | 'auto';
4export type CategoryReg = string | 'all' | 'weak-all';
5export type Entry = string | {
6 new(...x): any;
7};
8
9export interface EntryClass {
10 new(...x): any;
11}
12
13// ************************
14// Application and Process
15
16export interface ApplicationRepresentation {
17 appName: string;
18 appDir: string;
19 scale?: ProcessScale;
20 globalEnv?: any;
21 globalExecArgv?: any[];
22 globalArgs?: any[];
23 inspector?: true | {
24 setPortOnly?: boolean;
25 port?: number;
26 host?: string;
27 };
28}
29
30export interface ProcessRepresentation extends ApplicationRepresentation {
31 processName: string;
32 offset?: number;
33 order?: number;
34 scale?: ProcessScale;
35 env?: any;
36 execArgv?: any[];
37 args?: any[];
38 entryFileBaseDir?: string;
39 entryFile?: string;
40}
41
42export interface ApplicationStructureRepresentation extends ApplicationRepresentation {
43 process: Array<ProcessRepresentation>;
44}
45
46
47
48// ************************
49// Daemon Introspection
50
51export interface ApplicationIntrospectionResult {
52 state: State;
53 appName: string;
54 appDir: string;
55 appId: string;
56 pids: number[];
57 startCount: number;
58 restartCount: number;
59 uptime: number;
60 representation?: ApplicationRepresentation;
61 // the field complex for legacy, it is a alias of structure
62 complex?: ApplicationStructureRepresentation;
63 structure?: ApplicationStructureRepresentation;
64 stdoutLogPath?: string;
65}
66
67export type VersionsIntrospectionResult = typeof process.versions & {
68 pandora: string;
69};
70
71export interface DaemonIntrospectionResult {
72 versions: VersionsIntrospectionResult;
73 cwd: string;
74 pid: number;
75 uptime: number;
76 loadedGlobalConfigPaths: string[];
77 loadedEndPoints: string[];
78 loadedReporters: string[];
79}
80
81export interface Monitor {
82 start();
83 stop();
84}
85
86