Skip to content

chore: update node typings to 8 #3947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/common/file-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export class FileSystem implements IFileSystem {
}
}

public symlink(sourcePath: string, destinationPath: string, type?: string): void {
public symlink(sourcePath: string, destinationPath: string, type?: fs.symlink.Type): void {
fs.symlinkSync(sourcePath, destinationPath, type);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/common/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ export function isPromise(candidateFuture: any): boolean {
return !!(candidateFuture && typeof (candidateFuture.then) === "function");
}

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

try {
Expand Down
2 changes: 1 addition & 1 deletion lib/common/mobile/ios/device/ios-device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class IOSDevice implements Mobile.IiOSDevice {
public deviceInfo: Mobile.IDeviceInfo;

private _socket: net.Socket;
private _deviceLogHandler: Function;
private _deviceLogHandler: (...args: any[]) => void;

constructor(private deviceActionInfo: IOSDeviceLib.IDeviceActionInfo,
private $injector: IInjector,
Expand Down
2 changes: 1 addition & 1 deletion lib/common/prompter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export class Prompter implements IPrompter {
private cleanListener(stream: NodeJS.WritableStream, eventName: string, listenerName: string): void {
const eventListeners: any[] = process.stdout.listeners(eventName);

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

if (listenerFunction) {
stream.removeListener(eventName, listenerFunction);
Expand Down
2 changes: 1 addition & 1 deletion lib/common/services/process-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class ProcessService implements IProcessService {
const callbackToString = callback.toString();

if (this._listeners.length === 0) {
_.each(ProcessService.PROCESS_EXIT_SIGNALS, (signal: string) => {
_.each(ProcessService.PROCESS_EXIT_SIGNALS, (signal: NodeJS.Signals) => {
process.on(signal, () => this.executeAllCallbacks.apply(this));
});
}
Expand Down
2 changes: 1 addition & 1 deletion lib/common/test/unit-tests/process-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("Process service", () => {
$processService.attachToProcessExitSignals({}, emptyFunction);
$processService.attachToProcessExitSignals({}, emptyFunction);

_.each(processExitSignals, (signal: string) => {
_.each(processExitSignals, (signal: NodeJS.Signals) => {
// We need to search only for our listener because each exit signal have different listeners added to it.
const actualListeners = _.filter(process.listeners(signal), (listener: Function) => listener.toString().indexOf("executeAllCallbacks") >= 0);
assert.deepEqual(actualListeners.length, 1);
Expand Down
2 changes: 1 addition & 1 deletion lib/services/analytics/analytics-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export class AnalyticsService extends AnalyticsServiceBase {
return new Promise<void>((resolve, reject) => {
if (broker && broker.connected) {
try {
broker.send(message, resolve);
broker.send(message, (error: Error) => resolve());
} catch (err) {
this.$logger.trace("Error while trying to send message to broker:", err);
resolve();
Expand Down
2 changes: 1 addition & 1 deletion lib/services/debug-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class DebugService extends EventEmitter implements IDebugService {

if (fullUrl) {
const parseQueryString = true;
const wsQueryParam = parse(fullUrl, parseQueryString).query.ws;
const wsQueryParam = <string>parse(fullUrl, parseQueryString).query.ws;
const hostPortSplit = wsQueryParam && wsQueryParam.split(":");
debugInfo.port = hostPortSplit && +hostPortSplit[1];
}
Expand Down
6 changes: 3 additions & 3 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"@types/color": "3.0.0",
"@types/lockfile": "1.0.0",
"@types/lodash": "4.14.116",
"@types/node": "6.0.61",
"@types/node": "8.10.30",
"@types/ora": "1.3.3",
"@types/qr-image": "3.2.0",
"@types/request": "0.0.45",
Expand Down
4 changes: 2 additions & 2 deletions test/helpers/preview-command-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ function makeInteractive() {
}

function makeNonInteractive() {
process.stdout.isTTY = false;
process.stdin.isTTY = false;
(<any>process.stdout).isTTY = false;
(<any>process.stdin).isTTY = false;
}

function reset() {
Expand Down
2 changes: 1 addition & 1 deletion test/services/livesync/android-livesync-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const protocolVersion = "0.2.0";
class TestSocket extends LiveSyncSocket {
public accomulatedData: Buffer[] = [];
public connect () {
//ignore
return this;
}

public writeAsync(data: Buffer | string, cb?: string | Function, encoding?: Function | string): Promise<Boolean> {
Expand Down
6 changes: 3 additions & 3 deletions test/services/platform-environment-requirements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ describe("platformEnvironmentRequirements ", () => {
assert.deepEqual(['Sync to Playground', 'Configure for Local Builds', 'Skip Step and Configure Manually'], promptForChoiceData[0].choices);
});
it("should skip env check when NS_SKIP_ENV_CHECK environment variable is passed", async() => {
process.env.NS_SKIP_ENV_CHECK = true;
(<any>process.env).NS_SKIP_ENV_CHECK = true;

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

Expand Down Expand Up @@ -221,8 +221,8 @@ describe("platformEnvironmentRequirements ", () => {

describe("when console is non interactive", () => {
beforeEach(() => {
process.stdout.isTTY = false;
process.stdin.isTTY = false;
(<any>process).stdout.isTTY = false;
(<any>process.stdin).isTTY = false;
mockDoctorService({ canExecuteLocalBuild: false });
});

Expand Down