diff --git a/cordova_app_version_plugin/README.md b/cordova_app_version_plugin/README.md new file mode 100644 index 0000000000..a12ccb5267 --- /dev/null +++ b/cordova_app_version_plugin/README.md @@ -0,0 +1,8 @@ +# Installation +> `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) + +# 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 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;