definitelytyped / definitelytyped Goto Github PK
View Code? Open in Web Editor NEWThe repository for high quality TypeScript type definitions.
License: Other
The repository for high quality TypeScript type definitions.
License: Other
Boris,
For as much work as you have done with this project, you might add a way to donate or Flattr the project. That way, people who utilize the definitions and don't have time to contribute can show their appreciation. It's just a thought. Thanks again for your hard work!
I think, following changes should be made, to allow use of deferreds on ajax calls :
interface JQueryXHR extends XMLHttpRequest, JQueryPromise
ajax(settings: JQueryAjaxSettings):JQueryXHR;
ajax(url: string, settings: JQueryAjaxSettings):JQueryXHR;
///
class BusinessUnit extends Backbone.Model {
}
class BusinessUnitList extends Backbone.Collection {
model = BusinessUnit;
}
TypeScript compiler is complaining about the definition of model in the Collection class. I have downloaded and installed the latest backbone-0.9.d.ts file (with the updated "url" attribute).
This is an awesome little library for bootstrapjs http://bootboxjs.com/
I think these are wrong.
post(path: string, callbacks: any, callback: () => void ): void;
Shouldn't it be something more like:
interface IExpressHandler {
(req: express.ServerRequest, res:express.ServerResponse, next?:Function):void;
}
....
post(path: string, ...handlers: IExpressHandler[] ): void;
I think the function toJSON() from Model and Collection class must be any
type. Look http://backbonejs.org/#Model-toJSON
keyCode is missing from the event object.
$("aDialog").keypress(function(e) { if (e.keyCode == $.ui.keyCode.ENTER) {......
I added this to the d.ts file...
interface UI {
.
.
.
keyCode: any;
}
but I guess you could add a 'keyCodeEnum' class with all the values.
per this thread. The documentation was iffy on this point and i only noticed because the typescript definition file was yelling at me.
essentially:
reset(models : Model[], options? );
should be
reset(models?: Model[], options?);
yes i need to learn to do pull up requests.
Hi @borisyankov!
I've created a file manager project that use your DefinitelyTyped project as a repository. What do you think about?
My project: https://github.com/Diullei/tsd#readme
Tks!
See:
http://rxjsdts.codeplex.com/SourceControl/changeset/view/1a2b7804fc8a#rx.js.d.ts
I did not create it. I just saw the link on Twitter. Might be worth including...
I created a CodeMirror definition for my own usage, however if that can help someone
https://gist.github.com/3940192
The options for the fetch function in Backbone should be able to take any of the jQuery ajax settings, not just success and error.
tsc won't swallow that syntax so it either has to be fixed (somehow ^^) or commented out, i guess
Hi @borisyankov!
I saw that you need to update the History class of backbone source definition and put a function named navigate on backbone history class like:
export class History {
start(options? );
navigate(fragment: string, options: any);
}
Tks!
Maybe there's some really easy way to make this work in TS that I'm not seeing.
I want to load jQuery as an AMD module, not as a global. jquery.d.ts
as currently defined does not export a jquery external module. Instead it defines the $ and jQuery variables as global variables.
Is there a simple way to declare an external module that has the same signature as JQueryStatic?
If not, is it possible to change jquery.d.ts to support external module loading?
Here's how I have it working so far. The problem is I have to manually copy the whole JQueryStatic definition into jquery.d.ts. I don't want to do this. I want to take advantage of your work. Is there something I should do differently, or something that should be changed in jquery-1.8.d.ts?
folders
public/
components/
DefinitelyTyped/ (etc)
lib/
jquery.d.ts
main.ts
config.js
config.js
requirejs.config({
paths: {
'lib/jquery: 'path/to/jquery/lib',
}
})
main.ts
import $ = module("lib/jquery")
console.log("HI", $.ajax)
lib/jquery.d.ts
///<reference path="../components/DefinitelyTyped/Definitions/jquery-1.8.d.ts" />
declare module "lib/jquery" {
export function ajax(settings: JQueryAjaxSettings): JQueryXHR;
export function ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR;
export function (selector: string, context?: any): JQuery;
export function (element: Element): JQuery;
export function (object: { }): JQuery;
export function (elementArray: Element[]): JQuery;
export function (object: JQuery): JQuery;
export function (func: Function): JQuery;
export function (array: any[]): JQuery;
export function (): JQuery;
}
We updated toastr this week and added a few new API features. Love to see them added to your definition file. Summary of the changes are here: http://www.johnpapa.net/toastr-1-0-3-available/
UPDATE: I see you have clear()
There are also some new API parameters for the info, error, warning, and success methods. You can pass in optionsOverride to those for one time changes.
info = function (message, title, optionsOverride)
Thanks for adding toastr and the other libraries. Looking good!
easeljs uses a type "Image" wich is a variable and not a type in the typescript standard def file, i guess it should be HTMLImageElement because thats what using this Image-var returns.
Can you please add a definition for knockout.mapping.
In the jquery.d.ts the jQuery event mouseenter is missing, please add.
Thanks.
I use it to detect if a digest is in progress.
In the backbone.js source, in the Model object, this line exists:
_.extend(Model.prototype, Events ......
Should class def be like "export class Model extends Event { ... }"?
I noticed that some of the names of the typescript definitions don't match those of the scripts. For example:
chosen-0.9.d.ts -> chosen.jquery.js
bootstrap.datepicker.d.ts -> bootstrap-datepicker.js
knockout-2.2.d.ts -> knockout-2.2.0.js
knockoutmapping-2.0.d.ts -> knockout.mapping.-latest.js
I think they should be a 1.1 match with the readme having the version number (It's what version control is for:)).
Thanks for your time and hard work.
The following definition adds value over the current due to the fact you can specify a type of an observable and get intellisense for it: https://github.com/sv01a/TypeScript-Knockoutjs/blob/master/knockout.d.ts
Can we add this to the current typescript def?
Hello,
In the file angular-resource-1.0.d.ts there is a reference for the angular definition file:
reference path="angular-1.0.2.d.ts"
but the name of the file is angular-1.0.d.ts.
I have compared the content of the github file from Diego and the one I get from here and it's seams the same, so, I guess is just a name change issue.
Regards
In the JQuery interface, the callback for the each() function has wrong signature:
each(func: (index: any, elem: Element) => JQuery);
It should be:
each(func: (index: any, elem: Element) => any);
Returning false will stop the loop. Returning anything else (or nothing) will continue.
Add support for google. visualizations: https://developers.google.com/chart/interactive/docs/examples
One could copy most of the bootstrap datepicker to get this working (at the very least :)).
Project Information:
http://welldonethings.com/tags/manager
https://github.com/max-favilli/tagmanager
jquery-validate
jquery.unobtrusive-ajax.min.js
jquery.validate.unobtrusive.min.js
Hello, I'm working on the typescript definitions for createjs, you can see it here: https://bitbucket.org/drk4/createjs_ts_definitions
I think its a good idea to have the definitions on a single place so, if you're interested you can add it. It still needs testing, so maybe have a message saying that I suppose.
Cheers
To those new to typescript, please add usage examples
e.g.
<reference path="jquery.d.ts" />
interface JQueryDatePicker {
regional: any;
setDefaults(JQueryDatePickerDefaults);
formatDate: (format:string, date:Date, settings?) => void;
}
This is the most powerful animation library out there, and definitions would definitely be useful. Hell, you could probably just grab them from the AS3 version :)
http://www.greensock.com/v12/
http://www.greensock.com/gsap-js/
Backbone for instance is declared with the internal module style
declare module Backbone {
Why isn't it declared as an external module?
declare module "Backbone" {
See http://stackoverflow.com/questions/13049041/using-a-backbone-d-ts for more examples/details.
Hi nice definitions you have here, but don't you think we should try to not duplicate stuff like nodejs defs ? look over here: github.com/soywiz/typescript-node-definition
I'm not sure this is publicly supported yet, but I think the types file should contain it until it is dropped or improved.
Can you please add momentjs (https://github.com/Lakerfield/TypeScript.Definitions/blob/master/moment.d.ts)
Knockout permits the creation of observableArrays with an initialized value, e.g.
var x = ko.observableArray([1,2,3]);
This does not seem to be supported in the knockout library?
I modified the KnockoutObservableArrayStatic definition:
interface KnockoutObservableArrayStatic {
(): KnockoutObservableArray;
(value: any[]): KnockoutObservableArray;
fn: KnockoutObservableArrayFunctions;
}
the callback should be optional, as
var tmp = $.Deferred();
can be used to declare and create a new Deferred object.
JQueryDeferred interface is missing promise method.
https://github.com/eternicode/bootstrap-datepicker
I'm pretty bad at definition files, but here is one I made pretty quickly..
///
interface Datepicker {
show(e: any);
hide(e: any);
getDate(): Date;
getUTCDate(): Date;
setDate();
setUTCDate();
setValue();
setStartDate(startDate: Date);
setEndDate(endDate: Date);
place();
update();
fillDow();
fillMonths();
updateNavArrows();
click(e: any);
moveMonth(date: Date, dir: any);
moveYear(date: Date, dir: any);
dateWithinRange(date: Date): bool;
keydown(e: any);
datepicker(options: any);
}
interface JQuery {
datepicker(): Datepicker;
datepicker(options?: any): Datepicker;
}
Could you add a license file to DefinitelyTyped so that consumers of the library are clear of the terms of use.
'load' event handler is missing from jQuery type definition, e.g.
load(handler: (eventObject: JQueryEventObject) => any): JQuery;
load(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
I noticed some problems in your JQueryUI defintion, especialy the way you declare events. They should not be a method, but a property function.
For example in the Widget interface :
create(event: Event, ui): void;
should be in fact
create:(event: Event, ui)=> void;
Plus a lot of properties should be marked as optional etc.
In general we should find a way yo automate tests on lib files so we can be sure they perfectly match the true library, because at the moment i'm pretty sure none of the files presents in this repository are exacts.
One thing that needs to be addresses before it gets out of control is making sure that version numbers are embedded into the file name so that we can match definition versions with library versions.
For example the express.d.ts is not for the current version of express.js found at expressjs.com or on Github. The express.d.ts here appears to be for version 2.* of express.
Something like express.2.x.d.ts and jquery.1.8.1.d.ts seems reasonable enough.
I get the following errors:
jasmine.d.ts(16,40): The name 'JasmineSpyMatchers' does not exist in the current scope
jasmine.d.ts(17,42): The name 'JasmineSpyMatchers' does not exist in the current scope
jasmine.d.ts(17,29): The name 'JasmineSpy' does not exist in the current scope
jasmine.d.ts(20,53): The name 'JasmineSpyOn' does not exist in the current scope
jasmine.d.ts(17,29): The name 'JasmineSpy' does not exist in the current scope
Hi, this was added to KO a couple of releases back. Please add.
Thanks.
We have a flat structure in our scripts directory.. Thus I could easily copy and paste your updated definitions and check in the ones that changed.. This made it really easy, now its a PITA, and all the reference paths in the scripts are wrong... Any package manager npm/nuget will place libraries like jquery in the root scripts folder.
https://gist.github.com/3956226
Here is a dynatree deinitions file
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.