Skip to content

Commit

Permalink
refactor: do not use explicit NodeJS type
Browse files Browse the repository at this point in the history
It is more for fun than for practicality.
  • Loading branch information
senyai committed Apr 20, 2024
1 parent 68abef7 commit 046433d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/autoinout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const opAffectsInOut = (op: Operation): boolean =>

export class AutoIncomingOutgoing {
private disposables: Disposable[] = [];
private timer: NodeJS.Timer | undefined;
private timer: ReturnType<typeof setTimeout> | undefined;

constructor(private repository: Repository) {
workspace.onDidChangeConfiguration(
Expand Down
8 changes: 4 additions & 4 deletions src/fossilExecutable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class FossilExecutable {
const disposables: IDisposable[] = [];

const once = (
ee: NodeJS.EventEmitter,
ee: typeof child.stdout | typeof child,
name: 'close' | 'error' | 'exit',
fn: (...args: any[]) => void
) => {
Expand All @@ -233,14 +233,14 @@ export class FossilExecutable {
};

const on = (
ee: NodeJS.EventEmitter,
ee: typeof child.stdout | typeof child,
name: 'data',
fn: (...args: any[]) => void
) => {
ee.on(name, fn);
disposables.push(toDisposable(() => ee.removeListener(name, fn)));
};
let readTimeout: NodeJS.Timeout | undefined;
let readTimeout: ReturnType<typeof setTimeout> | undefined;
const buffers: Buffer[] = [];

async function onReadTimeout(): Promise<void> {
Expand Down Expand Up @@ -313,7 +313,7 @@ export class FossilExecutable {
options: FossilSpawnOptions
) {
const startTimeHR = process.hrtime();
const waitAndLog = (timeout: number): NodeJS.Timeout => {
const waitAndLog = (timeout: number): ReturnType<typeof setTimeout> => {
return setTimeout(() => {
this.logArgs(args, reason, 'still running');
logTimeout = waitAndLog(timeout * 4);
Expand Down

0 comments on commit 046433d

Please sign in to comment.