From af3a57e16aa35e809b4b23ff21c507d8b040c749 Mon Sep 17 00:00:00 2001 From: zhengbli Date: Fri, 16 Sep 2016 11:36:37 -0700 Subject: [PATCH 1/4] Fix Types-2.0 CI --- ...bowser-tests.ts => bowser-tests-global.ts} | 13 +- bowser/bowser-tests-module.ts | 9 + bowser/tsconfig.json | 3 +- electron/index.d.ts | 2 +- esprima/index.d.ts | 2 +- gulp/index.d.ts | 2 + mongoose-promise/index.d.ts | 231 +++++++++--------- mongoose-promise/tsconfig.json | 2 +- whatwg-fetch/whatwg-fetch-tests.ts | 41 +--- 9 files changed, 134 insertions(+), 171 deletions(-) rename bowser/{bowser-tests.ts => bowser-tests-global.ts} (55%) create mode 100644 bowser/bowser-tests-module.ts diff --git a/bowser/bowser-tests.ts b/bowser/bowser-tests-global.ts similarity index 55% rename from bowser/bowser-tests.ts rename to bowser/bowser-tests-global.ts index 910b716e0f..490d02a254 100644 --- a/bowser/bowser-tests.ts +++ b/bowser/bowser-tests-global.ts @@ -1,19 +1,10 @@ - - -import Bowser = require('bowser'); - -Bowser.msedge === true; -Bowser.test(['msie']) === true; -Bowser.a === Bowser.c; -Bowser.osversion > 10; -Bowser.osversion === '10.1A'; - bowser.msedge === true; bowser.test(['msie']) === true; bowser.a === bowser.c; bowser.osversion > 10; bowser.osversion === '10.1A'; bowser.compareVersions(['9.0', '10']); -bowser() === {android: true, x: true}; + +bowser() === {android: true, x: true}; bowser.check({msie: "11"}, window.navigator.userAgent); bowser.isUnsupportedBrowser({msie: "10"}, window.navigator.userAgent); \ No newline at end of file diff --git a/bowser/bowser-tests-module.ts b/bowser/bowser-tests-module.ts new file mode 100644 index 0000000000..7d662b2f2b --- /dev/null +++ b/bowser/bowser-tests-module.ts @@ -0,0 +1,9 @@ + + +import Bowser = require('bowser'); + +Bowser.msedge === true; +Bowser.test(['msie']) === true; +Bowser.a === Bowser.c; +Bowser.osversion > 10; +Bowser.osversion === '10.1A'; \ No newline at end of file diff --git a/bowser/tsconfig.json b/bowser/tsconfig.json index 7716ba9fcc..5261c0e68b 100644 --- a/bowser/tsconfig.json +++ b/bowser/tsconfig.json @@ -14,6 +14,7 @@ }, "files": [ "index.d.ts", - "bowser-tests.ts" + "bowser-tests-module.ts", + "bowser-tests-global.ts" ] } \ No newline at end of file diff --git a/electron/index.d.ts b/electron/index.d.ts index 7d10fce465..cac4bab9b2 100644 --- a/electron/index.d.ts +++ b/electron/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: jedmao , rhysd , Milan Burda // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace Electron { diff --git a/esprima/index.d.ts b/esprima/index.d.ts index 312392e4b5..920257abd3 100644 --- a/esprima/index.d.ts +++ b/esprima/index.d.ts @@ -21,7 +21,7 @@ declare namespace esprima { value: string; } - interface Comment extends ESTree.Node { + interface Comment extends ESTree.BaseNode { value: string; } diff --git a/gulp/index.d.ts b/gulp/index.d.ts index 0387e0962f..89b1a5dfa5 100644 --- a/gulp/index.d.ts +++ b/gulp/index.d.ts @@ -5,9 +5,11 @@ /// /// +/// import Orchestrator = require("orchestrator"); +import VinylFile = require("vinyl"); declare namespace gulp { interface Gulp extends Orchestrator { diff --git a/mongoose-promise/index.d.ts b/mongoose-promise/index.d.ts index d2622bb6f9..fe60fe73c3 100644 --- a/mongoose-promise/index.d.ts +++ b/mongoose-promise/index.d.ts @@ -3,126 +3,125 @@ // Definitions by: simonxca // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/* - * These are the default promises included in the Mongoose v4.x - * definitions. They will be deprecated beginning Mongoose V5.x - * in favor of native ES6 Promises. - * - * You can switch the promise library that mongoose uses by: - * - * 1. Including this somewhere in your code: - * mongoose.Promise = YOUR_PROMISE; - * - * 2. Including this somewhere in your main .d.ts file: - * type MongoosePromise = YOUR_PROMISE; - */ +/// +/// /* * http://mongoosejs.com/docs/api.html#promise-js * - * Callback signatures are from the mPromise type definitions. + * mongoose.d.ts uses global.Promise by default. This is the MongooseJS + * mpromise implementation (which are deprecated). If you still want to + * use it, install these definitions in your project. */ -interface MongoosePromise { - /** - * Promise constructor. - * Promises are returned from executed queries. - * @param fn a function which will be called when the promise - * is resolved that accepts fn(err, ...){} as signature - * @event err Emits when the promise is rejected - * @event complete Emits when the promise is fulfilled - * @deprecated Mongoose 5.0 will use native promises by default (or bluebird, if native - * promises are not present) but still support plugging in your own ES6-compatible - * promises library. Mongoose 5.0 will not support mpromise. +import mpromise = require('mpromise'); +declare module 'mongoose' { + + type Promise = MongoosePromise; + + /* + * mpromise definitions. + * Callback signatures are from the mPromise type definitions. */ - new(fn?: (err: any, arg: T) => void): MongoosePromise; - new(fn?: (err: any, ...args: T[]) => void): MongoosePromise; + class MongoosePromise extends mpromise { + /** + * Promise constructor. + * Promises are returned from executed queries. + * @param fn a function which will be called when the promise + * is resolved that accepts fn(err, ...){} as signature + * @event err Emits when the promise is rejected + * @event complete Emits when the promise is fulfilled + * @deprecated Mongoose 5.0 will use native promises by default (or bluebird, if native + * promises are not present) but still support plugging in your own ES6-compatible + * promises library. Mongoose 5.0 will not support mpromise. + */ + constructor(fn?: (err: any, arg: T) => void); + constructor(fn?: (err: any, ...args: T[]) => void); + + /** + * Adds a single function as a listener to both err and complete. + * It will be executed with traditional node.js argument position when the promise is resolved. + * @deprecated Use onResolve instead. + */ + addBack(listener: (err: any, arg: T) => void): this; + addBack(listener: (err: any, ...args: T[]) => void): this; + + /** + * Adds a listener to the complete (success) event. + * @deprecated Adds a listener to the complete (success) event. + */ + addCallback(listener: (arg: T) => void): this; + addCallback(listener: (...args: T[]) => void): this; + + /** + * Adds a listener to the err (rejected) event. + * @deprecated Use onReject instead. + */ + addErrback(listener: (err: any) => void): this; + + /** ES6-style .catch() shorthand */ + catch(onReject?: (err: any) => void | TRes | PromiseLike): MongoosePromise; + + /** + * Signifies that this promise was the last in a chain of then()s: if a handler passed + * to the call to then which produced this promise throws, the exception will go uncaught. + */ + end(): void; + + /** + * Rejects this promise with err. + * If the promise has already been fulfilled or rejected, not action is taken. + * Differs from #reject by first casting err to an Error if it is not instanceof Error. + */ + error(err: any): this; + + /** + * Adds listener to the event. + * If event is either the success or failure event and the event has already been emitted, + * thelistener is called immediately and passed the results of the original emitted event. + */ + on(event: string, listener: Function): this; + + /** + * Rejects this promise with reason. + * If the promise has already been fulfilled or rejected, not action is taken. + */ + reject(reason: Object | string | Error): this; + + /** + * Resolves this promise to a rejected state if err is passed or a fulfilled state if no err is passed. + * If the promise has already been fulfilled or rejected, not action is taken. + * err will be cast to an Error if not already instanceof Error. + * NOTE: overrides mpromise#resolve to provide error casting. + * @param err error or null + * @param val value to fulfill the promise with + */ + resolve(err?: any, val?: Object): this; + + /** + * Creates a new promise and returns it. If onFulfill or onReject are passed, they are added as + * SUCCESS/ERROR callbacks to this promise after the nextTick. + * Conforms to promises/A+ specification. + */ + then(onFulFill: (arg: T) => void | TRes | PromiseLike, + onReject?: (err: any) => void | TRes | PromiseLike): MongoosePromise; + then(onFulfill: (...args: T[]) => void | TRes | PromiseLike, + onReject?: (err: any) => void | TRes | PromiseLike): MongoosePromise; + + /** + * Fulfills this promise with passed arguments. Alias of mpromise#fulfill. + * @deprecated Use fulfill instead. + */ + complete(args: T): this; + complete(...args: T[]): this; + + /** Fulfills this promise with passed arguments. */ + fulfill(...args: T[]): this; + fulfill(arg: T): this; + + /** ES6-style promise constructor wrapper around mpromise. */ + static ES6(resolver: ( + complete: (...args: TRes[]) => void | TRes | PromiseLike, + error: (e: any) => void | TRes | PromiseLike + ) => void): MongoosePromise; + } } - -declare class MongoosePromise { - /** - * Adds a single function as a listener to both err and complete. - * It will be executed with traditional node.js argument position when the promise is resolved. - * @deprecated Use onResolve instead. - */ - addBack(listener: (err: any, arg: T) => void): this; - addBack(listener: (err: any, ...args: T[]) => void): this; - - /** - * Adds a listener to the complete (success) event. - * @deprecated Adds a listener to the complete (success) event. - */ - addCallback(listener: (arg: T) => void): this; - addCallback(listener: (...args: T[]) => void): this; - - /** - * Adds a listener to the err (rejected) event. - * @deprecated Use onReject instead. - */ - addErrback(listener: (err: any) => void): this; - - /** ES6-style .catch() shorthand */ - catch(onReject?: (err: any) => void | TRes | PromiseLike): MongoosePromise; - - /** - * Signifies that this promise was the last in a chain of then()s: if a handler passed - * to the call to then which produced this promise throws, the exception will go uncaught. - */ - end(): void; - - /** - * Rejects this promise with err. - * If the promise has already been fulfilled or rejected, not action is taken. - * Differs from #reject by first casting err to an Error if it is not instanceof Error. - */ - error(err: any): this; - - /** - * Adds listener to the event. - * If event is either the success or failure event and the event has already been emitted, - * thelistener is called immediately and passed the results of the original emitted event. - */ - on(event: string, listener: Function): this; - - /** - * Rejects this promise with reason. - * If the promise has already been fulfilled or rejected, not action is taken. - */ - reject(reason: Object | string | Error): this; - - /** - * Resolves this promise to a rejected state if err is passed or a fulfilled state if no err is passed. - * If the promise has already been fulfilled or rejected, not action is taken. - * err will be cast to an Error if not already instanceof Error. - * NOTE: overrides mpromise#resolve to provide error casting. - * @param err error or null - * @param val value to fulfill the promise with - */ - resolve(err?: any, val?: Object): this; - - /** - * Creates a new promise and returns it. If onFulfill or onReject are passed, they are added as - * SUCCESS/ERROR callbacks to this promise after the nextTick. - * Conforms to promises/A+ specification. - */ - then(onFulFill: (arg: T) => void | TRes | PromiseLike, - onReject?: (err: any) => void | TRes | PromiseLike): MongoosePromise; - then(onFulfill: (...args: T[]) => void | TRes | PromiseLike, - onReject?: (err: any) => void | TRes | PromiseLike): MongoosePromise; - - /** - * Fulfills this promise with passed arguments. Alias of mpromise#fulfill. - * @deprecated Use fulfill instead. - */ - complete(args: T): this; - complete(...args: T[]): this; - - /** Fulfills this promise with passed arguments. */ - fulfill(...args: T[]): this; - fulfill(arg: T): this; - - /** ES6-style promise constructor wrapper around mpromise. */ - static ES6(resolver: ( - complete: (...args: TRes[]) => void | TRes | PromiseLike, - error: (e: any) => void | TRes | PromiseLike - ) => void): MongoosePromise; -} \ No newline at end of file diff --git a/mongoose-promise/tsconfig.json b/mongoose-promise/tsconfig.json index 45378dfc67..ea8993399c 100644 --- a/mongoose-promise/tsconfig.json +++ b/mongoose-promise/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "target": "es5", + "target": "es6", "noImplicitAny": true, "strictNullChecks": false, "baseUrl": "../", diff --git a/whatwg-fetch/whatwg-fetch-tests.ts b/whatwg-fetch/whatwg-fetch-tests.ts index 7434c8372b..aa6b90b8c8 100644 --- a/whatwg-fetch/whatwg-fetch-tests.ts +++ b/whatwg-fetch/whatwg-fetch-tests.ts @@ -1,44 +1,5 @@  -function test_HeadersCopiedFromHeaders1() { - var source = new Headers(); - source.append('Content-Type', 'application/json'); - return new Headers(source); -} - -function test_HeadersCopiedFromHash1() { - var source:HeadersMap = { - 'Content-Type': 'application/json' - }; - return new Headers(source); -} - -function test_HeadersCopiedFromHeaders2() { - var source = new Headers(); - source.append('Content-Type', 'application/json'); - return new Headers(source); -} - -function test_HeadersCopiedFromHash2() { - var source:HeadersMap = { - 'Content-Type': 'application/json' - }; - return new Headers(source); -} - -function test_HeadersCopiedFromHeaders3() { - var source = new Headers(); - source.append('Content-Type', 'application/json'); - return new Headers(source); -} - -function test_HeadersCopiedFromHash3() { - var source:HeadersMap = { - 'Content-Type': 'application/json' - }; - return new Headers(source); -} - function test_HeadersCopiedFromHeaders() { var source = new Headers(); source.append('Content-Type', 'application/json'); @@ -107,4 +68,4 @@ function handlePromise(promise: Promise) { }).then((text) => { console.log(text); }); -} +} \ No newline at end of file From 27541f076b2e20514cb60456ccaeabf8c9958c88 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Fri, 16 Sep 2016 13:16:58 -0700 Subject: [PATCH 2/4] Fix header error: don't need periods at end of name --- cordova-plugin-contacts/index.d.ts | 6 +++--- cordova-plugin-file/index.d.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cordova-plugin-contacts/index.d.ts b/cordova-plugin-contacts/index.d.ts index 90b21ae2bb..6728b991d6 100644 --- a/cordova-plugin-contacts/index.d.ts +++ b/cordova-plugin-contacts/index.d.ts @@ -1,8 +1,8 @@ -// Type definitions for Apache Cordova Contacts plugin. +// Type definitions for Apache Cordova Contacts plugin // Project: https://github.com/apache/cordova-plugin-contacts // Definitions by: Microsoft Open Technologies, Inc. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// +// // Copyright (c) Microsoft Open Technologies, Inc. // Licensed under the MIT license. @@ -204,7 +204,7 @@ declare var ContactName: { * The ContactField object is a reusable component that represents contact fields generically. * Each ContactField object contains a value, type, and pref property. A Contact object stores * several properties in ContactField[] arrays, such as phone numbers and email addresses. - * + * * In most instances, there are no pre-determined values for a ContactField object's type attribute. * For example, a phone number can specify type values of home, work, mobile, iPhone, * or any other value that is supported by a particular device platform's contact database. diff --git a/cordova-plugin-file/index.d.ts b/cordova-plugin-file/index.d.ts index f9471eda72..3243632714 100644 --- a/cordova-plugin-file/index.d.ts +++ b/cordova-plugin-file/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Apache Cordova File System plugin. +// Type definitions for Apache Cordova File System plugin // Project: https://github.com/apache/cordova-plugin-file // Definitions by: Microsoft Open Technologies, Inc. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 915fd561991a100071ce072acb445344ba4001b8 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Fri, 16 Sep 2016 15:48:23 -0700 Subject: [PATCH 3/4] Fix more header punctuation --- cordova-plugin-contacts/index.d.ts | 2 +- cordova-plugin-file/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cordova-plugin-contacts/index.d.ts b/cordova-plugin-contacts/index.d.ts index 6728b991d6..f0979ba6c2 100644 --- a/cordova-plugin-contacts/index.d.ts +++ b/cordova-plugin-contacts/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Apache Cordova Contacts plugin // Project: https://github.com/apache/cordova-plugin-contacts -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // // Copyright (c) Microsoft Open Technologies, Inc. diff --git a/cordova-plugin-file/index.d.ts b/cordova-plugin-file/index.d.ts index 3243632714..6aadbf6fad 100644 --- a/cordova-plugin-file/index.d.ts +++ b/cordova-plugin-file/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Apache Cordova File System plugin // Project: https://github.com/apache/cordova-plugin-file -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // // Copyright (c) Microsoft Open Technologies, Inc. From 993a644034bdd1d1ce18478e6ef0e166abf1fd36 Mon Sep 17 00:00:00 2001 From: Mykhailo Stadnyk Date: Mon, 19 Sep 2016 10:36:28 +0300 Subject: [PATCH 4/4] Added new type definitions for canvas-gauges (#11251) --- canvas-gauges/canvas-gauges-tests.ts | 20 ++ canvas-gauges/canvas-gauges.d.ts | 263 +++++++++++++++++++++++++++ 2 files changed, 283 insertions(+) create mode 100644 canvas-gauges/canvas-gauges-tests.ts create mode 100644 canvas-gauges/canvas-gauges.d.ts diff --git a/canvas-gauges/canvas-gauges-tests.ts b/canvas-gauges/canvas-gauges-tests.ts new file mode 100644 index 0000000000..d0f04e1082 --- /dev/null +++ b/canvas-gauges/canvas-gauges-tests.ts @@ -0,0 +1,20 @@ +/// + +import { + LinearGaugeOptions, + RadialGaugeOptions, + LinearGauge, + RadialGauge +} from 'canvas-gauges'; + +let linearOptions: LinearGaugeOptions = { + renderTo: document.createElement('canvas') +}; +let radialOptions: RadialGaugeOptions = { + renderTo: 'gauge-id' +}; + +new LinearGauge(linearOptions); +new RadialGauge(radialOptions); + +console.log(document.gauges.length); diff --git a/canvas-gauges/canvas-gauges.d.ts b/canvas-gauges/canvas-gauges.d.ts new file mode 100644 index 0000000000..53858e566e --- /dev/null +++ b/canvas-gauges/canvas-gauges.d.ts @@ -0,0 +1,263 @@ +// Type definitions for canvas-gauges +// Project: https://github.com/Mikhus/canvas-gauges +// Definitions by: Mikhus +// Definitions: https://github.com/Mikhus/DefinitelyTyped + +declare namespace CanvasGauges { + export type RenderTarget = string|HTMLElement; + + export interface AnimationRule { + (percent: number): number; + } + + export interface Highlight { + from: number, + to: number, + color: string + } + + export type MajorTicks = string[]|number[]; + + export interface GenericOptions { + renderTo: RenderTarget, + width?: number, + height?: number, + minValue?: number, + maxValue?: number, + value?: number, + units?: string|boolean, + majorTicks?: MajorTicks, + minorTicks?: number, + strokeTicks?: boolean, + animatedValue?: boolean, + title?: string|boolean, + borders?: boolean, + valueInt?: number, + valueDec?: number, + majorTicksInt?: number, + majorTicksDec?: number, + animation?: boolean, + animationDuration?: number, + animationRule?: string|AnimationRule, + colorPlate?: string, + colorMajorTicks?: string, + colorMinorTicks?: string, + colorTitle?: string, + colorUnits?: string, + colorNumbers?: string, + colorNeedle?: string, + colorNeedleEnd?: string, + colorValueText?: string, + colorValueTextShadow?: string, + colorBorderShadow?: string, + colorBorderOuter?: string, + colorBorderOuterEnd?: string, + colorBorderMiddle?: string, + colorBorderMiddleEnd?: string, + colorBorderInner?: string, + colorBorderInnerEnd?: string, + colorValueBoxRect?: string, + colorValueBoxRectEnd?: string, + colorValueBoxBackground?: string, + colorValueBoxShadow?: string, + colorNeedleShadowUp?: string, + colorNeedleShadowDown?: string, + needle?: boolean, + needleShadow?: boolean, + needleType?: string, + needleStart?: number, + needleEnd?: number, + needleWidth?: number, + borderOuterWidth?: number, + borderMiddleWidth?: number, + borderInnerWidth?: number, + borderShadowWidth?: number, + valueBox?: boolean, + valueBoxStroke?: number, + valueText?: string, + valueTextShadow?: boolean, + valueBoxBorderRadius?: number, + highlights?: Highlight[], + fontNumbers?: string, + fontTitle?: string, + fontUnits?: string, + fontValue?: string, + fontTitleSize?: number, + fontValueSize?: number, + fontUnitsSize?: number, + fontNumbersSize?: number + } + + export interface RadialGaugeOptions extends GenericOptions { + ticksAngle?: number, + startAngle?: number, + colorNeedleCircleOuter?: string, + colorNeedleCircleOuterEnd?: string, + colorNeedleCircleInner?: string, + colorNeedleCircleInnerEnd?: string, + needleCircleSize?: number, + needleCircleInner?: boolean, + needleCircleOuter?: boolean, + animationTarget?: string + } + + export interface LinearGaugeOptions extends GenericOptions { + borderRadius?: number, + barBeginCircle?: number, + barWidth?: number, + barStrokeWidth?: number, + barProgress?: boolean, + colorBar?: string, + colorBarEnd?: string, + colorBarStroke?: string, + colorBarProgress?: string, + colorBarProgressEnd?: string, + tickSide?: string, + needleSide?: string, + numberSide?: string, + ticksWidth?: number, + ticksWidthMinor?: number, + ticksPadding?: number, + barLength?: number + } + + export interface DrawEventCallback { + (percent: number): any; + } + + export interface EndEventCallback { + (): any; + } + + export interface rules { + linear: AnimationRule, + quad: AnimationRule, + dequad: AnimationRule, + quint: AnimationRule, + dequint: AnimationRule, + cycle: AnimationRule, + decycle: AnimationRule, + bounce: AnimationRule, + debounce: AnimationRule, + elastic: AnimationRule, + delastic: AnimationRule + } + + export class Animation { + public duration: number; + public rule: string|AnimationRule; + public draw: DrawEventCallback; + public end: EndEventCallback; + + public static rules: rules; + + constructor(rule?: string|AnimationRule, duration?: number, + draw?: DrawEventCallback, end?: EndEventCallback); + + public animate(draw?: DrawEventCallback, end?: EndEventCallback): any; + public destroy(): any; + } + + export class SmartCanvas { + public element: HTMLCanvasElement; + public elementClone: HTMLCanvasElement; + public context: CanvasRenderingContext2D; + public contextClone: CanvasRenderingContext2D; + public drawWidth: number; + public drawHeight: number; + public drawX: number; + public drawY: number; + public minSide: number; + public width: number; + public height: number; + + constructor(element: HTMLCanvasElement, + width?: number, + height?: number); + + public init(): any; + public onRedraw(): any; + public destroy(): any; + public commit(): SmartCanvas; + public redraw(): SmartCanvas; + + public pixelRatio: number; + public static redraw(): any; + public static collection: Array; + } + + export class DomObserver { + public Type: BaseGauge; + public mutationsObserved: boolean; + public isObservable: boolean; + public options: GenericOptions; + public element: string; + public type: string; + + constructor(options: GenericOptions, + element: string, + type: string); + + public isValidNode(node: Node|HTMLElement): boolean; + public traverse(): any; + public observe(records: MutationRecord[]): any; + public process(node: Node|HTMLElement): BaseGauge; + + public static parse(value: any): any; + public static toDashed(camelCase: string): string; + public static toAttributeName(str: string): string; + static domReady(handler: Function): any; + } + + export abstract class BaseGauge { + public type: BaseGauge; + public options: GenericOptions; + public canvas: SmartCanvas; + public animation: Animation; + public value: number; + + constructor(options: GenericOptions); + + public update(options: GenericOptions): BaseGauge; + public destroy(): any; + public abstract draw(): BaseGauge; + + public static initialize(type: string, options: GenericOptions): any; + } + + export class RadialGauge extends BaseGauge { + public type: RadialGauge; + public options: RadialGaugeOptions; + + constructor(options: RadialGaugeOptions); + + public draw(): RadialGauge; + } + + export class LinearGauge extends BaseGauge { + public type: LinearGauge; + public options: LinearGaugeOptions; + + constructor(options: LinearGaugeOptions); + + public draw(): LinearGauge; + } + + export interface Collection extends Array { + get: (id: number | string) => BaseGauge; + } +} + +declare module 'canvas-gauges' { + export = CanvasGauges; +} + +interface Document { + gauges: CanvasGauges.Collection; +} + +interface Window { + BaseGauge: CanvasGauges.BaseGauge; + RadialGauge: CanvasGauges.RadialGauge; + LinearGauge: CanvasGauges.LinearGauge; +}