diff --git a/README.md b/README.md index ea97bba14..f3fa36b01 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ List of Definitions * [Chrome](http://developer.chrome.com/extensions/) (by [Matthew Kimber](https://github.com/matthewkimber)) * [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon)) * [d3.js](http://d3js.org/) (from TypeScript samples) +* [domo](http://domo-js.com/) (by [Steve Fenton](https://github.com/Steve-Fenton)) * [EaselJS](http://www.createjs.com/#!/EaselJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) * [ember.js](http://emberjs.com/) (by [Boris Yankov](https://github.com/borisyankov)) * [Express](http://expressjs.com/) (by [Boris Yankov](https://github.com/borisyankov)) @@ -93,6 +94,7 @@ List of Definitions * [Node.js](http://nodejs.org/) (from TypeScript samples) * [node_redis](https://github.com/mranney/node_redis) (by [Boris Yankov](https://github.com/borisyankov)) * [node-sqlserver](https://github.com/WindowsAzure/node-sqlserver) (by [Boris Yankov](https://github.com/borisyankov)) +* [Numeral.js](https://github.com/adamwdraper/Numeral-js) (by [Vincent Bortone](https://github.com/vbortone/)) * [PhoneGap](http://phonegap.com) (by [Boris Yankov](https://github.com/borisyankov)) * [Platform](https://github.com/bestiejs/platform.js) (by [Jake Hickman](https://github.com/JakeH)) * [PouchDB](http://pouchdb.com) (by [Bill Sears](https://github.com/MrBigDog2U/)) @@ -114,6 +116,7 @@ List of Definitions * [Toastr](https://github.com/CodeSeven/toastr) (by [Boris Yankov](https://github.com/borisyankov)) * [TweenJS](http://www.createjs.com/#!/TweenJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) * [tween.js](https://github.com/sole/tween.js/) (by [Adam R. Smith](https://github.com/sunetos)) +* [twitter-bootstrap-wizard](https://github.com/VinceG/twitter-bootstrap-wizard) (by [Blake Niemyjski](https://github.com/niemyjski)) * [Ubuntu Unity Web API](https://launchpad.net/libunity-webapps) (by [John Vrbanac](https://github.com/jmvrbanac)) * [Underscore.js](http://underscorejs.org/) (by [Boris Yankov](https://github.com/borisyankov)) * [Underscore.js (Typed)](http://underscorejs.org/) (by [Josh Baldwin](https://github.com/jbaldwin/)) @@ -122,9 +125,11 @@ List of Definitions * [WebRTC](http://dev.w3.org/2011/webrtc/editor/webrtc.html) (by [Ken Smith](https://github.com/smithkl42)) * [YouTube](https://developers.google.com/youtube/) (by [Daz Wilkin](https://github.com/DazWilkin/)) * [Zynga Scroller](https://github.com/zynga/scroller) (by [Boris Yankov](https://github.com/borisyankov)) +* [ZeroClipboard] (https://github.com/jonrohan/ZeroClipboard) (by [Eric J. Smith] (https://github.com/ejsmith)) Requested Definitions --------------------- +* [Rickshaw](https://github.com/shutterstock/rickshaw) * [Crossfilter](https://github.com/square/crossfilter) * [dc.js](https://github.com/NickQiZhu/dc.js) * [store.js](https://github.com/marcuswestin/store.js) @@ -132,7 +137,6 @@ Requested Definitions * [Tags Manager](http://welldonethings.com/tags/manager) * [jsoneditoronline](https://github.com/wjosdejong/jsoneditoronline) * [Tags Manager](http://welldonethings.com/tags/manager) -* [Rickshaw](https://github.com/shutterstock/rickshaw) * [Prelude.ls](http://gkz.github.com/prelude-ls/) * [MooTools](http://mootools.net/) * [Lo-Dash](http://lodash.com/) \ No newline at end of file diff --git a/d3/plugins/superformula.ts b/d3/plugins/superformula.ts new file mode 100644 index 000000000..bb1703c14 --- /dev/null +++ b/d3/plugins/superformula.ts @@ -0,0 +1,39 @@ + +interface ID3superformulaPath +{ + superformulaPath(params: number[], n: number, diameter: number): ID3superformula; +} + + +interface ID3superformulaType +{ + (any): any;//hans + m: number; + n1: number; + n2: number; + n3: number; + a: number; + b: number; +} + +interface ID3superformula +{ + (): any; + type(any): any; + param(name: string, value: number): ID3superformula; + size(x: number): ID3superformula; + segments(x: number): ID3superformula; +} +interface ID3Selectors +{ + +} + + +interface ID3Base extends ID3Selectors +{ + keys: ID3superformulaType[]; + superformula: ID3superformula; + superformulaPath: ID3superformulaPath; + superformulaTypes: ID3superformulaType[]; +} diff --git a/domo/domo-tests.ts b/domo/domo-tests.ts new file mode 100644 index 000000000..2f56be606 --- /dev/null +++ b/domo/domo-tests.ts @@ -0,0 +1,66 @@ +/// + +function opacity(pct) { + return { opacity: String(pct / 100), filter: "alpha(opacity=" + pct + ")" } +} + +HTML({ lang: "en" }, + HEAD( + TITLE("Welcome to d?mo"), + STYLE({ type: "text/css" }, + STYLE.on("body", { textAlign: "center", fontSize: 50 }), + STYLE.on("h1", opacity(50), { background: "#000", color: "#fff" }) + ) + ), + BODY(H1("Welcome to d?mo")) +); + +var withDomo = A({ href: "http://domo-js.com" }, "Learn about d?mo"); + +var withoutDomo = document.createElement("a"); +withoutDomo.setAttribute("href", "http://domo-js.com"); +withoutDomo.appendChild(document.createTextNode("Learn about d?mo")); + +var styleSheet = + STYLE({ type: "text/css" }, + STYLE.on("a", { color: "red" }), + STYLE.on("*", { margin: 0, padding: 0 }) + ); + +var blue = "#3B5998"; +var gray = "#3B3B3B"; +var defaultRadius = 10; + +function roundedCorners(radius) { + return { + borderRadius: radius, + WebkitBorderRadius: radius, + MozBorderRadius: radius + } +}; + +var styleSheet2 = + STYLE({ type: "text/css" }, + STYLE.on("h2", { color: gray }, roundedCorners(defaultRadius)), + STYLE.on("h1", { color: blue }, roundedCorners(defaultRadius * 2)) + ); + +var nestedStyles = + STYLE({ type: "text/css" }, + STYLE.on("a", { color: "red" }, + STYLE.on("img", { borderWidth: 0 }) + ) + ); + +var normalStyles = + STYLE({ type: "text/css" }, + STYLE.on("a", { color: "red" }), + STYLE.on("a img", { borderWidth: 0 }) + ); + +var domo = domo.global(false); + +domo.HTML( + domo.HEAD(domo.TITLE("Hello, world.")), + domo.BODY("Hello, world.") +); \ No newline at end of file diff --git a/domo/domo.d.ts b/domo/domo.d.ts new file mode 100644 index 000000000..73555dcf8 --- /dev/null +++ b/domo/domo.d.ts @@ -0,0 +1,121 @@ +// Type definitions for Domo 0.5 +// Project: http://domo-js.com/ +// Definitions by: Steve Fenton +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface Domo { + (attributes?: Object): string; + (attributes?: Object, ...content: string[]): string; + on(element: string, ...styles: Object[]): string; +} + +declare var A: Domo; +declare var ABBR: Domo; +declare var ACRONYM: Domo; +declare var ADDRESS: Domo; +declare var AREA: Domo; +declare var ARTICLE: Domo; +declare var ASIDE: Domo; +declare var AUDIO: Domo; +declare var B: Domo; +declare var BDI: Domo; +declare var BDO: Domo; +declare var BIG: Domo; +declare var BLOCKQUOTE: Domo; +declare var BODY: Domo; +declare var BR: Domo; +declare var BUTTON: Domo; +declare var CANVAS: Domo; +declare var CAPTION: Domo; +declare var CITE: Domo; +declare var CODE: Domo; +declare var COL: Domo; +declare var COLGROUP: Domo; +declare var COMMAND: Domo; +declare var DATALIST: Domo; +declare var DD: Domo; +declare var DEL: Domo; +declare var DETAILS: Domo; +declare var DFN: Domo; +declare var DIV: Domo; +declare var DL: Domo; +declare var DT: Domo; +declare var EM: Domo; +declare var EMBED: Domo; +declare var FIELDSET: Domo; +declare var FIGCAPTION: Domo; +declare var FIGURE: Domo; +declare var FOOTER: Domo; +declare var FORM: Domo; +declare var FRAME: Domo; +declare var FRAMESET: Domo; +declare var H1: Domo; +declare var H2: Domo; +declare var H3: Domo; +declare var H4: Domo; +declare var H5: Domo; +declare var H6: Domo; +declare var HEAD: Domo; +declare var HEADER: Domo; +declare var HGROUP: Domo; +declare var HR: Domo; +declare var HTML: Domo; +declare var I: Domo; +declare var IFRAME: Domo; +declare var IMG: Domo; +declare var INPUT: Domo; +declare var INS: Domo; +declare var KBD: Domo; +declare var KEYGEN: Domo; +declare var LABEL: Domo; +declare var LEGEND: Domo; +declare var LI: Domo; +declare var LINK: Domo; +declare var MAP: Domo; +declare var MARK: Domo; +declare var META: Domo; +declare var METER: Domo; +declare var NAV: Domo; +declare var NOSCRIPT: Domo; +declare var OBJECT: Domo; +declare var OL: Domo; +declare var OPTGROUP: Domo; +declare var OPTION: Domo; +declare var OUTPUT: Domo; +declare var P: Domo; +declare var PARAM: Domo; +declare var PRE: Domo; +declare var PROGRESS: Domo; +declare var Q: Domo; +declare var RP: Domo; +declare var RT: Domo; +declare var RUBY: Domo; +declare var SAMP: Domo; +declare var SCRIPT: Domo; +declare var SECTION: Domo; +declare var SELECT: Domo; +declare var SMALL: Domo; +declare var SOURCE: Domo; +declare var SPAN: Domo; +declare var SPLIT: Domo; +declare var STRONG: Domo; +declare var STYLE: Domo; +declare var SUB: Domo; +declare var SUMMARY: Domo; +declare var SUP: Domo; +declare var TABLE: Domo; +declare var TBODY: Domo; +declare var TD: Domo; +declare var TEXTAREA: Domo; +declare var TFOOT: Domo; +declare var TH: Domo; +declare var THEAD: Domo; +declare var TIME: Domo; +declare var TITLE: Domo; +declare var TR: Domo; +declare var TRACK: Domo; +declare var TT: Domo; +declare var UL: Domo; +declare var VAR: Domo; +declare var VIDEO: Domo; +declare var WBR: Domo; diff --git a/jquery.bootstrap.wizard/jquery.bootstrap.wizard.d.ts b/jquery.bootstrap.wizard/jquery.bootstrap.wizard.d.ts new file mode 100644 index 000000000..78a5730f1 --- /dev/null +++ b/jquery.bootstrap.wizard/jquery.bootstrap.wizard.d.ts @@ -0,0 +1,48 @@ +// Type definitions for twitter-bootstrap-wizard +// Project: https://github.com/VinceG/twitter-bootstrap-wizard +// Definitions by: Blake Niemyjski +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface WizardOptions { + tabClass?: string; + nextSelector?: string; + previousSelector?: string; + firstSelector?: string; + lastSelector?: string; + onShow?: (activeTab: any, navigation: any, nextIndex: number) => void; + onInit?: (activeTab: any, navigation: any, currentIndex: number) => void; + onNext?: (activeTab: any, navigation: any, nextIndex: number) => bool; + onPrevious?: (activeTab: any, navigation: any, previousIndex: number) => bool; + onLast?: (activeTab: any, navigation: any, lastIndex: number) => bool; + onFirst?: (activeTab: any, navigation: any, firstIndex: number) => bool; + onTabClick?: (activeTab: any, navigation: any, currentIndex: number) => bool; + onTabShow?: (activeTab: any, navigation: any, currentIndex: number) => bool; +} + +interface Wizard { + next(): void; + previous(): void; + first(): void; + last(): void; + currentIndex(): number; + firstIndex(): number; + lastIndex(): number; + getIndex(element: any): number; + nextIndex(): number; + previousIndex(): number; + navigationLength(): number; + activeTab(): any; + nextTab(): any; + previousTab(): any; + show(index: number): any; +} + +interface JQuery { + bootstrapWizard(options?: WizardOptions): Wizard; +} + +interface JQueryStatic { + bootstrapWizard: Wizard; +} \ No newline at end of file diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index ca43d94bc..4f566454a 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -126,6 +126,35 @@ interface JQueryEventObject extends Event { metaKey: any; } +interface JQueryInputEventObject extends JQueryEventObject +{ + altKey: bool; + ctrlKey: bool; + metaKey: bool; + shiftKey: bool; +} + +interface JQueryMouseEventObject extends JQueryInputEventObject +{ + button: number; + clientX: number; + clientY: number; + offsetX: number; + offsetY: number; + pageX: number; + pageY: number; + screenX: number; + screenY: number; +} + +interface JQueryKeyEventObject extends JQueryInputEventObject +{ + char: any; + charCode: number; + key: any; + keyCode: number; +} + /* Collection of properties of the current browser */ @@ -497,48 +526,48 @@ interface JQuery { hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery; hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery; - keydown(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - keydown(handler: (eventObject: JQueryEventObject) => any): JQuery; + keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; - keypress(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - keypress(handler: (eventObject: JQueryEventObject) => any): JQuery; + keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; - keyup(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - keyup(handler: (eventObject: JQueryEventObject) => any): JQuery; + keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; load(handler: (eventObject: JQueryEventObject) => any): JQuery; mousedown(): JQuery; - mousedown(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mousedown(handler: (eventObject: JQueryEventObject) => any): JQuery; + mousedown(eventData: any, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - mouseevent(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseevent(handler: (eventObject: JQueryEventObject) => any): JQuery; + mouseevent(eventData: any, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + mouseevent(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; mouseenter(): JQuery; - mouseenter(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseenter(handler: (eventObject: JQueryEventObject) => any): JQuery; + mouseenter(eventData: any, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; mouseleave(): JQuery; - mouseleave(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseleave(handler: (eventObject: JQueryEventObject) => any): JQuery; + mouseleave(eventData: any, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; mousemove(): JQuery; - mousemove(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mousemove(handler: (eventObject: JQueryEventObject) => any): JQuery; + mousemove(eventData: any, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; mouseout(): JQuery; - mouseout(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseout(handler: (eventObject: JQueryEventObject) => any): JQuery; + mouseout(eventData: any, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; mouseover(): JQuery; - mouseover(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseover(handler: (eventObject: JQueryEventObject) => any): JQuery; + mouseover(eventData: any, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; mouseup(): JQuery; - mouseup(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseup(handler: (eventObject: JQueryEventObject) => any): JQuery; + mouseup(eventData: any, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; off(events?: string, selector?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; off(eventsMap: { [key: string]: any; }, selector?: any): JQuery; diff --git a/numeraljs/numeraljs-tests.ts b/numeraljs/numeraljs-tests.ts new file mode 100644 index 000000000..4dadb0c0b --- /dev/null +++ b/numeraljs/numeraljs-tests.ts @@ -0,0 +1,42 @@ +/// +var valueFormat: string = numeral(1000).format('0,0'); +// '1,000' + +var valueUnformat: number = numeral().unformat('($10,000.00)'); +// '-10000' + +var value3: Numeral = numeral(1000); +var added: Numeral = value3.add(10); +// 1010 + +var value4: Numeral = numeral(1000); +var formatValue4a: string = value4.format('0,0'); +// '1,000' +var formatValue4b: number = value4.value(); +// 1000 + +var value5: Numeral = numeral(); +value5.set(1000); +var value5Num: number = value5.value(); +// 1000 + +var value6: Numeral = numeral(1000); +var value: number = 100; +var difference = value6.difference(value); +// 900 + +var value7: Numeral = numeral(0); +numeral.zeroFormat('N/A'); +var zeroString: string = value7.format('0.0') +// 'N/A' + +var a: Numeral = numeral(1000); +var b: Numeral = numeral(a); +var c: Numeral = a.clone(); + +var aVal: number = a.set(2000).value(); +// 2000 +var bVal: number = b.value(); +// 1000 +var cVal: number = c.add(10).value(); +// 1010 diff --git a/numeraljs/numeraljs.d.ts b/numeraljs/numeraljs.d.ts new file mode 100644 index 000000000..473353004 --- /dev/null +++ b/numeraljs/numeraljs.d.ts @@ -0,0 +1,46 @@ +// Type definitions for Numeral.js +// Project: https://github.com/adamwdraper/Numeral-js +// Definitions by: Vincent Bortone +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface NumeralJSStatic { + (value?: any): Numeral; +} + +interface NumeralJSLanguage { + delimiters: { + thousands: string; + decimal: string; + }; + abbreviations: { + thousand: string; + million: string; + billion: string; + trillion: string; + }; + ordinal(num: number): string; + currency: { + symbol: string; + }; +} + +interface Numeral { + (value?: any): Numeral; + version: string; + isNumeral: bool; + language(key: string, values?: NumeralJSLanguage): Numeral; + zeroFormat(format: string): string; + clone(): Numeral; + format(inputString: string): string; + unformat(inputString: string): number; + value(): number; + valueOf(): number; + set (value: any): Numeral; + add(value: any): Numeral; + subtract(value: any): Numeral; + multiply(value: any): Numeral; + divide(value: any): Numeral; + difference(value: any): number; +} + +declare var numeral: Numeral; \ No newline at end of file diff --git a/state-machine/state-machine.d.ts b/state-machine/state-machine.d.ts index a8682cdd5..0a0967c83 100644 --- a/state-machine/state-machine.d.ts +++ b/state-machine/state-machine.d.ts @@ -2,17 +2,11 @@ // Project: https://github.com/jakesgordon/javascript-state-machine // Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped +// Updated: 2013/01/22 by Maarten Docter interface ErrorCallback { - (name: string, from: string, to: string, args: any[]): void; -} - -interface EventCallback { - event: string; - from: string; - to: string; - msg?: string; + (eventName?: string, from?: string, to?: string, args?: any[], errorCode?: number, errorMessage?: string, ex?: Error): void; // NB. errorCode? See: StateMachine.Error } interface StateMachineEvent { @@ -24,26 +18,50 @@ interface StateMachineEvent { interface StateMachineConfig { initial?: any; // string or { state: 'foo', event: 'setup', defer: true|false } events?: StateMachineEvent[]; - callbacks?: any; + callbacks?: { + [s: string]: (event?: string, from?: string, to?: string, ...args: any[]) => any; + }; target?: any; error?: ErrorCallback; } interface StateMachineStatic { + + VERSION: string; // = "2.2.0" + WILDCARD: string; // = '*' + ASYNC: string; // = 'async' + + Result: { + SUCCEEDED: number; // = 1, the event transitioned successfully from one state to another + NOTRANSITION: number; // = 2, the event was successfull but no state transition was necessary + CANCELLED: number; // = 3, the event was cancelled by the caller in a beforeEvent callback + ASYNC: number; // = 4, the event is asynchronous and the caller is in control of when the transition occurs + }; + + Error: { + INVALID_TRANSITION: number; // = 100, caller tried to fire an event that was innapropriate in the current state + PENDING_TRANSITION: number; // = 200, caller tried to fire an event while an async transition was still pending + INVALID_CALLBACK: number; // = 300, caller provided callback function threw an exception + }; + create(config: StateMachineConfig, target?: any): StateMachine; } interface StateMachine { current: string; - is(sstate: string): bool; + is(state: string): bool; can(event: StateMachineEvent): bool; cannot(event: StateMachineEvent): bool; error: ErrorCallback; - onbeforeevent: EventCallback; - onleaveevent: EventCallback; - onenterevent: EventCallback; - onafterevent: EventCallback; + /* transition - only available when performing async state transitions; otherwise null. Can be a: + [1] function without arguments (see: https://github.com/jakesgordon/javascript-state-machine#asynchronous-state-transitions) + [2] property with a cancel function to cancel the ASYNC event. Example usages: + + [1] fsm.transition(); // called form async callback + [2] fsm.transition.cancel(); + */ + transition?: any; } declare var StateMachine: StateMachineStatic; \ No newline at end of file diff --git a/zeroclipboard/zeroclipboard.d.ts b/zeroclipboard/zeroclipboard.d.ts new file mode 100644 index 000000000..42191c0a8 --- /dev/null +++ b/zeroclipboard/zeroclipboard.d.ts @@ -0,0 +1,19 @@ +// Type definitions for ZeroClipboard +// Project: https://github.com/jonrohan/ZeroClipboard +// Definitions by: Eric J. Smith +// Updated by: Blake Niemyjski +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +module ZeroClipboard { + export function setMoviePath(moviePath: string); + + export class Client { + constructor(element?: any); + setText(text: string); + ready: bool; + clipText: string; + handCursorEnabled: bool; + cssEffects: bool; + glue(element); + } +} \ No newline at end of file