From 8a960c12ceeb8520896ba7b092fabc9a3d7ad6d9 Mon Sep 17 00:00:00 2001 From: Igor Kriklivets Date: Thu, 5 Dec 2013 16:40:33 +0400 Subject: [PATCH 01/15] Remove not required .tscparams --- chartjs/dx.chartjs-tests.tscparams | 1 - 1 file changed, 1 deletion(-) delete mode 100644 chartjs/dx.chartjs-tests.tscparams diff --git a/chartjs/dx.chartjs-tests.tscparams b/chartjs/dx.chartjs-tests.tscparams deleted file mode 100644 index 3cc762b55..000000000 --- a/chartjs/dx.chartjs-tests.tscparams +++ /dev/null @@ -1 +0,0 @@ -"" \ No newline at end of file From ddf2401d06db64c94fe48f0d57cdebcd58f17496 Mon Sep 17 00:00:00 2001 From: Brian Kotek Date: Tue, 10 Dec 2013 22:03:35 -0500 Subject: [PATCH 02/15] Update to TS 0.9.5; fix invalid MultiSlider setValue method; add logic to include static properties. --- extjs/ExtJS.d.ts | 958 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 944 insertions(+), 14 deletions(-) diff --git a/extjs/ExtJS.d.ts b/extjs/ExtJS.d.ts index 1c85967a7..7233d8b15 100644 --- a/extjs/ExtJS.d.ts +++ b/extjs/ExtJS.d.ts @@ -958,6 +958,26 @@ declare module Ext { export interface IAjax extends Ext.data.IConnection { } export class Ajax { + /** [Property] (Boolean) */ + static autoAbort: boolean; + /** [Property] (Object) */ + static defaultHeaders: any; + /** [Property] (Boolean) */ + static disableCaching: boolean; + /** [Property] (Object) */ + static extraParams: any; + /** [Property] (Object) */ + static hasListeners: any; + /** [Property] (Boolean) */ + static isObservable: boolean; + /** [Property] (String) */ + static method: string; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Number) */ + static timeout: number; + /** [Property] (String) */ + static url: string; /** [Method] Aborts an active request * @param request Object Defaults to the last request */ @@ -1349,6 +1369,8 @@ declare module Ext.app.domain { export interface IComponent extends Ext.app.IEventDomain { } export class Component { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -1394,6 +1416,10 @@ declare module Ext.app.domain { export interface IController extends Ext.app.IEventDomain { } export class Controller { + /** [Config Option] (String) */ + static idProperty: string; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -1439,6 +1465,10 @@ declare module Ext.app.domain { export interface IDirect extends Ext.app.IEventDomain { } export class Direct { + /** [Config Option] (String) */ + static idProperty: string; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -1484,6 +1514,8 @@ declare module Ext.app.domain { export interface IGlobal extends Ext.app.IEventDomain { } export class Global { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -1527,6 +1559,10 @@ declare module Ext.app.domain { export interface IStore extends Ext.app.IEventDomain { } export class Store { + /** [Config Option] (String) */ + static idProperty: string; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -1572,6 +1608,8 @@ declare module Ext.app { export interface IEventBus extends Ext.IBase { } export class EventBus { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -2421,6 +2459,8 @@ declare module Ext.button { export interface IManager extends Ext.IBase { } export class Manager { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -2456,6 +2496,8 @@ declare module Ext { export interface IButtonToggleManager extends Ext.IBase { } export class ButtonToggleManager { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -3729,6 +3771,8 @@ declare module Ext.chart { export interface IShape extends Ext.IBase { } export class Shape { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -4149,6 +4193,10 @@ declare module Ext { export interface IComponentManager extends Ext.IAbstractManager { } export class ComponentManager { + /** [Property] (Ext.util.HashMap) */ + static all: Ext.util.IHashMap; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -4228,6 +4276,10 @@ declare module Ext { export interface IComponentMgr extends Ext.IAbstractManager { } export class ComponentMgr { + /** [Property] (Ext.util.HashMap) */ + static all: Ext.util.IHashMap; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -4307,6 +4359,8 @@ declare module Ext { export interface IComponentQuery extends Ext.IBase { } export class ComponentQuery { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -5479,6 +5533,16 @@ declare module Ext.data { export interface IJsonP extends Ext.IBase { } export class JsonP { + /** [Property] (String) */ + static callbackKey: string; + /** [Property] (Boolean) */ + static disableCaching: boolean; + /** [Property] (String) */ + static disableCachingParam: string; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Number) */ + static timeout: number; /** [Method] Abort a request * @param request Object/String The request to abort */ @@ -8237,6 +8301,10 @@ declare module Ext.data { export interface ISortTypes extends Ext.IBase { } export class SortTypes { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (RegExp) */ + static stripTagsRE: RegExp; /** [Method] Date sorting * @param s Object The value being converted * @returns Number The comparison value @@ -8653,6 +8721,18 @@ declare module Ext.data { export interface IStoreManager extends Ext.util.IMixedCollection { } export class StoreManager { + /** [Property] (Object) */ + static hasListeners: any; + /** [Property] (Boolean) */ + static isMixedCollection: boolean; + /** [Property] (Boolean) */ + static isObservable: boolean; + /** [Property] (Boolean) */ + static isSortable: boolean; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Ext.util.MixedCollection) */ + static sorters: Ext.util.IMixedCollection; /** [Method] Adds an item to the collection * @param key String/Object The key to associate with the item, or the new item. If a getKey implementation was specified for this MixedCollection, or if the key of the stored items is in a property called id, the MixedCollection will be able to derive the key for the new item. In this case just pass the new item in this parameter. * @param obj Object The item to add. @@ -9025,6 +9105,18 @@ declare module Ext { export interface IStoreMgr extends Ext.util.IMixedCollection { } export class StoreMgr { + /** [Property] (Object) */ + static hasListeners: any; + /** [Property] (Boolean) */ + static isMixedCollection: boolean; + /** [Property] (Boolean) */ + static isObservable: boolean; + /** [Property] (Boolean) */ + static isSortable: boolean; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Ext.util.MixedCollection) */ + static sorters: Ext.util.IMixedCollection; /** [Method] Adds an item to the collection * @param key String/Object The key to associate with the item, or the new item. If a getKey implementation was specified for this MixedCollection, or if the key of the stored items is in a property called id, the MixedCollection will be able to derive the key for the new item. In this case just pass the new item in this parameter. * @param obj Object The item to add. @@ -9397,6 +9489,18 @@ declare module Ext.data { export interface IStoreMgr extends Ext.util.IMixedCollection { } export class StoreMgr { + /** [Property] (Object) */ + static hasListeners: any; + /** [Property] (Boolean) */ + static isMixedCollection: boolean; + /** [Property] (Boolean) */ + static isObservable: boolean; + /** [Property] (Boolean) */ + static isSortable: boolean; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Ext.util.MixedCollection) */ + static sorters: Ext.util.IMixedCollection; /** [Method] Adds an item to the collection * @param key String/Object The key to associate with the item, or the new item. If a getKey implementation was specified for this MixedCollection, or if the key of the stored items is in a property called id, the MixedCollection will be able to derive the key for the new item. In this case just pass the new item in this parameter. * @param obj Object The item to add. @@ -9769,6 +9873,18 @@ declare module Ext { export interface IStoreManager extends Ext.util.IMixedCollection { } export class StoreManager { + /** [Property] (Object) */ + static hasListeners: any; + /** [Property] (Boolean) */ + static isMixedCollection: boolean; + /** [Property] (Boolean) */ + static isObservable: boolean; + /** [Property] (Boolean) */ + static isSortable: boolean; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Ext.util.MixedCollection) */ + static sorters: Ext.util.IMixedCollection; /** [Method] Adds an item to the collection * @param key String/Object The key to associate with the item, or the new item. If a getKey implementation was specified for this MixedCollection, or if the key of the stored items is in a property called id, the MixedCollection will be able to derive the key for the new item. In this case just pass the new item in this parameter. * @param obj Object The item to add. @@ -10332,6 +10448,28 @@ declare module Ext.data { export interface ITypes extends Ext.IBase { } export class Types { + /** [Property] (Object) */ + static AUTO: any; + /** [Property] (Object) */ + static BOOL: any; + /** [Property] (Object) */ + static BOOLEAN: any; + /** [Property] (Object) */ + static DATE: any; + /** [Property] (Object) */ + static FLOAT: any; + /** [Property] (Object) */ + static INT: any; + /** [Property] (Object) */ + static INTEGER: any; + /** [Property] (Object) */ + static NUMBER: any; + /** [Property] (Object) */ + static STRING: any; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (RegExp) */ + static stripRe: RegExp; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -10381,6 +10519,22 @@ declare module Ext.data { export interface IValidations extends Ext.IBase { } export class Validations { + /** [Property] (String) */ + static emailMessage: string; + /** [Property] (RegExp) */ + static emailRe: RegExp; + /** [Property] (String) */ + static exclusionMessage: string; + /** [Property] (String) */ + static formatMessage: string; + /** [Property] (String) */ + static inclusionMessage: string; + /** [Property] (String) */ + static lengthMessage: string; + /** [Property] (String) */ + static presenceMessage: string; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -10581,6 +10735,38 @@ declare module Ext { export interface IDate { } export class Date { + /** [Property] (String) */ + static DAY: string; + /** [Property] (String) */ + static HOUR: string; + /** [Property] (String) */ + static MILLI: string; + /** [Property] (String) */ + static MINUTE: string; + /** [Property] (String) */ + static MONTH: string; + /** [Property] (String) */ + static SECOND: string; + /** [Property] (String) */ + static YEAR: string; + /** [Property] (String[]) */ + static dayNames: string[]; + /** [Property] (String) */ + static defaultFormat: string; + /** [Property] (Object) */ + static defaults: any; + /** [Property] (Object) */ + static formatCodes: any; + /** [Property] (Object) */ + static formatFunctions: any; + /** [Property] (String[]) */ + static monthNames: string[]; + /** [Property] (Object) */ + static monthNumbers: any; + /** [Property] (Object) */ + static parseFunctions: any; + /** [Property] (Boolean) */ + static useStrict: boolean; /** [Method] Provides a convenient method for performing basic date arithmetic * @param date Date The date to modify * @param interval String A valid date interval enum value. @@ -11100,6 +11286,28 @@ declare module Ext.dd { export interface IDragDropManager extends Ext.IBase { } export class DragDropManager { + /** [Property] (Number) */ + static INTERSECT: number; + /** [Property] (Number) */ + static POINT: number; + /** [Property] (Number) */ + static clickPixelThresh: number; + /** [Property] (Number) */ + static clickTimeThresh: number; + /** [Property] (String) */ + static dragCls: string; + /** [Property] (Number) */ + static mode: number; + /** [Property] (Boolean) */ + static notifyOccluded: boolean; + /** [Property] (Boolean) */ + static preventDefault: boolean; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Boolean) */ + static stopPropagation: boolean; + /** [Property] (Boolean) */ + static useCache: boolean; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -11223,6 +11431,28 @@ declare module Ext.dd { export interface IDragDropMgr extends Ext.IBase { } export class DragDropMgr { + /** [Property] (Number) */ + static INTERSECT: number; + /** [Property] (Number) */ + static POINT: number; + /** [Property] (Number) */ + static clickPixelThresh: number; + /** [Property] (Number) */ + static clickTimeThresh: number; + /** [Property] (String) */ + static dragCls: string; + /** [Property] (Number) */ + static mode: number; + /** [Property] (Boolean) */ + static notifyOccluded: boolean; + /** [Property] (Boolean) */ + static preventDefault: boolean; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Boolean) */ + static stopPropagation: boolean; + /** [Property] (Boolean) */ + static useCache: boolean; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -11346,6 +11576,28 @@ declare module Ext.dd { export interface IDDM extends Ext.IBase { } export class DDM { + /** [Property] (Number) */ + static INTERSECT: number; + /** [Property] (Number) */ + static POINT: number; + /** [Property] (Number) */ + static clickPixelThresh: number; + /** [Property] (Number) */ + static clickTimeThresh: number; + /** [Property] (String) */ + static dragCls: string; + /** [Property] (Number) */ + static mode: number; + /** [Property] (Boolean) */ + static notifyOccluded: boolean; + /** [Property] (Boolean) */ + static preventDefault: boolean; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Boolean) */ + static stopPropagation: boolean; + /** [Property] (Boolean) */ + static useCache: boolean; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -11893,6 +12145,8 @@ declare module Ext.dd { export interface IRegistry extends Ext.IBase { } export class Registry { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -11957,6 +12211,22 @@ declare module Ext.dd { export interface IScrollManager extends Ext.IBase { } export class ScrollManager { + /** [Property] (Number) */ + static animDuration: number; + /** [Property] (Boolean) */ + static animate: boolean; + /** [Property] (String) */ + static ddGroup: string; + /** [Property] (Number) */ + static frequency: number; + /** [Property] (Number) */ + static hthresh: number; + /** [Property] (Number) */ + static increment: number; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Number) */ + static vthresh: number; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -12068,6 +12338,14 @@ declare module Ext.direct { export interface IManager extends Ext.IBase,Ext.util.IObservable { } export class Manager { + /** [Property] (Object) */ + static exceptions: any; + /** [Property] (Object) */ + static hasListeners: any; + /** [Property] (Boolean) */ + static isObservable: boolean; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Adds the specified events to the list of events which this Observable may fire * @param eventNames Object/String... Either an object with event names as properties with a value of true. For example: this.addEvents({ storeloaded: true, storecleared: true }); Or any number of event names as separate parameters. For example: this.addEvents('storeloaded', 'storecleared'); */ @@ -12231,6 +12509,14 @@ declare module Ext { export interface IDirect extends Ext.IBase,Ext.util.IObservable { } export class Direct { + /** [Property] (Object) */ + static exceptions: any; + /** [Property] (Object) */ + static hasListeners: any; + /** [Property] (Boolean) */ + static isObservable: boolean; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Adds the specified events to the list of events which this Observable may fire * @param eventNames Object/String... Either an object with event names as properties with a value of true. For example: this.addEvents({ storeloaded: true, storecleared: true }); Or any number of event names as separate parameters. For example: this.addEvents('storeloaded', 'storecleared'); */ @@ -15534,6 +15820,12 @@ declare module Ext.dom { export interface IQuery { } export class Query { + /** [Property] (Object) */ + static matchers: any; + /** [Property] (Object) */ + static operators: any; + /** [Property] (Object) */ + static pseudos: any; /** [Method] Compiles a selector xpath query into a reusable function * @param selector String The selector/xpath query * @param type String Either "select" or "simple" for a simple selector match @@ -15593,6 +15885,12 @@ declare module Ext { export interface IDomQuery { } export class DomQuery { + /** [Property] (Object) */ + static matchers: any; + /** [Property] (Object) */ + static operators: any; + /** [Property] (Object) */ + static pseudos: any; /** [Method] Compiles a selector xpath query into a reusable function * @param selector String The selector/xpath query * @param type String Either "select" or "simple" for a simple selector match @@ -15652,6 +15950,12 @@ declare module Ext.core { export interface IDomQuery { } export class DomQuery { + /** [Property] (Object) */ + static matchers: any; + /** [Property] (Object) */ + static operators: any; + /** [Property] (Object) */ + static pseudos: any; /** [Method] Compiles a selector xpath query into a reusable function * @param selector String The selector/xpath query * @param type String Either "select" or "simple" for a simple selector match @@ -15711,6 +16015,10 @@ declare module Ext { export interface IDomHelper extends Ext.dom.IHelper { } export class DomHelper { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Boolean) */ + static useDom: boolean; /** [Method] Creates new DOM element s and appends them to el * @param el String/HTMLElement/Ext.Element The context element * @param o Object/String The DOM object spec (and children) or raw HTML blob @@ -15819,6 +16127,10 @@ declare module Ext.core { export interface IDomHelper extends Ext.dom.IHelper { } export class DomHelper { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Boolean) */ + static useDom: boolean; /** [Method] Creates new DOM element s and appends them to el * @param el String/HTMLElement/Ext.Element The context element * @param o Object/String The DOM object spec (and children) or raw HTML blob @@ -16128,6 +16440,8 @@ declare module Ext.draw { export interface IDraw extends Ext.IBase { } export class Draw { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -16179,6 +16493,20 @@ declare module Ext.draw.engine { export interface IImageExporter extends Ext.IBase { } export class ImageExporter { + /** [Property] (String) */ + static defaultUrl: string; + /** [Property] (String) */ + static heightParam: string; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Array) */ + static supportedTypes: any[]; + /** [Property] (String) */ + static svgParam: string; + /** [Property] (String) */ + static typeParam: string; + /** [Property] (String) */ + static widthParam: string; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -16264,6 +16592,8 @@ declare module Ext.draw.engine { export interface ISvgExporter extends Ext.IBase { } export class SvgExporter { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -17365,6 +17695,8 @@ declare module Ext { export interface IEventManager { } export class EventManager { + /** [Property] (Object) */ + static idleEvent: any; /** [Method] Appends an event handler to an element * @param el String/Ext.Element/HTMLElement/Window The html element or id to assign the event handler to. * @param eventName String The name of the event to listen for. @@ -17486,6 +17818,188 @@ declare module Ext { export interface IEventObject { } export class EventObject { + /** [Property] (Number) */ + static A: number; + /** [Property] (Number) */ + static ALT: number; + /** [Property] (Number) */ + static B: number; + /** [Property] (Number) */ + static BACKSPACE: number; + /** [Property] (Number) */ + static C: number; + /** [Property] (Number) */ + static CAPS_LOCK: number; + /** [Property] (Number) */ + static CONTEXT_MENU: number; + /** [Property] (Number) */ + static CTRL: number; + /** [Property] (Number) */ + static D: number; + /** [Property] (Number) */ + static DELETE: number; + /** [Property] (Number) */ + static DOWN: number; + /** [Property] (Number) */ + static E: number; + /** [Property] (Number) */ + static EIGHT: number; + /** [Property] (Number) */ + static END: number; + /** [Property] (Number) */ + static ENTER: number; + /** [Property] (Number) */ + static ESC: number; + /** [Property] (Number) */ + static F: number; + /** [Property] (Number) */ + static F1: number; + /** [Property] (Number) */ + static F10: number; + /** [Property] (Number) */ + static F11: number; + /** [Property] (Number) */ + static F12: number; + /** [Property] (Number) */ + static F2: number; + /** [Property] (Number) */ + static F3: number; + /** [Property] (Number) */ + static F4: number; + /** [Property] (Number) */ + static F5: number; + /** [Property] (Number) */ + static F6: number; + /** [Property] (Number) */ + static F7: number; + /** [Property] (Number) */ + static F8: number; + /** [Property] (Number) */ + static F9: number; + /** [Property] (Number) */ + static FIVE: number; + /** [Property] (Number) */ + static FOUR: number; + /** [Property] (Number) */ + static G: number; + /** [Property] (Number) */ + static H: number; + /** [Property] (Number) */ + static HOME: number; + /** [Property] (Number) */ + static I: number; + /** [Property] (Number) */ + static INSERT: number; + /** [Property] (Number) */ + static J: number; + /** [Property] (Number) */ + static K: number; + /** [Property] (Number) */ + static L: number; + /** [Property] (Number) */ + static LEFT: number; + /** [Property] (Number) */ + static M: number; + /** [Property] (Number) */ + static N: number; + /** [Property] (Number) */ + static NINE: number; + /** [Property] (Number) */ + static NUM_CENTER: number; + /** [Property] (Number) */ + static NUM_DIVISION: number; + /** [Property] (Number) */ + static NUM_EIGHT: number; + /** [Property] (Number) */ + static NUM_FIVE: number; + /** [Property] (Number) */ + static NUM_FOUR: number; + /** [Property] (Number) */ + static NUM_MINUS: number; + /** [Property] (Number) */ + static NUM_MULTIPLY: number; + /** [Property] (Number) */ + static NUM_NINE: number; + /** [Property] (Number) */ + static NUM_ONE: number; + /** [Property] (Number) */ + static NUM_PERIOD: number; + /** [Property] (Number) */ + static NUM_PLUS: number; + /** [Property] (Number) */ + static NUM_SEVEN: number; + /** [Property] (Number) */ + static NUM_SIX: number; + /** [Property] (Number) */ + static NUM_THREE: number; + /** [Property] (Number) */ + static NUM_TWO: number; + /** [Property] (Number) */ + static NUM_ZERO: number; + /** [Property] (Number) */ + static O: number; + /** [Property] (Number) */ + static ONE: number; + /** [Property] (Number) */ + static P: number; + /** [Property] (Number) */ + static PAGE_DOWN: number; + /** [Property] (Number) */ + static PAGE_UP: number; + /** [Property] (Number) */ + static PAUSE: number; + /** [Property] (Number) */ + static PRINT_SCREEN: number; + /** [Property] (Number) */ + static Q: number; + /** [Property] (Number) */ + static R: number; + /** [Property] (Number) */ + static RETURN: number; + /** [Property] (Number) */ + static RIGHT: number; + /** [Property] (Number) */ + static S: number; + /** [Property] (Number) */ + static SEVEN: number; + /** [Property] (Number) */ + static SHIFT: number; + /** [Property] (Number) */ + static SIX: number; + /** [Property] (Number) */ + static SPACE: number; + /** [Property] (Number) */ + static T: number; + /** [Property] (Number) */ + static TAB: number; + /** [Property] (Number) */ + static THREE: number; + /** [Property] (Number) */ + static TWO: number; + /** [Property] (Number) */ + static U: number; + /** [Property] (Number) */ + static UP: number; + /** [Property] (Number) */ + static V: number; + /** [Property] (Number) */ + static W: number; + /** [Property] (Number) */ + static WHEEL_SCALE: number; + /** [Property] (Number) */ + static X: number; + /** [Property] (Number) */ + static Y: number; + /** [Property] (Number) */ + static Z: number; + /** [Property] (Number) */ + static ZERO: number; + /** [Property] (Boolean) */ + static altKey: boolean; + /** [Property] (Boolean) */ + static ctrlKey: boolean; + /** [Property] (Boolean) */ + static shiftKey: boolean; /** [Method] Correctly scales a given wheel delta * @param delta Number The delta value. */ @@ -17655,6 +18169,18 @@ declare module Ext { export interface IFocusManager extends Ext.IBase,Ext.util.IObservable { } export class FocusManager { + /** [Property] (Boolean) */ + static enabled: boolean; + /** [Property] (Ext.Component) */ + static focusedCmp: Ext.IComponent; + /** [Property] (Object) */ + static hasListeners: any; + /** [Property] (Boolean) */ + static isObservable: boolean; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (String[]) */ + static whitelist: string[]; /** [Method] Adds the specified events to the list of events which this Observable may fire * @param eventNames Object/String... Either an object with event names as properties with a value of true. For example: this.addEvents({ storeloaded: true, storecleared: true }); Or any number of event names as separate parameters. For example: this.addEvents('storeloaded', 'storecleared'); */ @@ -17814,6 +18340,18 @@ declare module Ext { export interface IFocusMgr extends Ext.IBase,Ext.util.IObservable { } export class FocusMgr { + /** [Property] (Boolean) */ + static enabled: boolean; + /** [Property] (Ext.Component) */ + static focusedCmp: Ext.IComponent; + /** [Property] (Object) */ + static hasListeners: any; + /** [Property] (Boolean) */ + static isObservable: boolean; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (String[]) */ + static whitelist: string[]; /** [Method] Adds the specified events to the list of events which this Observable may fire * @param eventNames Object/String... Either an object with event names as properties with a value of true. For example: this.addEvents({ storeloaded: true, storecleared: true }); Or any number of event names as separate parameters. For example: this.addEvents('storeloaded', 'storecleared'); */ @@ -18483,6 +19021,18 @@ declare module Ext.form { export interface ICheckboxManager extends Ext.util.IMixedCollection { } export class CheckboxManager { + /** [Property] (Object) */ + static hasListeners: any; + /** [Property] (Boolean) */ + static isMixedCollection: boolean; + /** [Property] (Boolean) */ + static isObservable: boolean; + /** [Property] (Boolean) */ + static isSortable: boolean; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Ext.util.MixedCollection) */ + static sorters: Ext.util.IMixedCollection; /** [Method] Adds an item to the collection * @param key String/Object The key to associate with the item, or the new item. If a getKey implementation was specified for this MixedCollection, or if the key of the stored items is in a property called id, the MixedCollection will be able to derive the key for the new item. In this case just pass the new item in this parameter. * @param obj Object The item to add. @@ -22519,6 +23069,22 @@ declare module Ext.form.field { export interface IVTypes extends Ext.IBase { } export class VTypes { + /** [Property] (RegExp) */ + static alphaMask: RegExp; + /** [Property] (String) */ + static alphaText: string; + /** [Property] (RegExp) */ + static alphanumMask: RegExp; + /** [Property] (String) */ + static alphanumText: string; + /** [Property] (RegExp) */ + static emailMask: RegExp; + /** [Property] (String) */ + static emailText: string; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (String) */ + static urlText: string; /** [Method] The function used to validate alpha values * @param value String The value * @returns Boolean true if the RegExp test passed, and false if not. @@ -22574,6 +23140,22 @@ declare module Ext.form { export interface IVTypes extends Ext.IBase { } export class VTypes { + /** [Property] (RegExp) */ + static alphaMask: RegExp; + /** [Property] (String) */ + static alphaText: string; + /** [Property] (RegExp) */ + static alphanumMask: RegExp; + /** [Property] (String) */ + static alphanumText: string; + /** [Property] (RegExp) */ + static emailMask: RegExp; + /** [Property] (String) */ + static emailText: string; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (String) */ + static urlText: string; /** [Method] The function used to validate alpha values * @param value String The value * @returns Boolean true if the RegExp test passed, and false if not. @@ -23225,6 +23807,18 @@ declare module Ext.form { export interface IRadioManager extends Ext.util.IMixedCollection { } export class RadioManager { + /** [Property] (Object) */ + static hasListeners: any; + /** [Property] (Boolean) */ + static isMixedCollection: boolean; + /** [Property] (Boolean) */ + static isObservable: boolean; + /** [Property] (Boolean) */ + static isSortable: boolean; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Ext.util.MixedCollection) */ + static sorters: Ext.util.IMixedCollection; /** [Method] Adds an item to the collection * @param key String/Object The key to associate with the item, or the new item. If a getKey implementation was specified for this MixedCollection, or if the key of the stored items is in a property called id, the MixedCollection will be able to derive the key for the new item. In this case just pass the new item in this parameter. * @param obj Object The item to add. @@ -24078,6 +24672,8 @@ declare module Ext.fx { export interface ICubicBezier extends Ext.IBase { } export class CubicBezier { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -24119,6 +24715,12 @@ declare module Ext.fx { export interface IManager extends Ext.IBase,Ext.fx.IQueue { } export class Manager { + /** [Config Option] (Boolean) */ + static forceJS: boolean; + /** [Config Option] (Number) */ + static interval: number; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Add an Anim to the manager * @param anim Ext.fx.Anim */ @@ -25947,6 +26549,32 @@ declare module Ext { export interface IIs { } export class Is { + /** [Property] (Boolean) */ + static Android: boolean; + /** [Property] (Boolean) */ + static Blackberry: boolean; + /** [Property] (Boolean) */ + static Desktop: boolean; + /** [Property] (Boolean) */ + static Linux: boolean; + /** [Property] (Boolean) */ + static Mac: boolean; + /** [Property] (Boolean) */ + static Phone: boolean; + /** [Property] (Boolean) */ + static Standalone: boolean; + /** [Property] (Object) */ + static Tablet: any; + /** [Property] (Boolean) */ + static Windows: boolean; + /** [Property] (Boolean) */ + static iOS: boolean; + /** [Property] (Boolean) */ + static iPad: boolean; + /** [Property] (Boolean) */ + static iPhone: boolean; + /** [Property] (Boolean) */ + static iPod: boolean; } } declare module Ext { @@ -28611,6 +29239,24 @@ declare module Ext { export interface ILoader { } export class Loader { + /** [Config Option] (Boolean) */ + static disableCaching: boolean; + /** [Config Option] (String) */ + static disableCachingParam: string; + /** [Config Option] (Boolean) */ + static enabled: boolean; + /** [Config Option] (Boolean) */ + static garbageCollect: boolean; + /** [Config Option] (Object) */ + static paths: any; + /** [Config Option] (Boolean) */ + static preserveScripts: boolean; + /** [Config Option] (Boolean) */ + static scriptChainDelay: boolean; + /** [Config Option] (String) */ + static scriptCharset: string; + /** [Property] (Array) */ + static history: any[]; /** [Method] Sets a batch of path entries * @param paths Object a set of className: path mappings * @returns Ext.Loader this @@ -29056,6 +29702,8 @@ declare module Ext.menu { export interface IManager extends Ext.IBase { } export class Manager { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -29100,6 +29748,8 @@ declare module Ext.menu { export interface IMenuMgr extends Ext.IBase { } export class MenuMgr { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -29206,6 +29856,76 @@ declare module Ext { export interface IMessageBox extends Ext.window.IMessageBox { } export class MessageBox { + /** [Property] (Number) */ + static CANCEL: number; + /** [Property] (String) */ + static ERROR: string; + /** [Property] (String) */ + static INFO: string; + /** [Property] (Number) */ + static NO: number; + /** [Property] (Number) */ + static OK: number; + /** [Property] (Number) */ + static OKCANCEL: number; + /** [Property] (String) */ + static QUESTION: string; + /** [Property] (String) */ + static WARNING: string; + /** [Property] (Number) */ + static YES: number; + /** [Property] (Number) */ + static YESNO: number; + /** [Property] (Number) */ + static YESNOCANCEL: number; + /** [Property] (Boolean) */ + static _isLayoutRoot: boolean; + /** [Property] (Ext.dom.Element) */ + static body: Ext.dom.IElement; + /** [Property] (Object) */ + static buttonText: any; + /** [Property] (String) */ + static contentPaddingProperty: string; + /** [Property] (Ext.util.ComponentDragger) */ + static dd: Ext.util.IComponentDragger; + /** [Property] (Number) */ + static defaultTextHeight: number; + /** [Property] (Boolean) */ + static draggable: boolean; + /** [Property] (Ext.Container) */ + static floatParent: Ext.IContainer; + /** [Property] (Object) */ + static frameSize: any; + /** [Property] (Object) */ + static hasListeners: any; + /** [Property] (Boolean) */ + static isComponent: boolean; + /** [Property] (Boolean) */ + static isObservable: boolean; + /** [Property] (Boolean) */ + static isPanel: boolean; + /** [Property] (Boolean) */ + static isWindow: boolean; + /** [Property] (Ext.util.AbstractMixedCollection) */ + static items: Ext.util.IAbstractMixedCollection; + /** [Property] (Boolean) */ + static maskOnDisable: boolean; + /** [Property] (Number) */ + static minProgressWidth: number; + /** [Property] (Number) */ + static minPromptWidth: number; + /** [Property] (Ext.Container) */ + static ownerCt: Ext.IContainer; + /** [Property] (Boolean) */ + static rendered: boolean; + /** [Property] (Object) */ + static scrollFlags: any; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Ext.ZIndexManager) */ + static zIndexManager: Ext.IZIndexManager; + /** [Property] (Ext.Container) */ + static zIndexParent: Ext.IContainer; /** [Method] Adds Component s to this Container * @param component Ext.Component[]|Object[]/Ext.Component.../Object... Either one or more Components to add or an Array of Components to add. See items for additional information. * @returns Ext.Component[]/Ext.Component The Components that were added. @@ -30292,6 +31012,76 @@ declare module Ext { export interface IMsg extends Ext.window.IMessageBox { } export class Msg { + /** [Property] (Number) */ + static CANCEL: number; + /** [Property] (String) */ + static ERROR: string; + /** [Property] (String) */ + static INFO: string; + /** [Property] (Number) */ + static NO: number; + /** [Property] (Number) */ + static OK: number; + /** [Property] (Number) */ + static OKCANCEL: number; + /** [Property] (String) */ + static QUESTION: string; + /** [Property] (String) */ + static WARNING: string; + /** [Property] (Number) */ + static YES: number; + /** [Property] (Number) */ + static YESNO: number; + /** [Property] (Number) */ + static YESNOCANCEL: number; + /** [Property] (Boolean) */ + static _isLayoutRoot: boolean; + /** [Property] (Ext.dom.Element) */ + static body: Ext.dom.IElement; + /** [Property] (Object) */ + static buttonText: any; + /** [Property] (String) */ + static contentPaddingProperty: string; + /** [Property] (Ext.util.ComponentDragger) */ + static dd: Ext.util.IComponentDragger; + /** [Property] (Number) */ + static defaultTextHeight: number; + /** [Property] (Boolean) */ + static draggable: boolean; + /** [Property] (Ext.Container) */ + static floatParent: Ext.IContainer; + /** [Property] (Object) */ + static frameSize: any; + /** [Property] (Object) */ + static hasListeners: any; + /** [Property] (Boolean) */ + static isComponent: boolean; + /** [Property] (Boolean) */ + static isObservable: boolean; + /** [Property] (Boolean) */ + static isPanel: boolean; + /** [Property] (Boolean) */ + static isWindow: boolean; + /** [Property] (Ext.util.AbstractMixedCollection) */ + static items: Ext.util.IAbstractMixedCollection; + /** [Property] (Boolean) */ + static maskOnDisable: boolean; + /** [Property] (Number) */ + static minProgressWidth: number; + /** [Property] (Number) */ + static minPromptWidth: number; + /** [Property] (Ext.Container) */ + static ownerCt: Ext.IContainer; + /** [Property] (Boolean) */ + static rendered: boolean; + /** [Property] (Object) */ + static scrollFlags: any; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Ext.ZIndexManager) */ + static zIndexManager: Ext.IZIndexManager; + /** [Property] (Ext.Container) */ + static zIndexParent: Ext.IContainer; /** [Method] Adds Component s to this Container * @param component Ext.Component[]|Object[]/Ext.Component.../Object... Either one or more Components to add or an Array of Components to add. See items for additional information. * @returns Ext.Component[]/Ext.Component The Components that were added. @@ -31378,6 +32168,12 @@ declare module Ext { export interface IModelManager extends Ext.IAbstractManager { } export class ModelManager { + /** [Property] (Ext.util.HashMap) */ + static all: Ext.util.IHashMap; + /** [Property] (Ext.data.association.Association[]) */ + static associationStack: Ext.data.association.IAssociation[]; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -31457,6 +32253,12 @@ declare module Ext { export interface IModelMgr extends Ext.IAbstractManager { } export class ModelMgr { + /** [Property] (Ext.util.HashMap) */ + static all: Ext.util.IHashMap; + /** [Property] (Ext.data.association.Association[]) */ + static associationStack: Ext.data.association.IAssociation[]; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -32385,6 +33187,8 @@ declare module Ext.perf { export interface IMonitor extends Ext.IBase { } export class Monitor { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -32420,6 +33224,8 @@ declare module Ext { export interface IPerf extends Ext.IBase { } export class Perf { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -32909,6 +33715,10 @@ declare module Ext { export interface IPluginManager extends Ext.IAbstractManager { } export class PluginManager { + /** [Property] (Ext.util.HashMap) */ + static all: Ext.util.IHashMap; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -32994,6 +33804,10 @@ declare module Ext { export interface IPluginMgr extends Ext.IAbstractManager { } export class PluginMgr { + /** [Property] (Ext.util.HashMap) */ + static all: Ext.util.IHashMap; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -33976,6 +34790,8 @@ declare module Ext { export interface IShadowPool extends Ext.IBase { } export class ShadowPool { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -34091,13 +34907,6 @@ declare module Ext.slider { * @param readOnly Object */ setReadOnly?( readOnly?:any ): void; - /** [Method] Programmatically sets the value of the Slider - * @param index Number/Number[] Index of the thumb to move. Alternatively, it can be an array of values to set for each thumb in the slider. - * @param value Number The value to set the slider to. (This will be constrained within minValue and maxValue) - * @param animate Boolean Turn on or off animation - * @returns any this - */ - setValue?( index?:any, value?:number, animate?:boolean ): any; /** [Method] Synchronizes thumbs position to the proper proportion of the total component width based on the current slider value */ syncThumbs?(): void; } @@ -34186,13 +34995,6 @@ declare module Ext.slider { * @param readOnly Object */ setReadOnly?( readOnly?:any ): void; - /** [Method] Programmatically sets the value of the Slider - * @param index Number/Number[] Index of the thumb to move. Alternatively, it can be an array of values to set for each thumb in the slider. - * @param value Number The value to set the slider to. (This will be constrained within minValue and maxValue) - * @param animate Boolean Turn on or off animation - * @returns any this - */ - setValue?( index?:any, value?:number, animate?:boolean ): any; /** [Method] Synchronizes thumbs position to the proper proportion of the total component width based on the current slider value */ syncThumbs?(): void; } @@ -34333,6 +35135,8 @@ declare module Ext.state { export interface IManager extends Ext.IBase { } export class Manager { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -34797,6 +35601,82 @@ declare module Ext { export interface ISupports { } export class Supports { + /** [Property] (Boolean) */ + static ArraySort: boolean; + /** [Property] (Boolean) */ + static AudioTag: boolean; + /** [Property] (Boolean) */ + static BoundingClientRect: boolean; + /** [Property] (Boolean) */ + static CSS3BorderRadius: boolean; + /** [Property] (Boolean) */ + static CSS3BoxShadow: boolean; + /** [Property] (Boolean) */ + static CSS3DTransform: boolean; + /** [Property] (Boolean) */ + static CSS3LinearGradient: boolean; + /** [Property] (Boolean) */ + static Canvas: boolean; + /** [Property] (Boolean) */ + static ClassList: boolean; + /** [Property] (Boolean) */ + static ComputedStyle: boolean; + /** [Property] (Boolean) */ + static CreateContextualFragment: boolean; + /** [Property] (Boolean) */ + static DeviceMotion: boolean; + /** [Property] (Boolean) */ + static Direct2DBug: boolean; + /** [Property] (Object) */ + static DisplayChangeInputSelectionBug: any; + /** [Property] (Object) */ + static DisplayChangeTextAreaSelectionBug: any; + /** [Property] (Boolean) */ + static Float: boolean; + /** [Property] (Boolean) */ + static GeoLocation: boolean; + /** [Property] (Boolean) */ + static GetPositionPercentage: boolean; + /** [Property] (Boolean) */ + static History: boolean; + /** [Property] (Object) */ + static LocalStorage: any; + /** [Property] (Boolean) */ + static MouseEnterLeave: boolean; + /** [Property] (Boolean) */ + static MouseWheel: boolean; + /** [Property] (Boolean) */ + static Opacity: boolean; + /** [Property] (Boolean) */ + static OrientationChange: boolean; + /** [Property] (Boolean) */ + static Placeholder: boolean; + /** [Property] (Boolean) */ + static PointerEvents: boolean; + /** [Property] (Boolean) */ + static Range: boolean; + /** [Property] (Boolean) */ + static RightMargin: boolean; + /** [Property] (Boolean) */ + static RotatedBoundingClientRect: boolean; + /** [Property] (Boolean) */ + static ScrollWidthInlinePaddingBug: boolean; + /** [Property] (Boolean) */ + static Svg: boolean; + /** [Property] (Boolean) */ + static TextAreaMaxLength: boolean; + /** [Property] (Boolean) */ + static TimeoutActualLateness: boolean; + /** [Property] (Boolean) */ + static Touch: boolean; + /** [Property] (Boolean) */ + static Transitions: boolean; + /** [Property] (Boolean) */ + static TransparentColor: boolean; + /** [Property] (Boolean) */ + static Vml: boolean; + /** [Property] (Boolean) */ + static WindowOnError: boolean; } } declare module Ext.tab { @@ -35119,6 +35999,8 @@ declare module Ext.tip { export interface IQuickTipManager extends Ext.IBase { } export class QuickTipManager { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -35185,6 +36067,8 @@ declare module Ext { export interface IQuickTips extends Ext.IBase { } export class QuickTips { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -36465,6 +37349,8 @@ declare module Ext.util { export interface ICookies extends Ext.IBase { } export class Cookies { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -36519,6 +37405,8 @@ declare module Ext.util { export interface ICSS extends Ext.IBase { } export class CSS { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -36733,6 +37621,16 @@ declare module Ext.util { export interface IFormat { } export class Format { + /** [Property] (Boolean) */ + static currencyAtEnd: boolean; + /** [Property] (Number) */ + static currencyPrecision: number; + /** [Property] (String) */ + static currencySign: string; + /** [Property] (String) */ + static decimalSeparator: string; + /** [Property] (String) */ + static thousandSeparator: string; /** [Method] Formats an object of name value properties as HTML element attribute values suitable for using when creating textual * @param attributes Object An object containing the HTML attributes as properties eg: {height:40, vAlign:'top'} */ @@ -37086,6 +37984,18 @@ declare module Ext.util { export interface IHistory extends Ext.IBase,Ext.util.IObservable { } export class History { + /** [Property] (String) */ + static fieldId: string; + /** [Property] (Object) */ + static hasListeners: any; + /** [Property] (String) */ + static iframeId: string; + /** [Property] (Boolean) */ + static isObservable: boolean; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Boolean) */ + static useTopWindow: boolean; /** [Method] Add a new token to the history stack * @param token String The value that defines a particular application-specific history state * @param preventDuplicates Boolean When true, if the passed token matches the current token it will not save a new history step. Set to false if the same state can be saved more than once at the same history stack location. @@ -37249,6 +38159,18 @@ declare module Ext { export interface IHistory extends Ext.IBase,Ext.util.IObservable { } export class History { + /** [Property] (String) */ + static fieldId: string; + /** [Property] (Object) */ + static hasListeners: any; + /** [Property] (String) */ + static iframeId: string; + /** [Property] (Boolean) */ + static isObservable: boolean; + /** [Property] (Ext.Class) */ + static self: Ext.IClass; + /** [Property] (Boolean) */ + static useTopWindow: boolean; /** [Method] Add a new token to the history stack * @param token String The value that defines a particular application-specific history state * @param preventDuplicates Boolean When true, if the passed token matches the current token it will not save a new history step. Set to false if the same state can be saved more than once at the same history stack location. @@ -37412,6 +38334,8 @@ declare module Ext.util { export interface IInflector extends Ext.IBase { } export class Inflector { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -38456,6 +39380,8 @@ declare module Ext.util { export interface ITaskManager extends Ext.util.ITaskRunner { } export class TaskManager { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -38509,6 +39435,8 @@ declare module Ext { export interface ITaskManager extends Ext.util.ITaskRunner { } export class TaskManager { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Call the original method that was previously overridden with override Ext define My Cat constructor functi * @param args Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments) * @returns Object Returns the result of calling the overridden method @@ -39692,6 +40620,8 @@ declare module Ext { export interface IWindowManager extends Ext.IZIndexManager { } export class WindowManager { + /** [Property] (Ext.Class) */ + static self: Ext.IClass; /** [Method] Brings the specified Component to the front of any other active Components in this ZIndexManager * @param comp String/Object The id of the Component or a Ext.Component instance * @returns Boolean True if the dialog was brought to the front, else false if it was already in front From 751cdfb539fcac6a78e571a4df09174064d3e955 Mon Sep 17 00:00:00 2001 From: Michel Salib Date: Wed, 11 Dec 2013 10:48:53 +0100 Subject: [PATCH 03/15] [Angular-ui-router] onExit/onEnter can be inline injected functions --- angular-ui/angular-ui-router.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/angular-ui/angular-ui-router.d.ts b/angular-ui/angular-ui-router.d.ts index 7f9c3869b..bc3e27c2d 100644 --- a/angular-ui/angular-ui-router.d.ts +++ b/angular-ui/angular-ui-router.d.ts @@ -19,8 +19,8 @@ declare module ng.ui { params?: any[]; views?: {}; abstract?: boolean; - onEnter?: Function; - onExit?: Function; + onEnter?: any; + onExit?: any; data?: any; } From 1e8f04b8f8a4f22a1b23c8cfbbda832529d88f30 Mon Sep 17 00:00:00 2001 From: Michel Salib Date: Wed, 11 Dec 2013 12:02:46 +0100 Subject: [PATCH 04/15] Add karma-jasmine extra definitions --- karma-jasmine/karma-jasmine-tests.ts | 7 +++++++ karma-jasmine/karma-jasmine.d.ts | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 karma-jasmine/karma-jasmine-tests.ts create mode 100644 karma-jasmine/karma-jasmine.d.ts diff --git a/karma-jasmine/karma-jasmine-tests.ts b/karma-jasmine/karma-jasmine-tests.ts new file mode 100644 index 000000000..6e7a8db9f --- /dev/null +++ b/karma-jasmine/karma-jasmine-tests.ts @@ -0,0 +1,7 @@ +/// + +ddescribe("A suite", () => { + iit("contains spec with an expectation", () => { + expect(true).toBe(true); + }); +}); diff --git a/karma-jasmine/karma-jasmine.d.ts b/karma-jasmine/karma-jasmine.d.ts new file mode 100644 index 000000000..92b5e962d --- /dev/null +++ b/karma-jasmine/karma-jasmine.d.ts @@ -0,0 +1,9 @@ +// Type definitions for karma-jasmine plugin +// Project: https://github.com/karma-runner/karma-jasmine +// Definitions by: Michel Salib +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare function ddescribe(description: string, specDefinitions: () => void): void; +declare function iit(expectation: string, assertion: () => void): void; From 2661fd4a9a50906a55bd3896f97226504e4fa060 Mon Sep 17 00:00:00 2001 From: Dan Spencer Date: Wed, 11 Dec 2013 12:15:34 +0000 Subject: [PATCH 05/15] Added definition file for Promptly --- promptly/promptly-tests.ts | 86 ++++++++++++++++++++++++++++++++++++++ promptly/promptly.d.ts | 34 +++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 promptly/promptly-tests.ts create mode 100644 promptly/promptly.d.ts diff --git a/promptly/promptly-tests.ts b/promptly/promptly-tests.ts new file mode 100644 index 000000000..b18578be5 --- /dev/null +++ b/promptly/promptly-tests.ts @@ -0,0 +1,86 @@ +/// +/// + +import promptly = require('promptly'); + +process.stdin + +// Options +var options: promptly.Options = {} +options = { + default: 'value' +} +options = { + trim: false +} +options = { + retry: false +} +options = { + silent: false +} +options = { + input: process.stdin +} +options = { + output: process.stdout +} + +// Validator +options = { + validator: () => {} +} +options = { + validator: (value: string) => {} +} +options = { + validator: (value: string) => { + return 'result'; + } +} +options = { + validator: [ + (value: string) => { return 'result' }, + (value: string) => { return 'result' } + ] +} + +// Prompt +promptly.prompt('hello world'); +promptly.prompt('hello world', options); +promptly.prompt('hello world', () => { + +}); +promptly.prompt('hello world', options, (err: Error, value: string) => { + +}); + +// Password +promptly.password('hello world'); +promptly.password('hello world', options); +promptly.password('hello world', () => { + +}); +promptly.password('hello world', options, (err: Error, value: string) => { + +}); + +// Confirm +promptly.confirm('hello world'); +promptly.confirm('hello world', options); +promptly.confirm('hello world', () => { + +}); +promptly.confirm('hello world', options, (err: Error, value: string) => { + +}); + +// Choose +promptly.choose('hello world', ['test1', 'test2']); +promptly.choose('hello world', ['test1', 'test2'], options); +promptly.choose('hello world', ['test1', 'test2'], () => { + +}); +promptly.choose('hello world', ['test1', 'test2'], options, (err: Error, value: string) => { + +}); \ No newline at end of file diff --git a/promptly/promptly.d.ts b/promptly/promptly.d.ts new file mode 100644 index 000000000..2ad8f3310 --- /dev/null +++ b/promptly/promptly.d.ts @@ -0,0 +1,34 @@ +// Type definitions for node-promptly 1.1.1 +// Project: https://github.com/IndigoUnited/node-promptly +// Definitions by: Dan Spencer +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "promptly" { + + interface Callback { + (err: Error, value: string): void; + } + + export interface Options { + default?: string; + trim?: boolean; + validator?: any; + retry?: boolean; + silent?: boolean; + input?: ReadableStream; + output?: WritableStream; + } + + export function prompt(message: string, fn?: Callback); + export function prompt(message: string, opts: Options, fn?: Callback); + + export function password(message: string, fn?: Callback); + export function password(message: string, opts: Options, fn?: Callback); + + export function confirm(message: string, fn?: Callback); + export function confirm(message: string, opts: Options, fn?: Callback); + + export function choose(message: string, choices: string[], fn?: Callback); + export function choose(message: string, choices: string[], opts: Options, fn?: Callback); + +} \ No newline at end of file From f56e4880dfa50ca5400e1fb0b1f6f5069d15aa86 Mon Sep 17 00:00:00 2001 From: timbow574521 Date: Wed, 11 Dec 2013 16:44:11 -0500 Subject: [PATCH 06/15] Add suport for Google BarChart. --- .../google.visualization.d.ts | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/google.visualization/google.visualization.d.ts b/google.visualization/google.visualization.d.ts index e9888a64c..a08f73997 100644 --- a/google.visualization/google.visualization.d.ts +++ b/google.visualization/google.visualization.d.ts @@ -404,6 +404,57 @@ declare module google { width?: number; } + //#endregion + //#region BarChart + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/barchart#Configuration_Options + export interface BarChartOptions { + aggregationTarget?: string; + animation?: TransitionAnimation; + axisTitlesPosition?: string; // in, out, none + backgroundColor?: any; + bar?: ColumnChartBarOptions; + chartArea?: ChartArea; + colors?: string[]; + dataOpacity?: number; + enableInteractivity?: boolean; + focusTarget?: string; + fontSize?: number; + fontName?: string; + hAxis?: ChartAxis; + height?: number; + isStacked?: boolean; + legend?: ChartLegend; + reverseCategories?: boolean; + series?: any; + theme?: string; + title?: string; + titlePosition?: string; + titleTextStyle?: ChartTextStyle; + tooltip?: ChartTooltip; + vAxes?: any; + vAxis?: ChartAxis; + width?: number; + } + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/barchart + export class BarChart { + constructor(element: Element); + draw(data: DataTable, options: BarChartOptions): void; + draw(data: DataView, options: BarChartOptions): void; + getBoundingBox(id: string): ChartBoundingBox; + getChartAreaBoundingBox(): ChartBoundingBox; + getChartLayoutInterface(): ChartLayoutInterface; + getHAxisValue(position: number, axisIndex?: number): number; + getVAxisValue(position: number, axisIndex?: number): number; + getXLocation(position: number, axisIndex?: number): number; + getYLocation(position: number, axisIndex?: number): number; + getSelection(): any[]; + setSelection(selection: any[]): void; + clearChart(): void; + + } + //#endregion //#region Events From dd476daddddfca5ea31da39b0bd878de11999b29 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Dec 2013 10:06:42 +1100 Subject: [PATCH 07/15] add node def reference --- promptly/promptly.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/promptly/promptly.d.ts b/promptly/promptly.d.ts index 2ad8f3310..ed30f2f3b 100644 --- a/promptly/promptly.d.ts +++ b/promptly/promptly.d.ts @@ -3,6 +3,8 @@ // Definitions by: Dan Spencer // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module "promptly" { interface Callback { @@ -31,4 +33,4 @@ declare module "promptly" { export function choose(message: string, choices: string[], fn?: Callback); export function choose(message: string, choices: string[], opts: Options, fn?: Callback); -} \ No newline at end of file +} From a11a5d90e6abd043953deb67fc4fa5f6bb45282e Mon Sep 17 00:00:00 2001 From: Mark Wong Siang Kai Date: Wed, 11 Dec 2013 16:12:31 -0800 Subject: [PATCH 08/15] Specified typings for functions returning void -- note that removeKeyMap in codemirror.js returns true sometimes -- but I think it should only return --- codemirror/codemirror.d.ts | 176 ++++++++++++++++++------------------- 1 file changed, 88 insertions(+), 88 deletions(-) diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts index 03dc2878f..97568dbdc 100644 --- a/codemirror/codemirror.d.ts +++ b/codemirror/codemirror.d.ts @@ -10,77 +10,77 @@ declare module CodeMirror { /** If you want to define extra methods in terms of the CodeMirror API, it is possible to use defineExtension. This will cause the given value(usually a method) to be added to all CodeMirror instances created from then on. */ - function defineExtension(name: string, value: any); + function defineExtension(name: string, value: any): void; /** Like defineExtension, but the method will be added to the interface for Doc objects instead. */ - function defineDocExtension(name: string, value: any); + function defineDocExtension(name: string, value: any): void; /** Similarly, defineOption can be used to define new options for CodeMirror. The updateFunc will be called with the editor instance and the new value when an editor is initialized, and whenever the option is modified through setOption. */ - function defineOption(name: string, default_: any, updateFunc: Function); + function defineOption(name: string, default_: any, updateFunc: Function): void; /** If your extention just needs to run some code whenever a CodeMirror instance is initialized, use CodeMirror.defineInitHook. Give it a function as its only argument, and from then on, that function will be called (with the instance as argument) whenever a new CodeMirror instance is initialized. */ - function defineInitHook(func: Function); + function defineInitHook(func: Function): void; - function on(element: any, eventName: string, handler: Function); - function off(element: any, eventName: string, handler: Function); + function on(element: any, eventName: string, handler: Function): void; + function off(element: any, eventName: string, handler: Function): void; /** Fired whenever a change occurs to the document. changeObj has a similar type as the object passed to the editor's "change" event, but it never has a next property, because document change events are not batched (whereas editor change events are). */ - function on(doc: Doc, eventName: 'change', handler: (instance: Doc, change: EditorChange) => void ); - function off(doc: Doc, eventName: 'change', handler: (instance: Doc, change: EditorChange) => void ); + function on(doc: Doc, eventName: 'change', handler: (instance: Doc, change: EditorChange) => void ): void; + function off(doc: Doc, eventName: 'change', handler: (instance: Doc, change: EditorChange) => void ): void; /** See the description of the same event on editor instances. */ - function on(doc: Doc, eventName: 'beforeChange', handler: (instance: Doc, change: EditorChangeCancellable) => void ); - function off(doc: Doc, eventName: 'beforeChange', handler: (instance: Doc, change: EditorChangeCancellable) => void ); + function on(doc: Doc, eventName: 'beforeChange', handler: (instance: Doc, change: EditorChangeCancellable) => void ): void; + function off(doc: Doc, eventName: 'beforeChange', handler: (instance: Doc, change: EditorChangeCancellable) => void ): void; /** Fired whenever the cursor or selection in this document changes. */ - function on(doc: Doc, eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void ); - function off(doc: Doc, eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void ); + function on(doc: Doc, eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void ): void; + function off(doc: Doc, eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void ): void; /** Equivalent to the event by the same name as fired on editor instances. */ - function on(doc: Doc, eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: Position; anchor: Position; }) => void ); - function off(doc: Doc, eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: Position; anchor: Position; }) => void ); + function on(doc: Doc, eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: Position; anchor: Position; }) => void ): void; + function off(doc: Doc, eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: Position; anchor: Position; }) => void ): void; /** Will be fired when the line object is deleted. A line object is associated with the start of the line. Mostly useful when you need to find out when your gutter markers on a given line are removed. */ - function on(line: LineHandle, eventName: 'delete', handler: () => void ); - function off(line: LineHandle, eventName: 'delete', handler: () => void ); + function on(line: LineHandle, eventName: 'delete', handler: () => void ): void; + function off(line: LineHandle, eventName: 'delete', handler: () => void ): void; /** Fires when the line's text content is changed in any way (but the line is not deleted outright). The change object is similar to the one passed to change event on the editor object. */ - function on(line: LineHandle, eventName: 'change', handler: (line: LineHandle, change: EditorChange) => void ); - function off(line: LineHandle, eventName: 'change', handler: (line: LineHandle, change: EditorChange) => void ); + function on(line: LineHandle, eventName: 'change', handler: (line: LineHandle, change: EditorChange) => void ): void; + function off(line: LineHandle, eventName: 'change', handler: (line: LineHandle, change: EditorChange) => void ): void; /** Fired when the cursor enters the marked range. From this event handler, the editor state may be inspected but not modified, with the exception that the range on which the event fires may be cleared. */ - function on(marker: TextMarker, eventName: 'beforeCursorEnter', handler: () => void ); - function off(marker: TextMarker, eventName: 'beforeCursorEnter', handler: () => void ); + function on(marker: TextMarker, eventName: 'beforeCursorEnter', handler: () => void ): void; + function off(marker: TextMarker, eventName: 'beforeCursorEnter', handler: () => void ): void; /** Fired when the range is cleared, either through cursor movement in combination with clearOnEnter or through a call to its clear() method. Will only be fired once per handle. Note that deleting the range through text editing does not fire this event, because an undo action might bring the range back into existence. */ - function on(marker: TextMarker, eventName: 'clear', handler: () => void ); - function off(marker: TextMarker, eventName: 'clear', handler: () => void ); + function on(marker: TextMarker, eventName: 'clear', handler: () => void ): void; + function off(marker: TextMarker, eventName: 'clear', handler: () => void ): void; /** Fired when the last part of the marker is removed from the document by editing operations. */ - function on(marker: TextMarker, eventName: 'hide', handler: () => void ); - function off(marker: TextMarker, eventName: 'hide', handler: () => void ); + function on(marker: TextMarker, eventName: 'hide', handler: () => void ): void; + function off(marker: TextMarker, eventName: 'hide', handler: () => void ): void; /** Fired when, after the marker was removed by editing, a undo operation brought the marker back. */ - function on(marker: TextMarker, eventName: 'unhide', handler: () => void ); - function off(marker: TextMarker, eventName: 'unhide', handler: () => void ); + function on(marker: TextMarker, eventName: 'unhide', handler: () => void ): void; + function off(marker: TextMarker, eventName: 'unhide', handler: () => void ): void; /** Fired whenever the editor re-adds the widget to the DOM. This will happen once right after the widget is added (if it is scrolled into view), and then again whenever it is scrolled out of view and back in again, or when changes to the editor options or the line the widget is on require the widget to be redrawn. */ - function on(line: LineWidget, eventName: 'redraw', handler: () => void ); - function off(line: LineWidget, eventName: 'redraw', handler: () => void ); + function on(line: LineWidget, eventName: 'redraw', handler: () => void ): void; + function off(line: LineWidget, eventName: 'redraw', handler: () => void ): void; interface Editor { @@ -100,7 +100,7 @@ declare module CodeMirror { /** Change the configuration of the editor. option should the name of an option, and value should be a valid value for that option. */ - setOption(option: string, value: any); + setOption(option: string, value: any): void; /** Retrieves the current value of the given option for this editor instance. */ getOption(option: string): any; @@ -110,21 +110,21 @@ declare module CodeMirror { Maps added in this way have a higher precedence than the extraKeys and keyMap options, and between them, the maps added earlier have a lower precedence than those added later, unless the bottom argument was passed, in which case they end up below other keymaps added with this method. */ - addKeyMap(map: any, bottom?: boolean); + addKeyMap(map: any, bottom?: boolean): void; /** Disable a keymap added with addKeyMap.Either pass in the keymap object itself , or a string, which will be compared against the name property of the active keymaps. */ - removeKeyMap(map: any); + removeKeyMap(map: any): void; /** Enable a highlighting overlay.This is a stateless mini - mode that can be used to add extra highlighting. For example, the search add - on uses it to highlight the term that's currently being searched. mode can be a mode spec or a mode object (an object with a token method). The options parameter is optional. If given, it should be an object. Currently, only the opaque option is recognized. This defaults to off, but can be given to allow the overlay styling, when not null, to override the styling of the base mode entirely, instead of the two being applied together. */ - addOverlay(mode: any, options?: any); + addOverlay(mode: any, options?: any): void; /** Pass this the exact argument passed for the mode parameter to addOverlay to remove an overlay again. */ - removeOverlay(mode: any); + removeOverlay(mode: any): void; /** Retrieve the currently active document from an editor. */ @@ -140,7 +140,7 @@ declare module CodeMirror { setGutterMarker(line: any, gutterID: string, value: HTMLElement): CodeMirror.LineHandle; /** Remove all gutter markers in the gutter with the given ID. */ - clearGutter(gutterID: string); + clearGutter(gutterID: string): void; /** Set a CSS class name for the given line.line can be a number or a line handle. where determines to which element this class should be applied, can can be one of "text" (the text element, which lies in front of the selection), @@ -171,7 +171,7 @@ declare module CodeMirror { /** Puts node, which should be an absolutely positioned DOM node, into the editor, positioned right below the given { line , ch } position. When scrollIntoView is true, the editor will ensure that the entire node is visible (if possible). To remove the widget again, simply use DOM methods (move it somewhere else, or call removeChild on its parent). */ - addWidget(pos: CodeMirror.Position, node: HTMLElement, scrollIntoView: boolean); + addWidget(pos: CodeMirror.Position, node: HTMLElement, scrollIntoView: boolean): void; /** Adds a line widget, an element shown below a line, spanning the whole of the editor's width, and moving the lines below it downwards. line should be either an integer or a line handle, and node should be a DOM node, which will be displayed below the given line. @@ -192,10 +192,10 @@ declare module CodeMirror { /** Programatically set the size of the editor (overriding the applicable CSS rules). width and height height can be either numbers(interpreted as pixels) or CSS units ("100%", for example). You can pass null for either of them to indicate that that dimension should not be changed. */ - setSize(width: any, height: any); + setSize(width: any, height: any): void; /** Scroll the editor to a given(pixel) position.Both arguments may be left as null or undefined to have no effect. */ - scrollTo(x: number, y: number); + scrollTo(x: number, y: number): void; /** Get an { left , top , width , height , clientWidth , clientHeight } object that represents the current scroll position, the size of the scrollable area, and the size of the visible area(minus scrollbars). */ @@ -210,11 +210,11 @@ declare module CodeMirror { /** Scrolls the given element into view. pos is a { line , ch } position, referring to a given character, null, to refer to the cursor. The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */ - scrollIntoView(pos: CodeMirror.Position, margin?: number); + scrollIntoView(pos: CodeMirror.Position, margin?: number): void; /** Scrolls the given element into view. pos is a { left , top , right , bottom } object, in editor-local coordinates. The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */ - scrollIntoView(pos: { left: number; top: number; right: number; bottom: number; }, margin: number); + scrollIntoView(pos: { left: number; top: number; right: number; bottom: number; }, margin: number): void; /** Returns an { left , top , bottom } object containing the coordinates of the cursor position. If mode is "local" , they will be relative to the top-left corner of the editable document. @@ -251,7 +251,7 @@ declare module CodeMirror { /** If your code does something to change the size of the editor element (window resizes are already listened for), or unhides it, you should probably follow up by calling this method to ensure CodeMirror is still looking as intended. */ - refresh(); + refresh(): void; /** Retrieves information about the token the current mode found before the given position (a {line, ch} object). */ @@ -285,11 +285,11 @@ declare module CodeMirror { "smart" Use the mode's smart indentation if available, behave like "prev" otherwise. "add" Increase the indentation of the line by one indent unit. "subtract" Reduce the indentation of the line. */ - indentLine(line: number, dir?: string); + indentLine(line: number, dir?: string): void; /** Give the editor focus. */ - focus(); + focus(): void; /** Returns the hidden textarea used to read input. */ getInputField(): HTMLTextAreaElement; @@ -308,61 +308,61 @@ declare module CodeMirror { /** Events are registered with the on method (and removed with the off method). These are the events that fire on the instance object. The name of the event is followed by the arguments that will be passed to the handler. The instance argument always refers to the editor instance. */ - on(eventName: string, handler: (instance: CodeMirror.Editor) => void ); - off(eventName: string, handler: (instance: CodeMirror.Editor) => void ); + on(eventName: string, handler: (instance: CodeMirror.Editor) => void ): void; + off(eventName: string, handler: (instance: CodeMirror.Editor) => void ): void; /** Fires every time the content of the editor is changed. */ - on(eventName: 'change', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeLinkedList) => void ); - off(eventName: 'change', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeLinkedList) => void ); + on(eventName: 'change', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeLinkedList) => void ): void; + off(eventName: 'change', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeLinkedList) => void ): void; /** This event is fired before a change is applied, and its handler may choose to modify or cancel the change. The changeObj never has a next property, since this is fired for each individual change, and not batched per operation. Note: you may not do anything from a "beforeChange" handler that would cause changes to the document or its visualization. Doing so will, since this handler is called directly from the bowels of the CodeMirror implementation, probably cause the editor to become corrupted. */ - on(eventName: 'beforeChange', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeCancellable) => void ); - off(eventName: 'beforeChange', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeCancellable) => void ); + on(eventName: 'beforeChange', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeCancellable) => void ): void; + off(eventName: 'beforeChange', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeCancellable) => void ): void; /** Will be fired when the cursor or selection moves, or any change is made to the editor content. */ - on(eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void ); - off(eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void ); + on(eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void ): void; + off(eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void ): void; /** This event is fired before the selection is moved. Its handler may modify the resulting selection head and anchor. Handlers for this event have the same restriction as "beforeChange" handlers � they should not do anything to directly update the state of the editor. */ - on(eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: CodeMirror.Position; anchor: CodeMirror.Position; }) => void ); - off(eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: CodeMirror.Position; anchor: CodeMirror.Position; }) => void ); + on(eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: CodeMirror.Position; anchor: CodeMirror.Position; }) => void ): void; + off(eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: CodeMirror.Position; anchor: CodeMirror.Position; }) => void ): void; /** Fires whenever the view port of the editor changes (due to scrolling, editing, or any other factor). The from and to arguments give the new start and end of the viewport. */ - on(eventName: 'viewportChange', handler: (instance: CodeMirror.Editor, from: number, to: number) => void ); - off(eventName: 'viewportChange', handler: (instance: CodeMirror.Editor, from: number, to: number) => void ); + on(eventName: 'viewportChange', handler: (instance: CodeMirror.Editor, from: number, to: number) => void ): void; + off(eventName: 'viewportChange', handler: (instance: CodeMirror.Editor, from: number, to: number) => void ): void; /** Fires when the editor gutter (the line-number area) is clicked. Will pass the editor instance as first argument, the (zero-based) number of the line that was clicked as second argument, the CSS class of the gutter that was clicked as third argument, and the raw mousedown event object as fourth argument. */ - on(eventName: 'gutterClick', handler: (instance: CodeMirror.Editor, line: number, gutter: string, clickEvent: Event) => void ); - off(eventName: 'gutterClick', handler: (instance: CodeMirror.Editor, line: number, gutter: string, clickEvent: Event) => void ); + on(eventName: 'gutterClick', handler: (instance: CodeMirror.Editor, line: number, gutter: string, clickEvent: Event) => void ): void; + off(eventName: 'gutterClick', handler: (instance: CodeMirror.Editor, line: number, gutter: string, clickEvent: Event) => void ): void; /** Fires whenever the editor is focused. */ - on(eventName: 'focus', handler: (instance: CodeMirror.Editor) => void ); - off(eventName: 'focus', handler: (instance: CodeMirror.Editor) => void ); + on(eventName: 'focus', handler: (instance: CodeMirror.Editor) => void ): void; + off(eventName: 'focus', handler: (instance: CodeMirror.Editor) => void ): void; /** Fires whenever the editor is unfocused. */ - on(eventName: 'blur', handler: (instance: CodeMirror.Editor) => void ); - off(eventName: 'blur', handler: (instance: CodeMirror.Editor) => void ); + on(eventName: 'blur', handler: (instance: CodeMirror.Editor) => void ): void; + off(eventName: 'blur', handler: (instance: CodeMirror.Editor) => void ): void; /** Fires when the editor is scrolled. */ - on(eventName: 'scroll', handler: (instance: CodeMirror.Editor) => void ); - off(eventName: 'scroll', handler: (instance: CodeMirror.Editor) => void ); + on(eventName: 'scroll', handler: (instance: CodeMirror.Editor) => void ): void; + off(eventName: 'scroll', handler: (instance: CodeMirror.Editor) => void ): void; /** Will be fired whenever CodeMirror updates its DOM display. */ - on(eventName: 'update', handler: (instance: CodeMirror.Editor) => void ); - off(eventName: 'update', handler: (instance: CodeMirror.Editor) => void ); + on(eventName: 'update', handler: (instance: CodeMirror.Editor) => void ): void; + off(eventName: 'update', handler: (instance: CodeMirror.Editor) => void ): void; /** Fired whenever a line is (re-)rendered to the DOM. Fired right after the DOM element is built, before it is added to the document. The handler may mess with the style of the resulting element, or add event handlers, but should not try to change the state of the editor. */ - on(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void ); - off(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void ); + on(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void ): void; + off(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void ): void; } class Doc { @@ -372,7 +372,7 @@ declare module CodeMirror { getValue(seperator?: string): string; /** Set the editor content. */ - setValue(content: string); + setValue(content: string): void; /** Get the text between the given points in the editor, which should be {line, ch} objects. An optional third argument can be given to indicate the line separator string to use (defaults to "\n"). */ @@ -380,16 +380,16 @@ declare module CodeMirror { /** Replace the part of the document between from and to with the given string. from and to must be {line, ch} objects. to can be left off to simply insert the string at position from. */ - replaceRange(replacement: string, from: CodeMirror.Position, to: CodeMirror.Position); + replaceRange(replacement: string, from: CodeMirror.Position, to: CodeMirror.Position): void; /** Get the content of line n. */ getLine(n: number): string; /** Set the content of line n. */ - setLine(n: number, text: string); + setLine(n: number, text: string): void; /** Remove the given line from the document. */ - removeLine(n: number); + removeLine(n: number): void; /** Get the number of lines in the editor. */ lineCount(): number; @@ -410,16 +410,16 @@ declare module CodeMirror { /** Iterate over the whole document, and call f for each line, passing the line handle. This is a faster way to visit a range of line handlers than calling getLineHandle for each of them. Note that line handles have a text property containing the line's content (as a string). */ - eachLine(f: (line: CodeMirror.LineHandle) => void ); + eachLine(f: (line: CodeMirror.LineHandle) => void ): void; /** Iterate over the range from start up to (not including) end, and call f for each line, passing the line handle. This is a faster way to visit a range of line handlers than calling getLineHandle for each of them. Note that line handles have a text property containing the line's content (as a string). */ - eachLine(start: number, end: number, f: (line: CodeMirror.LineHandle) => void ); + eachLine(start: number, end: number, f: (line: CodeMirror.LineHandle) => void ): void; /** Set the editor content as 'clean', a flag that it will retain until it is edited, and which will be set again when such an edit is undone again. Useful to track whether the content needs to be saved. */ - markClean(); + markClean(): void; /** Returns whether the document is currently clean (not modified since initialization or the last call to markClean). */ isClean(): boolean; @@ -431,7 +431,7 @@ declare module CodeMirror { /** Replace the selection with the given string. By default, the new selection will span the inserted text. The optional collapse argument can be used to change this � passing "start" or "end" will collapse the selection to the start or end of the inserted text. */ - replaceSelection(replacement: string, collapse?: string) + replaceSelection(replacement: string, collapse?: string): void; /** start is a an optional string indicating which end of the selection to return. It may be "start" , "end" , "head"(the side of the selection that moves when you press shift + arrow), @@ -442,20 +442,20 @@ declare module CodeMirror { somethingSelected(): boolean; /** Set the cursor position.You can either pass a single { line , ch } object , or the line and the character as two separate parameters. */ - setCursor(pos: CodeMirror.Position); + setCursor(pos: CodeMirror.Position): void; /** Set the selection range.anchor and head should be { line , ch } objects.head defaults to anchor when not given. */ - setSelection(anchor: CodeMirror.Position, head: CodeMirror.Position); + setSelection(anchor: CodeMirror.Position, head: CodeMirror.Position): void; /** Similar to setSelection , but will, if shift is held or the extending flag is set, move the head of the selection while leaving the anchor at its current place. pos2 is optional , and can be passed to ensure a region (for example a word or paragraph) will end up selected (in addition to whatever lies between that region and the current anchor). */ - extendSelection(from: CodeMirror.Position, to?: CodeMirror.Position); + extendSelection(from: CodeMirror.Position, to?: CodeMirror.Position): void; /** Sets or clears the 'extending' flag , which acts similar to the shift key, in that it will cause cursor movement and calls to extendSelection to leave the selection anchor in place. */ - setExtending(value: boolean); + setExtending(value: boolean): void; /** Retrieve the editor associated with a document. May return null. */ @@ -481,30 +481,30 @@ declare module CodeMirror { /** Break the link between two documents. After calling this , changes will no longer propagate between the documents, and, if they had a shared history, the history will become separate. */ - unlinkDoc(doc: CodeMirror.Doc); + unlinkDoc(doc: CodeMirror.Doc): void; /** Will call the given function for all documents linked to the target document. It will be passed two arguments, the linked document and a boolean indicating whether that document shares history with the target. */ - iterLinkedDocs(fn: (doc: CodeMirror.Doc, sharedHist: boolean) => void ); + iterLinkedDocs(fn: (doc: CodeMirror.Doc, sharedHist: boolean) => void ): void; /** Undo one edit (if any undo events are stored). */ - undo(); + undo(): void; /** Redo one undone edit. */ - redo(); + redo(): void; /** Returns an object with {undo, redo } properties , both of which hold integers , indicating the amount of stored undo and redo operations. */ historySize(): { undo: number; redo: number; }; /** Clears the editor's undo history. */ - clearHistory(); + clearHistory(): void; /** Get a(JSON - serializeable) representation of the undo history. */ getHistory(): any; /** Replace the editor's undo history with the one provided, which must be a value as returned by getHistory. Note that this will have entirely undefined results if the editor content isn't also the same as it was when getHistory was called. */ - setHistory(history: any); + setHistory(history: any): void; /** Can be used to mark a range of text with a specific CSS class name. from and to should be { line , ch } objects. */ @@ -548,7 +548,7 @@ declare module CodeMirror { interface TextMarker { /** Remove the mark. */ - clear(); + clear(): void; /** Returns a {from, to} object (both holding document positions), indicating the current position of the marked range, or undefined if the marker is no longer in the document. */ @@ -564,7 +564,7 @@ declare module CodeMirror { /** Call this if you made some change to the widget's DOM node that might affect its height. It'll force CodeMirror to update the height of the line that contains the widget. */ - changed(); + changed(): void; } interface EditorChange { @@ -585,9 +585,9 @@ declare module CodeMirror { interface EditorChangeCancellable extends CodeMirror.EditorChange { /** may be used to modify the change. All three arguments to update are optional, and can be left off to leave the existing value for that field intact. */ - update(from?: CodeMirror.Position, to?: CodeMirror.Position, text?: string); + update(from?: CodeMirror.Position, to?: CodeMirror.Position, text?: string): void; - cancel(); + cancel(): void; } interface Position { From 40296ff5e1b6e818cdc9c3eeb448bd4242206f98 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Dec 2013 15:56:13 +1100 Subject: [PATCH 09/15] Update promptly.d.ts --- promptly/promptly.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/promptly/promptly.d.ts b/promptly/promptly.d.ts index ed30f2f3b..3469ea04a 100644 --- a/promptly/promptly.d.ts +++ b/promptly/promptly.d.ts @@ -21,16 +21,16 @@ declare module "promptly" { output?: WritableStream; } - export function prompt(message: string, fn?: Callback); - export function prompt(message: string, opts: Options, fn?: Callback); + export function prompt(message: string, fn?: Callback):any; + export function prompt(message: string, opts: Options, fn?: Callback):any; - export function password(message: string, fn?: Callback); - export function password(message: string, opts: Options, fn?: Callback); + export function password(message: string, fn?: Callback):any; + export function password(message: string, opts: Options, fn?: Callback):any; - export function confirm(message: string, fn?: Callback); - export function confirm(message: string, opts: Options, fn?: Callback); + export function confirm(message: string, fn?: Callback):any; + export function confirm(message: string, opts: Options, fn?: Callback):any; - export function choose(message: string, choices: string[], fn?: Callback); - export function choose(message: string, choices: string[], opts: Options, fn?: Callback); + export function choose(message: string, choices: string[], fn?: Callback):any; + export function choose(message: string, choices: string[], opts: Options, fn?: Callback):any; } From 67c0a6fc377d75957d19196957563aefc8841d64 Mon Sep 17 00:00:00 2001 From: Natan Vivo Date: Thu, 12 Dec 2013 12:13:10 -0200 Subject: [PATCH 10/15] Makes some parameters optional, as they are not required by backbone. --- backbone/backbone.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts index 25b431453..cdcd145c2 100644 --- a/backbone/backbone.d.ts +++ b/backbone/backbone.d.ts @@ -10,7 +10,7 @@ declare module Backbone { interface AddOptions extends Silenceable { - at: number; + at?: number; } interface HistoryOptions extends Silenceable { @@ -19,7 +19,7 @@ declare module Backbone { } interface NavigateOptions { - trigger: boolean; + trigger?: boolean; } interface RouterOptions { From 1ee4c773d0136fc4436861fccc4ac99846cab39d Mon Sep 17 00:00:00 2001 From: Jed Mao Date: Wed, 11 Dec 2013 18:14:21 -0600 Subject: [PATCH 11/15] More specific Express types --- express/express-tests.ts | 263 +++++++++++++++++++-------------------- express/express.d.ts | 53 ++++---- 2 files changed, 156 insertions(+), 160 deletions(-) diff --git a/express/express-tests.ts b/express/express-tests.ts index 27ba253c1..45e6b643e 100644 --- a/express/express-tests.ts +++ b/express/express-tests.ts @@ -20,7 +20,7 @@ app.use(express.session()); // Session-persisted message middleware -app.use(function (req, res, next) { +app.use((req: express.Request, res: express.Response, next) => { var err = req.session.error , msg = req.session.success; delete req.session.error; @@ -40,7 +40,7 @@ var users = { // when you create a user, generate a salt // and hash the password ('foobar' is the pass here) -hash('foobar', function (err, salt, hash) { +hash('foobar', (err, salt, hash) => { if (err) throw err; // store the salt & hash in the "db" users.tj.salt = salt; @@ -58,11 +58,11 @@ function authenticate(name, pass, fn) { // apply the same algorithm to the POSTed password, applying // the hash against the pass / salt, if there is a match we // found the user - hash(pass, user.salt, function (err, hash) { + hash(pass, user.salt, (err, hash) => { if (err) return fn(err); if (hash == user.hash) return fn(null, user); fn(new Error('invalid password')); - }) + }); } function restrict(req: express.Request, res: express.Response, next?: Function) { @@ -74,32 +74,32 @@ function restrict(req: express.Request, res: express.Response, next?: Function) } } -app.get('/', function (req, res) { +app.get('/', (req: express.Request, res: express.Response) => { res.redirect('login'); }); -app.get('/restricted', restrict, function (req, res) { +app.get('/restricted', restrict, (req: express.Request, res: express.Response) => { res.send('Wahoo! restricted area, click to logout'); }); -app.get('/logout', function (req, res) { +app.get('/logout', (req: express.Request, res: express.Response) => { // destroy the user's session to log them out // will be re-created next request - req.session.destroy(function () { + req.session.destroy(() => { res.redirect('/'); }); }); -app.get('/login', function (req, res) { +app.get('/login', (req: express.Request, res: express.Response) => { res.render('login'); }); -app.post('/login', function (req, res) { - authenticate(req.body.username, req.body.password, function (err, user) { +app.post('/login', (req: express.Request, res: express.Response) => { + authenticate(req.body.username, req.body.password, (err, user) => { if (user) { // Regenerate session when signing in // to prevent fixation - req.session.regenerate(function () { + req.session.regenerate(() => { // Store the user's primary key // in the session store to be retrieved, // or in this case the entire user object @@ -139,7 +139,7 @@ while (n--) { app.use(express.logger('dev')); -app.get('/', function (req, res) { +app.get('/', (req: express.Request, res: express.Response) => { res.render('pets', { pets: pets }); }); @@ -148,24 +148,24 @@ console.log('Express listening on port 3000'); ///////////// -app.get('/', function (req, res) { +app.get('/', (req: express.Request, res: express.Response) => { res.format({ - html: function () { - res.send('
    ' + users.map(function (user) { + html: () => { + res.send('
      ' + users.map(user => { return '
    • ' + user.name + '
    • '; }).join('') + '
    '); }, - text: function () { - res.send(users.map(function (user) { + text: () => { + res.send(users.map(user => { return ' - ' + user.name + '\n'; }).join('')); }, - json: function () { + json: () => { res.json(users); } - }) + }); }); // or you could write a tiny middleware like @@ -173,9 +173,9 @@ app.get('/', function (req, res) { function format(mod) { var obj = require(mod); - return function (req, res) { + return (req: express.Request, res: express.Response) => { res.format(obj); - } + }; } app.get('/users', format('./users')); @@ -207,7 +207,7 @@ app.use(express.cookieParser('my secret here')); // parses json, x-www-form-urlencoded, and multipart/form-data app.use(express.bodyParser()); -app.get('/', function (req, res) { +app.get('/', (req: express.Request, res: express.Response) => { if (req.cookies.remember) { res.send('Remembered :). Click to forget!.'); } else { @@ -217,12 +217,12 @@ app.get('/', function (req, res) { } }); -app.get('/forget', function (req, res) { +app.get('/forget', (req: express.Request, res: express.Response) => { res.clearCookie('remember'); res.redirect('back'); }); -app.post('/', function (req, res) { +app.post('/', (req: express.Request, res: express.Response) => { var minute = 60000; if (req.body.remember) res.cookie('remember', 1, { maxAge: minute }); res.redirect('back'); @@ -248,7 +248,7 @@ app.use(express.cookieSession()); app.use(count); // custom middleware -function count(req, res) { +function count(req: express.Request, res: express.Response) { req.session.count = req.session.count || 0; var n = req.session.count++; res.send('viewed ' + n + ' times\n'); @@ -274,7 +274,7 @@ api.use(express.bodyParser()); * CORS support. */ -api.all('*', function (req, res, next) { +api.all('*', (req: express.Request, res: express.Response, next) => { if (!req.get('Origin')) return next(); // use "*" here to accept any origin res.set('Access-Control-Allow-Origin', 'http://localhost:3000'); @@ -289,7 +289,7 @@ api.all('*', function (req, res, next) { * POST a user. */ -api.post('/user', function (req, res) { +api.post('/user', (req: express.Request, res: express.Response) => { console.log(req.body); res.send(201); }); @@ -302,7 +302,7 @@ console.log('api listening on 3001'); //////////////////// -app.get('/', function (req, res) { +app.get('/', (req: express.Request, res: express.Response) => { res.send('
      ' + '
    • Download amazing.txt.
    • ' + '
    • Download missing.txt.
    • ' @@ -311,7 +311,7 @@ app.get('/', function (req, res) { // /files/* is accessed via req.params[0] // but here we name it :file -app.get('/files/:file(*)', function (req, res, next?) { +app.get('/files/:file(*)', (req: express.Request, res: express.Response) => { var file = req.params.file , path = __dirname + '/files/' + file; @@ -322,7 +322,7 @@ app.get('/files/:file(*)', function (req, res, next?) { // below our routes, you will be able to // "intercept" errors, otherwise Connect // will respond with 500 "Internal Server Error". -app.use(function (err, req, res, next) { +app.use((err, req, res: express.Response, next) => { // special-case 404s, // remember you could // render a 404 template here @@ -363,7 +363,7 @@ app.set('views', __dirname + '/views'); // ex: res.render('users.html'). app.set('view engine', 'html'); -app.get('/', function (req, res) { +app.get('/', (req: express.Request, res: express.Response) => { res.render('users', { users: users, title: "EJS example", @@ -390,12 +390,12 @@ app.use(app.router); app.use(error); // error handling middleware have an arity of 4 -// instead of the typical (req, res, next), +// instead of the typical (req: express.Request, res: express.Response, next), // otherwise they behave exactly like regular // middleware, you may have several of them, // in different orders etc. -function error(err, req, res, next) { +function error(err, req, res: express.Response, next) { // log it if (!test) console.error(err.stack); @@ -403,14 +403,14 @@ function error(err, req, res, next) { res.send(500); } -app.get('/', function (req, res) { +app.get('/', () => { // Caught and passed down to the errorHandler middleware throw new Error('something broke!'); }); -app.get('/next', function (req, res, next) { +app.get('/next', (req: express.Request, res: express.Response, next) => { // We can also pass exceptions to next() - process.nextTick(function () { + process.nextTick(() => { next(new Error('oh no!')); }); }); @@ -460,7 +460,7 @@ app.use(app.router); // $ curl http://localhost:3000/notfound -H "Accept: application/json" // $ curl http://localhost:3000/notfound -H "Accept: text/plain" -app.use(function (req, res, next) { +app.use((req: express.Request, res: express.Response) => { res.status(404); // respond with html page @@ -481,7 +481,7 @@ app.use(function (req, res, next) { // error-handling middleware, take the same form // as regular middleware, however they require an -// arity of 4, aka the signature (err, req, res, next). +// arity of 4, aka the signature (err, req, res: express.Response, next). // when connect has an error, it will invoke ONLY error-handling // middleware. @@ -491,7 +491,7 @@ app.use(function (req, res, next) { // would remain being executed, however here // we simply respond with an error page. -app.use(function (err, req, res, next) { +app.use((err, req, res: express.Response) => { // we may use properties of the error object // here and next(err) appropriately, or if // we possibly recovered from the error, simply next(). @@ -501,25 +501,25 @@ app.use(function (err, req, res, next) { // Routes -app.get('/', function (req, res) { +app.get('/', (req: express.Request, res: express.Response) => { res.render('index.jade'); }); -app.get('/404', function (req, res, next) { +app.get('/404', (req: express.Request, res: express.Response, next) => { // trigger a 404 since no other middleware // will match /404 after this one, and we're not // responding here next(); }); -app.get('/403', function (req, res, next) { +app.get('/403', (req: express.Request, res: express.Response, next) => { // trigger a 403 error var err = new Error('not allowed!'); err.status = 403; next(err); }); -app.get('/500', function (req, res, next) { +app.get('/500', (req: express.Request, res: express.Response, next) => { // trigger a generic (500) error next(new Error('keyboard cat!')); }); @@ -552,7 +552,7 @@ User.prototype.toJSON = function () { return { id: this.id, name: this.name - } + }; }; app.use(express.logger('dev')); @@ -563,7 +563,7 @@ app.use(express.logger('dev')); // to the templates, so "expose" will // be present. -app.use(function (req, res, next) { +app.use((req: express.Request, res: express.Response, next) => { res.locals.expose = {}; // you could alias this as req or res.expose // to make it shorter and less annoying @@ -572,16 +572,16 @@ app.use(function (req, res, next) { // pretend we loaded a user -app.use(function (req, res, next) { +app.use((req: express.Request, res: express.Response, next) => { req.user = new User('Tobi'); next(); }); -app.get('/', function (req, res) { +app.get('/', (req: express.Request, res: express.Response) => { res.redirect('/user'); }); -app.get('/user', function (req, res) { +app.get('/user', (req: express.Request, res: express.Response) => { // we only want to expose the user // to the client for this route: res.locals.expose.user = req.user; @@ -593,7 +593,7 @@ console.log('app listening on port 3000'); /////////////////////// -app.get('/', function (req, res) { +app.get('/', (req: express.Request, res: express.Response) => { res.send('Hello World'); }); @@ -604,33 +604,33 @@ console.log('Express started on port 3000'); // register .md as an engine in express view system -app.engine('md', function (path, options, fn) { - fs.readFile(path, 'utf8', function (err, str) { +app.engine('md', (path, options, fn) => { + fs.readFile(path, 'utf8', (err, str) => { if (err) return fn(err); try { var html = md(str); - html = html.replace(/\{([^}]+)\}/g, function (_, name) { + html = html.replace(/\{([^}]+)\}/g, (_, name) => { return options[name] || ''; - }) + }); fn(null, html); } catch (err) { fn(err); } }); -}) +}); app.set('views', __dirname + '/views'); // make it the default so we dont need .md app.set('view engine', 'md'); -app.get('/', function (req, res) { +app.get('/', (req: express.Request, res: express.Response) => { res.render('index', { title: 'Markdown Example' }); -}) +}); -app.get('/fail', function (req, res) { +app.get('/fail', (req: express.Request, res: express.Response) => { res.render('missing', { title: 'Markdown Example' }); -}) +}); if (!module.parent) { app.listen(3000); @@ -643,9 +643,9 @@ var mformat: any; // bodyParser in connect 2.x uses node-formidable to parse // the multipart form data. -app.use(express.bodyParser()) +app.use(express.bodyParser()); -app.get('/', function (req, res) { +app.get('/', (req: express.Request, res: express.Response) => { res.send('
      ' + '

      Title:

      ' + '

      Image:

      ' @@ -653,7 +653,7 @@ app.get('/', function (req, res) { + '
      '); }); -app.post('/', function (req, res, next) { +app.post('/', (req: express.Request, res: express.Response) => { // the uploaded file can be found as `req.files.image` and the // title field as `req.body.title` res.send(mformat('\nuploaded %s (%d Kb) to %s as %s' @@ -680,7 +680,6 @@ if (!module.parent) { */ var online: any; -var redis: any; var db: any; // online @@ -690,7 +689,7 @@ online = online(db); // activity tracking, in this case using // the UA string, you would use req.user.id etc -app.use(function (req, res, next) { +app.use((req: express.Request, res: express.Response, next) => { // fire-and-forget online.add(req.headers['user-agent']); next(); @@ -701,7 +700,7 @@ app.use(function (req, res, next) { */ function list(ids) { - return '
        ' + ids.map(function (id) { + return '
          ' + ids.map(id => { return '
        • ' + id + '
        • '; }).join('') + '
        '; } @@ -710,8 +709,8 @@ function list(ids) { * GET users online. */ -app.get('/', function (req, res, next) { - online.last(5, function (err, ids) { +app.get('/', (req: express.Request, res: express.Response, next) => { + online.last(5, (err, ids) => { if (err) return next(err); res.send('

        Users online: ' + ids.length + '

        ' + list(ids)); }); @@ -724,7 +723,7 @@ console.log('listening on port 3000'); // Convert :to and :from to integers -app.param(['to', 'from'], function (req, res, next, num, name) { +app.param(['to', 'from'], (req: express.Request, res: express.Response, next, num, name) => { req.params[name] = num = parseInt(num, 10); if (isNaN(num)) { next(new Error('failed to parseInt ' + num)); @@ -735,7 +734,7 @@ app.param(['to', 'from'], function (req, res, next, num, name) { // Load user by id -app.param('user', function (req, res, next, id) { +app.param('user', (req: express.Request, res: express.Response, next, id) => { if (req.user = users[id]) { next(); } else { @@ -747,7 +746,7 @@ app.param('user', function (req, res, next, id) { * GET index. */ -app.get('/', function (req, res) { +app.get('/', (req: express.Request, res: express.Response) => { res.send('Visit /user/0 or /users/0-2'); }); @@ -755,7 +754,7 @@ app.get('/', function (req, res) { * GET :user. */ -app.get('/user/:user', function (req, res, next) { +app.get('/user/:user', (req: express.Request, res: express.Response) => { res.send('user ' + req.user.name); }); @@ -763,10 +762,10 @@ app.get('/user/:user', function (req, res, next) { * GET users :from - :to. */ -app.get('/users/:from-:to', function (req, res, next) { +app.get('/users/:from-:to', (req: express.Request, res: express.Response) => { var from = req.params.from , to = req.params.to - , names = users.map(function (user) { return user.name; }); + , names = users.map(user => { return user.name; }); res.send('users ' + names.slice(from, to).join(', ')); }); @@ -781,7 +780,7 @@ if (!module.parent) { app.resource = function (path, obj) { this.get(path, obj.index); - this.get(path + '/:a..:b.:format?', function (req, res) { + this.get(path + '/:a..:b.:format?', (req: express.Request, res: express.Response) => { var a = parseInt(req.params.a, 10) , b = parseInt(req.params.b, 10) , format = req.params.format; @@ -794,19 +793,19 @@ app.resource = function (path, obj) { // Fake controller. var FUser = { - index: function (req, res) { + index: (req: express.Request, res: express.Response) => { res.send(users); }, - show: function (req, res) { + show: (req: express.Request, res: express.Response) => { res.send(users[req.params.id] || { error: 'Cannot find user' }); }, - destroy: function (req, res) { + destroy: (req: express.Request, res: express.Response) => { var id = req.params.id; var destroyed = id in users; delete users[id]; res.send(destroyed ? 'destroyed' : 'Cannot find user'); }, - range: function (req, res, a, b, format) { + range: (req: express.Request, res: express.Response, a, b, format) => { var range = users.slice(a, b + 1); switch (format) { case 'json': @@ -814,7 +813,7 @@ var FUser = { break; case 'html': default: - var html = '
          ' + range.map(function (user) { + var html = '
            ' + range.map(user => { return '
          • ' + user.name + '
          • '; }).join('\n') + '
          '; res.send(html); @@ -831,7 +830,7 @@ var FUser = { app.resource('/users', FUser); -app.get('/', function (req, res) { +app.get('/', (req: express.Request, res: express.Response) => { res.send([ '

          Examples:

            ' , '
          • GET /users
          • ' @@ -854,7 +853,7 @@ if (!module.parent) { var verbose: any; -app.map = function (a, route) { +app.map = (a, route) => { route = route || ''; for (var key in a) { switch (typeof a[key]) { @@ -872,25 +871,25 @@ app.map = function (a, route) { }; var users2 = { - list: function (req, res) { + list: (req: express.Request, res: express.Response) => { res.send('user list'); }, - get: function (req, res) { + get: (req: express.Request, res: express.Response) => { res.send('user ' + req.params.uid); }, - del: function (req, res) { + del: (req: express.Request, res: express.Response) => { res.send('delete users'); } }; var pets2 = { - list: function (req, res) { + list: (req: express.Request, res: express.Response) => { res.send('user ' + req.params.uid + '\'s pets'); }, - del: function (req, res) { + del: (req: express.Request, res: express.Response) => { res.send('delete ' + req.params.uid + '\'s pet ' + req.params.pid); } }; @@ -922,7 +921,7 @@ app.listen(3000); // curl http://localhost:3000/user/1/edit (unauthorized since this is not you) // curl -X DELETE http://localhost:3000/user/0 (unauthorized since you are not an admin) -function loadUser(req, res, next) { +function loadUser(req: express.Request, res: express.Response, next) { // You would fetch your user from the db var user = users[req.params.id]; if (user) { @@ -933,7 +932,7 @@ function loadUser(req, res, next) { } } -function andRestrictToSelf(req, res, next) { +function andRestrictToSelf(req: express.Request, res: express.Response, next) { // If our authenticated user is the user we are viewing // then everything is fine :) if (req.authenticatedUser.id == req.user.id) { @@ -948,13 +947,13 @@ function andRestrictToSelf(req, res, next) { } function andRestrictTo(role) { - return function (req, res, next) { + return (req: express.Request, res: express.Response, next) => { if (req.authenticatedUser.role == role) { next(); } else { next(new Error('Unauthorized')); } - } + }; } // Middleware for faux authentication @@ -962,24 +961,24 @@ function andRestrictTo(role) { // but this illustrates how an authenticated user // may interact with middleware -app.use(function (req, res, next) { +app.use((req: express.Request, res: express.Response, next) => { req.authenticatedUser = users[0]; next(); }); -app.get('/', function (req, res) { +app.get('/', (req: express.Request, res: express.Response) => { res.redirect('/user/0'); }); -app.get('/user/:id', loadUser, function (req, res) { +app.get('/user/:id', loadUser, (req: express.Request, res: express.Response) => { res.send('Viewing user ' + req.user.name); }); -app.get('/user/:id/edit', loadUser, andRestrictToSelf, function (req, res) { +app.get('/user/:id/edit', loadUser, andRestrictToSelf, (req: express.Request, res: express.Response) => { res.send('Editing user ' + req.user.name); }); -app.del('/user/:id', loadUser, andRestrictTo('admin'), function (req, res) { +app.del('/user/:id', loadUser, andRestrictTo('admin'), (req: express.Request, res: express.Response) => { res.send('Deleted user ' + req.user.name); }); @@ -1003,7 +1002,7 @@ db.sadd('cat', 'luna'); * GET the search page. */ -app.get('/', function (req, res) { +app.get('/', (req: express.Request, res: express.Response) => { res.render('search'); }); @@ -1011,9 +1010,9 @@ app.get('/', function (req, res) { * GET search for :query. */ -app.get('/search/:query?', function (req, res) { +app.get('/search/:query?', (req: express.Request, res: express.Response) => { var query = req.params.query; - db.smembers(query, function (err, vals) { + db.smembers(query, (err, vals) => { if (err) return res.send(500); res.send(vals); }); @@ -1026,7 +1025,7 @@ app.get('/search/:query?', function (req, res) { * template. */ -app.get('/client.js', function (req, res) { +app.get('/client.js', (req: express.Request, res: express.Response) => { res.sendfile(__dirname + '/client.js'); }); @@ -1045,7 +1044,7 @@ app.use(express.cookieParser('keyboard cat')); // Populates req.session app.use(express.session()); -app.get('/', function (req, res) { +app.get('/', (req: express.Request, res: express.Response) => { var body = ''; if (req.session.views) { ++req.session.views; @@ -1118,11 +1117,11 @@ var main = express(); main.use(express.logger('dev')); -main.get('/', function (req, res) { - res.send('Hello from main app!') +main.get('/', (req: express.Request, res: express.Response) => { + res.send('Hello from main app!'); }); -main.get('/:sub', function (req, res) { +main.get('/:sub', (req: express.Request, res: express.Response) => { res.send('requsted ' + req.params.sub); }); @@ -1130,12 +1129,12 @@ main.get('/:sub', function (req, res) { var redirect = express(); -redirect.all('*', function (req, res) { +redirect.all('*', (req: express.Request, res: express.Response) => { console.log(req.subdomains); res.redirect('http://example.com:3000/' + req.subdomains[0]); }); -app.use(express.vhost('*.example.com', redirect)) +app.use(express.vhost('*.example.com', redirect)); app.use(express.vhost('example.com', main)); app.listen(3000); @@ -1162,7 +1161,7 @@ function merror(status, msg) { // meaning only paths prefixed with "/api" // will cause this middleware to be invoked -app.use('/api', function (req, res, next) { +app.use('/api', (req, res: express.Response, next) => { var key = req.query['api-key']; // key isnt present @@ -1186,7 +1185,7 @@ app.use(app.router); // it will be passed through the defined middleware // in order, but ONLY those with an arity of 4, ignoring // regular middleware. -app.use(function (err, req, res, next) { +app.use((err, req, res: express.Response) => { // whatever you want here, feel free to populate // properties on `err` to treat it differently in here. res.send(err.status || 500, { error: err.message }); @@ -1195,7 +1194,7 @@ app.use(function (err, req, res, next) { // our custom JSON 404 middleware. Since it's placed last // it will be the last middleware called, if all others // invoke next() and do not respond. -app.use(function (req, res) { +app.use((req: express.Request, res: express.Response) => { res.send(404, { error: "Lame, can't find that" }); }); @@ -1223,15 +1222,15 @@ var userRepos = { // we now can assume the api key is valid, // and simply expose the data -app.get('/api/users', function (req, res, next) { +app.get('/api/users', (req: express.Request, res: express.Response) => { res.send(users); }); -app.get('/api/repos', function (req, res, next) { +app.get('/api/repos', (req: express.Request, res: express.Response) => { res.send(repos); }); -app.get('/api/user/:name/repos', function (req, res, next) { +app.get('/api/user/:name/repos', (req: express.Request, res: express.Response, next) => { var name = req.params.name , user = userRepos[name]; @@ -1248,19 +1247,19 @@ if (!module.parent) { function test_general() { - app.use(function (err, req, res, next) { + app.use((err, req, res: express.Response) => { console.error(err.stack); res.send(500, 'Something broke!'); }); app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(app.router); - app.use(function (err, req, res, next) { }); + app.use(() => {}); app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(app.router); - app.get('/', function (req, res) { + app.get('/', (req: express.Request, res: express.Response) => { res.send('hello world'); }); @@ -1285,18 +1284,18 @@ function test_general() { app.set('db uri', 'localhost/dev'); }); - app.configure('stage', 'production', function () { }); + app.configure('stage', 'production', () => {}); - app.configure('1', '2', '3', function () { }); + app.configure('1', '2', '3', () => {}); - app.use(function (req, res, next) { + app.use((req: express.Request, res: express.Response) => { res.send('Hello World'); }); app.engine('jade', require('jade').__express); var User; - app.param('user', (req, res, next, id) => { + app.param('user', (req: express.Request, res: express.Response, next, id) => { User.find(id, (err, user) =>{ if (err) { next(err); @@ -1309,7 +1308,7 @@ function test_general() { }); }); - app.get(/^\/commits\/(\d+)(?:\.\.(\d+))?$/, (req, res) => { + app.get(/^\/commits\/(\d+)(?:\.\.(\d+))?$/, (req: express.Request, res: express.Response) => { var from = req.params[0]; var to = req.params[1] || 'HEAD'; res.send('commit range ' + from + '..' + to); @@ -1319,7 +1318,7 @@ function test_general() { app.locals.strftime = require('strftime'); var requireAuthentication; - var loadUser = function () { }; + var loadUser = () => {}; app.all('*', requireAuthentication, loadUser); app.all('*', loadUser); app.all('*', loadUser, loadUser, loadUser); @@ -1331,9 +1330,9 @@ function test_general() { phone: '1-250-858-9990', email: 'me@myapp.com' }); - app.render('email', function (err, html) { }); + app.render('email', () => {}); - app.render('email', { name: 'Tobi' }, function (err, html) { }); + app.render('email', { name: 'Tobi' }, () => {}); } function test_request() { @@ -1413,24 +1412,24 @@ function test_response() { res.type('application/json'); res.format({ - 'text/plain': function () { + 'text/plain': () => { res.send('hey'); }, - 'text/html': function () { + 'text/html': () => { res.send('hey'); }, - 'application/json': function () { + 'application/json': () => { res.send({ message: 'hey' }); } }); res.attachment(); res.attachment('path/to/logo.png'); - app.get('/user/:uid/photos/:file', function (req, res) { + app.get('/user/:uid/photos/:file', (req: express.Request, res: express.Response) => { var uid = req.params.uid , file = req.params.file; - req.user.mayViewFilesFrom(uid, function (yes) { + req.user.mayViewFilesFrom(uid, yes => { if (yes) { res.sendfile('/uploads/' + uid + '/' + file); } else { @@ -1441,7 +1440,7 @@ function test_response() { res.download('/report-12345.pdf'); res.download('/report-12345.pdf', 'report.pdf'); - res.download('/report-12345.pdf', 'report.pdf', function (err) { + res.download('/report-12345.pdf', 'report.pdf', err => { if (err) { } else { } }); @@ -1450,19 +1449,19 @@ function test_response() { last: 'http://api.example.com/users?page=5' }); - app.use(function (req, res, next) { + app.use((req: express.Request, res: express.Response, next) => { res.locals.user = req.user; res.locals.authenticated = !req.user.anonymous; next(); }); - res.render('index', function (err, html) { }); - res.render('user', { name: 'Tobi' }, function (err, html) { }); + res.render('index', () => {}); + res.render('user', { name: 'Tobi' }, () => {}); } function test_middleware() { app.use(express.basicAuth('username', 'password')); - app.use(express.basicAuth(function (user, pass) { + app.use(express.basicAuth((user, pass) => { return 'tj' == user && 'wahoo' == pass; })); app.use(express.bodyParser()); diff --git a/express/express.d.ts b/express/express.d.ts index 12456ac8e..6fa79fc76 100644 --- a/express/express.d.ts +++ b/express/express.d.ts @@ -125,6 +125,8 @@ declare module "express" { success: string; views: any; + + count: number; } interface Request { @@ -156,6 +158,8 @@ declare module "express" { header(name: string): string; + headers: string[]; + /** * Check if the given `type(s)` is acceptable, returning * the best match when true, otherwise `undefined`, in which @@ -235,19 +239,8 @@ declare module "express" { /** * Return an array of Accepted media types * ordered from highest quality to lowest. - * - * Examples: - * - * [ { value: 'application/json', - * quality: 1, - * type: 'application', - * subtype: 'json' }, - * { value: 'text/html', - * quality: 0.5, - * type: 'text', - * subtype: 'html' } ] */ - accepted: any[]; + accepted: MediaType[]; /** * Return an array of Accepted languages @@ -417,6 +410,8 @@ declare module "express" { user: any; + authenticatedUser: any; + files: any; /** @@ -434,6 +429,20 @@ declare module "express" { signedCookies: any; originalUrl: string; + + url: string; + } + + interface MediaType { + value: string; + quality: number; + type: string; + subtype: string; + } + + interface Send { + (status: number, body?: any): Response; + (body: any): Response; } interface Response extends http.ServerResponse { @@ -469,11 +478,7 @@ declare module "express" { * res.send(404, 'Sorry, cant find that'); * res.send(404); */ - send(status: number): Response; - - send(bodyOrStatus: any): Response; - - send(status: number, body: any): Response; + send: Send; /** * Send JSON response. @@ -485,11 +490,7 @@ declare module "express" { * res.json(500, 'oh noes!'); * res.json(404, 'I dont have that'); */ - json(status: number): Response; - - json(bodyOrStatus: any): Response; - - json(status: number, body: any): Response; + json: Send; /** * Send JSON response with JSONP callback support. @@ -501,11 +502,7 @@ declare module "express" { * res.jsonp(500, 'oh noes!'); * res.jsonp(404, 'I dont have that'); */ - jsonp(status: number): Response; - - jsonp(bodyOrStatus: any): Response; - - jsonp(status: number, body: any): Response; + jsonp: Send; /** * Transfer the file at the given `path`. @@ -884,7 +881,7 @@ declare module "express" { */ param(name: string, fn: Function): Application; - param(name: any[], fn: Function): Application; + param(name: string[], fn: Function): Application; /** * Assign `setting` to `val`, or return `setting`'s value. From 41d06a112ded4695044c50bd17ca40bd8bed98a4 Mon Sep 17 00:00:00 2001 From: Igor Kriklivets Date: Thu, 12 Dec 2013 21:30:01 +0400 Subject: [PATCH 12/15] .tscparams removed --- phonejs/dx.phonejs-tests.ts.tscparams | 1 - 1 file changed, 1 deletion(-) delete mode 100644 phonejs/dx.phonejs-tests.ts.tscparams diff --git a/phonejs/dx.phonejs-tests.ts.tscparams b/phonejs/dx.phonejs-tests.ts.tscparams deleted file mode 100644 index 3cc762b55..000000000 --- a/phonejs/dx.phonejs-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ -"" \ No newline at end of file From 6b0e6361f45c0ba6a1f66b07f3990ec240f89c54 Mon Sep 17 00:00:00 2001 From: Igor Kriklivets Date: Thu, 12 Dec 2013 21:31:41 +0400 Subject: [PATCH 13/15] Support for 0.9.5 compiler version --- chartjs/dx.chartjs.d.ts | 31 +++++++++++------------ phonejs/dx.phonejs-tests.ts | 4 +-- phonejs/dx.phonejs.d.ts | 49 +++++++++++++------------------------ 3 files changed, 33 insertions(+), 51 deletions(-) diff --git a/chartjs/dx.chartjs.d.ts b/chartjs/dx.chartjs.d.ts index 13a2e8bc2..7c961da9e 100644 --- a/chartjs/dx.chartjs.d.ts +++ b/chartjs/dx.chartjs.d.ts @@ -208,7 +208,7 @@ declare module DevExpress.data { } export interface StoreOptions { key?: any; - errorHandler: ErrorHandler; + errorHandler?: ErrorHandler; loaded?: JQueryCallback; loading?: JQueryCallback; modified?: JQueryCallback; @@ -294,14 +294,6 @@ declare module DevExpress.data { export class ODataStore extends Store { constructor(options?: ODataStoreOptions); } - interface IODataContextBase { - get(operationName: string, params: { [key: string]: any }): JQueryDeferred>; - invoke(operationName: string, params: { [key: string]: any }, httpMethod?: string): JQueryDeferred>; - objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; } - } - interface IODataContext extends IODataContextBase { - [entitySetName: string]: Store; - } export interface ODataContextOptions { url: string; jsonp?: boolean; @@ -310,11 +302,11 @@ declare module DevExpress.data { beforeSend?: () => any; entities?: Array; } - export class ODataContext implements IODataContextBase { + export class ODataContext { constructor(options?: ODataContextOptions); get(operationName: string, params: { [key: string]: any }): JQueryDeferred>; invoke(operationName: string, params: { [key: string]: any }, httpMethod?: string): JQueryDeferred>; - objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; } + objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; }; } } declare module DevExpress.ui { @@ -1030,7 +1022,12 @@ declare module DevExpress.viz.charts.series { hoverStyle?: AreaSeriesStyle; point?: BasePointOptions; } - export interface RangeBarSeriesOptions extends z_BaseRangeSeriesOptions, z_BaseBarSeriesOptions { } + export interface RangeBarSeriesOptions extends z_BaseBarSeriesOptions { + rangeValue1Field?: string; + rangeValue2Field?: string; + pane?: string; + axis?: string; + } export interface SplineSeriesOptions extends LineSeriesOptions { } export interface SplineAreaSeries extends AreaSeriesOptions { } export interface StackedLineSeries extends LineSeriesOptions { } @@ -1373,8 +1370,8 @@ declare module DevExpress.viz.map { borderColor?: string; color?: string; }; - dataSource?: any; - area?: { + mapData?: any; + areaSettings?: { borderColor?: string; color?: string; hoveredBorderColor?: string; @@ -1389,8 +1386,8 @@ declare module DevExpress.viz.map { click?: (arg: Proxy) => void; selectionChanged?: (arg: Proxy) => void; }; - markerDataSource?: any; - marker?: { + markers?: any; + markerSettings?: { borderColor?: string; color?: string; hoveredBorderColor?: string; @@ -1448,7 +1445,7 @@ declare module DevExpress.viz.map { } export class Proxy { type: string; - attr(name: string): any; + attribute(name: string): any; selected(state: boolean): void; selected(): boolean; } diff --git a/phonejs/dx.phonejs-tests.ts b/phonejs/dx.phonejs-tests.ts index 41fbc2c11..049eaef5c 100644 --- a/phonejs/dx.phonejs-tests.ts +++ b/phonejs/dx.phonejs-tests.ts @@ -14,8 +14,8 @@ module Test { namespace: "global", defaultLayout: "slideout", navigation: [ - { title: "Home", action: "#home" }, - { title: "About", action: "#about" } + { id: "first", title: "Home", action: "#home" }, + { id: "second", title: "About", action: "#about" } ] }); application.router.register(":view/:id", { view: "home", id: undefined }); diff --git a/phonejs/dx.phonejs.d.ts b/phonejs/dx.phonejs.d.ts index a3813eb56..185ee4d41 100644 --- a/phonejs/dx.phonejs.d.ts +++ b/phonejs/dx.phonejs.d.ts @@ -208,7 +208,7 @@ declare module DevExpress.data { } export interface StoreOptions { key?: any; - errorHandler: ErrorHandler; + errorHandler?: ErrorHandler; loaded?: JQueryCallback; loading?: JQueryCallback; modified?: JQueryCallback; @@ -294,14 +294,6 @@ declare module DevExpress.data { export class ODataStore extends Store { constructor(options?: ODataStoreOptions); } - interface IODataContextBase { - get(operationName: string, params: { [key: string]: any }): JQueryDeferred>; - invoke(operationName: string, params: { [key: string]: any }, httpMethod?: string): JQueryDeferred>; - objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; } - } - interface IODataContext extends IODataContextBase { - [entitySetName: string]: Store; - } export interface ODataContextOptions { url: string; jsonp?: boolean; @@ -310,24 +302,18 @@ declare module DevExpress.data { beforeSend?: () => any; entities?: Array; } - export class ODataContext implements IODataContextBase { + export class ODataContext { constructor(options?: ODataContextOptions); get(operationName: string, params: { [key: string]: any }): JQueryDeferred>; invoke(operationName: string, params: { [key: string]: any }, httpMethod?: string): JQueryDeferred>; - objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; } + objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; }; } } declare module DevExpress.framework { - interface NavigationItem { - title: string; - icon?: string; - root?: boolean; - action: any; - } export interface dxViewOptions { name: string; - title: string; - layout: string; + title?: string; + layout?: string; } export class dxView extends ui.Component { constructor(options?: dxViewOptions); @@ -365,19 +351,19 @@ declare module DevExpress.framework { export class dxContent extends ui.Component { constructor(options?: dxLayoutOptions); } - export interface CommandOptions extends ui.ComponentOptions { + export interface dxCommandOptions extends ui.ComponentOptions { id: string; - action: any; - icon: string; - title: string; - iconSrc: string; - visible: boolean; + action?: any; + icon?: string; + title?: string; + iconSrc?: string; + visible?: boolean; } export class dxCommand extends ui.Component { public beforeExecute: JQueryCallback; public afterExecute: JQueryCallback; - constructor(element: JQuery, options?: CommandOptions); - constructor(element: Element, options?: CommandOptions); + constructor(element: JQuery, options?: dxCommandOptions); + constructor(element: Element, options?: dxCommandOptions); execute(): void; } export class dxCommandContainer extends ui.Component { @@ -543,7 +529,7 @@ declare module DevExpress.framework { disableViewCache?: boolean; stateManager?: StateManager; navigationManager?: NavigationManager; - navigation?: NavigationItem[]; + navigation?: dxCommandOptions[]; commandMapping?: CommandMap; } export class Application { @@ -552,7 +538,7 @@ declare module DevExpress.framework { public components: any[]; public stateManager: StateManager; public commandMapping: CommandMap; - public navigation: NavigationItem[]; + public navigation: dxCommand[]; public navigationManager: NavigationManager; public beforeViewSetup: JQueryCallback; public afterViewSetup: JQueryCallback; @@ -669,7 +655,7 @@ declare module DevExpress.framework.html { } export interface HtmlApplicationBaseOptions extends framework.ApplicationOptions { device?: devices.Device; - defaultLayout?: string; + navigationType?: string; } export class HtmlApplicationBase extends framework.Application { public viewRendered: JQueryCallback; @@ -685,7 +671,6 @@ declare module DevExpress.framework.html { } export class HtmlApplication extends HtmlApplicationBase { public viewEngine: ViewEngineBase; - public blankViewRendered: JQueryCallback; constructor(options?: HtmlApplicationOptions); } } @@ -904,7 +889,7 @@ declare module DevExpress.ui { autoPagingEnabled?: boolean; scrollingEnabled?: boolean; showScrollbar?: boolean; - useNative?: boolean; + useNativeScrolling?: boolean; grouped?: boolean; editEnabled?: boolean; showNextButton?: boolean; From f1c040b378e2c1cf5690fece38c84a7ff62f2c2c Mon Sep 17 00:00:00 2001 From: John Vilk Date: Thu, 12 Dec 2013 14:41:23 -0500 Subject: [PATCH 14/15] [Node] Removing incorrect typing for `buffer.INSPECT_MAX_BYTES`. From http://nodejs.org/api/buffer.html#buffer_buffer_inspect_max_bytes: "...this is a property on the buffer module returned by require('buffer'), not on the Buffer global, or a buffer instance." The Node typings do not have a notion of a buffer module, and introducing one would be more work than might be useful. It contains a reference to `Buffer` and `SlowBuffer`, which are currently defined as variables in the typings. I believe I would need to redefine these in the module definition. If anyone has any ideas for how to efficiently restructure this, let me know. --- node/node.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/node/node.d.ts b/node/node.d.ts index 4c8c043d3..26ac44b94 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -195,7 +195,6 @@ interface NodeBuffer { writeDoubleLE(value: number, offset: number, noAssert?: boolean): void; writeDoubleBE(value: number, offset: number, noAssert?: boolean): void; fill(value: any, offset?: number, end?: number): void; - INSPECT_MAX_BYTES: number; } interface NodeTimer { From 5a1317725c238d8e54f1a6c457ae895678477233 Mon Sep 17 00:00:00 2001 From: ashwinr Date: Thu, 12 Dec 2013 17:09:36 -0500 Subject: [PATCH 15/15] Update when.d.ts --- when/when.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/when/when.d.ts b/when/when.d.ts index 2389a4243..dbf4050a0 100644 --- a/when/when.d.ts +++ b/when/when.d.ts @@ -51,6 +51,7 @@ declare module When { promise: Promise; reject(reason: any): void; resolve(value?: T): void; + resolve(value?: Promise): void; } interface Promise {