Skip to content

Commit 6167820

Browse files
author
Dimitar Tachev
authored
Merge pull request #3947 from NativeScript/tachev/update-typings
chore: update node typings to 8
2 parents 6664585 + 34493ac commit 6167820

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",

0 commit comments

Comments
 (0)