From ca7130dfb120b8db9edcbf29979fd3133e24ff70 Mon Sep 17 00:00:00 2001 From: Jan Wolf Date: Sun, 23 Apr 2017 22:39:49 +0200 Subject: [PATCH 1/2] no message --- types/ably/auto-sni/auto-sni-tests.ts | 4 ++++ types/ably/auto-sni/index.d.ts | 10 ++++++++++ types/ably/auto-sni/tsconfig.json | 22 ++++++++++++++++++++++ types/ably/auto-sni/tslint.json | 3 +++ 4 files changed, 39 insertions(+) create mode 100644 types/ably/auto-sni/auto-sni-tests.ts create mode 100644 types/ably/auto-sni/index.d.ts create mode 100644 types/ably/auto-sni/tsconfig.json create mode 100644 types/ably/auto-sni/tslint.json diff --git a/types/ably/auto-sni/auto-sni-tests.ts b/types/ably/auto-sni/auto-sni-tests.ts new file mode 100644 index 0000000000..6dbf962ec4 --- /dev/null +++ b/types/ably/auto-sni/auto-sni-tests.ts @@ -0,0 +1,4 @@ +import * as autosni from "auto-sni"; +let a = autosni({ + test: 0 +}); diff --git a/types/ably/auto-sni/index.d.ts b/types/ably/auto-sni/index.d.ts new file mode 100644 index 0000000000..3d679e303e --- /dev/null +++ b/types/ably/auto-sni/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for auto-sni v2.1.1 +// Project: https://www.npmjs.com/package/auto-sni +// Definitions by: Jan Wolf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace createServer { + +} +declare function createServer(opts: any, app?: any): any; +export = createServer; diff --git a/types/ably/auto-sni/tsconfig.json b/types/ably/auto-sni/tsconfig.json new file mode 100644 index 0000000000..715f315867 --- /dev/null +++ b/types/ably/auto-sni/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "auto-sni-tests.ts" + ] +} diff --git a/types/ably/auto-sni/tslint.json b/types/ably/auto-sni/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/ably/auto-sni/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 408fb4d5aa31e6ffa9de83ee7272b841e95de1ed Mon Sep 17 00:00:00 2001 From: Jan Wolf Date: Tue, 25 Apr 2017 18:41:16 +0200 Subject: [PATCH 2/2] Added more specific types --- types/{ably => }/auto-sni/auto-sni-tests.ts | 4 +++- types/{ably => }/auto-sni/index.d.ts | 17 ++++++++++++++++- types/{ably => }/auto-sni/tsconfig.json | 0 types/{ably => }/auto-sni/tslint.json | 0 4 files changed, 19 insertions(+), 2 deletions(-) rename types/{ably => }/auto-sni/auto-sni-tests.ts (57%) rename types/{ably => }/auto-sni/index.d.ts (51%) rename types/{ably => }/auto-sni/tsconfig.json (100%) rename types/{ably => }/auto-sni/tslint.json (100%) diff --git a/types/ably/auto-sni/auto-sni-tests.ts b/types/auto-sni/auto-sni-tests.ts similarity index 57% rename from types/ably/auto-sni/auto-sni-tests.ts rename to types/auto-sni/auto-sni-tests.ts index 6dbf962ec4..a271a1a1ad 100644 --- a/types/ably/auto-sni/auto-sni-tests.ts +++ b/types/auto-sni/auto-sni-tests.ts @@ -1,4 +1,6 @@ import * as autosni from "auto-sni"; let a = autosni({ - test: 0 + agreeTos: true, + email: '', + domains: [''] }); diff --git a/types/ably/auto-sni/index.d.ts b/types/auto-sni/index.d.ts similarity index 51% rename from types/ably/auto-sni/index.d.ts rename to types/auto-sni/index.d.ts index 3d679e303e..075f093f0b 100644 --- a/types/ably/auto-sni/index.d.ts +++ b/types/auto-sni/index.d.ts @@ -3,8 +3,23 @@ // Definitions by: Jan Wolf // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +import {Server} from "https"; + declare namespace createServer { } -declare function createServer(opts: any, app?: any): any; + +declare function createServer(opts: { + email: string, + agreeTos: boolean, + domains: Array, + ports?: { + http?: number, + https?: number + }, + debug?: boolean +}, app?: any): Server; + export = createServer; diff --git a/types/ably/auto-sni/tsconfig.json b/types/auto-sni/tsconfig.json similarity index 100% rename from types/ably/auto-sni/tsconfig.json rename to types/auto-sni/tsconfig.json diff --git a/types/ably/auto-sni/tslint.json b/types/auto-sni/tslint.json similarity index 100% rename from types/ably/auto-sni/tslint.json rename to types/auto-sni/tslint.json