1 | import { FileDescriptions, StrykerOptions } from '@stryker-mutator/api/core';
|
2 | import { Disposable, InjectableClass, InjectionToken } from 'typed-inject';
|
3 | import { LoggingClientContext } from '../logging/index.js';
|
4 | import { ChildProcessContext } from './child-process-proxy-worker.js';
|
5 | import { IdGenerator } from './id-generator.js';
|
6 | type Func<TS extends any[], R> = (...args: TS) => R;
|
7 | type PromisifiedFunc<TS extends any[], R> = (...args: TS) => Promise<R>;
|
8 | export type Promisified<T> = {
|
9 | [K in keyof T]: T[K] extends PromisifiedFunc<any, any> ? T[K] : T[K] extends Func<infer TS, infer R> ? PromisifiedFunc<TS, R> : () => Promise<T[K]>;
|
10 | };
|
11 | export declare class ChildProcessProxy<T> implements Disposable {
|
12 | readonly proxy: Promisified<T>;
|
13 | private readonly worker;
|
14 | private readonly initTask;
|
15 | private disposeTask;
|
16 | private fatalError;
|
17 | private readonly workerTasks;
|
18 | private readonly log;
|
19 | private readonly stdoutBuilder;
|
20 | private readonly stderrBuilder;
|
21 | private isDisposed;
|
22 | private readonly initMessage;
|
23 | private constructor();
|
24 | /**
|
25 | * @description Creates a proxy where each function of the object created using the constructorFunction arg is ran inside of a child process
|
26 | */
|
27 | static create<R, Tokens extends Array<InjectionToken<ChildProcessContext>>>(modulePath: string, loggingContext: LoggingClientContext, options: StrykerOptions, fileDescriptions: FileDescriptions, pluginModulePaths: readonly string[], workingDirectory: string, injectableClass: InjectableClass<ChildProcessContext, R, Tokens>, execArgv: string[], idGenerator: IdGenerator): ChildProcessProxy<R>;
|
28 | private send;
|
29 | private initProxy;
|
30 | private forward;
|
31 | private listenForMessages;
|
32 | private listenToStdoutAndStderr;
|
33 | get stdout(): string;
|
34 | get stderr(): string;
|
35 | private reportError;
|
36 | private readonly handleUnexpectedExit;
|
37 | private readonly handleError;
|
38 | private innerProcessIsCrashed;
|
39 | dispose(): Promise<void>;
|
40 | private logUnidentifiedMessage;
|
41 | }
|
42 | export {};
|
43 |
|
\ | No newline at end of file |