GithubHelp home page GithubHelp logo

definitelytyped / definitelytyped Goto Github PK

View Code? Open in Web Editor NEW
47.2K 657.0 29.8K 663.81 MB

The repository for high quality TypeScript type definitions.

License: Other

TypeScript 99.92% JavaScript 0.07% Shell 0.01%
typescript definition dts types typings typescript-definitions hacktoberfest

definitelytyped's Issues

Add a way to donate to the project

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!

jquery ajax definitions

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;

Express route middleware

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;

keyCode is missing from jQueryUI

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.

Backbone fetch options

The options for the fetch function in Backbone should be able to take any of the jQuery ajax settings, not just success and error.

Backbone.history.navigate function is missing

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!

jQuery AMD Module Issues

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.tsas 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;
}

new toastr v1.0.3 API changes

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 using invalid Image type

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.

Backbone.js - extends Event?

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 { ... }"?

Inconsistent definition names.

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.

Wrong name for Angular defenition

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

each() in JQuery

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.

DatePicker is missing "formatDate"

interface JQueryDatePicker {
regional: any;
setDefaults(JQueryDatePickerDefaults);
formatDate: (format:string, date:Date, settings?) => void;
}

typescript definition duplication hell

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

knockout-2.1d.ts observableArray issue

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;
}

Add support for bootstrap datepicker.

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;
}

Include license file

Could you add a license file to DefinitelyTyped so that consumers of the library are clear of the terms of use.

jQuery type definition is missing load event handler

'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;

JQuery UI definitions file problems, and in general lack of test for definitions files

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.

Version Numbering...

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.

Jasmine definitions doesn't compile

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

Please revert back to the old structure...

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.