Skip to content

Commit 41ead74

Browse files
committed
Add definitions for stripe, knockout.es5, jquery.payment and jquery.superLink
1 parent 4bb55a2 commit 41ead74

File tree

6 files changed

+191
-4
lines changed

6 files changed

+191
-4
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,14 @@ List of Definitions
110110
* [jQuery.Flot](http://www.flotcharts.org/) (by [Matt Burland](https://github.com/burlandm))
111111
* [jQuery.form](http://malsup.com/jquery/form/) (by [François Guillot](http://fguillot.developpez.com/))
112112
* [jQuery.Globalize](https://github.com/jquery/globalize) (by [Boris Yankov](https://github.com/borisyankov))
113-
* [jQuery.gridster] (http://gridster.net) (by [Josh Baldwin](https://github.com/jbaldwin/gridster.d.ts))
113+
* [jQuery.gridster](http://gridster.net) (by [Josh Baldwin](https://github.com/jbaldwin/gridster.d.ts))
114114
* [jQuery.jNotify](http://jnotify.codeplex.com) (by [James Curran](https://github.com/jamescurran/))
115115
* [jQuery.noty](http://needim.github.io/noty/) (by [Aaron King](https://github.com/kingdango/))
116116
* [jQuery.pickadate](https://github.com/amsul/pickadate.js) (by [Theodore Brown](https://github.com/theodorejb))
117+
* [jQuery.payment](http://needim.github.io/noty/) (by [Eric J. Smith](https://github.com/ejsmith/))
117118
* [jQuery.scrollTo](https://github.com/flesler/jquery.scrollTo) (by [Neil Stalker](https://github.com/nestalk/))
118119
* [jQuery.simplePagination](https://github.com/flaviusmatis/simplePagination.js) (by [Natan Vivo](https://github.com/nvivo/))
120+
* [jquery.superLink](http://james.padolsey.com/demos/plugins/jQuery/superLink/superlink.jquery.js) (by [Blake Niemyjski](https://github.com/niemyjski))
119121
* [jQuery.timeago](http://timeago.yarp.com/) (by [François Guillot](http://fguillot.developpez.com/))
120122
* [jQuery.Timepicker](http://fgelinas.com/code/timepicker/) (by [Anwar Javed](https://github.com/anwarjaved))
121123
* [jQuery.TinyCarousel](http://baijs.nl/tinycarousel/) (by [Christiaan Rakowski](https://github.com/csrakowski))
@@ -168,6 +170,7 @@ List of Definitions
168170
* [PreloadJS](http://www.createjs.com/#!/PreloadJS) (by [Pedro Ferreira](https://bitbucket.org/drk4))
169171
* [QUnit](http://qunitjs.com/) (by [Diullei Gomes](https://github.com/Diullei))
170172
* [Raven.js](https://github.com/getsentry/raven-js) (by [Santi Albo](https://github.com/santialbo))
173+
* [Rickshaw](http://code.shutterstock.com/rickshaw/) (by [Blake Niemyjski](https://github.com/niemyjski))
171174
* [Restify](https://github.com/mcavage/node-restify) (by [Bret Little](https://github.com/blittle))
172175
* [Royalslider](http://dimsemenov.com/plugins/royal-slider/) (by [Christiaan Rakowski](https://github.com/csrakowski))
173176
* [Rx.js](http://rx.codeplex.com/) (by [gsino](http://www.codeplex.com/site/users/view/gsino))
@@ -180,11 +183,12 @@ List of Definitions
180183
* [SharePoint](http://sptypescript.codeplex.com) (by [Stanislav Vyshchepan](http://gandjustas.blogspot.ru) and [Andrey Markeev](http://markeev.com))
181184
* [SignalR](http://www.asp.net/signalr) (by [Boris Yankov](https://github.com/borisyankov))
182185
* [Sinon](http://sinonjs.org/) (by [William Sears](https://github.com/mrbigdog2u))
183-
* [SlickGrid] (https://github.com/mleibman/SlickGrid) (by [Josh Baldwin](https://github.com/jbaldwin))
186+
* [SlickGrid](https://github.com/mleibman/SlickGrid) (by [Josh Baldwin](https://github.com/jbaldwin))
184187
* [socket.io](http://socket.io) (by [William Orr](https://github.com/worr))
185188
* [SockJS](https://github.com/sockjs/sockjs-client) (by [Emil Ivanov](https://github.com/vladev))
186189
* [SoundJS](http://www.createjs.com/#!/SoundJS) (by [Pedro Ferreira](https://bitbucket.org/drk4))
187190
* [Spin](http://fgnass.github.com/spin.js/) (by [Boris Yankov](https://github.com/borisyankov))
191+
* [stripe](https://stripe.com/) (by [Eric J. Smith](https://github.com/ejsmith/))
188192
* [Store.js](https://github.com/marcuswestin/store.js/) (by [Vincent Bortone](https://github.com/vbortone))
189193
* [Sugar](http://sugarjs.com/) (by [Josh Baldwin](https://github.com/jbaldwin/))
190194
* [Swiper](http://www.idangero.us/sliders/swiper) (by [Sebastián Galiano](https://github.com/sgaliano))
@@ -216,7 +220,6 @@ List of Definitions
216220

217221
Requested Definitions
218222
---------------------
219-
* [Rickshaw](https://github.com/shutterstock/rickshaw)
220223
* [jQuery ScrollTo](https://github.com/balupton/jquery-scrollto)
221224
* [Crossfilter](https://github.com/square/crossfilter)
222225
* [dc.js](https://github.com/NickQiZhu/dc.js)
@@ -227,4 +230,4 @@ Requested Definitions
227230
* [java](https://github.com/nearinfinity/node-java)
228231
* [SVG.js](http://www.svgjs.com/)
229232

230-
In addition you can find the [updated open requests that you can contribute here](https://github.com/borisyankov/DefinitelyTyped/issues?labels=request&page=1&state=open)
233+
In addition you can find the [updated open requests that you can contribute here](https://github.com/borisyankov/DefinitelyTyped/issues?labels=request&page=1&state=open)

jquery.payment/jquery.payment.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Type definitions for jQuery.payment
2+
// Project: https://github.com/stripe/jquery.payment
3+
// Definitions by: Eric J. Smith <https://github.com/ejsmith/>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
interface JQuery {
7+
payment(validatorName: string);
8+
}
9+
10+
interface JQueryStatic {
11+
payment: JQueryPayment;
12+
}
13+
14+
interface JQueryPayment {
15+
validateCardNumber(cardNumber: string) : boolean;
16+
validateCardExpiry(year: string, month: string) : boolean;
17+
validateCardExpiry(expiry: any) : boolean;
18+
validateCardCVC(cvc: string, type: string) : boolean;
19+
cardType(cardNumber: string): string;
20+
cardExpiryVal(monthYear: string): JQueryPaymentExpiryInfo;
21+
}
22+
23+
interface JQueryPaymentExpiryInfo {
24+
month: number;
25+
year: number;
26+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Type definitions for jquery.superLink
2+
// Project: http://james.padolsey.com/demos/plugins/jQuery/superLink/superlink.jquery.js
3+
// Definitions by: Blake Niemyjski <https://github.com/niemyjski/>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
/// <reference path="../jquery/jquery.d.ts"/>
7+
8+
interface JQuery {
9+
superLink(link?: string): JQuery;
10+
}

knockout/knockout.amd.d.ts

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// Type definitions for Knockout 2.2 (as an AMD module)
2+
// Project: http://knockoutjs.com
3+
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
///<reference path="knockout.d.ts" />
6+
7+
declare module 'knockout' {
8+
export var utils: KnockoutUtils;
9+
export var memoization: KnockoutMemoization;
10+
export var bindingHandlers: KnockoutBindingHandlers;
11+
export var virtualElements: KnockoutVirtualElements;
12+
export var extenders: KnockoutExtenders;
13+
export function applyBindings(viewModel: any, rootNode?: any): void;
14+
export function applyBindingsToDescendants(viewModel: any, rootNode: any): void;
15+
export function applyBindingsToNode(node: Element, options: any, viewModel: any): void;
16+
export var subscribable: KnockoutSubscribableStatic;
17+
export var observable: KnockoutObservableStatic;
18+
export var computed: KnockoutComputedStatic;
19+
export var observableArray: KnockoutObservableArrayStatic;
20+
export function contextFor(node: any): any;
21+
export function isSubscribable(instance: any): boolean;
22+
export function toJSON(viewModel: any, replacer?: Function, space?: any): string;
23+
export function toJS(viewModel: any): any;
24+
export function isObservable(instance: any): boolean;
25+
export function isComputed(instance: any): boolean;
26+
export function dataFor(node: any): any;
27+
export function removeNode(node: Element);
28+
export function cleanNode(node: Element);
29+
export function renderTemplate(template: Function, viewModel: any, options?: any, target?: any, renderMode?: any);
30+
export function renderTemplate(template: string, viewModel: any, options?: any, target?: any, renderMode?: any);
31+
32+
//////////////////////////////////
33+
//// templateSources.js
34+
////////////////////////////////////
35+
export var templateSources: KnockoutTemplateSources;
36+
////////////////////////////////////
37+
//// templateEngine.js
38+
////////////////////////////////////
39+
export var templateEngine: {
40+
prototype: KnockoutTemplateEngine;
41+
new (): KnockoutTemplateEngine;
42+
};
43+
////////////////////////////////////
44+
//// templateRewriting.js
45+
////////////////////////////////////
46+
export var templateRewriting: {
47+
ensureTemplateIsRewritten(template, templateEngine, templateDocument);
48+
memoizeBindingAttributeSyntax(htmlString: string, templateEngine: KnockoutTemplateEngine);
49+
applyMemoizedBindingsToNextSibling(bindings);
50+
};
51+
////////////////////////////////////
52+
//// nativeTemplateEngine.js
53+
////////////////////////////////////
54+
export var nativeTemplateEngine: {
55+
prototype: KnockoutNativeTemplateEngine;
56+
new (): KnockoutNativeTemplateEngine;
57+
instance: KnockoutNativeTemplateEngine;
58+
};
59+
////////////////////////////////////
60+
//// jqueryTmplTemplateEngine.js
61+
////////////////////////////////////
62+
export var jqueryTmplTemplateEngine: {
63+
prototype: KnockoutTemplateEngine;
64+
renderTemplateSource(templateSource, bindingContext, options);
65+
createJavaScriptEvaluatorBlock(script: string): string;
66+
addTemplate(templateName, templateMarkup);
67+
};
68+
////////////////////////////////////
69+
//// templating.js
70+
////////////////////////////////////
71+
export function setTemplateEngine(templateEngine: KnockoutNativeTemplateEngine);
72+
export function renderTemplate(template, dataOrBindingContext, options, targetNodeOrNodeArray, renderMode);
73+
export function renderTemplateForEach(template, arrayOrObservableArray, options, targetNode, parentBindingContext);
74+
export var expressionRewriting: {
75+
bindingRewriteValidators: any;
76+
};
77+
78+
///////////////////////////////////
79+
export var bindingProvider: any;
80+
}

rickshaw/rickshaw.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Type definitions for Rickshaw
2+
// Project: http://code.shutterstock.com/rickshaw/
3+
// Definitions by: Blake Niemyjski <https://github.com/niemyjski/>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
declare var Rickshaw: any;

stripe/stripe.d.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Type definitions for stripe
2+
// Project: https://stripe.com/
3+
// Definitions by: Eric J. Smith <https://github.com/ejsmith/>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
interface StripeStatic {
7+
setPublishableKey(key: string);
8+
createToken(data: StripeTokenData, responseHandler: (status: number, response: StripeTokenResponse) => void);
9+
validateCardNumber(cardNumber: string): boolean;
10+
validateExpiry(month: string, year: string): boolean;
11+
validateCVC(cardCVC: string): boolean;
12+
cardType(cardNumber: string): string;
13+
getToken(token: string, responseHandler: (status: number, response: StripeTokenResponse) => void);
14+
}
15+
16+
interface StripeTokenData {
17+
number: string;
18+
exp_month: number;
19+
exp_year: number;
20+
cvc?: string;
21+
name?: string;
22+
address_line1?: string;
23+
address_line2?: string;
24+
address_city?: string;
25+
address_state?: string;
26+
address_zip?: string;
27+
address_country?: string;
28+
}
29+
30+
interface StripeTokenResponse {
31+
id: string;
32+
card: StripeCardData;
33+
created: number;
34+
currency: string;
35+
livemode: boolean;
36+
object: string;
37+
used: boolean;
38+
error: StripeError;
39+
}
40+
41+
interface StripeError {
42+
message: string;
43+
}
44+
45+
interface StripeCardData {
46+
object: string;
47+
last4: string;
48+
type: string;
49+
exp_month: number;
50+
exp_year: number;
51+
fingerprint: string;
52+
country?: string;
53+
name?: string;
54+
address_line1?: string;
55+
address_line2?: string;
56+
address_city?: string;
57+
address_state?: string;
58+
address_zip?: string;
59+
address_country?: string;
60+
}
61+
62+
declare var Stripe: StripeStatic;

0 commit comments

Comments
 (0)