@tapjs/processinfo 1.0.10 → 1.0.12

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 ADDED
@@ -0,0 +1,208 @@
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
+ parent: ProcessInfoNode | null
21
+ root: ProcessInfoNode | null
22
+ children: ProcessInfoNode[] | null
23
+ files: string[] | null
24
+ externalID?: string | null
25
+ uuid: string
26
+ date: string
27
+ argv: string[]
28
+ execArgv: string[]
29
+ pid: number
30
+ ppid: number
31
+ cwd: string
32
+ code?: number | null
33
+ signal: string | null
34
+ runtime: number
35
+ link(db: ProcessInfo): void
36
+ NODE_OPTIONS?: string | null
37
+ }
38
+
39
+ declare interface ProcessInfoSpawnOptions extends SpawnOptions {
40
+ externalID?: string
41
+ }
42
+
43
+ declare interface ProcessInfoSpawnSyncOptions extends SpawnSyncOptions {
44
+ externalID?: string
45
+ }
46
+ declare interface ProcessInfoSpawnSyncOptionsWithStringEncoding
47
+ extends ProcessInfoSpawnSyncOptions {
48
+ encoding: BufferEncoding
49
+ }
50
+ interface ProcessInfoSpawnSyncOptionsWithBufferEncoding
51
+ extends ProcessInfoSpawnSyncOptions {
52
+ encoding?: 'buffer' | null | undefined
53
+ }
54
+
55
+ declare interface ProcessInfoExecSyncOptions extends ExecSyncOptions {
56
+ externalID?: string
57
+ }
58
+ declare interface ProcessInfoExecSyncOptionsWithStringEncoding
59
+ extends ProcessInfoExecSyncOptions {
60
+ encoding: BufferEncoding
61
+ }
62
+ declare interface ProcessInfoExecSyncOptionsWithBufferEncoding
63
+ extends ProcessInfoExecSyncOptions {
64
+ encoding?: 'buffer' | null | undefined
65
+ }
66
+
67
+ declare interface ProcessInfoExecOptions extends ExecOptions {
68
+ externalID?: string
69
+ }
70
+ declare interface ProcessInfoExecFileSyncOptions extends ExecFileSyncOptions {
71
+ externalID?: string
72
+ }
73
+ declare interface ProcessInfoExecFileSyncOptionsWithStringEncoding
74
+ extends ProcessInfoExecFileSyncOptions {
75
+ encoding: BufferEncoding
76
+ }
77
+ declare interface ProcessInfoExecFileSyncOptionsWithBufferEncoding
78
+ extends ProcessInfoExecFileSyncOptions {
79
+ encoding?: 'buffer' | null | undefined
80
+ }
81
+ declare interface ProcessInfoExecFileOptions extends ExecFileOptions {
82
+ externalID?: string
83
+ }
84
+
85
+ declare class ProcessInfo {
86
+ public dir: string
87
+ public exclude: RegExp
88
+ public roots: Set<ProcessInfoNode>
89
+ public files: Map<string, Set<ProcessInfoNode>>
90
+ public uuids: Map<string, ProcessInfoNode>
91
+ public externalIDs: Map<string, ProcessInfoNode>
92
+
93
+ private pendingRoot: Map<string, ProcessInfoNode>
94
+ private pendingParent: Map<string, ProcessInfoNode>
95
+
96
+ constructor(options?: ProcessInfoOptions)
97
+
98
+ save(): Promise<void>
99
+ saveSync(): void
100
+ erase(): Promise<void>
101
+ eraseSync(): void
102
+
103
+ load(): Promise<ProcessInfo>
104
+ loadSync(): ProcessInfo
105
+
106
+ static get Node(): typeof ProcessInfoNode
107
+ static get ProcessInfo(): typeof ProcessInfo
108
+
109
+ static spawn(
110
+ cmd: string,
111
+ args: string[],
112
+ options: ProcessInfoSpawnOptions
113
+ ): ChildProcess
114
+
115
+ static spawnSync(cmd: string): SpawnSyncReturns<Buffer>
116
+ static spawnSync(
117
+ cmd: string,
118
+ options: ProcessInfoSpawnSyncOptionsWithStringEncoding
119
+ ): SpawnSyncReturns<string>
120
+ static spawnSync(
121
+ cmd: string,
122
+ options: ProcessInfoSpawnSyncOptionsWithBufferEncoding
123
+ ): SpawnSyncReturns<Buffer>
124
+ static spawnSync(
125
+ cmd: string,
126
+ options?: ProcessInfoSpawnSyncOptions
127
+ ): SpawnSyncReturns<string | Buffer>
128
+ static spawnSync(
129
+ cmd: string,
130
+ args: readonly string[]
131
+ ): SpawnSyncReturns<Buffer>
132
+ static spawnSync(
133
+ cmd: string,
134
+ args: readonly string[],
135
+ options: ProcessInfoSpawnSyncOptionsWithStringEncoding
136
+ ): SpawnSyncReturns<string>
137
+ static spawnSync(
138
+ cmd: string,
139
+ args: readonly string[],
140
+ options: ProcessInfoSpawnSyncOptionsWithBufferEncoding
141
+ ): SpawnSyncReturns<Buffer>
142
+ static spawnSync(
143
+ cmd: string,
144
+ args?: readonly string[],
145
+ options?: ProcessInfoSpawnSyncOptions
146
+ ): SpawnSyncReturns<string | Buffer>
147
+
148
+ static exec(
149
+ cmd: string,
150
+ options: ProcessInfoExecOptions,
151
+ callback?: (
152
+ error: ExecException | null,
153
+ stdout: Buffer,
154
+ stderr: Buffer
155
+ ) => void
156
+ ): ChildProcess
157
+
158
+ static execSync(
159
+ cmd: string,
160
+ options: ProcessInfoExecSyncOptionsWithStringEncoding
161
+ ): string
162
+ static execSync(
163
+ cmd: string,
164
+ options: ProcessInfoExecSyncOptionsWithBufferEncoding
165
+ ): Buffer
166
+ static execSync(
167
+ cmd: string,
168
+ options?: ProcessInfoExecSyncOptions
169
+ ): string | Buffer
170
+
171
+ static execFile(
172
+ cmd: string,
173
+ args: string[],
174
+ options: ProcessInfoExecFileOptions
175
+ ): ChildProcess
176
+
177
+ static execFileSync(file: string): Buffer
178
+ static execFileSync(
179
+ file: string,
180
+ options: ProcessInfoExecFileSyncOptionsWithStringEncoding
181
+ ): string
182
+ static execFileSync(
183
+ file: string,
184
+ options: ProcessInfoExecFileSyncOptionsWithBufferEncoding
185
+ ): Buffer
186
+ static execFileSync(
187
+ file: string,
188
+ options?: ProcessInfoExecFileSyncOptions
189
+ ): string | Buffer
190
+ static execFileSync(file: string, args: readonly string[]): Buffer
191
+ static execFileSync(
192
+ file: string,
193
+ args: readonly string[],
194
+ options: ProcessInfoExecFileSyncOptionsWithStringEncoding
195
+ ): string
196
+ static execFileSync(
197
+ file: string,
198
+ args: readonly string[],
199
+ options: ProcessInfoExecFileSyncOptionsWithBufferEncoding
200
+ ): Buffer
201
+ static execFileSync(
202
+ file: string,
203
+ args?: readonly string[],
204
+ options?: ProcessInfoExecFileSyncOptions
205
+ ): string | Buffer
206
+ }
207
+
208
+ export = ProcessInfo
package/lib/index.d.cts CHANGED
@@ -17,11 +17,23 @@ declare interface ProcessInfoOptions {
17
17
  }
