Skip to content

Commit f58bf5d

Browse files
author
DimitarTachev
committed
chore: update nodejs typings to 8
1 parent b59e85a commit f58bf5d

14 files changed

+27
-27
lines changed

lib/common/file-system.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ export class FileSystem implements IFileSystem {
304304
}
305305
}
306306

307-
public symlink(sourcePath: string, destinationPath: string, type?: string): void {
307+
public symlink(sourcePath: string, destinationPath: string, type?: fs.symlink.Type): void {
308308
fs.symlinkSync(sourcePath, destinationPath, type);
309309
}
310310

lib/common/helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ export function isPromise(candidateFuture: any): boolean {
432432
return !!(candidateFuture && typeof (candidateFuture.then) === "function");
433433
}
434434

435-
export async function attachAwaitDetach(eventName: string, eventEmitter: EventEmitter, eventHandler: Function, operation: Promise<any>) {
435+
export async function attachAwaitDetach(eventName: string, eventEmitter: EventEmitter, eventHandler: (...args: any[]) => void, operation: Promise<any>) {
436436
eventEmitter.on(eventName, eventHandler);
437437

438438
try {

lib/common/mobile/ios/device/ios-device.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class IOSDevice implements Mobile.IiOSDevice {
1010
public deviceInfo: Mobile.IDeviceInfo;
1111

1212
private _socket: net.Socket;
13-
private _deviceLogHandler: Function;
13+
private _deviceLogHandler: (...args: any[]) => void;
1414

1515
constructor(private deviceActionInfo: IOSDeviceLib.IDeviceActionInfo,
1616
private $injector: IInjector,

lib/common/mobile/ios/simulator/ios-simulator-device.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { cache } from "../../../decorators";
66
export class IOSSimulator implements Mobile.IiOSSimulator {
77
private _applicationManager: Mobile.IDeviceApplicationManager;
88
private _fileSystem: Mobile.IDeviceFileSystem;
9-
private _deviceLogHandler: Function;
9+
private _deviceLogHandler: (...args: any[]) => void;
1010

1111
constructor(private simulator: Mobile.IiSimDevice,
1212
private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants,

lib/common/prompter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export class Prompter implements IPrompter {
159159
private cleanListener(stream: NodeJS.WritableStream, eventName: string, listenerName: string): void {
160160
const eventListeners: any[] = process.stdout.listeners(eventName);
161161

162-
const listenerFunction: Function = _.find(eventListeners, (func: any) => func.name === listenerName);
162+
const listenerFunction: (...args: any[]) => void = _.find(eventListeners, (func: any) => func.name === listenerName);
163163

164164
if (listenerFunction) {
165165
stream.removeListener(eventName, listenerFunction);

lib/common/services/process-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class ProcessService implements IProcessService {
1414
const callbackToString = callback.toString();
1515

1616
if (this._listeners.length === 0) {
17-
_.each(ProcessService.PROCESS_EXIT_SIGNALS, (signal: string) => {
17+
_.each(ProcessService.PROCESS_EXIT_SIGNALS, (signal: NodeJS.Signals) => {
1818
process.on(signal, () => this.executeAllCallbacks.apply(this));
1919
});
2020
}

lib/common/test/unit-tests/process-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe("Process service", () => {
2525
$processService.attachToProcessExitSignals({}, emptyFunction);
2626
$processService.attachToProcessExitSignals({}, emptyFunction);
2727

28-
_.each(processExitSignals, (signal: string) => {
28+
_.each(processExitSignals, (signal: NodeJS.Signals) => {
2929
// We need to search only for our listener because each exit signal have different listeners added to it.
3030
const actualListeners = _.filter(process.listeners(signal), (listener: Function) => listener.toString().indexOf("executeAllCallbacks") >= 0);
3131
assert.deepEqual(actualListeners.length, 1);

lib/services/analytics/analytics-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export class AnalyticsService extends AnalyticsServiceBase {
192192
return new Promise<void>((resolve, reject) => {
193193
if (broker && broker.connected) {
194194
try {
195-
broker.send(message, resolve);
195+
broker.send(message, (error: Error) => resolve());
196196
} catch (err) {
197197
this.$logger.trace("Error while trying to send message to broker:", err);
198198
resolve();

lib/services/debug-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export class DebugService extends EventEmitter implements IDebugService {
111111

112112
if (fullUrl) {
113113
const parseQueryString = true;
114-
const wsQueryParam = parse(fullUrl, parseQueryString).query.ws;
114+
const wsQueryParam = <string>parse(fullUrl, parseQueryString).query.ws;
115115
const hostPortSplit = wsQueryParam && wsQueryParam.split(":");
116116
debugInfo.port = hostPortSplit && +hostPortSplit[1];
117117
}

npm-shrinkwrap.json

+11-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"@types/color": "3.0.0",
9696
"@types/lockfile": "1.0.0",
9797
"@types/lodash": "4.14.116",
98-
"@types/node": "6.0.61",
98+
"@types/node": "8.10.30",
9999
"@types/ora": "1.3.3",
100100
"@types/qr-image": "3.2.0",
101101
"@types/request": "0.0.45",

test/helpers/preview-command-helper.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ function makeInteractive() {
6868
}
6969

7070
function makeNonInteractive() {
71-
process.stdout.isTTY = false;
72-
process.stdin.isTTY = false;
71+
(<any>process.stdout).isTTY = false;
72+
(<any>process.stdin).isTTY = false;
7373
}
7474

7575
function reset() {

test/services/livesync/android-livesync-tool.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const protocolVersion = "0.2.0";
1818
class TestSocket extends LiveSyncSocket {
1919
public accomulatedData: Buffer[] = [];
2020
public connect () {
21-
//ignore
21+
return this;
2222
}
2323

2424
public writeAsync(data: Buffer | string, cb?: string | Function, encoding?: Function | string): Promise<Boolean> {

test/services/platform-environment-requirements.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ describe("platformEnvironmentRequirements ", () => {
131131
assert.deepEqual(['Sync to Playground', 'Configure for Local Builds', 'Skip Step and Configure Manually'], promptForChoiceData[0].choices);
132132
});
133133
it("should skip env check when NS_SKIP_ENV_CHECK environment variable is passed", async() => {
134-
process.env.NS_SKIP_ENV_CHECK = true;
134+
(<any>process.env).NS_SKIP_ENV_CHECK = true;
135135

136136
const output = await platformEnvironmentRequirements.checkEnvironmentRequirements({ platform });
137137

@@ -220,8 +220,8 @@ describe("platformEnvironmentRequirements ", () => {
220220

221221
describe("when console is non interactive", () => {
222222
beforeEach(() => {
223-
process.stdout.isTTY = false;
224-
process.stdin.isTTY = false;
223+
(<any>process).stdout.isTTY = false;
224+
(<any>process.stdin).isTTY = false;
225225
mockDoctorService({ canExecuteLocalBuild: false });
226226
});
227227

0 commit comments

Comments
 (0)