From 15f015047d6f64af308fc6239c3b72cd5873cd98 Mon Sep 17 00:00:00 2001 From: hansrwindhoff Date: Mon, 21 Jan 2013 21:18:52 -0800 Subject: [PATCH 01/13] Create superformula.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit definitions for the superformula.js d3 plugin  https://raw.github.com/d3/d3-plugins/master/superformula/superformula.js --- d3/superformula.ts | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 d3/superformula.ts diff --git a/d3/superformula.ts b/d3/superformula.ts new file mode 100644 index 000000000..bb1703c14 --- /dev/null +++ b/d3/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[]; +} From bb2198f4d8169e7eb73df4b82a9baaefc1b3f252 Mon Sep 17 00:00:00 2001 From: Maarten Docter Date: Tue, 22 Jan 2013 11:02:16 +0100 Subject: [PATCH 02/13] Added missing ASYNC stuff + some bug fixes Added all stuff required to use the ASYNC features of StateMachine and refined some other modelled functions / properties. Also removed: - onbeforeevent: EventCallback; - onleaveevent: EventCallback; - onenterevent: EventCallback; - onafterevent: EventCallback; and the EventCallback interface. StateMachine dynamically adds event functions depending on the config being used. These can't be modelled in this file. The four event callbacks from above could wrongly suggest that these event callbacks are present on the returned StateMachine instance. Also noticed a bug in the StateMachine code. The StateMachine is wrongly using the StateMachine.Result constants. The author forgot the add the Result property to the code, so he's now returning StateMachine.SUCCEEDED instead of StateMachine.Result.SUCCEEDED. I will create a pull-request to fix this issue. --- state-machine/state-machine-2.2.d.ts | 46 +++++++++++++++++++--------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/state-machine/state-machine-2.2.d.ts b/state-machine/state-machine-2.2.d.ts index a8682cdd5..0a0967c83 100644 --- a/state-machine/state-machine-2.2.d.ts +++ b/state-machine/state-machine-2.2.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 From 0e32032ca42eb5d4bb73644a0fde5fdae2819087 Mon Sep 17 00:00:00 2001 From: choffmeister Date: Wed, 23 Jan 2013 17:10:30 +0100 Subject: [PATCH 03/13] added specific event interfaces for key and mouse events. fixes #208 --- jquery/jquery.d.ts | 73 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 51 insertions(+), 22 deletions(-) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index ca43d94bc..865c44918 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -126,6 +126,35 @@ interface JQueryEventObject extends Event { metaKey: any; } +interface JInputQueryEventObject extends JQueryEventObject +{ + altKey: bool; + ctrlKey: bool; + metaKey: bool; + shiftKey: bool; +} + +interface JMouseQueryEventObject extends JInputQueryEventObject +{ + button: number; + clientX: number; + clientY: number; + offsetX: number; + offsetY: number; + pageX: number; + pageY: number; + screenX: number; + screenY: number; +} + +interface JKeyQueryEventObject extends JInputQueryEventObject +{ + 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: JKeyQueryEventObject) => any): JQuery; + keydown(handler: (eventObject: JKeyQueryEventObject) => any): JQuery; - keypress(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - keypress(handler: (eventObject: JQueryEventObject) => any): JQuery; + keypress(eventData?: any, handler?: (eventObject: JKeyQueryEventObject) => any): JQuery; + keypress(handler: (eventObject: JKeyQueryEventObject) => any): JQuery; - keyup(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - keyup(handler: (eventObject: JQueryEventObject) => any): JQuery; + keyup(eventData?: any, handler?: (eventObject: JKeyQueryEventObject) => any): JQuery; + keyup(handler: (eventObject: JKeyQueryEventObject) => 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: JMouseQueryEventObject) => any): JQuery; + mousedown(handler: (eventObject: JMouseQueryEventObject) => any): JQuery; - mouseevent(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseevent(handler: (eventObject: JQueryEventObject) => any): JQuery; + mouseevent(eventData: any, handler: (eventObject: JMouseQueryEventObject) => any): JQuery; + mouseevent(handler: (eventObject: JMouseQueryEventObject) => any): JQuery; mouseenter(): JQuery; - mouseenter(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseenter(handler: (eventObject: JQueryEventObject) => any): JQuery; + mouseenter(eventData: any, handler: (eventObject: JMouseQueryEventObject) => any): JQuery; + mouseenter(handler: (eventObject: JMouseQueryEventObject) => any): JQuery; mouseleave(): JQuery; - mouseleave(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseleave(handler: (eventObject: JQueryEventObject) => any): JQuery; + mouseleave(eventData: any, handler: (eventObject: JMouseQueryEventObject) => any): JQuery; + mouseleave(handler: (eventObject: JMouseQueryEventObject) => any): JQuery; mousemove(): JQuery; - mousemove(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mousemove(handler: (eventObject: JQueryEventObject) => any): JQuery; + mousemove(eventData: any, handler: (eventObject: JMouseQueryEventObject) => any): JQuery; + mousemove(handler: (eventObject: JMouseQueryEventObject) => any): JQuery; mouseout(): JQuery; - mouseout(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseout(handler: (eventObject: JQueryEventObject) => any): JQuery; + mouseout(eventData: any, handler: (eventObject: JMouseQueryEventObject) => any): JQuery; + mouseout(handler: (eventObject: JMouseQueryEventObject) => any): JQuery; mouseover(): JQuery; - mouseover(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseover(handler: (eventObject: JQueryEventObject) => any): JQuery; + mouseover(eventData: any, handler: (eventObject: JMouseQueryEventObject) => any): JQuery; + mouseover(handler: (eventObject: JMouseQueryEventObject) => any): JQuery; mouseup(): JQuery; - mouseup(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseup(handler: (eventObject: JQueryEventObject) => any): JQuery; + mouseup(eventData: any, handler: (eventObject: JMouseQueryEventObject) => any): JQuery; + mouseup(handler: (eventObject: JMouseQueryEventObject) => any): JQuery; off(events?: string, selector?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; off(eventsMap: { [key: string]: any; }, selector?: any): JQuery; From 55133f6297cbaa86ebda39c01e8e8b5f3c6f6f44 Mon Sep 17 00:00:00 2001 From: choffmeister Date: Wed, 23 Jan 2013 17:26:29 +0100 Subject: [PATCH 04/13] fixed systematic typo in interface names. fixes #208 --- jquery/jquery.d.ts | 50 +++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 865c44918..4f566454a 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -126,7 +126,7 @@ interface JQueryEventObject extends Event { metaKey: any; } -interface JInputQueryEventObject extends JQueryEventObject +interface JQueryInputEventObject extends JQueryEventObject { altKey: bool; ctrlKey: bool; @@ -134,7 +134,7 @@ interface JInputQueryEventObject extends JQueryEventObject shiftKey: bool; } -interface JMouseQueryEventObject extends JInputQueryEventObject +interface JQueryMouseEventObject extends JQueryInputEventObject { button: number; clientX: number; @@ -147,7 +147,7 @@ interface JMouseQueryEventObject extends JInputQueryEventObject screenY: number; } -interface JKeyQueryEventObject extends JInputQueryEventObject +interface JQueryKeyEventObject extends JQueryInputEventObject { char: any; charCode: number; @@ -526,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: JKeyQueryEventObject) => any): JQuery; - keydown(handler: (eventObject: JKeyQueryEventObject) => any): JQuery; + keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; - keypress(eventData?: any, handler?: (eventObject: JKeyQueryEventObject) => any): JQuery; - keypress(handler: (eventObject: JKeyQueryEventObject) => any): JQuery; + keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; - keyup(eventData?: any, handler?: (eventObject: JKeyQueryEventObject) => any): JQuery; - keyup(handler: (eventObject: JKeyQueryEventObject) => 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: JMouseQueryEventObject) => any): JQuery; - mousedown(handler: (eventObject: JMouseQueryEventObject) => any): JQuery; + mousedown(eventData: any, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - mouseevent(eventData: any, handler: (eventObject: JMouseQueryEventObject) => any): JQuery; - mouseevent(handler: (eventObject: JMouseQueryEventObject) => any): JQuery; + mouseevent(eventData: any, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + mouseevent(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; mouseenter(): JQuery; - mouseenter(eventData: any, handler: (eventObject: JMouseQueryEventObject) => any): JQuery; - mouseenter(handler: (eventObject: JMouseQueryEventObject) => any): JQuery; + mouseenter(eventData: any, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; mouseleave(): JQuery; - mouseleave(eventData: any, handler: (eventObject: JMouseQueryEventObject) => any): JQuery; - mouseleave(handler: (eventObject: JMouseQueryEventObject) => any): JQuery; + mouseleave(eventData: any, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; mousemove(): JQuery; - mousemove(eventData: any, handler: (eventObject: JMouseQueryEventObject) => any): JQuery; - mousemove(handler: (eventObject: JMouseQueryEventObject) => any): JQuery; + mousemove(eventData: any, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; mouseout(): JQuery; - mouseout(eventData: any, handler: (eventObject: JMouseQueryEventObject) => any): JQuery; - mouseout(handler: (eventObject: JMouseQueryEventObject) => any): JQuery; + mouseout(eventData: any, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; mouseover(): JQuery; - mouseover(eventData: any, handler: (eventObject: JMouseQueryEventObject) => any): JQuery; - mouseover(handler: (eventObject: JMouseQueryEventObject) => any): JQuery; + mouseover(eventData: any, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; mouseup(): JQuery; - mouseup(eventData: any, handler: (eventObject: JMouseQueryEventObject) => any): JQuery; - mouseup(handler: (eventObject: JMouseQueryEventObject) => 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; From 51dfad8435ae39e3fe60cbdc80fc045e18dd4cda Mon Sep 17 00:00:00 2001 From: Steve Fenton Date: Wed, 23 Jan 2013 09:29:33 -0800 Subject: [PATCH 05/13] Create domo.d.ts First draft of definition file for Domo JS. If accepted, this will need to go into a folder (which I can't do using the GitHub Web UI). --- domo.d.ts | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 domo.d.ts diff --git a/domo.d.ts b/domo.d.ts new file mode 100644 index 000000000..d657a6a55 --- /dev/null +++ b/domo.d.ts @@ -0,0 +1,121 @@ +// Type definitions for Domo 0.5.7 +// 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; From 8d16022cdedeb9549ad482d11871d50ff63285f2 Mon Sep 17 00:00:00 2001 From: Boris Yankov Date: Wed, 23 Jan 2013 20:09:55 +0200 Subject: [PATCH 06/13] Move d3 superformula plugin to dedicated folder --- d3/{ => plugins}/superformula.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename d3/{ => plugins}/superformula.ts (100%) diff --git a/d3/superformula.ts b/d3/plugins/superformula.ts similarity index 100% rename from d3/superformula.ts rename to d3/plugins/superformula.ts From ef76f42c49f361f8fa4f4abd248ca5401ae5e46c Mon Sep 17 00:00:00 2001 From: Boris Yankov Date: Wed, 23 Jan 2013 20:25:26 +0200 Subject: [PATCH 07/13] Move domo to a dedicate folder --- domo.d.ts => domo/domo.d.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename domo.d.ts => domo/domo.d.ts (100%) diff --git a/domo.d.ts b/domo/domo.d.ts similarity index 100% rename from domo.d.ts rename to domo/domo.d.ts From ef2997f9b777861726150400530a740327019461 Mon Sep 17 00:00:00 2001 From: Boris Yankov Date: Wed, 23 Jan 2013 21:04:21 +0200 Subject: [PATCH 08/13] Add domo tests --- domo/domo-tests.ts | 66 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 domo/domo-tests.ts 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 From da819d6080c4c7aa2816345ead3a94a587a203ae Mon Sep 17 00:00:00 2001 From: Boris Yankov Date: Wed, 23 Jan 2013 21:06:15 +0200 Subject: [PATCH 09/13] Update domo definitions readme and metadata --- README.md | 1 + domo/domo.d.ts | 242 ++++++++++++++++++++++++------------------------- 2 files changed, 122 insertions(+), 121 deletions(-) diff --git a/README.md b/README.md index ea97bba14..f8784e6cf 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)) diff --git a/domo/domo.d.ts b/domo/domo.d.ts index d657a6a55..73555dcf8 100644 --- a/domo/domo.d.ts +++ b/domo/domo.d.ts @@ -1,121 +1,121 @@ -// Type definitions for Domo 0.5.7 -// 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; +// 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; From 80dd1892b57191a0323dd3f03065a47606dbb37c Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Wed, 23 Jan 2013 14:39:28 -0600 Subject: [PATCH 10/13] Updated Request read me. Added definitions for ZeroClipboard and twitter-bootstrap-wizard. --- README.md | 5 +- ZeroClipboard/ZeroClipboard.d.ts | 19 ++++++++ .../jquery.bootstrap.wizard.d.ts | 48 +++++++++++++++++++ 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 ZeroClipboard/ZeroClipboard.d.ts create mode 100644 jquery.bootstrap.wizard/jquery.bootstrap.wizard.d.ts diff --git a/README.md b/README.md index f8784e6cf..01f26a72f 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,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/)) @@ -123,9 +124,12 @@ 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 --------------------- +* [Numeral-js](https://github.com/adamwdraper/Numeral-js) +* [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) @@ -133,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/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 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 From 2c0c45a040e3a9a473bbd0f6d2e62e86bf8faecc Mon Sep 17 00:00:00 2001 From: Boris Yankov Date: Thu, 24 Jan 2013 00:30:35 +0200 Subject: [PATCH 11/13] Fix ZeroClipboard folder/file case --- .../ZeroClipboard.d.ts => zeroclipboard/zeroclipboard.d.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ZeroClipboard/ZeroClipboard.d.ts => zeroclipboard/zeroclipboard.d.ts (100%) diff --git a/ZeroClipboard/ZeroClipboard.d.ts b/zeroclipboard/zeroclipboard.d.ts similarity index 100% rename from ZeroClipboard/ZeroClipboard.d.ts rename to zeroclipboard/zeroclipboard.d.ts From 0979c4799113938021ed9dc4b06ffa9c24263484 Mon Sep 17 00:00:00 2001 From: Vincent Bortone Date: Wed, 23 Jan 2013 18:55:36 -0500 Subject: [PATCH 12/13] Added Numeral.js Added Numeral.js definition and tests. --- numeraljs/numeraljs-tests.ts | 42 ++++++++++++++++++++++++++++++++ numeraljs/numeraljs.d.ts | 46 ++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 numeraljs/numeraljs-tests.ts create mode 100644 numeraljs/numeraljs.d.ts 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 From 1adfae9d6bfd10efe039f3da19a5cb52593d2f11 Mon Sep 17 00:00:00 2001 From: Boris Yankov Date: Thu, 24 Jan 2013 03:20:37 +0200 Subject: [PATCH 13/13] Update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 01f26a72f..f3fa36b01 100644 --- a/README.md +++ b/README.md @@ -94,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/)) @@ -128,7 +129,6 @@ List of Definitions Requested Definitions --------------------- -* [Numeral-js](https://github.com/adamwdraper/Numeral-js) * [Rickshaw](https://github.com/shutterstock/rickshaw) * [Crossfilter](https://github.com/square/crossfilter) * [dc.js](https://github.com/NickQiZhu/dc.js)