[node] set correct type for process.env and fix node dependents

This commit is contained in:
Michiel de Bruijne
2017-06-24 21:39:39 +02:00
parent 866feab759
commit f8c68213bf
20 changed files with 44 additions and 8 deletions
+2 -1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/apocas/dockerode
// Definitions by: Carl Winkler <https://github.com/seikho>, Nicolas Laplante <https://github.com/nlaplante>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="node" />
@@ -637,7 +638,7 @@ declare namespace Dockerode {
interface DockerOptions {
socketPath?: string;
host?: string;
port?: number;
port?: number | string;
ca?: string;
cert?: string;
key?: string;
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/mde/jake
// Definitions by: Kon <http://phyzkit.net/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="node" />
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: https://github.com/brianc/node-libpq#readme
// Definitions by: Vlad Rindevich <https://github.com/Lodin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
// TypeScript Version: 2.2
/// <reference types="node" />
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/ck86/main-bower-files
// Definitions by: Keita Kagurazaka <https://github.com/k-kagurazaka>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="node" />
+5 -1
View File
@@ -400,6 +400,10 @@ declare namespace NodeJS {
isTTY?: true;
}
export interface ProcessEnv {
[key: string]: string | undefined
}
export interface Process extends EventEmitter {
stdout: Socket;
stderr: Socket;
@@ -413,7 +417,7 @@ declare namespace NodeJS {
chdir(directory: string): void;
cwd(): string;
emitWarning(warning: string | Error, name?: string, ctor?: Function): void;
env: any;
env: ProcessEnv;
exit(code?: number): never;
exitCode: number;
getgid(): number;
+2 -1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/alfw/passport-beam
// Definitions by: AtlasDev <https://github.com/AtlasDev>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
///<reference types="passport"/>
///<reference types="express"/>
@@ -31,4 +32,4 @@ export namespace Strategy {
_raw: any;
_json: any;
}
}
}
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/drudge/passport-facebook-token
// Definitions by: Ray Martone <https://github.com/rmartone>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="passport"/>
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/jaredhanson/passport-facebook
// Definitions by: James Roland Cabresos <https://github.com/staticfunction>, Lucas Acosta <https://github.com/lucasmacosta>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="passport"/>
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/jaredhanson/passport-github
// Definitions by: Yasunori Ohoka <https://github.com/yasupeke>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
import passport = require('passport');
import express = require('express');
+19 -3
View File
@@ -11,11 +11,27 @@ const User = {
}
};
const callbackURL = process.env.PASSPORT_GITHUB_CALLBACK_URL;
const clientID = process.env.PASSPORT_GITHUB_CONSUMER_KEY;
const clientSecret = process.env.PASSPORT_GITHUB_CONSUMER_SECRET;
if (typeof callbackURL === "undefined") {
throw new Error("callbackURL is undefined");
}
if (typeof clientID === "undefined") {
throw new Error("clientID is undefined");
}
if (typeof clientSecret === "undefined") {
throw new Error("clientSecret is undefined");
}
passport.use(new github.Strategy(
{
clientID: process.env.PASSPORT_GITHUB_CONSUMER_KEY,
clientSecret: process.env.PASSPORT_GITHUB_CONSUMER_SECRET,
callbackURL: process.env.PASSPORT_GITHUB_CALLBACK_URL
callbackURL,
clientID,
clientSecret
},
(accessToken: string, refreshToken: string, profile: github.Profile, done: (error: any, user?: any) => void) => {
User.findOrCreate(profile.id, profile.provider, (err, user) => {
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/jaredhanson/passport-facebook
// Definitions by: James Roland Cabresos <https://github.com/staticfunction>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="passport"/>
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/jaredhanson/passport-twitter
// Definitions by: James Roland Cabresos <https://github.com/staticfunction>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="passport"/>
+1 -1
View File
@@ -2,4 +2,4 @@
"dependencies": {
"moment": ">=2.14.0"
}
}
}
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/chjj/pty.js
// Definitions by: Vadim Macagon <https://github.com/enlight/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="node" />
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/LearnBoost/stylus
// Definitions by: Maxime LUCE <https://github.com/SomaticIT>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="node" />
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/apigee-127/swagger-express#readme
// Definitions by: Michael Mrowetz <https://github.com/micmro/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/* =================== USAGE ===================
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/apigee-127/swagger-hapi#readme
// Definitions by: Michael Mrowetz <https://github.com/micmro/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/* =================== USAGE ===================
+1
View File
@@ -2,6 +2,7 @@
// Project: https://www.npmjs.com/package/swagger-node-runner
// Definitions by: Michael Mrowetz <https://github.com/micmro/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/* =================== USAGE ===================
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/apigee-127/swagger-restify#readme
// Definitions by: Michael Mrowetz <https://github.com/micmro/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/* =================== USAGE ===================
import * as SwaggerRestify from "swagger-restify-mw";
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/apigee-127/swagger-tools
// Definitions by: Alex Brick <https://github.com/bricka>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
import { NextHandleFunction } from 'connect';
import { IncomingMessage } from 'http';