18
18
 
19
19
  declare class ProcessInfoNode {
20
- public parent: ProcessInfoNode | null
21
- public children: ProcessInfoNode[] | null
22
- public files: string[] | null
23
- public externalID: string | null
20
+ parent: ProcessInfoNode | null
21
+ root: ProcessInfoNode | null
22
+ children: ProcessInfoNode[] | null
23
+ files: string[] | null
24
+ externalID?: string | null
25
+ uuid: string
26
+ date: string
27
+ argv: string[]
28
+ execArgv: string[]
29
+ pid: number
30
+ ppid: number
31
+ cwd: string
32
+ code?: number | null
33
+ signal: string | null
34
+ runtime: number
24
35
  link(db: ProcessInfo): void
36
+ NODE_OPTIONS?: string | null
25
37
  }
26
38
 
27
39
  declare interface ProcessInfoSpawnOptions extends SpawnOptions {
package/lib/index.d.ts ADDED
@@ -0,0 +1,208 @@
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
+ parent: ProcessInfoNode | null
21
+ root: ProcessInfoNode | null
22
+ children: ProcessInfoNode[] | null
23
+ files: string[] | null
24
+ externalID?: string | null
25
+ uuid: string
26
+ date: string
27
+ argv: string[]
28
+ execArgv: string[]
29
+ pid: number
30
+ ppid: number
31
+ cwd: string
32
+ code?: number | null
33
+ signal: string | null
34
+ runtime: number
35
+ link(db: ProcessInfo): void
36
+ NODE_OPTIONS?: string | null
37
+ }
38
+
39
+ declare interface ProcessInfoSpawnOptions extends SpawnOptions {
40
+ externalID?: string
41
+ }
42
+
43
+ declare interface ProcessInfoSpawnSyncOptions extends SpawnSyncOptions {
44
+ externalID?: string
45
+ }
46
+ declare interface ProcessInfoSpawnSyncOptionsWithStringEncoding
47
+ extends ProcessInfoSpawnSyncOptions {
48
+ encoding: BufferEncoding
49
+ }
50
+ interface ProcessInfoSpawnSyncOptionsWithBufferEncoding
51
+ extends ProcessInfoSpawnSyncOptions {
52
+ encoding?: 'buffer' | null | undefined
53
+ }
54
+
55
+ declare interface ProcessInfoExecSyncOptions extends ExecSyncOptions {
56
+ externalID?: string
57
+ }
58
+ declare interface ProcessInfoExecSyncOptionsWithStringEncoding
59
+ extends ProcessInfoExecSyncOptions {
60
+ encoding: BufferEncoding
61
+ }
62
+ declare interface ProcessInfoExecSyncOptionsWithBufferEncoding
63
+ extends ProcessInfoExecSyncOptions {
64
+ encoding?: 'buffer' | null | undefined
65
+ }
66
+
67
+ declare interface ProcessInfoExecOptions extends ExecOptions {
68
+ externalID?: string
69
+ }
70
+ declare interface ProcessInfoExecFileSyncOptions extends ExecFileSyncOptions {
71
+ externalID?: string
72
+ }
73
+ declare interface ProcessInfoExecFileSyncOptionsWithStringEncoding
74
+ extends ProcessInfoExecFileSyncOptions {
75
+ encoding: BufferEncoding
76
+ }
77
+ declare interface ProcessInfoExecFileSyncOptionsWithBufferEncoding
78
+ extends ProcessInfoExecFileSyncOptions {
79
+ encoding?: 'buffer' | null | undefined
80
+ }
81
+ declare interface ProcessInfoExecFileOptions extends ExecFileOptions {
82
+ externalID?: string
83
+ }
84
+
85
+ declare class ProcessInfo {
86
+ public dir: string
87
+ public exclude: RegExp
88
+ public roots: Set<ProcessInfoNode>
89
+ public files: Map<string, Set<ProcessInfoNode>>
90
+ public uuids: Map<string, ProcessInfoNode>
91
+ public externalIDs: Map<string, ProcessInfoNode>
92
+
93
+ private pendingRoot: Map<string, ProcessInfoNode>
94
+ private pendingParent: Map<string, ProcessInfoNode>
95
+
96
+ constructor(options?: ProcessInfoOptions)
97
+
98
+ save(): Promise<void>
99
+ saveSync(): void
100
+ erase(): Promise<void>
101
+ eraseSync(): void
102
+
103
+ load(): Promise<ProcessInfo>
104
+ loadSync(): ProcessInfo
105
+
106
+ static get Node(): typeof ProcessInfoNode
107
+ static get ProcessInfo(): typeof ProcessInfo
108
+
109
+ static spawn(
110
+ cmd: string,
111
+ args: string[],
112
+ options: ProcessInfoSpawnOptions
113
+ ): ChildProcess
114
+
115
+ static spawnSync(cmd: string): SpawnSyncReturns<Buffer>
116
+ static spawnSync(
117
+ cmd: string,
118
+ options: ProcessInfoSpawnSyncOptionsWithStringEncoding
119
+ ): SpawnSyncReturns<string>
120
+ static spawnSync(
121
+ cmd: string,
122
+ options: ProcessInfoSpawnSyncOptionsWithBufferEncoding
123
+ ): SpawnSyncReturns<Buffer>
124
+ static spawnSync(
125
+ cmd: string,
126
+ options?: ProcessInfoSpawnSyncOptions
127
+ ): SpawnSyncReturns<string | Buffer>
128
+ static spawnSync(
129
+ cmd: string,
130
+ args: readonly string[]
131
+ ): SpawnSyncReturns<Buffer>
132
+ static spawnSync(
133
+ cmd: string,
134
+ args: readonly string[],
135
+ options: ProcessInfoSpawnSyncOptionsWithStringEncoding
136
+ ): SpawnSyncReturns<string>
137
+ static spawnSync(
138
+ cmd: string,
139
+ args: readonly string[],
140
+ options: ProcessInfoSpawnSyncOptionsWithBufferEncoding
141
+ ): SpawnSyncReturns<Buffer>
142
+ static spawnSync(
143
+ cmd: string,
144
+ args?: readonly string[],
145
+ options?: ProcessInfoSpawnSyncOptions
146
+ ): SpawnSyncReturns<string | Buffer>
147
+
148
+ static exec(
149
+ cmd: string,
150
+ options: ProcessInfoExecOptions,
151
+ callback?: (
152
+ error: ExecException | null,
153
+ stdout: Buffer,
154
+ stderr: Buffer
155
+ ) => void
156
+ ): ChildProcess
157
+
158
+ static execSync(
159
+ cmd: string,
160
+ options: ProcessInfoExecSyncOptionsWithStringEncoding
161
+ ): string
162
+ static execSync(
163
+ cmd: string,
164
+ options: ProcessInfoExecSyncOptionsWithBufferEncoding
165
+ ): Buffer
166
+ static execSync(
167
+ cmd: string,
168
+ options?: ProcessInfoExecSyncOptions
169
+ ): string | Buffer
170
+
171
+ static execFile(
172
+ cmd: string,
173
+ args: string[],
174
+ options: ProcessInfoExecFileOptions
175
+ ): ChildProcess
176
+
177
+ static execFileSync(file: string): Buffer
178
+ static execFileSync(
179
+ file: string,
180
+ options: ProcessInfoExecFileSyncOptionsWithStringEncoding
181
+ ): string
182
+ static execFileSync(
183
+ file: string,
184
+ options: ProcessInfoExecFileSyncOptionsWithBufferEncoding
185
+ ): Buffer
186
+ static execFileSync(
187
+ file: string,
188
+ options?: ProcessInfoExecFileSyncOptions
189
+ ): string | Buffer
190
+ static execFileSync(file: string, args: readonly string[]): Buffer
191
+ static execFileSync(
192
+ file: string,
193
+ args: readonly string[],
194
+ options: ProcessInfoExecFileSyncOptionsWithStringEncoding
195
+ ): string
196
+ static execFileSync(
197
+ file: string,
198
+ args: readonly string[],
199
+ options: ProcessInfoExecFileSyncOptionsWithBufferEncoding
200
+ ): Buffer
201
+ static execFileSync(
202
+ file: string,
203
+ args?: readonly string[],
204
+ options?: ProcessInfoExecFileSyncOptions
205
+ ): string | Buffer
206
+ }
207
+
208
+ export = ProcessInfo
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@tapjs/processinfo",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "main": "lib/index.cjs",
5
+ "types": "index.d.ts",
5
6
  "files": [
6
7
  "index.d.ts",
7
8
  "lib"