tnp-core 19.0.36 → 19.0.37
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/browser/fesm2022/tnp-core.mjs +0 -19
- package/browser/fesm2022/tnp-core.mjs.map +1 -1
- package/browser/package.json +1 -1
- package/cli.backend.js +2 -2
- package/client/package.json +1 -1
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/env/env.angular-node-app.d.ts +13 -0
- package/lib/env/env.angular-node-app.js +19 -0
- package/lib/env/env.angular-node-app.js.map +1 -0
- package/lib/env/env.electron-app.d.ts +13 -0
- package/lib/env/env.electron-app.js +19 -0
- package/lib/env/env.electron-app.js.map +1 -0
- package/lib/env/env.mobile-app.d.ts +13 -0
- package/lib/env/env.mobile-app.js +19 -0
- package/lib/env/env.mobile-app.js.map +1 -0
- package/lib/env/env.npm-lib-and-cli-tool.d.ts +13 -0
- package/lib/env/env.npm-lib-and-cli-tool.js +19 -0
- package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -0
- package/lib/env/env.vscode-plugin.d.ts +13 -0
- package/lib/env/env.vscode-plugin.js +19 -0
- package/lib/env/env.vscode-plugin.js.map +1 -0
- package/lib/env/index.d.ts +5 -0
- package/lib/env/index.js +22 -0
- package/lib/env/index.js.map +1 -0
- package/lib/node-chalk-mock.js +2 -2
- package/lib/node-path-mock.js +2 -2
- package/lib/required-global-npm-packages.d.ts +0 -4
- package/lib/required-global-npm-packages.js +0 -19
- package/lib/required-global-npm-packages.js.map +1 -1
- package/package.json +1 -1
- package/tmp-environment.json +4 -10
- package/websql/fesm2022/tnp-core.mjs +0 -19
- package/websql/fesm2022/tnp-core.mjs.map +1 -1
- package/websql/package.json +1 -1
- package/client/README.md +0 -24
- package/client/fesm2022/tnp-core.mjs +0 -6442
- package/client/fesm2022/tnp-core.mjs.map +0 -1
- package/client/index.d.ts +0 -6
- package/client/lib/core-cli.d.ts +0 -4
- package/client/lib/core-config.d.ts +0 -6
- package/client/lib/core-imports.d.ts +0 -61
- package/client/lib/core-models.d.ts +0 -487
- package/client/lib/framework-name.d.ts +0 -3
- package/client/lib/helpers-isomorphic.d.ts +0 -28
- package/client/lib/helpers-messages.d.ts +0 -49
- package/client/lib/helpers.d.ts +0 -185
- package/client/lib/index.d.ts +0 -12
- package/client/lib/node-chalk-mock.d.ts +0 -3
- package/client/lib/node-path-mock.d.ts +0 -26
- package/client/lib/progress-data.d.ts +0 -19
- package/client/lib/required-global-npm-packages.d.ts +0 -10
- package/client/lib/utils.d.ts +0 -388
- package/client/public-api.d.ts +0 -2
package/client/lib/helpers.d.ts
DELETED
@@ -1,185 +0,0 @@
|
|
1
|
-
// @ts-nocheck
|
2
|
-
import { HelpersMessages } from './helpers-messages';
|
3
|
-
import { CoreModels } from './core-models';
|
4
|
-
import type { ChildProcess } from 'child_process';
|
5
|
-
export interface RunSyncOrAsyncOptions {
|
6
|
-
functionFn: Function;
|
7
|
-
context?: object;
|
8
|
-
arrayOfParams?: any[];
|
9
|
-
}
|
10
|
-
export interface CommandOutputOptions {
|
11
|
-
biggerBuffer?: boolean;
|
12
|
-
showOnlyLastLine?: boolean;
|
13
|
-
showStder?: boolean;
|
14
|
-
gatherColors?: boolean;
|
15
|
-
showErrorWarning?: boolean;
|
16
|
-
}
|
17
|
-
export declare class HelpersCore extends HelpersMessages {
|
18
|
-
private static _instanceCore;
|
19
|
-
static get InstanceCore(): HelpersCore;
|
20
|
-
readonly bigMaxBuffer: number;
|
21
|
-
constructor();
|
22
|
-
/**
|
23
|
-
* @deprecated use UtilsOs.isRunningInsideWsl()
|
24
|
-
*/
|
25
|
-
get isWsl(): boolean;
|
26
|
-
/**
|
27
|
-
* @deprecated use UtilsOs.isRunningInDocker
|
28
|
-
*/
|
29
|
-
isRunningInDocker(): boolean;
|
30
|
-
/**
|
31
|
-
* @deprecated use UtilsOs.isRunningInLinuxGraphicEnvironment
|
32
|
-
*/
|
33
|
-
isRunningInLinuxGraphicsCapableEnvironment(): boolean;
|
34
|
-
/**
|
35
|
-
* @deprecated use UtilsTerminal.clearConsole
|
36
|
-
*/
|
37
|
-
clearConsole(): void;
|
38
|
-
mediaTypeFromSrc(src: string): CoreModels.MediaType;
|
39
|
-
sleep(seconds?: number): any;
|
40
|
-
removeIfExists(absoluteFileOrFolderPath: string | string[]): any;
|
41
|
-
/**
|
42
|
-
* path.relative that return cross platform path
|
43
|
-
*/
|
44
|
-
relative(cwd: string, to: string): string;
|
45
|
-
removeFileIfExists(absoluteFilePath: string | string[]): any;
|
46
|
-
removeFolderIfExists(absoluteFolderPath: string | string[]): any;
|
47
|
-
/**
|
48
|
-
* leave max 1 empty line
|
49
|
-
*/
|
50
|
-
removeEmptyLineFromString(str: string): string;
|
51
|
-
/**
|
52
|
-
* @deprecated
|
53
|
-
*/
|
54
|
-
tryRemoveDir(dirpath: string, contentOnly?: boolean, omitWarningNotExisted?: boolean): any;
|
55
|
-
removeSymlinks(dirPath: string | string[], options?: {
|
56
|
-
dryRun?: boolean;
|
57
|
-
}): void;
|
58
|
-
/**
|
59
|
-
* @deprecated use safeRemove
|
60
|
-
*/
|
61
|
-
remove(fileOrFolderPathOrPatter: string | string[], exactFolder?: boolean): any;
|
62
|
-
get isRunningInGitBash(): boolean;
|
63
|
-
/**
|
64
|
-
* Check if the current shell is supported by Taon framework.
|
65
|
-
*/
|
66
|
-
get isSupportedTaonTerminal(): boolean;
|
67
|
-
/**
|
68
|
-
* check if function is class
|
69
|
-
*/
|
70
|
-
isClass(funcOrClass: any): boolean;
|
71
|
-
/**
|
72
|
-
* check if data is nodejs/browser blob
|
73
|
-
*
|
74
|
-
* @param maybeBlob
|
75
|
-
* @returns
|
76
|
-
*/
|
77
|
-
isBlob(maybeBlob: any): maybeBlob is Blob;
|
78
|
-
/**
|
79
|
-
* Check if data is nodejs buffer
|
80
|
-
*
|
81
|
-
* @param maybeNodejsBuffer
|
82
|
-
* @returns
|
83
|
-
*/
|
84
|
-
removeSlashAtEnd(s: string): string;
|
85
|
-
removeSlashAtBegin(s: string): string;
|
86
|
-
/**
|
87
|
-
* stringify to pretty json string
|
88
|
-
*/
|
89
|
-
stringify(inputObject: any): string;
|
90
|
-
runSyncOrAsync<FUNCTION_RETURN_TYPE = any>(fnOrOptions: RunSyncOrAsyncOptions): Promise<FUNCTION_RETURN_TYPE>;
|
91
|
-
/**
|
92
|
-
* symlink may have existed or unexisted destiantion url
|
93
|
-
* @param destUrl M
|
94
|
-
*/
|
95
|
-
isSymlinkThatMatchesUrl(possibleSymlink: string, destUrl: string, absoluteFileMatch?: boolean): boolean;
|
96
|
-
isSymlinkFileExitedOrUnexisted(filePath: string | string[]): boolean;
|
97
|
-
/**
|
98
|
-
* If symbolnk link that target file does not exits
|
99
|
-
*/
|
100
|
-
isUnexistedLink(filePath: string | string[]): boolean;
|
101
|
-
/**
|
102
|
-
* @param existedLink check if source of link exists
|
103
|
-
*/
|
104
|
-
isExistedSymlink(filePath: string | string[]): boolean;
|
105
|
-
exists(folderOrFilePath: string | string[]): any;
|
106
|
-
/**
|
107
|
-
* this is HACK for running procesess inside processes
|
108
|
-
*/
|
109
|
-
_fixCommand(command: string): string;
|
110
|
-
command(command: string): {};
|
111
|
-
/**
|
112
|
-
* @deprecated use UtilsTerminal.wait
|
113
|
-
*/
|
114
|
-
wait(second: number): Promise<void>;
|
115
|
-
timeout(seconds: number): Promise<void>;
|
116
|
-
killProcessByPort(portOrPortsToKill: number | number[], options?: {
|
117
|
-
silent?: boolean;
|
118
|
-
}): Promise<any>;
|
119
|
-
killOnPort(portOrPortsToKill: number | number[], options?: {
|
120
|
-
silent?: boolean;
|
121
|
-
}): Promise<any>;
|
122
|
-
killProcess(byPid: number): void;
|
123
|
-
run(command: string, options?: CoreModels.RunOptions): {
|
124
|
-
/**
|
125
|
-
* start command as synchronous nodej proces
|
126
|
-
*/
|
127
|
-
sync(): any;
|
128
|
-
/**
|
129
|
-
* start command as asynchronous nodej proces
|
130
|
-
* @param detach (default: false) - if true process will be detached
|
131
|
-
*/
|
132
|
-
async(detach?: boolean, mockFun?: (stdoutCallback: (dataForStdout: any) => any, stdErrcCallback: (dataForStder: any) => any, shouldProcesBeDead?: () => boolean) => Promise<number> | number): ChildProcess;
|
133
|
-
/**
|
134
|
-
* start command as asynchronous nodej proces inside promise
|
135
|
-
*/
|
136
|
-
asyncAsPromise(): Promise<void>;
|
137
|
-
unitlOutput(optionsOutput: {
|
138
|
-
stdoutMsg: string | string[];
|
139
|
-
stderMsg?: string | string[];
|
140
|
-
timeout?: number;
|
141
|
-
stdoutOutputContainsCallback?: () => any;
|
142
|
-
outputLineReplace?: (outputLine: string) => string;
|
143
|
-
}): Promise<void>;
|
144
|
-
/**
|
145
|
-
* @deprecated use unitlOutput
|
146
|
-
* start command as asynchronous nodej proces inside promise
|
147
|
-
* and wait until output contains some string
|
148
|
-
*/
|
149
|
-
unitlOutputContains(stdoutMsg: string | string[], stderMsg?: string | string[], timeout?: number, stdoutOutputContainsCallback?: () => any): any;
|
150
|
-
};
|
151
|
-
/**
|
152
|
-
* @deprecated use UtilsTerminal.confirm
|
153
|
-
*/
|
154
|
-
questionYesNo(message: string, callbackTrue?: () => any, callbackFalse?: () => any, defaultValue?: boolean): Promise<any>;
|
155
|
-
/**
|
156
|
-
* Quick fix for object values
|
157
|
-
* @deprecated
|
158
|
-
*/
|
159
|
-
values(obj: any): any[];
|
160
|
-
/**
|
161
|
-
* does not make sense
|
162
|
-
* @deprecated
|
163
|
-
*/
|
164
|
-
private isFile;
|
165
|
-
tryReadFile(absoluteFilePath: string | string[], // @ts-ignore
|
166
|
-
defaultValueWhenNotExists?: string, notTrim?: boolean): Promise<string | undefined>;
|
167
|
-
/**
|
168
|
-
* wrapper for fs.readFileSync
|
169
|
-
*/
|
170
|
-
readFile(absoluteFilePath: string | string[], // @ts-ignore
|
171
|
-
defaultValueWhenNotExists?: string, notTrim?: boolean): string | undefined;
|
172
|
-
/**
|
173
|
-
* read json from absolute path
|
174
|
-
* @returns json object
|
175
|
-
*/
|
176
|
-
readJson(absoluteFilePath: string | string[], defaultValue?: {}, useJson5?: boolean): any;
|
177
|
-
readJson5(absoluteFilePath: string | string[], defaultValue?: any): any;
|
178
|
-
readJsonC(absoluteFilePath: string | string[], defaultValue?: any): any;
|
179
|
-
replaceLinesInFile(absoluteFilePath: string | string[], lineReplaceFn: (line: string) => string): void;
|
180
|
-
getFilesFrom(folderOrLinkToFolder: string | string[], options?: {
|
181
|
-
recursive?: boolean;
|
182
|
-
followSymlinks?: boolean;
|
183
|
-
}): string[];
|
184
|
-
hideNodeWarnings(): void;
|
185
|
-
}
|
package/client/lib/index.d.ts
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
// @ts-nocheck
|
2
|
-
export * from './framework-name';
|
3
|
-
export * from './core-imports';
|
4
|
-
export * from './core-models';
|
5
|
-
import { HelpersCore as Base } from './helpers';
|
6
|
-
export * from './core-config';
|
7
|
-
export * from './progress-data';
|
8
|
-
export * from './utils';
|
9
|
-
export * from './core-cli';
|
10
|
-
export * from './required-global-npm-packages';
|
11
|
-
export { HelpersCore as CoreHelpers, CommandOutputOptions } from './helpers';
|
12
|
-
export declare let Helpers: Base;
|
@@ -1,26 +0,0 @@
|
|
1
|
-
// @ts-nocheck
|
2
|
-
export declare const path: {
|
3
|
-
resolve: (pathToResovle: any) => any;
|
4
|
-
normalize: (pathArg: any) => any;
|
5
|
-
isAbsolute: (pathArg: any) => boolean;
|
6
|
-
join: () => any;
|
7
|
-
relative: (from: any, to: any) => any;
|
8
|
-
_makeLong: (path: any) => any;
|
9
|
-
dirname: (path: any) => any;
|
10
|
-
basename: (pathArg: any, ext: any) => any;
|
11
|
-
extname: (pathArg: any) => any;
|
12
|
-
format: (pathObject: any) => any;
|
13
|
-
parse: (pathArg: any) => {
|
14
|
-
root: string;
|
15
|
-
dir: string;
|
16
|
-
base: string;
|
17
|
-
ext: string;
|
18
|
-
name: string;
|
19
|
-
};
|
20
|
-
sep: string;
|
21
|
-
delimiter: string;
|
22
|
-
win32: {
|
23
|
-
normalize: (p: any) => any;
|
24
|
-
};
|
25
|
-
posix: any;
|
26
|
-
};
|
@@ -1,19 +0,0 @@
|
|
1
|
-
// @ts-nocheck
|
2
|
-
import { CoreModels } from './core-models';
|
3
|
-
export interface IPROGRESS_DATA {
|
4
|
-
/**
|
5
|
-
* How man percent of
|
6
|
-
*/
|
7
|
-
value?: number;
|
8
|
-
msg?: string;
|
9
|
-
type?: CoreModels.PROGRESS_DATA_TYPE;
|
10
|
-
date?: Date;
|
11
|
-
}
|
12
|
-
export declare class PROGRESS_DATA implements IPROGRESS_DATA {
|
13
|
-
static log(log: IPROGRESS_DATA): void;
|
14
|
-
static resolveFrom(chunk: string, callbackOnFounded?: (json: PROGRESS_DATA) => any, checkSplit?: boolean): PROGRESS_DATA[];
|
15
|
-
value?: number;
|
16
|
-
msg?: string;
|
17
|
-
type: CoreModels.PROGRESS_DATA_TYPE;
|
18
|
-
date?: Date;
|
19
|
-
}
|
package/client/lib/utils.d.ts
DELETED
@@ -1,388 +0,0 @@
|
|
1
|
-
// @ts-nocheck
|
2
|
-
import { Blob } from 'buffer';
|
3
|
-
import { CoreModels } from './core-models';
|
4
|
-
export declare namespace Utils {
|
5
|
-
export const uniqArray: <T = any>(array: any[], uniqueProperty?: keyof T) => T[];
|
6
|
-
/**
|
7
|
-
* @param anyObject
|
8
|
-
* @returns object with sorted keys
|
9
|
-
*/
|
10
|
-
export const sortKeys: (anyObject: any) => any;
|
11
|
-
/**
|
12
|
-
* Example:
|
13
|
-
* new RegExp(escapeStringForRegEx('a.b.c'),'g') => /a\.b\.c/g
|
14
|
-
*/
|
15
|
-
export const escapeStringForRegEx: (stringForRegExp: string) => string;
|
16
|
-
export function removeChalkSpecialChars(str: string): string;
|
17
|
-
export const fullDateTime: () => any;
|
18
|
-
export const fullDate: () => any;
|
19
|
-
export const getFreePort: (options?: {
|
20
|
-
startFrom?: number;
|
21
|
-
}) => Promise<number>;
|
22
|
-
export const requireUncached: (module: string) => any;
|
23
|
-
/**
|
24
|
-
* similar to camelCase but remove
|
25
|
-
* all non word / repeated characters
|
26
|
-
*/
|
27
|
-
export const camelize: (str?: string) => string;
|
28
|
-
interface AttrJsoncProp {
|
29
|
-
name: string;
|
30
|
-
value?: any;
|
31
|
-
}
|
32
|
-
export namespace json {
|
33
|
-
const getAtrributies: (jsonDeepPath: string, fileContent: string) => AttrJsoncProp[];
|
34
|
-
}
|
35
|
-
export enum DbBinaryFormatEnum {
|
36
|
-
Blob = "Blob",
|
37
|
-
File = "File",
|
38
|
-
string = "string"
|
39
|
-
}
|
40
|
-
export type DbBinaryFormatForBrowser = Blob | File | string;
|
41
|
-
/**
|
42
|
-
* Binary format that can be stored in database
|
43
|
-
*
|
44
|
-
* for nodejs => Buffer
|
45
|
-
* for sql.js => string (shoulb be blob - but not supported)
|
46
|
-
*
|
47
|
-
*/
|
48
|
-
export type DbBinaryFormat = DbBinaryFormatForBrowser;
|
49
|
-
export namespace binary {
|
50
|
-
/**
|
51
|
-
* This is for BROWSER ONLY
|
52
|
-
*
|
53
|
-
* @param buffer
|
54
|
-
* @param contentType
|
55
|
-
* @returns
|
56
|
-
*/
|
57
|
-
function arrayBufferToBlob(buffer: ArrayBuffer, contentType: CoreModels.ContentType): Promise<Blob>;
|
58
|
-
/**
|
59
|
-
* This is for BROWSER ONLY
|
60
|
-
* @param blob
|
61
|
-
* @returns
|
62
|
-
*/
|
63
|
-
function blobToArrayBuffer(blob: Blob): Promise<ArrayBuffer>;
|
64
|
-
/**
|
65
|
-
* it is revers to base64toBlob
|
66
|
-
* @param blob
|
67
|
-
* @returns
|
68
|
-
*/
|
69
|
-
function blobToBase64(blob: Blob): Promise<string>;
|
70
|
-
/**
|
71
|
-
* it is revers to blobToBase64()
|
72
|
-
* @param base64Data
|
73
|
-
* @returns
|
74
|
-
*/
|
75
|
-
function base64toBlob(base64Data: string, contentTypeOverride?: CoreModels.ContentType): Promise<Blob>;
|
76
|
-
function base64toDbBinaryFormat(text: string): Promise<DbBinaryFormat>;
|
77
|
-
function dbBinaryFormatToBase64(binaryFormat: DbBinaryFormat): Promise<string>;
|
78
|
-
function textToDbBinaryFormat(text: string): Promise<DbBinaryFormat>;
|
79
|
-
function dbBinaryFormatToText(binaryFormat: DbBinaryFormat): Promise<string>;
|
80
|
-
function fileToBlob(file: File): Promise<Blob>;
|
81
|
-
function blobToFile(blob: Blob, nameForFile?: string): Promise<File>;
|
82
|
-
function textToBlob(text: string, type?: CoreModels.ContentType): Promise<Blob>;
|
83
|
-
function blobToText(blob: Blob): Promise<string>;
|
84
|
-
function textToFile(text: string, fileRelativePathOrName: string): Promise<File>;
|
85
|
-
function fileToText(file: File): Promise<string>;
|
86
|
-
function jsonToBlob(jsonObj: object): Promise<Blob>;
|
87
|
-
/**
|
88
|
-
* TODO NOT TESTED
|
89
|
-
*/
|
90
|
-
function blobToJson(blob: Blob): Promise<string>;
|
91
|
-
function getBlobFrom(url: string): Promise<Blob>;
|
92
|
-
}
|
93
|
-
export namespace css {
|
94
|
-
/**
|
95
|
-
*
|
96
|
-
* @param pixelsCss pixels ex. 100px
|
97
|
-
* @returns
|
98
|
-
*/
|
99
|
-
function numValue(pixelsCss: string | number): number;
|
100
|
-
}
|
101
|
-
export {};
|
102
|
-
}
|
103
|
-
export declare namespace UtilsProcess {
|
104
|
-
interface ResolvePromiseMsg {
|
105
|
-
/**
|
106
|
-
* until this string is in output of stdout
|
107
|
-
*/
|
108
|
-
stdout?: string | string[];
|
109
|
-
/**
|
110
|
-
* until this string is in output of stderr
|
111
|
-
*/
|
112
|
-
stderr?: string | string[];
|
113
|
-
/**
|
114
|
-
* by default only resolve when exit code is 0
|
115
|
-
*/
|
116
|
-
resolveAfterAnyExitCode?: boolean;
|
117
|
-
}
|
118
|
-
export interface ProcessStartOptions {
|
119
|
-
/**
|
120
|
-
* by default is process.cwd();
|
121
|
-
*/
|
122
|
-
cwd?: string;
|
123
|
-
/**
|
124
|
-
* by default is false
|
125
|
-
*/
|
126
|
-
showCommand?: boolean;
|
127
|
-
/**
|
128
|
-
* Modify output line by line
|
129
|
-
*/
|
130
|
-
outputLineReplace?: (outputLineStderOrStdout: string) => string;
|
131
|
-
resolvePromiseMsg?: ResolvePromiseMsg;
|
132
|
-
/**
|
133
|
-
* Prefix messages output from child_process
|
134
|
-
*/
|
135
|
-
prefix?: string;
|
136
|
-
/**
|
137
|
-
* Try command again after fail after n milliseconds
|
138
|
-
*/
|
139
|
-
tryAgainWhenFailAfter?: number;
|
140
|
-
askToTryAgainOnError?: boolean;
|
141
|
-
exitOnErrorCallback?: (code: number) => void;
|
142
|
-
/**
|
143
|
-
* Use big buffer for big webpack logs
|
144
|
-
* (it may slow down smaller processes execution)
|
145
|
-
*/
|
146
|
-
biggerBuffer?: boolean;
|
147
|
-
hideOutput?: {
|
148
|
-
stdout?: boolean;
|
149
|
-
stderr?: boolean;
|
150
|
-
};
|
151
|
-
}
|
152
|
-
/**
|
153
|
-
* TODO IMPLEMENT
|
154
|
-
* start async node process
|
155
|
-
*/
|
156
|
-
export const startAsync: (command: string, cwd: string, options?: Omit<CoreModels.ExecuteOptions, "tryAgainWhenFailAfter">) => Promise<void>;
|
157
|
-
/**
|
158
|
-
* This let you start child process and resolve promise when some
|
159
|
-
* condition is met. It is useful for example when you want to start
|
160
|
-
* process and wait until some output is in stdout or stderr.
|
161
|
-
*/
|
162
|
-
export const startAsyncChildProcessCommandUntil: (command: string, options: {
|
163
|
-
/**
|
164
|
-
* tels when to resolve promise
|
165
|
-
*/
|
166
|
-
untilOptions: ResolvePromiseMsg;
|
167
|
-
displayOutputInParentProcess?: boolean;
|
168
|
-
resolveAfterAnyExitCode?: boolean;
|
169
|
-
cwd?: string;
|
170
|
-
}) => Promise<void>;
|
171
|
-
export const getGitBashPath: () => any;
|
172
|
-
/**
|
173
|
-
* TODO IMPLEMENT
|
174
|
-
* start async node process
|
175
|
-
*/
|
176
|
-
export const startInNewTerminalWindow: (command: string, options?: Pick<ProcessStartOptions, "cwd" | "hideOutput">) => any;
|
177
|
-
export const getBashOrShellName: () => "browser" | "cmd" | "powershell" | "gitbash" | "cygwin" | "unknown" | "bash" | "zsh" | "fish" | "sh";
|
178
|
-
/**
|
179
|
-
* Get CPU and memory usage for a single PID.
|
180
|
-
*/
|
181
|
-
export const getUsageForPid: (pid: number) => Promise<{
|
182
|
-
cpu: number;
|
183
|
-
memoryInGB: number;
|
184
|
-
memoryInMB: number;
|
185
|
-
}>;
|
186
|
-
/**
|
187
|
-
* Cross-platform function to list *direct* child PIDs of a given PID.
|
188
|
-
* Uses the appropriate command depending on `process.platform`.
|
189
|
-
*/
|
190
|
-
export function getChildPidsOnce(pid: number): Promise<number[]>;
|
191
|
-
/**
|
192
|
-
* Get CPU and memory usage for the current process (the Node.js process itself),
|
193
|
-
* plus any child processes spawned by it.
|
194
|
-
*/
|
195
|
-
export const getCurrentProcessAndChildUsage: () => Promise<{
|
196
|
-
current: {
|
197
|
-
cpu: number;
|
198
|
-
memoryInMB: number;
|
199
|
-
};
|
200
|
-
children: Array<{
|
201
|
-
pid: number;
|
202
|
-
cpu: number;
|
203
|
-
memoryInMB: number;
|
204
|
-
}>;
|
205
|
-
}>;
|
206
|
-
export {};
|
207
|
-
}
|
208
|
-
export declare namespace UtilsOs {
|
209
|
-
/**
|
210
|
-
* check if script is running in client browser
|
211
|
-
* (websql model -> is also considered as browser
|
212
|
-
* because it is running in browser)
|
213
|
-
*/
|
214
|
-
const isRunningInBrowser: () => boolean;
|
215
|
-
/**
|
216
|
-
* check if script is running in nodejs
|
217
|
-
* (backend script or electron script)
|
218
|
-
*/
|
219
|
-
const isRunningInNode: () => boolean;
|
220
|
-
/**
|
221
|
-
* check if script is running special
|
222
|
-
* browser mode that has sql.js backend
|
223
|
-
* and executes sql queries in browser
|
224
|
-
*/
|
225
|
-
const isRunningInWebSQL: () => boolean;
|
226
|
-
/**
|
227
|
-
* check whether the current process is running inside
|
228
|
-
* Electron backend or browser.
|
229
|
-
*/
|
230
|
-
const isRunningInElectron: () => boolean;
|
231
|
-
/**
|
232
|
-
* Check whether the current process is running inside
|
233
|
-
* a Visual Studio Code extension.
|
234
|
-
*/
|
235
|
-
const isRunningInVscodeExtension: () => boolean;
|
236
|
-
/**
|
237
|
-
* Check wether the current process is running inside
|
238
|
-
* windows subsystem for linux (WSL).
|
239
|
-
*/
|
240
|
-
const isRunningInWsl: () => boolean;
|
241
|
-
const isRunningInWindowsPowerShell: () => boolean;
|
242
|
-
const isRunningInWindowsCmd: () => boolean;
|
243
|
-
const isRunningInDocker: () => boolean;
|
244
|
-
const isRunningInLinuxGraphicsCapableEnvironment: () => boolean;
|
245
|
-
/**
|
246
|
-
* Check whether the current process is running in CLI mode.
|
247
|
-
*/
|
248
|
-
const isRunningInCliMode: () => boolean;
|
249
|
-
/**
|
250
|
-
* Check whether the current process is running in mocha test.
|
251
|
-
*/
|
252
|
-
const isRunningInMochaTest: () => boolean;
|
253
|
-
/**
|
254
|
-
* Checks if a given port is already in use (bound by another process).
|
255
|
-
*
|
256
|
-
* @param port - The port number to check.
|
257
|
-
* @param host - The hostname or IP address to bind to (default: '127.0.0.1').
|
258
|
-
* @returns Promise<boolean> - Resolves to `true` if the port is in use, otherwise `false`.
|
259
|
-
*/
|
260
|
-
const isPortInUse: (port: number, options?: {
|
261
|
-
/**
|
262
|
-
* '127.0.0.1' etc..
|
263
|
-
*/
|
264
|
-
checkForSpecificOnlyHost?: string;
|
265
|
-
}) => Promise<boolean>;
|
266
|
-
const isElectron: boolean;
|
267
|
-
const isBrowser: boolean;
|
268
|
-
const isNode: boolean;
|
269
|
-
const isWebSQL: boolean;
|
270
|
-
const isVscodeExtension: boolean;
|
271
|
-
}
|
272
|
-
export declare namespace UtilsString {
|
273
|
-
const kebabCaseNoSplitNumbers: (input: string) => string;
|
274
|
-
}
|
275
|
-
/**
|
276
|
-
* Taon migration utilities
|
277
|
-
*/
|
278
|
-
export declare namespace UtilsMigrations {
|
279
|
-
const getTimestampFromClassName: (className: string) => number | undefined;
|
280
|
-
const getFormattedTimestampFromClassName: (className: string) => string | undefined;
|
281
|
-
const formatTimestamp: (timestamp: number) => string;
|
282
|
-
const isValidTimestamp: (value: any) => boolean;
|
283
|
-
}
|
284
|
-
export declare namespace UtilsTerminal {
|
285
|
-
export interface SelectChoice {
|
286
|
-
/**
|
287
|
-
* Title of the choice
|
288
|
-
*/
|
289
|
-
name?: string;
|
290
|
-
disabled?: boolean;
|
291
|
-
}
|
292
|
-
export interface SelectChoiceValue<T = string> extends SelectChoice {
|
293
|
-
value?: T;
|
294
|
-
}
|
295
|
-
type SelectActionChoice = {
|
296
|
-
[choice: string]: SelectChoice & {
|
297
|
-
/**
|
298
|
-
* Action to execute
|
299
|
-
*/
|
300
|
-
action?: () => any;
|
301
|
-
};
|
302
|
-
};
|
303
|
-
export const wait: (second: number) => Promise<void>;
|
304
|
-
export const clearConsole: () => void;
|
305
|
-
export const multiselect: <T = string>(options: {
|
306
|
-
question: string;
|
307
|
-
/**
|
308
|
-
* If true, then only one choice can be selected
|
309
|
-
* @deprecated use select instead
|
310
|
-
*/
|
311
|
-
onlyOneChoice?: boolean;
|
312
|
-
choices: SelectChoiceValue<T>[] | {
|
313
|
-
[choice: string]: SelectChoice;
|
314
|
-
};
|
315
|
-
autocomplete?: boolean;
|
316
|
-
defaultSelected?: string[];
|
317
|
-
}) => Promise<T[]>;
|
318
|
-
/**
|
319
|
-
* Similar to select but executes action if provided
|
320
|
-
* @returns selected and executed value
|
321
|
-
*/
|
322
|
-
export const multiselectActionAndExecute: <CHOICE extends SelectActionChoice = SelectActionChoice>(choices: CHOICE, options?: {
|
323
|
-
question?: string;
|
324
|
-
autocomplete?: boolean;
|
325
|
-
defaultSelected?: string;
|
326
|
-
hint?: string;
|
327
|
-
executeActionsOnDefault?: boolean;
|
328
|
-
}) => Promise<any>;
|
329
|
-
/**
|
330
|
-
* Similar to select but executes action if provided
|
331
|
-
* @returns selected and executed value
|
332
|
-
*/
|
333
|
-
export const selectActionAndExecute: <CHOICE extends SelectActionChoice = SelectActionChoice>(choices: CHOICE, options?: {
|
334
|
-
question?: string;
|
335
|
-
autocomplete?: boolean;
|
336
|
-
defaultSelected?: string;
|
337
|
-
hint?: string;
|
338
|
-
executeActionOnDefault?: boolean;
|
339
|
-
}) => Promise<any>;
|
340
|
-
export const select: <T = string>(options: {
|
341
|
-
question: string;
|
342
|
-
choices: SelectChoiceValue<T>[] | {
|
343
|
-
[choice: string]: SelectChoice;
|
344
|
-
};
|
345
|
-
autocomplete?: boolean;
|
346
|
-
defaultSelected?: string;
|
347
|
-
hint?: string;
|
348
|
-
}) => Promise<T>;
|
349
|
-
export const pipeEnterToStdin: () => void;
|
350
|
-
export const input: ({ defaultValue, question, required, }: {
|
351
|
-
defaultValue?: string;
|
352
|
-
question: string;
|
353
|
-
required?: boolean;
|
354
|
-
validate?: (value: string) => boolean;
|
355
|
-
}) => Promise<string>;
|
356
|
-
export const confirm: (options?: {
|
357
|
-
/**
|
358
|
-
* default: Are you sure?
|
359
|
-
*/
|
360
|
-
message?: string;
|
361
|
-
callbackTrue?: () => any;
|
362
|
-
callbackFalse?: () => any;
|
363
|
-
/**
|
364
|
-
* default: true
|
365
|
-
*/
|
366
|
-
defaultValue?: boolean;
|
367
|
-
engine?: "inquirer-toggle" | "prompts" | "enquirer" | "@inquirer/prompts";
|
368
|
-
}) => Promise<any>;
|
369
|
-
export const pressAnyKeyToContinueAsync: (options?: {
|
370
|
-
message?: string;
|
371
|
-
}) => Promise<void>;
|
372
|
-
/**
|
373
|
-
* @deprecated use UtilsTerminal.pressAnyKeyToContinueAsync()
|
374
|
-
*/
|
375
|
-
export const pressAnyKey: (options?: {
|
376
|
-
message?: string;
|
377
|
-
}) => any;
|
378
|
-
export const previewLongList: (list: string | string[], listName?: string) => Promise<void>;
|
379
|
-
/**
|
380
|
-
* Displays a long list in the console using a pager like `less`.
|
381
|
-
* Returns a Promise that resolves when the user exits the pager.
|
382
|
-
*
|
383
|
-
* @param {string} list - The long string content to display.
|
384
|
-
* @returns {Promise<void>} A Promise that resolves when the pager exits.
|
385
|
-
*/
|
386
|
-
export const previewLongListGitLogLike: (list: string | string[]) => Promise<void>;
|
387
|
-
export {};
|
388
|
-
}
|
package/client/public-api.d.ts
DELETED