From 5aad433978f54c05ed5cfce1e65808829c2329d3 Mon Sep 17 00:00:00 2001 From: Larry Bahr Date: Thu, 9 Feb 2017 17:51:38 -0600 Subject: [PATCH 1/3] [cordova_app_version_plugin] new definitions, v1.0 Added cordova_app_version_plugin definitions --- cordova_app_version_plugin/README.md | 8 ++++++ .../cordova_app_version_plugin-tests.ts | 3 +++ cordova_app_version_plugin/index.d.ts | 26 +++++++++++++++++++ cordova_app_version_plugin/tsconfig.json | 23 ++++++++++++++++ 4 files changed, 60 insertions(+) create mode 100644 cordova_app_version_plugin/README.md create mode 100644 cordova_app_version_plugin/cordova_app_version_plugin-tests.ts create mode 100644 cordova_app_version_plugin/index.d.ts create mode 100644 cordova_app_version_plugin/tsconfig.json diff --git a/cordova_app_version_plugin/README.md b/cordova_app_version_plugin/README.md new file mode 100644 index 0000000000..17e7e72ad3 --- /dev/null +++ b/cordova_app_version_plugin/README.md @@ -0,0 +1,8 @@ +# Installation +> `npm install --save @types/cordova_app_version_plugin` + +# Summary +This package contains type definitions for cordova_app_version_plugin (https://www.npmjs.com/package/cordova_app_version_plugin) + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/cordova_app_version_plugin diff --git a/cordova_app_version_plugin/cordova_app_version_plugin-tests.ts b/cordova_app_version_plugin/cordova_app_version_plugin-tests.ts new file mode 100644 index 0000000000..5e4eb16e66 --- /dev/null +++ b/cordova_app_version_plugin/cordova_app_version_plugin-tests.ts @@ -0,0 +1,3 @@ +/// + +var appVersion = window.cordova.plugins.version.getAppVersion(); // e.g. "1.5.0" diff --git a/cordova_app_version_plugin/index.d.ts b/cordova_app_version_plugin/index.d.ts new file mode 100644 index 0000000000..b8a70216a6 --- /dev/null +++ b/cordova_app_version_plugin/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for cordova_app_version_plugin v0.2.6 +// Project: https://www.npmjs.com/package/cordova_app_version_plugin +// Definitions by: Larry Bahr +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// +// Licensed under the MIT license. + +interface CordovaPlugins { + /** + * cordova_app_version_plugin interface + */ + version: CordovaAppVersionPlugin.CordovaAppVersionPlugin; +} + +/** + * Keep the type global namespace clean by using a module + */ +declare module CordovaAppVersionPlugin { + interface CordovaAppVersionPlugin { + /** + * App version from config.xml's version (e.g. ) + * @example window.cordova.plugins.version.getAppVersion() // e.g: "1.5.0" + */ + getAppVersion(): string; + } +} \ No newline at end of file diff --git a/cordova_app_version_plugin/tsconfig.json b/cordova_app_version_plugin/tsconfig.json new file mode 100644 index 0000000000..62f656037c --- /dev/null +++ b/cordova_app_version_plugin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cordova_app_version_plugin-tests.ts" + ] +} \ No newline at end of file From 255287863032d944257e5ecb38ac20a8d0da412e Mon Sep 17 00:00:00 2001 From: Larry Bahr Date: Fri, 10 Feb 2017 15:36:25 -0600 Subject: [PATCH 2/3] --save changed to --save-dev --save changed to --save-dev as requested by aozgaa --- cordova_app_version_plugin/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cordova_app_version_plugin/README.md b/cordova_app_version_plugin/README.md index 17e7e72ad3..a12ccb5267 100644 --- a/cordova_app_version_plugin/README.md +++ b/cordova_app_version_plugin/README.md @@ -1,5 +1,5 @@ # Installation -> `npm install --save @types/cordova_app_version_plugin` +> `npm install --save-dev @types/cordova_app_version_plugin` # Summary This package contains type definitions for cordova_app_version_plugin (https://www.npmjs.com/package/cordova_app_version_plugin) From 56826fe3d177bd37a6395a481aa3611de3da123e Mon Sep 17 00:00:00 2001 From: Ken Howard Date: Fri, 10 Feb 2017 16:24:43 -0800 Subject: [PATCH 3/3] allow arguments passed to controller constructor --- hapi-decorators/hapi-decorators-tests.ts | 15 +++++++++++++++ hapi-decorators/index.d.ts | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/hapi-decorators/hapi-decorators-tests.ts b/hapi-decorators/hapi-decorators-tests.ts index 2a05f67e4d..49a112152a 100644 --- a/hapi-decorators/hapi-decorators-tests.ts +++ b/hapi-decorators/hapi-decorators-tests.ts @@ -39,3 +39,18 @@ class TestController implements Controller { const server = new hapi.Server(); server.route(new TestController().routes()); + +@controller('/test') +class SimpleTestController implements Controller { + + foo: string; + + constructor(foo: string) { + this.foo = foo; + } + + baseUrl: string; + routes: () => hapi.IRouteConfiguration[]; +} + +server.route(new SimpleTestController('bar').routes()); diff --git a/hapi-decorators/index.d.ts b/hapi-decorators/index.d.ts index c58a1a6052..fc32ae8ad5 100644 --- a/hapi-decorators/index.d.ts +++ b/hapi-decorators/index.d.ts @@ -5,7 +5,7 @@ import * as hapi from 'hapi'; interface ControllerStatic { - new (): Controller; + new (...args: any[]): Controller; } export interface Controller { baseUrl: string;