diff --git a/types/angular-material/angular-material-tests.ts b/types/angular-material/angular-material-tests.ts index d46a51d578..ce5a9bf71e 100644 --- a/types/angular-material/angular-material-tests.ts +++ b/types/angular-material/angular-material-tests.ts @@ -5,6 +5,7 @@ interface TestScope extends ng.IScope { } myApp.config(( + $mdAriaProvider: ng.material.IAriaProvider, $mdThemingProvider: ng.material.IThemingProvider, $mdIconProvider: ng.material.IIconProvider, $mdProgressCircularProvider: ng.material.IProgressCircularProvider) => { @@ -52,6 +53,9 @@ myApp.config(( return c * Math.pow(2, (t / d - 1) * 10) + b; } }); + + // Globally disables all ARIA warnings. + $mdAriaProvider.disableWarnings(); }); myApp.controller('BottomSheetController', ($scope: TestScope, $mdBottomSheet: ng.material.IBottomSheetService, $q: ng.IQService) => { diff --git a/types/angular-material/index.d.ts b/types/angular-material/index.d.ts index 4bfadbf9b3..2dca0c66da 100644 --- a/types/angular-material/index.d.ts +++ b/types/angular-material/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for angular-material 1.1 // Project: https://github.com/angular/material -// Definitions by: Blake Bigelow , Peter Hajdu , Davide Donadello , Geert Jansen +// Definitions by: Blake Bigelow , Peter Hajdu , Davide Donadello , Geert Jansen , Edward Knowles // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -11,6 +11,10 @@ export = _; declare module 'angular' { namespace material { + interface IAriaProvider { + disableWarnings(): void; + } + interface ResolveObject { [name: string]: Injectable<(...args: any[]) => PromiseLike>; } diff --git a/types/case-sensitive-paths-webpack-plugin/case-sensitive-paths-webpack-plugin-tests.ts b/types/case-sensitive-paths-webpack-plugin/case-sensitive-paths-webpack-plugin-tests.ts new file mode 100644 index 0000000000..a4370cff73 --- /dev/null +++ b/types/case-sensitive-paths-webpack-plugin/case-sensitive-paths-webpack-plugin-tests.ts @@ -0,0 +1,15 @@ +import { Configuration } from 'webpack'; +import CaseSensitivePathsWebpackPlugin = require('case-sensitive-paths-webpack-plugin'); + +const options: CaseSensitivePathsWebpackPlugin.Options = { + debug: true, +}; + +const c: Configuration = { + plugins: [ + new CaseSensitivePathsWebpackPlugin(), + new CaseSensitivePathsWebpackPlugin({ + debug: true + }), + ], +}; diff --git a/types/case-sensitive-paths-webpack-plugin/index.d.ts b/types/case-sensitive-paths-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..360d3d6d08 --- /dev/null +++ b/types/case-sensitive-paths-webpack-plugin/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for case-sensitive-paths-webpack-plugin 2.1 +// Project: https://github.com/Urthen/case-sensitive-paths-webpack-plugin#readme +// Definitions by: Andrew Makarov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'webpack'; + +export = CaseSensitivePathsWebpackPlugin; + +declare class CaseSensitivePathsWebpackPlugin extends Plugin { + constructor(options?: CaseSensitivePathsWebpackPlugin.Options); +} + +declare namespace CaseSensitivePathsWebpackPlugin { + interface Options { + /** + * Show more information + */ + debug?: boolean; + } +} diff --git a/types/case-sensitive-paths-webpack-plugin/tsconfig.json b/types/case-sensitive-paths-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..b8cb05390a --- /dev/null +++ b/types/case-sensitive-paths-webpack-plugin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "case-sensitive-paths-webpack-plugin-tests.ts" + ] +} diff --git a/types/case-sensitive-paths-webpack-plugin/tslint.json b/types/case-sensitive-paths-webpack-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/case-sensitive-paths-webpack-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index c2ae788396..f4f4bda40d 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Chart.js 2.6 +// Type definitions for Chart.js 2.7 // Project: https://github.com/nnnick/Chart.js // Definitions by: Alberto Nuti // Fabien Lavocat @@ -114,18 +114,25 @@ declare namespace Chart { index?: number; } + interface ChartTooltipLabelColor { + borderColor: ChartColor; + backgroundColor: ChartColor; + } + interface ChartTooltipCallback { - beforeTitle?(item?: ChartTooltipItem[], data?: any): void; - title?(item?: ChartTooltipItem[], data?: any): void; - afterTitle?(item?: ChartTooltipItem[], data?: any): void; - beforeBody?(item?: ChartTooltipItem[], data?: any): void; - beforeLabel?(tooltipItem?: ChartTooltipItem, data?: any): void; - label?(tooltipItem?: ChartTooltipItem, data?: any): void; - afterLabel?(tooltipItem?: ChartTooltipItem, data?: any): void; - afterBody?(item?: ChartTooltipItem[], data?: any): void; - beforeFooter?(item?: ChartTooltipItem[], data?: any): void; - footer?(item?: ChartTooltipItem[], data?: any): void; - afterFooter?(item?: ChartTooltipItem[], data?: any): void; + beforeTitle?(item: ChartTooltipItem[], data: ChartData): string | string[]; + title?(item: ChartTooltipItem[], data: ChartData): string | string[]; + afterTitle?(item: ChartTooltipItem[], data: ChartData): string | string[]; + beforeBody?(item: ChartTooltipItem[], data: ChartData): string | string[]; + beforeLabel?(tooltipItem: ChartTooltipItem, data: ChartData): string | string[]; + label?(tooltipItem: ChartTooltipItem, data: ChartData): string | string[]; + labelColor?(tooltipItem: ChartTooltipItem, chart: Chart): ChartTooltipLabelColor; + labelTextColor?(tooltipItem: ChartTooltipItem, chart: Chart): string; + afterLabel?(tooltipItem: ChartTooltipItem, data: ChartData): string | string[]; + afterBody?(item: ChartTooltipItem[], data: ChartData): string | string[]; + beforeFooter?(item: ChartTooltipItem[], data: ChartData): string | string[]; + footer?(item: ChartTooltipItem[], data: ChartData): string | string[]; + afterFooter?(item: ChartTooltipItem[], data: ChartData): string | string[]; } interface ChartAnimationParameter { diff --git a/types/command-line-args/index.d.ts b/types/command-line-args/index.d.ts index 442ee5cb93..332368d827 100644 --- a/types/command-line-args/index.d.ts +++ b/types/command-line-args/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for command-line-args 4.0.6 +// Type definitions for command-line-args 4.0.7 // Project: https://github.com/75lb/command-line-args // Definitions by: CzBuCHi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -25,50 +25,63 @@ */ declare function commandLineArgs(optionDefinitions: commandLineArgs.OptionDefinition[], options?: commandLineArgs.Options): any; -declare module commandLineArgs { +declare module commandLineArgs { - export interface OptionDefinition { - /** - * The only required definition property is name, the value of each option will be either a Boolean or string. - */ - name: string, - /** - * The type value is a setter function (you receive the output from this), enabling you to be specific about the type and value received. - */ - type?: (arg: string) => any, - /** - * getopt-style short option names. Can be any single character (unicode included) except a digit or hypen. - */ - alias?: string, - /** - * Set this flag if the option takes a list of values. You will receive an array of values, each passed through the type function (if specified). - */ - multiple?: boolean, - /** - * Any unclaimed command-line args will be set on this option. This flag is typically set on the most commonly-used option to make for more concise usage (i.e. $ myapp *.js instead of $ myapp --files *.js). - */ - defaultOption?: boolean, - /** - * An initial value for the option. - */ - defaultValue?: any, - /** - * When your app has a large amount of options it makes sense to organise them in groups. - * There are two automatic groups: _all (contains all options) and _none (contains options without a group specified in their definition). - */ - group?: string | string[], - } + export interface OptionDefinition { + /** + * The only required definition property is name, the value of each option will be either a Boolean or string. + */ + name: string, + /** + * The type value is a setter function (you receive the output from this), + * enabling you to be specific about the type and value received. + */ + type?: (arg: string) => any, + /** + * getopt-style short option names. Can be any single character (unicode included) except a digit or hypen. + */ + alias?: string, + /** + * Set this flag if the option takes a list of values. You will receive an array of values, each passed + * through the type function (if specified). + */ + multiple?: boolean, + /** + * Any unclaimed command-line args will be set on this option. This flag is typically set on + * the most commonly-used option to make for more concise usage + * (i.e. $ myapp *.js instead of $ myapp --files *.js). + */ + defaultOption?: boolean, + /** + * An initial value for the option. + */ + defaultValue?: any, + /** + * When your app has a large amount of options it makes sense to organise them in groups. + * There are two automatic groups: _all (contains all options) and _none (contains options + * without a group specified in their definition). + */ + group?: string | string[], + /** + * Describes the option. + */ + description?: string, + /** + * A label for the type, e.g. . + */ + typeLabel?: string; + } - export interface Options { - /** - * An array of strings, which if passed will be parsed instead of `process.argv`. - */ - argv?: string[]; - /** - * If `true`, an array of unknown arguments is returned in the `_unknown` property of the output. - */ - partial?: boolean; - } + export interface Options { + /** + * An array of strings, which if passed will be parsed instead of `process.argv`. + */ + argv?: string[]; + /** + * If `true`, an array of unknown arguments is returned in the `_unknown` property of the output. + */ + partial?: boolean; + } } export = commandLineArgs; diff --git a/types/enigma.js/enigma.js-tests.ts b/types/enigma.js/enigma.js-tests.ts new file mode 100644 index 0000000000..10f6aae226 --- /dev/null +++ b/types/enigma.js/enigma.js-tests.ts @@ -0,0 +1,10 @@ +import * as enigma from "enigma.js"; +// import enigma = require("enigma.js"); + +const config: enigmaJS.IConfig = { + url: "http://127.0.0.1:4848/", + schema: {} + }; +enigma.create(config).open().then((global) => { + console.log("connect fine"); +}); diff --git a/types/enigma.js/index.d.ts b/types/enigma.js/index.d.ts new file mode 100644 index 0000000000..38fc18da16 --- /dev/null +++ b/types/enigma.js/index.d.ts @@ -0,0 +1,194 @@ +// Type definitions for enigma.js 2.2 +// Project: https://github.com/qlik-oss/enigma.js/ +// Definitions by: Konrad Mattheis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare module "enigma.js" { + const e: IEnigmaClass; + export = e; +} + +// declare const enigmaJS: IEnigmaClass; +// export = enigmaJS; +// export as namespace enigmaJS; + +interface IEnigmaClass { + /** + * Create a session object. + * @returns - Returns a session. + * Note: See Configuration for the configuration options. + */ + create(config: enigmaJS.IConfig): enigmaJS.ISession; +} + +declare namespace enigmaJS { + type MixinType = "Doc"| "GenericObject"| "GenericBookmark" | string; + + interface IMixin { + /** + * QIX Engine types like for example GenericObject, Doc, GenericBookmark, are supported but also custom GenericObject + * types such as barchart, story and myCustomType. + * An API will get both their generic type as well as custom type mixins applied. + */ + types: MixinType[]; + + init(args: {config: any, api: IGeneratedAPI}): void; + + /** + * mixin.extend is an object containing methods to extend the generated API with. These method names cannot already exist or enigma.js will throw an error. + */ + extend?: [any]; + + /** + * mixin.override is an object containing methods that overrides existing API methods. + * These method names needs to exist already* or engima.js will throw an error. + * Be careful when overriding, you may break expected behaviors in other mixins or your application. + * base is a reference to the previous mixin method, can be used to invoke the mixin chain before this mixin method. + */ + override?: [any]; + } + + interface IProtocol { + // Set to false to disable the use of the bandwidth-reducing delta protocol. + delta?: boolean; + } + + /** + * This section describes the configuration object that is sent into enigma.create(config). + */ + interface IConfig { + /** + * Object containing the specification for the API to generate. Corresponds to a specific version of the QIX Engine API. + */ + schema: object; + /** + * String containing a proper websocket URL to QIX Engine. + */ + url: string; + /** + * A function to use when instantiating the WebSocket, mandatory for Node.js. + */ + createSocket?: any; + /** + * ES6-compatible Promise library. + */ + Promise?: any; + /** + * Set to true if the session should be suspended instead of closed when the websocket is closed. + */ + suspendOnClose?: boolean; + /** + * Mixins to extend/augment the QIX Engine API. + * See Mixins section for more information how each entry in this array should look like. + * Mixins are applied in the array order. + */ + mixins?: [any]; + /** + * Interceptors for augmenting responses before they are passed into mixins and end-users. + * See Interceptors section for more information how each entry in this array should look like. + * Interceptors are applied in the array order. + */ + interceptors?: [any]; + /** + * An object containing additional JSON-RPC request parameters. + * protocol.delta : Set to false to disable the use of the bandwidth-reducing delta protocol. + */ + protocol?: any; + } + + interface ISession { + /** + * Establishes the websocket against the configured URL. Eventually resolved with the QIX global interface when the connection has been established. + * @return Promise. + */ + open(): Promise; + + /** + * Closes the websocket and cleans up internal caches, also triggers the closed event on all generated APIs. + * Eventually resolved when the websocket has been closed. + * + * Note: you need to manually invoke this when you want to close a session and config.suspendOnClose is true. + * @return Promise. + */ + close(): Promise; + + /** + * Suspends the enigma.js session by closing the websocket and rejecting all method calls until it has been resumed again. + * @return Promise. + */ + suspend(): Promise; + + /** + * Resume a previously suspended enigma.js session by re-creating the websocket and, if possible, re-open the document + * as well as refreshing the internal caches. If successful, changed events will be triggered on all generated APIs, + * and on the ones it was unable to restore, the closed event will be triggered. + * @param onlyIfAttached onlyIfAttached can be used to only allow resuming if the QIX Engine session was reattached properly. + * @return Promise. + * Note: Eventually resolved when the websocket (and potentially the previously opened document, and generated APIs) has been restored, + * rejected when it fails any of those steps, or when onlyIfAttached is true and a new QIX Engine session was created. + */ + resume(onlyIfAttached?: boolean): Promise; + + /** + * Handle opened state. This event is triggered whenever the websocket is connected and ready for communication. + * + * Handle closed state. This event is triggered when the underlying websocket is closed and config.suspendOnClose is false. + * + * Handle suspended state. This event is triggered in two cases (listed below). It is useful in scenarios where you for example + * want to block interaction in your application until you are resumed again. + * If config.suspendOnClose is true and there was a network disconnect (socked closed) + * If you ran session.suspend() + * The evt.initiator value is a string indicating what triggered the suspended state. Possible values: network, manual. + * + * Handle resumed state. This event is triggered when the session was properly resumed. + * It is useful in scenarios where you for example can close blocking modal dialogs and allow the user to interact with your application again. + * + * notification:* + * @param event - Event that triggers the function + * @param func - Called function + */ + on(event: "opened" | "close" | "suspended" | "resumed" | string, func: any): void; + } + + interface IGeneratedAPI { + /** + * This property contains the unique identifier for this API. + */ + id: string; + + /** + * This property contains the schema class name for this API. + */ + type: string; + + /** + * Despite the name, this property corresponds to the qInfo.qType property on your generic object's properties object. + */ + genericType: string; + + /** + * This property contains a reference to the session that this API belongs to. + */ + session: ISession; + + /** + * This property contains the handle QIX Engine assigned to the API. + * Used internally in enigma.js for caches and JSON-RPC + */ + handle: number; + + /** + * register a function for events + * @param event - function called if this event occures + * @param func - function that is called + */ + on(event: "changed" | "closed", func: () => void): void; + + /** + * manual emit an events + * @param event - event that occures + */ + emit(event: "changed" | "closed"): void; + } +} diff --git a/types/enigma.js/tsconfig.json b/types/enigma.js/tsconfig.json new file mode 100644 index 0000000000..b3b93456f0 --- /dev/null +++ b/types/enigma.js/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "enigma.js-tests.ts" + ] +} \ No newline at end of file diff --git a/types/enigma.js/tslint.json b/types/enigma.js/tslint.json new file mode 100644 index 0000000000..84cbb5f289 --- /dev/null +++ b/types/enigma.js/tslint.json @@ -0,0 +1,13 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // TODOs + "ban-types": false, + "no-empty-interface": false, + "no-mergeable-namespace": false, + "no-unnecessary-generics": false, + "no-single-declare-module": false, + "no-declare-current-package": false, + "interface-name": false + } +} diff --git a/types/hex-rgba/hex-rgba-tests.ts b/types/hex-rgba/hex-rgba-tests.ts new file mode 100644 index 0000000000..f7ee8cf285 --- /dev/null +++ b/types/hex-rgba/hex-rgba-tests.ts @@ -0,0 +1,3 @@ +import hexToRgba = require('hex-rgba'); + +const rgba = hexToRgba('#1b2b34', 40); diff --git a/types/hex-rgba/index.d.ts b/types/hex-rgba/index.d.ts new file mode 100644 index 0000000000..ba4205a73f --- /dev/null +++ b/types/hex-rgba/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for hex-rgba 1.0 +// Project: https://github.com/developersoul/hex-rgba#readme +// Definitions by: Andrew Makarov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = hexToRgba; + +declare function hexToRgba(hex: string, opacity: number): string; diff --git a/types/hex-rgba/tsconfig.json b/types/hex-rgba/tsconfig.json new file mode 100644 index 0000000000..82f2e3808e --- /dev/null +++ b/types/hex-rgba/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "hex-rgba-tests.ts" + ] +} diff --git a/types/hex-rgba/tslint.json b/types/hex-rgba/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/hex-rgba/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/hystrixjs/hystrixjs-tests.ts b/types/hystrixjs/hystrixjs-tests.ts index 676015be06..7ed7819fb7 100644 --- a/types/hystrixjs/hystrixjs-tests.ts +++ b/types/hystrixjs/hystrixjs-tests.ts @@ -4,7 +4,7 @@ import q = require('q'); var commandFactory = hystrixjs.commandFactory; var command = commandFactory - .getOrCreate('testCommand', 'testGroup') + .getOrCreate('testCommand', 'testGroup') .circuitBreakerSleepWindowInMilliseconds(5000) .errorHandler((error) => { return false; diff --git a/types/hystrixjs/index.d.ts b/types/hystrixjs/index.d.ts index 865f2b3916..b49cd40ba4 100644 --- a/types/hystrixjs/index.d.ts +++ b/types/hystrixjs/index.d.ts @@ -4,7 +4,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import * as Q from "q"; import * as RX from "rx"; export as namespace hystrixjs; @@ -23,7 +22,8 @@ export interface HystrixProperties { "hystrix.metrics.statistical.window.bucketsNumber"?: number, "hystrix.metrics.percentile.window.timeInMilliseconds"?: number, "hystrix.metrics.percentile.window.bucketsNumber"?: number, - "hystrix.request.volume.rejectionThreshold"?: number + "hystrix.request.volume.rejectionThreshold"?: number, + "hystrix.promise.implementation"?: PromiseConstructorLike, } export interface HystrixConfig { @@ -46,7 +46,39 @@ export interface HystrixConfig { } export interface Command { - execute(...args: any[]): Q.Promise; + execute(...args: any[]): PromiseLike +} + +export interface CommandA0 { + execute(): PromiseLike +} + +export interface CommandA1 { + execute(t: T): PromiseLike +} + +export interface CommandA2 { + execute(t: T, u: U): PromiseLike +} + +export interface CommandA3 { + execute(t: T, u: U, v: V): PromiseLike +} + +export interface CommandA4 { + execute(t: T, u: U, v: V, w: W): PromiseLike +} + +export interface CommandA5 { + execute(t: T, u: U, v: V, w: W, x: X): PromiseLike +} + +export interface CommandA6 { + execute(t: T, u: U, v: V, w: W, x: X, y: Y): PromiseLike +} + +export interface CommandA7 { + execute(t: T, u: U, v: V, w: W, x: X, y: Y, z: Z): PromiseLike } export interface CommandBuilder { @@ -62,14 +94,174 @@ export interface CommandBuilder { percentileWindowNumberOfBuckets(value: number): CommandBuilder; percentileWindowLength(value: number): CommandBuilder; circuitBreakerErrorThresholdPercentage(value: number): CommandBuilder; - run(value: (args: any) => Q.Promise): CommandBuilder; - fallbackTo(value: (...args: any[]) => Q.Promise): CommandBuilder; context(value: any): CommandBuilder; - build(): Command; + run(value: (...args: any[]) => PromiseLike): CommandBuilder; + fallbackTo(value: (error: Error, args ?: any[]) => PromiseLike): CommandBuilder; + build() : Command; +} + +export interface CommandBuilderA0 { + circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilderA0; + errorHandler(value: (error: any) => boolean): CommandBuilderA0; + timeout(value: number): CommandBuilderA0; + circuitBreakerRequestVolumeThreshold(value: number): CommandBuilderA0; + requestVolumeRejectionThreshold(value: number): CommandBuilderA0; + circuitBreakerForceOpened(value: boolean): CommandBuilderA0; + circuitBreakerForceClosed(value: boolean): CommandBuilderA0; + statisticalWindowNumberOfBuckets(value: number): CommandBuilderA0; + statisticalWindowLength(value: number): CommandBuilderA0; + percentileWindowNumberOfBuckets(value: number): CommandBuilderA0; + percentileWindowLength(value: number): CommandBuilderA0; + circuitBreakerErrorThresholdPercentage(value: number): CommandBuilderA0; + context(value: any): CommandBuilderA0; + run(value: () => PromiseLike): CommandBuilderA0; + fallbackTo(value: (error: Error) => PromiseLike): CommandBuilderA0; + build() : CommandA0; +} + +export interface CommandBuilderA1 { + circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilderA1; + errorHandler(value: (error: any) => boolean): CommandBuilderA1; + timeout(value: number): CommandBuilderA1; + circuitBreakerRequestVolumeThreshold(value: number): CommandBuilderA1; + requestVolumeRejectionThreshold(value: number): CommandBuilderA1; + circuitBreakerForceOpened(value: boolean): CommandBuilderA1; + circuitBreakerForceClosed(value: boolean): CommandBuilderA1; + statisticalWindowNumberOfBuckets(value: number): CommandBuilderA1; + statisticalWindowLength(value: number): CommandBuilderA1; + percentileWindowNumberOfBuckets(value: number): CommandBuilderA1; + percentileWindowLength(value: number): CommandBuilderA1; + circuitBreakerErrorThresholdPercentage(value: number): CommandBuilderA1; + context(value: any): CommandBuilderA1; + run(value: (t: T) => PromiseLike): CommandBuilderA1; + fallbackTo(value: (error: Error, args : [T]) => PromiseLike): CommandBuilderA1; + build(): CommandA1; +} + +export interface CommandBuilderA2 { + circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilderA2; + errorHandler(value: (error: any) => boolean): CommandBuilderA2; + timeout(value: number): CommandBuilderA2; + circuitBreakerRequestVolumeThreshold(value: number): CommandBuilderA2; + requestVolumeRejectionThreshold(value: number): CommandBuilderA2; + circuitBreakerForceOpened(value: boolean): CommandBuilderA2; + circuitBreakerForceClosed(value: boolean): CommandBuilderA2; + statisticalWindowNumberOfBuckets(value: number): CommandBuilderA2; + statisticalWindowLength(value: number): CommandBuilderA2; + percentileWindowNumberOfBuckets(value: number): CommandBuilderA2; + percentileWindowLength(value: number): CommandBuilderA2; + circuitBreakerErrorThresholdPercentage(value: number): CommandBuilderA2; + context(value: any): CommandBuilderA2; + run(value: (t: T, u: U) => PromiseLike): CommandBuilderA2; + fallbackTo(value: (error: Error, args: [T, U]) => PromiseLike): CommandBuilderA2; + build(): CommandA2; +} + +export interface CommandBuilderA3 { + circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilderA3; + errorHandler(value: (error: any) => boolean): CommandBuilderA3; + timeout(value: number): CommandBuilderA3; + circuitBreakerRequestVolumeThreshold(value: number): CommandBuilderA3; + requestVolumeRejectionThreshold(value: number): CommandBuilderA3; + circuitBreakerForceOpened(value: boolean): CommandBuilderA3; + circuitBreakerForceClosed(value: boolean): CommandBuilderA3; + statisticalWindowNumberOfBuckets(value: number): CommandBuilderA3; + statisticalWindowLength(value: number): CommandBuilderA3; + percentileWindowNumberOfBuckets(value: number): CommandBuilderA3; + percentileWindowLength(value: number): CommandBuilderA3; + circuitBreakerErrorThresholdPercentage(value: number): CommandBuilderA3; + context(value: any): CommandBuilderA3; + run(value: (t: T, u: U, v: V) => PromiseLike): CommandBuilderA3; + fallbackTo(value: (error: Error, args: [T, U, V]) => PromiseLike): CommandBuilderA3; + build(): CommandA3; +} + +export interface CommandBuilderA4 { + circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilderA4; + errorHandler(value: (error: any) => boolean): CommandBuilderA4; + timeout(value: number): CommandBuilderA4; + circuitBreakerRequestVolumeThreshold(value: number): CommandBuilderA4; + requestVolumeRejectionThreshold(value: number): CommandBuilderA4; + circuitBreakerForceOpened(value: boolean): CommandBuilderA4; + circuitBreakerForceClosed(value: boolean): CommandBuilderA4; + statisticalWindowNumberOfBuckets(value: number): CommandBuilderA4; + statisticalWindowLength(value: number): CommandBuilderA4; + percentileWindowNumberOfBuckets(value: number): CommandBuilderA4; + percentileWindowLength(value: number): CommandBuilderA4; + circuitBreakerErrorThresholdPercentage(value: number): CommandBuilderA4; + context(value: any): CommandBuilderA4; + run(value: (t: T, u: U, v: V, w: W) => PromiseLike): CommandBuilderA4; + fallbackTo(value: (error: Error, args: [T, U, V, W]) => PromiseLike): CommandBuilderA4; + build(): CommandA4; +} + +export interface CommandBuilderA5 { + circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilderA5; + errorHandler(value: (error: any) => boolean): CommandBuilderA5; + timeout(value: number): CommandBuilderA5; + circuitBreakerRequestVolumeThreshold(value: number): CommandBuilderA5; + requestVolumeRejectionThreshold(value: number): CommandBuilderA5; + circuitBreakerForceOpened(value: boolean): CommandBuilderA5; + circuitBreakerForceClosed(value: boolean): CommandBuilderA5; + statisticalWindowNumberOfBuckets(value: number): CommandBuilderA5; + statisticalWindowLength(value: number): CommandBuilderA5; + percentileWindowNumberOfBuckets(value: number): CommandBuilderA5; + percentileWindowLength(value: number): CommandBuilderA5; + circuitBreakerErrorThresholdPercentage(value: number): CommandBuilderA5; + context(value: any): CommandBuilderA5; + run(value: (t: T, u: U, v: V, w: W, x: X) => PromiseLike): CommandBuilderA5; + fallbackTo(value: (error: Error, args: [T, U, V, W, X]) => PromiseLike): CommandBuilderA5; + build(): CommandA5; +} + +export interface CommandBuilderA6 { + circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilderA6; + errorHandler(value: (error: any) => boolean): CommandBuilderA6; + timeout(value: number): CommandBuilderA6; + circuitBreakerRequestVolumeThreshold(value: number): CommandBuilderA6; + requestVolumeRejectionThreshold(value: number): CommandBuilderA6; + circuitBreakerForceOpened(value: boolean): CommandBuilderA6; + circuitBreakerForceClosed(value: boolean): CommandBuilderA6; + statisticalWindowNumberOfBuckets(value: number): CommandBuilderA6; + statisticalWindowLength(value: number): CommandBuilderA6; + percentileWindowNumberOfBuckets(value: number): CommandBuilderA6; + percentileWindowLength(value: number): CommandBuilderA6; + circuitBreakerErrorThresholdPercentage(value: number): CommandBuilderA6; + context(value: any): CommandBuilderA6; + run(value: (t: T, u: U, v: V, w: W, x: X, y: Y) => PromiseLike): CommandBuilderA6; + fallbackTo(value: (error: Error, args: [T, U, V, W, X, Y]) => PromiseLike): CommandBuilderA6; + build(): CommandA6; +} + +export interface CommandBuilderA7 { + circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilderA7; + errorHandler(value: (error: any) => boolean): CommandBuilderA7; + timeout(value: number): CommandBuilderA7; + circuitBreakerRequestVolumeThreshold(value: number): CommandBuilderA7; + requestVolumeRejectionThreshold(value: number): CommandBuilderA7; + circuitBreakerForceOpened(value: boolean): CommandBuilderA7; + circuitBreakerForceClosed(value: boolean): CommandBuilderA7; + statisticalWindowNumberOfBuckets(value: number): CommandBuilderA7; + statisticalWindowLength(value: number): CommandBuilderA7; + percentileWindowNumberOfBuckets(value: number): CommandBuilderA7; + percentileWindowLength(value: number): CommandBuilderA7; + circuitBreakerErrorThresholdPercentage(value: number): CommandBuilderA7; + context(value: any): CommandBuilderA7; + run(value: (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z) => PromiseLike): CommandBuilderA7; + fallbackTo(value: (error: Error, args: [T, U, V, W, X, Y, Z]) => PromiseLike): CommandBuilderA7; + build(): CommandA7; } export interface CommandFactory { getOrCreate(commandKey: string, commandGroup?: string): CommandBuilder; + getOrCreate(commandKey: string, commandGroup?: string): CommandBuilderA0; + getOrCreate(commandKey: string, commandGroup?: string): CommandBuilderA1; + getOrCreate(commandKey: string, commandGroup?: string): CommandBuilderA2; + getOrCreate(commandKey: string, commandGroup?: string): CommandBuilderA3; + getOrCreate(commandKey: string, commandGroup?: string): CommandBuilderA4; + getOrCreate(commandKey: string, commandGroup?: string): CommandBuilderA5; + getOrCreate(commandKey: string, commandGroup?: string): CommandBuilderA6; + getOrCreate(commandKey: string, commandGroup?: string): CommandBuilderA7; resetCache(): void; } @@ -141,4 +333,4 @@ export var commandFactory: CommandFactory; export var metricsFactory: MetricsFactory; export var circuitFactory: CircuitFactory; export var hystrixSSEStream: HystrixSSEStream; -export var hystrixConfig: HystrixConfig; \ No newline at end of file +export var hystrixConfig: HystrixConfig; diff --git a/types/hystrixjs/tsconfig.json b/types/hystrixjs/tsconfig.json index 0cf5de7b81..480476e8d1 100644 --- a/types/hystrixjs/tsconfig.json +++ b/types/hystrixjs/tsconfig.json @@ -13,11 +13,7 @@ "typeRoots": [ "../" ], - "paths": { - "q": [ - "q/v0" - ] - }, + "paths": {}, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true @@ -26,4 +22,4 @@ "index.d.ts", "hystrixjs-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/ioredis/index.d.ts b/types/ioredis/index.d.ts index f1d7f6eb95..ec1dbe3512 100644 --- a/types/ioredis/index.d.ts +++ b/types/ioredis/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: York Yao // Christopher Eck // Yoga Aliarham +// Ebrahim // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /* =================== USAGE =================== @@ -344,8 +345,8 @@ declare namespace IORedis { type(key: string, callback: (err: Error, res: string) => void): void; type(key: string): Promise; - multi(callback: (err: Error, res: string) => void): void; - multi(): Promise; + multi(commands?: string[][], options?: MultiOptions): Pipeline; + multi(options: { pipeline: false }): Promise; exec(callback: (err: Error, res: any) => void): void; exec(): Promise; @@ -844,4 +845,8 @@ declare namespace IORedis { retryDelayOnTryAgain?: number; redisOptions?: RedisOptions; } + + interface MultiOptions { + pipeline: boolean; + } } diff --git a/types/ioredis/ioredis-tests.ts b/types/ioredis/ioredis-tests.ts index 2be342c2bd..02b62def62 100644 --- a/types/ioredis/ioredis-tests.ts +++ b/types/ioredis/ioredis-tests.ts @@ -90,3 +90,17 @@ Redis.Command.setArgumentTransformer('set', args => { Redis.Command.setReplyTransformer('get', (result: any) => { return result; }); + +// multi +redis.multi().set('foo', 'bar').set('foo', 'baz').get('foo', (err, result) => { + // result === 'QUEUED' +}).exec((err, results) => { + // results = [[null, 'OK'], [null, 'OK'], [null, 'baz']] +}); + +redis.multi([ + ['set', 'foo', 'bar'], + ['get', 'foo'] +]).exec((err, results) => { + // results = [[null, 'OK'], [null, 'bar']] +}); diff --git a/types/otplib/index.d.ts b/types/otplib/index.d.ts new file mode 100644 index 0000000000..d9ae32ddfb --- /dev/null +++ b/types/otplib/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for otplib 7.0 +// Project: https://yeojz.github.io/otplib +// Definitions by: Soner Köksal +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export namespace authenticator { + interface VerifyOptions { + token: string; + secret: string; + } + + function generateSecret(): string; + + function generate(secret: string): string; + + function check(token: string, secret: string): boolean; + + function verify(options: VerifyOptions): boolean; +} diff --git a/types/otplib/otplib-tests.ts b/types/otplib/otplib-tests.ts new file mode 100644 index 0000000000..231b16716f --- /dev/null +++ b/types/otplib/otplib-tests.ts @@ -0,0 +1,7 @@ +import * as otplib from "otplib"; + +const secretValue = otplib.authenticator.generateSecret(); +const tokenValue = otplib.authenticator.generate(secretValue); + +let isValid = otplib.authenticator.check(tokenValue, secretValue); +isValid = otplib.authenticator.verify({secret: secretValue, token: tokenValue}); diff --git a/types/otplib/tsconfig.json b/types/otplib/tsconfig.json new file mode 100644 index 0000000000..cfb2b07081 --- /dev/null +++ b/types/otplib/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "otplib-tests.ts" + ] +} diff --git a/types/otplib/tslint.json b/types/otplib/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/otplib/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/package-json/index.d.ts b/types/package-json/index.d.ts new file mode 100644 index 0000000000..e57902875b --- /dev/null +++ b/types/package-json/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for package-json 4.0 +// Project: https://github.com/sindresorhus/package-json#readme +// Definitions by: Jinwoo Lee +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface PackageJsonOptions { + version?: string; + fullMetadata?: boolean; + allVersions?: boolean; +} + +declare function packageJson(name: string, options?: PackageJsonOptions): Promise<{}>; + +export = packageJson; diff --git a/types/package-json/package-json-tests.ts b/types/package-json/package-json-tests.ts new file mode 100644 index 0000000000..98f14b1192 --- /dev/null +++ b/types/package-json/package-json-tests.ts @@ -0,0 +1,10 @@ +import packageJson = require('package-json'); + +let pkg: {}; +packageJson('package-json', { + version: '1.2.3', + fullMetadata: true, + allVersions: true, +}).then(x => { + pkg = x; +}); diff --git a/types/package-json/tsconfig.json b/types/package-json/tsconfig.json new file mode 100644 index 0000000000..52c1adb7d3 --- /dev/null +++ b/types/package-json/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "package-json-tests.ts" + ] +} diff --git a/types/package-json/tslint.json b/types/package-json/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/package-json/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/qlik-engineapi/index.d.ts b/types/qlik-engineapi/index.d.ts index e124d12f5f..7347b17bf0 100644 --- a/types/qlik-engineapi/index.d.ts +++ b/types/qlik-engineapi/index.d.ts @@ -5070,32 +5070,11 @@ declare namespace EngineAPI { qAttrDims?: INxAttributeDimValues; } - /** - * ImplementOn... - */ - interface IImplementOn { - /** - * register a function for events - * @param event - function called if this event occures - * @param func - function that is called - */ - on(event: "changed" | "closed", func: () => void): void; - - /** - * manual emit an events - * @param event - event that occures - */ - emit(event: "changed" | "closed"): void; - - // ? not in Docu - id: string; - } - /** * This class describes all the methods that apply at generic object level. * The handle member in the JSON request for all methods listed in this section is the handle of the generic object. */ - interface IGenericObject extends IImplementOn { + interface IGenericObject extends enigmaJS.IGeneratedAPI { /** * app describes all the methods that apply at app level. */ @@ -6010,7 +5989,7 @@ declare namespace EngineAPI { interface IGenericDerivedFieldProperties extends IGenericProperties { } - interface IGenericDerivedFields extends IImplementOn { + interface IGenericDerivedFields extends enigmaJS.IGeneratedAPI { /** * Shows the properties of an object. * Returns the identifier and the definition of the derived field. @@ -6054,7 +6033,7 @@ declare namespace EngineAPI { * This class describes all the methods that apply at measure level. * The handle member in the JSON request for all methods listed in this section is the handle of the measure. */ - interface IGenericMeasure extends IImplementOn { + interface IGenericMeasure extends enigmaJS.IGeneratedAPI { /** * Applies a patch to the properties of an object. Allows an update to some of the properties. * @@ -6122,7 +6101,7 @@ declare namespace EngineAPI { * This class describes all the methods that apply at generic variable level. * The handle member in the JSON request for all methods listed in this section is the handle of the generic variable. */ - interface IGenericVariable extends IImplementOn { + interface IGenericVariable extends enigmaJS.IGeneratedAPI { /** * Applies a patch to the properties of a variable. Allows an update to some of the properties. * @@ -6245,7 +6224,7 @@ declare namespace EngineAPI { * * The handle member in the JSON request for all methods listed in this section is the handle of the variable. */ - interface IVariable extends IImplementOn { + interface IVariable extends enigmaJS.IGeneratedAPI { /** * Sets the value of a dual variable overriding any input constraints. * @@ -6926,7 +6905,7 @@ declare namespace EngineAPI { * This class describes all the methods that apply at global level. * The handle member in the JSON request for all methods listed in this section is -1. */ - interface IGlobal { + interface IGlobal extends enigmaJS.IGeneratedAPI { /** * Sets an abort flag on all pending and ongoing requests in the current engine session. * If an abort flag is set on a pending request, the request is aborted. @@ -9700,3 +9679,8 @@ declare namespace EngineAPI { } } //#endregion + +declare namespace enigmaJS { + interface IGeneratedAPI { + } +} diff --git a/types/qlik-visualizationextensions/index.d.ts b/types/qlik-visualizationextensions/index.d.ts index 7e6f3384b4..6baee98c1b 100644 --- a/types/qlik-visualizationextensions/index.d.ts +++ b/types/qlik-visualizationextensions/index.d.ts @@ -2565,3 +2565,45 @@ declare module "qvangular" { const e: IQVAngular; export = e; } + +/** + * This section is added because the Qlik Sense Client after > 3.2 contains a engineapi + * an this makes the handling more fluent for users of that files. + */ +declare namespace enigmaJS { + interface IGeneratedAPI { + /** + * This property contains the unique identifier for this API. + */ + id: string; + + /** + * This property contains the schema class name for this API. + */ + type: string; + + /** + * Despite the name, this property corresponds to the qInfo.qType property on your generic object's properties object. + */ + genericType: string; + + /** + * This property contains the handle QIX Engine assigned to the API. + * Used internally in enigma.js for caches and JSON-RPC + */ + handle: number; + + /** + * register a function for events + * @param event - function called if this event occures + * @param func - function that is called + */ + on(event: "changed" | "closed", func: () => void): void; + + /** + * manual emit an events + * @param event - event that occures + */ + emit(event: "changed" | "closed"): void; + } +} diff --git a/types/react-mdl/index.d.ts b/types/react-mdl/index.d.ts index 33dccccd07..8e70852190 100644 --- a/types/react-mdl/index.d.ts +++ b/types/react-mdl/index.d.ts @@ -418,7 +418,7 @@ declare namespace __ReactMDL { hideSpacer?: boolean; } interface HeaderRowProps extends __MDLOtherProps { - title?: string; + title?: any; // string | JSX.Element hideSpacer?: boolean; } interface HeaderTabsProps extends __MDLOtherProps, RippleComponent { diff --git a/types/react-native-datepicker/index.d.ts b/types/react-native-datepicker/index.d.ts index 7d2fd0c21e..548de52db4 100644 --- a/types/react-native-datepicker/index.d.ts +++ b/types/react-native-datepicker/index.d.ts @@ -1,16 +1,20 @@ -// Type definitions for react-native-datepicker 1.4 +// Type definitions for react-native-datepicker 1.6 // Project: https://github.com/xgfe/react-native-datepicker // Definitions by: Jacob Baskin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import * as React from 'react'; +import { ImageURISource } from 'react-native'; export interface DatePickerProps { mode?: 'date' | 'datetime' | 'time'; androidMode?: 'default' | 'calendar' | 'spinner'; date?: string | Date; format?: string; + iconSource?: ImageURISource; + iconComponent?: JSX.Element; + hideText?: boolean; minDate?: string | Date; maxDate?: string | Date; height?: number; @@ -20,12 +24,16 @@ export interface DatePickerProps { showIcon?: boolean; disabled?: boolean; onDateChange?(dateStr: string, date: Date): void; + onOpenModal?: () => void; + onCloseModal?: () => void; + onPressMask?: () => void; placeholder?: string; modalOnResponderTerminationRequest?(e: any): boolean; is24Hour?: boolean; style?: any; customStyles?: any; minuteInterval?: number; + TouchableComponent?: React.Component; } declare class DatePicker extends React.Component { diff --git a/types/react-onsenui/index.d.ts b/types/react-onsenui/index.d.ts index a910b94adf..72cd5658e8 100644 --- a/types/react-onsenui/index.d.ts +++ b/types/react-onsenui/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React OnSenui (react-onsenui) 2.1 +// Type definitions for React OnSenui (react-onsenui) 2.7 // Project: https://onsen.io/v2/docs/guide/react/ // Definitions by: Ozytis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -48,7 +48,9 @@ export class Splitter extends Component { } /*** toolbar ***/ -export class Toolbar extends Component {} +export class Toolbar extends Component<{ + modifier?: string +}, any> {} export class BottomToolbar extends Component<{ modifier?: string @@ -57,7 +59,7 @@ export class BottomToolbar extends Component<{ export class ToolbarButton extends Component<{ modifier?: string, disabled?: boolean, - onClick?(e?: Event): void + onClick?(e?: React.MouseEvent): void }, any> {} /*** icon ***/ @@ -101,7 +103,7 @@ export class BackButton extends Component<{ }, any> {} export class Navigator extends Component<{ - renderPage(route: any, navigator: Navigator): JSX.Element, + renderPage(route: any): JSX.Element, initialRouteStack?: string[], initialRoute?: any, onPrePush?(): void, @@ -109,8 +111,10 @@ export class Navigator extends Component<{ onPrePop?(): void, onPostPop?(): void, animation?: "slide" | "lift" | "fade" | "none" | string, - animationOptions?: AnimationOptions + animationOptions?: AnimationOptions, }, any> { + pages: any[]; + routes: any[]; resetPage(route: any, options?: any): void; resetPageStack(route: any, options?: any): void; pushPage(route: any, options?: any): void; @@ -196,6 +200,29 @@ export class Popover extends Component<{ onPostHide?(): void, }, any> {} +export class ActionSheet extends Component<{ + onCancel?(): void, + isOpen?: boolean, + isCancelable?: boolean, + isDisabled?: boolean, + animation?: string, + modifier?: string + maskColor?: string, + animationOptions?: {}, + title?: string + onPreShow?(): void, + onPostShow?(): void, + onPreHide?(): void, + onPostHide?(): void, + onDeviceBackButton?(): void +}, any> {} + +export class ActionSheetButton extends Component<{ + modifier?: string, + icon?: string, + onClick?(e?: React.MouseEvent): void +}, any> {} + export class ProgressBar extends Component<{ modifier?: string, value?: number, @@ -222,20 +249,21 @@ export class Fab extends Component<{ ripple?: boolean, position?: string, disabled?: boolean, - onClick?: React.MouseEventHandler, + onClick?(e?: React.MouseEvent): void, }, any> {} export class Button extends Component<{ modifier?: string, disabled?: boolean, ripple?: boolean, - onClick?: React.MouseEventHandler, + className?: string, + onClick?(e?: React.MouseEvent): void }, any> {} export class Input extends Component<{ modifier?: string, disabled?: boolean, - onChange?: React.ChangeEventHandler, + onChange?: (e: React.ChangeEvent) => void, value?: string, checked?: boolean, placeholder?: string, @@ -243,18 +271,36 @@ export class Input extends Component<{ inputId?: string, float?: boolean, name?: string, + className?: string +}, any> {} + +export class Radio extends Component<{ + modifier?: string, + disabled?: boolean, + onChange?(e: Event): void, + value?: string, + checked?: boolean, + inputId?: string +}, any> {} + +export class Checkbox extends Component<{ + modifier?: string, + disabled?: boolean, + onChange?(e: Event): void, + value?: string, + checked?: boolean, + inputId?: string }, any> {} export class Range extends Component<{ modifier?: string, - onChange?: React.ChangeEventHandler, + onChange?(e: Event): void, value?: number, disabled?: boolean, }, any> {} export class Switch extends Component<{ - modifier?: string, - onChange?: React.ChangeEventHandler, + onChange?(e: Event): void, checked?: boolean, disabled?: boolean, inputId?: string @@ -309,7 +355,7 @@ export class ListItem extends Component<{ tappable?: boolean, tapBackgroundColor?: string, lockOnDrag?: boolean, - onClick?: React.MouseEventHandler, + onClick?: React.MouseEventHandler, }, any> {} export class Card extends Component { } diff --git a/types/react-onsenui/react-onsenui-tests.tsx b/types/react-onsenui/react-onsenui-tests.tsx index 9d5c86682f..fc472b96d6 100644 --- a/types/react-onsenui/react-onsenui-tests.tsx +++ b/types/react-onsenui/react-onsenui-tests.tsx @@ -21,6 +21,9 @@ export class App extends React.Component { this.setState({ isOpen: false }); } + onChange(event: React.ChangeEvent) {} + onClick(event: React.MouseEvent) {} + render() { return ( @@ -37,8 +40,8 @@ export class App extends React.Component { Test page - -