Skip to content

Commit 34493ac

Browse files
author
DimitarTachev
committed
chore: update nodejs typings to 8
1 parent 6664585 commit 34493ac

File tree

13 files changed

+18
-18
lines changed

13 files changed

+18
-18
lines changed

lib/common/file-system.ts

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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/prompter.ts

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

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

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

@@ -221,8 +221,8 @@ describe("platformEnvironmentRequirements ", () => {
221221

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

0 commit comments

Comments
 (0)