@tapjs/processinfo 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +196 -0
- package/lib/index.d.ts +196 -0
- package/package.json +2 -1
package/index.d.ts
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import {
|
|
3
|
+
ChildProcess,
|
|
4
|
+
ExecException,
|
|
5
|
+
ExecFileOptions,
|
|
6
|
+
ExecFileSyncOptions,
|
|
7
|
+
ExecOptions,
|
|
8
|
+
ExecSyncOptions,
|
|
9
|
+
SpawnOptions,
|
|
10
|
+
SpawnSyncOptions,
|
|
11
|
+
SpawnSyncReturns,
|
|
12
|
+
} from 'node:child_process'
|
|
13
|
+
|
|
14
|
+
declare interface ProcessInfoOptions {
|
|
15
|
+
dir?: string
|
|
16
|
+
exclude?: RegExp
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare class ProcessInfoNode {
|
|
20
|
+
public parent: ProcessInfoNode | null
|
|
21
|
+
public children: ProcessInfoNode[] | null
|
|
22
|
+
public files: string[] | null
|
|
23
|
+
public externalID: string | null
|
|
24
|
+
link(db: ProcessInfo): void
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare interface ProcessInfoSpawnOptions extends SpawnOptions {
|
|
28
|
+
externalID?: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare interface ProcessInfoSpawnSyncOptions extends SpawnSyncOptions {
|
|
32
|
+
externalID?: string
|
|
33
|
+
}
|
|
34
|
+
declare interface ProcessInfoSpawnSyncOptionsWithStringEncoding
|
|
35
|
+
extends ProcessInfoSpawnSyncOptions {
|
|
36
|
+
encoding: BufferEncoding
|
|
37
|
+
}
|
|
38
|
+
interface ProcessInfoSpawnSyncOptionsWithBufferEncoding
|
|
39
|
+
extends ProcessInfoSpawnSyncOptions {
|
|
40
|
+
encoding?: 'buffer' | null | undefined
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare interface ProcessInfoExecSyncOptions extends ExecSyncOptions {
|
|
44
|
+
externalID?: string
|
|
45
|
+
}
|
|
46
|
+
declare interface ProcessInfoExecSyncOptionsWithStringEncoding
|
|
47
|
+
extends ProcessInfoExecSyncOptions {
|
|
48
|
+
encoding: BufferEncoding
|
|
49
|
+
}
|
|
50
|
+
declare interface ProcessInfoExecSyncOptionsWithBufferEncoding
|
|
51
|
+
extends ProcessInfoExecSyncOptions {
|
|
52
|
+
encoding?: 'buffer' | null | undefined
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare interface ProcessInfoExecOptions extends ExecOptions {
|
|
56
|
+
externalID?: string
|
|
57
|
+
}
|
|
58
|
+
declare interface ProcessInfoExecFileSyncOptions extends ExecFileSyncOptions {
|
|
59
|
+
externalID?: string
|
|
60
|
+
}
|
|
61
|
+
declare interface ProcessInfoExecFileSyncOptionsWithStringEncoding
|
|
62
|
+
extends ProcessInfoExecFileSyncOptions {
|
|
63
|
+
encoding: BufferEncoding
|
|
64
|
+
}
|
|
65
|
+
declare interface ProcessInfoExecFileSyncOptionsWithBufferEncoding
|
|
66
|
+
extends ProcessInfoExecFileSyncOptions {
|
|
67
|
+
encoding?: 'buffer' | null | undefined
|
|
68
|
+
}
|
|
69
|
+
declare interface ProcessInfoExecFileOptions extends ExecFileOptions {
|
|
70
|
+
externalID?: string
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
declare class ProcessInfo {
|
|
74
|
+
public dir: string
|
|
75
|
+
public exclude: RegExp
|
|
76
|
+
public roots: Set<ProcessInfoNode>
|
|
77
|
+
public files: Map<string, Set<ProcessInfoNode>>
|
|
78
|
+
public uuids: Map<string, ProcessInfoNode>
|
|
79
|
+
public externalIDs: Map<string, ProcessInfoNode>
|
|
80
|
+
|
|
81
|
+
private pendingRoot: Map<string, ProcessInfoNode>
|
|
82
|
+
private pendingParent: Map<string, ProcessInfoNode>
|
|
83
|
+
|
|
84
|
+
constructor(options?: ProcessInfoOptions)
|
|
85
|
+
|
|
86
|
+
save(): Promise<void>
|
|
87
|
+
saveSync(): void
|
|
88
|
+
erase(): Promise<void>
|
|
89
|
+
eraseSync(): void
|
|
90
|
+
|
|
91
|
+
load(): Promise<ProcessInfo>
|
|
92
|
+
loadSync(): ProcessInfo
|
|
93
|
+
|
|
94
|
+
static get Node(): typeof ProcessInfoNode
|
|
95
|
+
static get ProcessInfo(): typeof ProcessInfo
|
|
96
|
+
|
|
97
|
+
static spawn(
|
|
98
|
+
cmd: string,
|
|
99
|
+
args: string[],
|
|
100
|
+
options: ProcessInfoSpawnOptions
|
|
101
|
+
): ChildProcess
|
|
102
|
+
|
|
103
|
+
static spawnSync(cmd: string): SpawnSyncReturns<Buffer>
|
|
104
|
+
static spawnSync(
|
|
105
|
+
cmd: string,
|
|
106
|
+
options: ProcessInfoSpawnSyncOptionsWithStringEncoding
|
|
107
|
+
): SpawnSyncReturns<string>
|
|
108
|
+
static spawnSync(
|
|
109
|
+
cmd: string,
|
|
110
|
+
options: ProcessInfoSpawnSyncOptionsWithBufferEncoding
|
|
111
|
+
): SpawnSyncReturns<Buffer>
|
|
112
|
+
static spawnSync(
|
|
113
|
+
cmd: string,
|
|
114
|
+
options?: ProcessInfoSpawnSyncOptions
|
|
115
|
+
): SpawnSyncReturns<string | Buffer>
|
|
116
|
+
static spawnSync(
|
|
117
|
+
cmd: string,
|
|
118
|
+
args: readonly string[]
|
|
119
|
+
): SpawnSyncReturns<Buffer>
|
|
120
|
+
static spawnSync(
|
|
121
|
+
cmd: string,
|
|
122
|
+
args: readonly string[],
|
|
123
|
+
options: ProcessInfoSpawnSyncOptionsWithStringEncoding
|
|
124
|
+
): SpawnSyncReturns<string>
|
|
125
|
+
static spawnSync(
|
|
126
|
+
cmd: string,
|
|
127
|
+
args: readonly string[],
|
|
128
|
+
options: ProcessInfoSpawnSyncOptionsWithBufferEncoding
|
|
129
|
+
): SpawnSyncReturns<Buffer>
|
|
130
|
+
static spawnSync(
|
|
131
|
+
cmd: string,
|
|
132
|
+
args?: readonly string[],
|
|
133
|
+
options?: ProcessInfoSpawnSyncOptions
|
|
134
|
+
): SpawnSyncReturns<string | Buffer>
|
|
135
|
+
|
|
136
|
+
static exec(
|
|
137
|
+
cmd: string,
|
|
138
|
+
options: ProcessInfoExecOptions,
|
|
139
|
+
callback?: (
|
|
140
|
+
error: ExecException | null,
|
|
141
|
+
stdout: Buffer,
|
|
142
|
+
stderr: Buffer
|
|
143
|
+
) => void
|
|
144
|
+
): ChildProcess
|
|
145
|
+
|
|
146
|
+
static execSync(
|
|
147
|
+
cmd: string,
|
|
148
|
+
options: ProcessInfoExecSyncOptionsWithStringEncoding
|
|
149
|
+
): string
|
|
150
|
+
static execSync(
|
|
151
|
+
cmd: string,
|
|
152
|
+
options: ProcessInfoExecSyncOptionsWithBufferEncoding
|
|
153
|
+
): Buffer
|
|
154
|
+
static execSync(
|
|
155
|
+
cmd: string,
|
|
156
|
+
options?: ProcessInfoExecSyncOptions
|
|
157
|
+
): string | Buffer
|
|
158
|
+
|
|
159
|
+
static execFile(
|
|
160
|
+
cmd: string,
|
|
161
|
+
args: string[],
|
|
162
|
+
options: ProcessInfoExecFileOptions
|
|
163
|
+
): ChildProcess
|
|
164
|
+
|
|
165
|
+
static execFileSync(file: string): Buffer
|
|
166
|
+
static execFileSync(
|
|
167
|
+
file: string,
|
|
168
|
+
options: ProcessInfoExecFileSyncOptionsWithStringEncoding
|
|
169
|
+
): string
|
|
170
|
+
static execFileSync(
|
|
171
|
+
file: string,
|
|
172
|
+
options: ProcessInfoExecFileSyncOptionsWithBufferEncoding
|
|
173
|
+
): Buffer
|
|
174
|
+
static execFileSync(
|
|
175
|
+
file: string,
|
|
176
|
+
options?: ProcessInfoExecFileSyncOptions
|
|
177
|
+
): string | Buffer
|
|
178
|
+
static execFileSync(file: string, args: readonly string[]): Buffer
|
|
179
|
+
static execFileSync(
|
|
180
|
+
file: string,
|
|
181
|
+
args: readonly string[],
|
|
182
|
+
options: ProcessInfoExecFileSyncOptionsWithStringEncoding
|
|
183
|
+
): string
|
|
184
|
+
static execFileSync(
|
|
185
|
+
file: string,
|
|
186
|
+
args: readonly string[],
|
|
187
|
+
options: ProcessInfoExecFileSyncOptionsWithBufferEncoding
|
|
188
|
+
): Buffer
|
|
189
|
+
static execFileSync(
|
|
190
|
+
file: string,
|
|
191
|
+
args?: readonly string[],
|
|
192
|
+
options?: ProcessInfoExecFileSyncOptions
|
|
193
|
+
): string | Buffer
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export = ProcessInfo
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import {
|
|
3
|
+
ChildProcess,
|
|
4
|
+
ExecException,
|
|
5
|
+
ExecFileOptions,
|
|
6
|
+
ExecFileSyncOptions,
|
|
7
|
+
ExecOptions,
|
|
8
|
+
ExecSyncOptions,
|
|
9
|
+
SpawnOptions,
|
|
10
|
+
SpawnSyncOptions,
|
|
11
|
+
SpawnSyncReturns,
|
|
12
|
+
} from 'node:child_process'
|
|
13
|
+
|
|
14
|
+
declare interface ProcessInfoOptions {
|
|
15
|
+
dir?: string
|
|
16
|
+
exclude?: RegExp
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare class ProcessInfoNode {
|
|
20
|
+
public parent: ProcessInfoNode | null
|
|
21
|
+
public children: ProcessInfoNode[] | null
|
|
22
|
+
public files: string[] | null
|
|
23
|
+
public externalID: string | null
|
|
24
|
+
link(db: ProcessInfo): void
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare interface ProcessInfoSpawnOptions extends SpawnOptions {
|
|
28
|
+
externalID?: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare interface ProcessInfoSpawnSyncOptions extends SpawnSyncOptions {
|
|
32
|
+
externalID?: string
|
|
33
|
+
}
|
|
34
|
+
declare interface ProcessInfoSpawnSyncOptionsWithStringEncoding
|
|
35
|
+
extends ProcessInfoSpawnSyncOptions {
|
|
36
|
+
encoding: BufferEncoding
|
|
37
|
+
}
|
|
38
|
+
interface ProcessInfoSpawnSyncOptionsWithBufferEncoding
|
|
39
|
+
extends ProcessInfoSpawnSyncOptions {
|
|
40
|
+
encoding?: 'buffer' | null | undefined
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare interface ProcessInfoExecSyncOptions extends ExecSyncOptions {
|
|
44
|
+
externalID?: string
|
|
45
|
+
}
|
|
46
|
+
declare interface ProcessInfoExecSyncOptionsWithStringEncoding
|
|
47
|
+
extends ProcessInfoExecSyncOptions {
|
|
48
|
+
encoding: BufferEncoding
|
|
49
|
+
}
|
|
50
|
+
declare interface ProcessInfoExecSyncOptionsWithBufferEncoding
|
|
51
|
+
extends ProcessInfoExecSyncOptions {
|
|
52
|
+
encoding?: 'buffer' | null | undefined
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare interface ProcessInfoExecOptions extends ExecOptions {
|
|
56
|
+
externalID?: string
|
|
57
|
+
}
|
|
58
|
+
declare interface ProcessInfoExecFileSyncOptions extends ExecFileSyncOptions {
|
|
59
|
+
externalID?: string
|
|
60
|
+
}
|
|
61
|
+
declare interface ProcessInfoExecFileSyncOptionsWithStringEncoding
|
|
62
|
+
extends ProcessInfoExecFileSyncOptions {
|
|
63
|
+
encoding: BufferEncoding
|
|
64
|
+
}
|
|
65
|
+
declare interface ProcessInfoExecFileSyncOptionsWithBufferEncoding
|
|
66
|
+
extends ProcessInfoExecFileSyncOptions {
|
|
67
|
+
encoding?: 'buffer' | null | undefined
|
|
68
|
+
}
|
|
69
|
+
declare interface ProcessInfoExecFileOptions extends ExecFileOptions {
|
|
70
|
+
externalID?: string
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
declare class ProcessInfo {
|
|
74
|
+
public dir: string
|
|
75
|
+
public exclude: RegExp
|
|
76
|
+
public roots: Set<ProcessInfoNode>
|
|
77
|
+
public files: Map<string, Set<ProcessInfoNode>>
|
|
78
|
+
public uuids: Map<string, ProcessInfoNode>
|
|
79
|
+
public externalIDs: Map<string, ProcessInfoNode>
|
|
80
|
+
|
|
81
|
+
private pendingRoot: Map<string, ProcessInfoNode>
|
|
82
|
+
private pendingParent: Map<string, ProcessInfoNode>
|
|
83
|
+
|
|
84
|
+
constructor(options?: ProcessInfoOptions)
|
|
85
|
+
|
|
86
|
+
save(): Promise<void>
|
|
87
|
+
saveSync(): void
|
|
88
|
+
erase(): Promise<void>
|
|
89
|
+
eraseSync(): void
|
|
90
|
+
|
|
91
|
+
load(): Promise<ProcessInfo>
|
|
92
|
+
loadSync(): ProcessInfo
|
|
93
|
+
|
|
94
|
+
static get Node(): typeof ProcessInfoNode
|
|
95
|
+
static get ProcessInfo(): typeof ProcessInfo
|
|
96
|
+
|
|
97
|
+
static spawn(
|
|
98
|
+
cmd: string,
|
|
99
|
+
args: string[],
|
|
100
|
+
options: ProcessInfoSpawnOptions
|
|
101
|
+
): ChildProcess
|
|
102
|
+
|
|
103
|
+
static spawnSync(cmd: string): SpawnSyncReturns<Buffer>
|
|
104
|
+
static spawnSync(
|
|
105
|
+
cmd: string,
|
|
106
|
+
options: ProcessInfoSpawnSyncOptionsWithStringEncoding
|
|
107
|
+
): SpawnSyncReturns<string>
|
|
108
|
+
static spawnSync(
|
|
109
|
+
cmd: string,
|
|
110
|
+
options: ProcessInfoSpawnSyncOptionsWithBufferEncoding
|
|
111
|
+
): SpawnSyncReturns<Buffer>
|
|
112
|
+
static spawnSync(
|
|
113
|
+
cmd: string,
|
|
114
|
+
options?: ProcessInfoSpawnSyncOptions
|
|
115
|
+
): SpawnSyncReturns<string | Buffer>
|
|
116
|
+
static spawnSync(
|
|
117
|
+
cmd: string,
|
|
118
|
+
args: readonly string[]
|
|
119
|
+
): SpawnSyncReturns<Buffer>
|
|
120
|
+
static spawnSync(
|
|
121
|
+
cmd: string,
|
|
122
|
+
args: readonly string[],
|
|
123
|
+
options: ProcessInfoSpawnSyncOptionsWithStringEncoding
|
|
124
|
+
): SpawnSyncReturns<string>
|
|
125
|
+
static spawnSync(
|
|
126
|
+
cmd: string,
|
|
127
|
+
args: readonly string[],
|
|
128
|
+
options: ProcessInfoSpawnSyncOptionsWithBufferEncoding
|
|
129
|
+
): SpawnSyncReturns<Buffer>
|
|
130
|
+
static spawnSync(
|
|
131
|
+
cmd: string,
|
|
132
|
+
args?: readonly string[],
|
|
133
|
+
options?: ProcessInfoSpawnSyncOptions
|
|
134
|
+
): SpawnSyncReturns<string | Buffer>
|
|
135
|
+
|
|
136
|
+
static exec(
|
|
137
|
+
cmd: string,
|
|
138
|
+
options: ProcessInfoExecOptions,
|
|
139
|
+
callback?: (
|
|
140
|
+
error: ExecException | null,
|
|
141
|
+
stdout: Buffer,
|
|
142
|
+
stderr: Buffer
|
|
143
|
+
) => void
|
|
144
|
+
): ChildProcess
|
|
145
|
+
|
|
146
|
+
static execSync(
|
|
147
|
+
cmd: string,
|
|
148
|
+
options: ProcessInfoExecSyncOptionsWithStringEncoding
|
|
149
|
+
): string
|
|
150
|
+
static execSync(
|
|
151
|
+
cmd: string,
|
|
152
|
+
options: ProcessInfoExecSyncOptionsWithBufferEncoding
|
|
153
|
+
): Buffer
|
|
154
|
+
static execSync(
|
|
155
|
+
cmd: string,
|
|
156
|
+
options?: ProcessInfoExecSyncOptions
|
|
157
|
+
): string | Buffer
|
|
158
|
+
|
|
159
|
+
static execFile(
|
|
160
|
+
cmd: string,
|
|
161
|
+
args: string[],
|
|
162
|
+
options: ProcessInfoExecFileOptions
|
|
163
|
+
): ChildProcess
|
|
164
|
+
|
|
165
|
+
static execFileSync(file: string): Buffer
|
|
166
|
+
static execFileSync(
|
|
167
|
+
file: string,
|
|
168
|
+
options: ProcessInfoExecFileSyncOptionsWithStringEncoding
|
|
169
|
+
): string
|
|
170
|
+
static execFileSync(
|
|
171
|
+
file: string,
|
|
172
|
+
options: ProcessInfoExecFileSyncOptionsWithBufferEncoding
|
|
173
|
+
): Buffer
|
|
174
|
+
static execFileSync(
|
|
175
|
+
file: string,
|
|
176
|
+
options?: ProcessInfoExecFileSyncOptions
|
|
177
|
+
): string | Buffer
|
|
178
|
+
static execFileSync(file: string, args: readonly string[]): Buffer
|
|
179
|
+
static execFileSync(
|
|
180
|
+
file: string,
|
|
181
|
+
args: readonly string[],
|
|
182
|
+
options: ProcessInfoExecFileSyncOptionsWithStringEncoding
|
|
183
|
+
): string
|
|
184
|
+
static execFileSync(
|
|
185
|
+
file: string,
|
|
186
|
+
args: readonly string[],
|
|
187
|
+
options: ProcessInfoExecFileSyncOptionsWithBufferEncoding
|
|
188
|
+
): Buffer
|
|
189
|
+
static execFileSync(
|
|
190
|
+
file: string,
|
|
191
|
+
args?: readonly string[],
|
|
192
|
+
options?: ProcessInfoExecFileSyncOptions
|
|
193
|
+
): string | Buffer
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export = ProcessInfo
|