@tapjs/processinfo 1.0.2 → 1.0.4

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.
Files changed (2) hide show
  1. package/index.d.ts +103 -0
  2. package/package.json +2 -1
package/index.d.ts ADDED
@@ -0,0 +1,103 @@
1
+ /// <reference types="node" />
2
+ import {
3
+ ChildProcess,
4
+ ExecFileOptions,
5
+ ExecFileSyncOptions,
6
+ ExecOptions,
7
+ ExecSyncOptions,
8
+ SpawnOptions,
9
+ SpawnSyncOptions,
10
+ } from 'node:child_process'
11
+
12
+ declare interface ProcessInfoOptions {
13
+ dir?: string
14
+ exclude?: RegExp
15
+ }
16
+
17
+ declare class ProcessInfoNode {
18
+ public parent: ProcessInfoNode | null
19
+ public children: ProcessInfoNode[] | null
20
+ public files: string[] | null
21
+ public externalID: string | null
22
+ link(db: ProcessInfo): void
23
+ }
24
+
25
+ declare interface ProcessInfoSpawnOptions extends SpawnOptions {
26
+ externalID?: string
27
+ }
28
+ declare interface ProcessInfoSpawnSyncOptions extends SpawnSyncOptions {
29
+ externalID?: string
30
+ }
31
+ declare interface ProcessInfoExecSyncOptions extends ExecSyncOptions {
32
+ externalID?: string
33
+ }
34
+ declare interface ProcessInfoExecOptions extends ExecOptions {
35
+ externalID?: string
36
+ }
37
+ declare interface ProcessInfoExecFileSyncOptions extends ExecFileSyncOptions {
38
+ externalID?: string
39
+ }
40
+ declare interface ProcessInfoExecFileOptions extends ExecFileOptions {
41
+ externalID?: string
42
+ }
43
+
44
+ declare class ProcessInfo {
45
+ public dir: string
46
+ public exclude: RegExp
47
+ public roots: Set<ProcessInfoNode>
48
+ public files: Map<string, Set<ProcessInfoNode>>
49
+ public uuids: Map<string, ProcessInfoNode>
50
+ public externalIDs: Map<string, ProcessInfoNode>
51
+
52
+ private pendingRoot: Map<string, ProcessInfoNode>
53
+ private pendingParent: Map<string, ProcessInfoNode>
54
+
55
+ constructor(options: ProcessInfoOptions)
56
+
57
+ save(): Promise<void>
58
+ saveSync(): void
59
+ erase(): Promise<void>
60
+ eraseSync(): void
61
+
62
+ load(): Promise<ProcessInfo>
63
+ loadSync(): ProcessInfo
64
+
65
+ static get Node(): typeof ProcessInfoNode
66
+ static get ProcessInfo(): typeof ProcessInfo
67
+
68
+ static get spawn(): (
69
+ cmd: string,
70
+ args: string[],
71
+ options: ProcessInfoSpawnOptions
72
+ ) => ChildProcess
73
+ static get spawnSync(): (
74
+ cmd: string,
75
+ args: string[],
76
+ options: ProcessInfoSpawnSyncOptions
77
+ ) => SpawnSyncReturns
78
+ static get exec(): (
79
+ cmd: string,
80
+ options: ProcessInfoExecOptions,
81
+ callback?: (
82
+ error: ExecException | null,
83
+ stdout: Buffer,
84
+ stderr: Buffer
85
+ ) => void
86
+ ) => ChildProcess
87
+ static get execSync(): (
88
+ cmd: string,
89
+ options: ProcessInfoExecSyncOptions
90
+ ) => string | Buffer
91
+ static get execFile(): (
92
+ cmd: string,
93
+ args: string[],
94
+ options: ProcessInfoExecFileOptions
95
+ ) => ChildProcess
96
+ static get execFileSync(): (
97
+ cmd: string,
98
+ args: string[],
99
+ options: ProcessInfoExecFileSyncOptions
100
+ ) => string | Buffer
101
+ }
102
+
103
+ export = ProcessInfo
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@tapjs/processinfo",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "main": "lib/index.cjs",
5
5
  "files": [
6
+ "index.d.ts",
6
7
  "lib"
7
8
  ],
8
9
  "exports": {