This commit is contained in:
EWOUT-QMINO\Ewout
2015-02-10 08:55:41 +01:00
15 changed files with 3361 additions and 1535 deletions
+1
View File
@@ -712,6 +712,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](tween.js/tween.js.d.ts) [tween.js r12](https://github.com/sole/tween.js) by [sunetos](https://github.com/sunetos), [jzarnikov](https://github.com/jzarnikov)
* [:link:](tweenjs/tweenjs.d.ts) [TweenJS](http://www.createjs.com/#!/TweenJS) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist)
* [:link:](twig/twig.d.ts) [twig](https://github.com/justjohn/twig.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
* [:link:](twitter/twitter.d.ts) [Twitter for Websites](https://dev.twitter.com/web) by [Chitoku](https://github.com/chitoku-k)
* [:link:](jquery.bootstrap.wizard/jquery.bootstrap.wizard.d.ts) [twitter-bootstrap-wizard](https://github.com/VinceG/twitter-bootstrap-wizard) by [Blake Niemyjski](https://github.com/niemyjski)
* [:link:](type-detect/type-detect.d.ts) [type-detect](https://github.com/chaijs/type-detect) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](typeahead/typeahead.d.ts) [typeahead.js](http://twitter.github.io/typeahead.js) by [Ivaylo Gochkov](https://github.com/igochkov), [Gidon Junge](https://github.com/gjunge)
+2 -2
View File
@@ -9,7 +9,7 @@ declare module ng.angularFileUpload {
interface IUploadService {
http<T>(config: IFileUploadConfig): IUploadPromise<T>;
http<T>(config: ng.IRequestConfig): IUploadPromise<T>;
upload<T>(config: IFileUploadConfig): IUploadPromise<T>;
}
@@ -23,4 +23,4 @@ declare module ng.angularFileUpload {
file: File;
fileName?: string;
}
}
}
+25 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for BigInteger.js
// Project: https://github.com/peterolson/BigInteger.js
// Definitions by: Ingo Bürk <https://github.com/Airblader>
// Definitions by: Ingo Bürk <https://github.com/Airblader>, Roel van Uden <https://github.com/Deathspike>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface BigInteger {
@@ -167,6 +167,30 @@ interface BigInteger {
/** Checks if two numbers are not equal. */
notEquals( number: string ): boolean;
/** Performs the bitwise AND operation. */
and( number: number ): BigInteger;
/** Performs the bitwise AND operation. */
and( number: BigInteger ): BigInteger;
/** Performs the bitwise AND operation. */
and( number: string ): BigInteger;
/** Performs the bitwise NOT operation. */
not(): BigInteger;
/** Performs the bitwise OR operation. */
or( number: number ): BigInteger;
/** Performs the bitwise OR operation. */
or( number: BigInteger ): BigInteger;
/** Performs the bitwise OR operation. */
or( number: string ): BigInteger;
/** Performs the bitwise XOR operation. */
xor( number: number ): BigInteger;
/** Performs the bitwise XOR operation. */
xor( number: BigInteger ): BigInteger;
/** Performs the bitwise XOR operation. */
xor( number: string ): BigInteger;
/** Converts a bigInt into a native Javascript number. Loses precision for numbers outside the range. */
toJSNumber(): number;
+62 -91
View File
@@ -21,8 +21,8 @@ declare module chrome.alarms {
name: string;
}
interface AlarmEvent extends chrome.events.Event {
addListener(callback: (alarm: Alarm) => void) : void;
interface AlarmEvent extends chrome.events.Event {
addListener(callback: (alarm: Alarm) => void): void;
}
export function create(alarmInfo: AlarmCreateInfo): void;
@@ -32,7 +32,7 @@ declare module chrome.alarms {
export function clear(name?: string): void;
export function get(callback: (alarm: Alarm) => void): void;
export function get(name: string, callback: (alarm: Alarm) => void): void;
var onAlarm: AlarmEvent;
}
@@ -60,7 +60,7 @@ declare module chrome.bookmarks {
index: number;
oldIndex: number;
parentId: string;
oldParentId: string;
oldParentId: string;
}
interface BookmarkChangeInfo {
@@ -72,7 +72,7 @@ declare module chrome.bookmarks {
childIds: string[];
}
interface BookmarkRemovedEvent extends chrome.events.Event {
interface BookmarkRemovedEvent extends chrome.events.Event {
addListener(callback: (id: string, removeInfo: BookmarkRemoveInfo) => void): void;
}
@@ -227,10 +227,10 @@ declare module chrome.browsingData {
// Commands
////////////////////
declare module chrome.commands {
interface CommandEvent extends chrome.events.Event {
interface CommandEvent extends chrome.events.Event {
addListener(callback: (command: string) => void): void;
}
var onCommand: CommandEvent;
}
@@ -471,7 +471,7 @@ declare module chrome.declarativeWebRequest {
lowerPriorityThan: number;
}
interface RedirectToEmptyDocument {}
interface RedirectToEmptyDocument { }
interface RedirectRequest {
redirectUrl: string;
@@ -497,7 +497,7 @@ declare module chrome.declarativeWebRequest {
modification: ResponseCookie;
}
interface CancelRequest {}
interface CancelRequest { }
interface RemoveRequestHeader {
name: string;
@@ -523,7 +523,7 @@ declare module chrome.declarativeWebRequest {
from: string;
}
interface RedirectToTransparentImage {}
interface RedirectToTransparentImage { }
interface AddRequestCookie {
cookie: RequestCookie;
@@ -535,7 +535,7 @@ declare module chrome.declarativeWebRequest {
interface RequestedEvent extends chrome.events.Event {
addListener(callback: Function): void;
}
}
var onRequest: RequestedEvent;
}
@@ -886,7 +886,7 @@ declare module chrome.fileBrowserHandler {
interface FileHandlerExecuteEventDetails {
tab_id?: number;
entries: any[];
selectFile(selectionParams: SelectionParams, callback:(result: SelectionResult) => void): void;
selectFile(selectionParams: SelectionParams, callback: (result: SelectionResult) => void): void;
}
interface FileBrowserHandlerExecuteEvent extends chrome.events.Event {
@@ -1043,7 +1043,7 @@ declare module chrome.history {
// Identity
////////////////////
declare module chrome.identity {
var getAuthToken: (options:any, cb:(token:{})=>void)=>void;
var getAuthToken: (options: any, cb: (token: {}) => void) => void;
}
@@ -1533,7 +1533,7 @@ declare module chrome.runtime {
arch: string;
nacl_arch: string;
}
interface Port {
postMessage: Function;
sender?: MessageSender;
@@ -1592,7 +1592,7 @@ declare module chrome.runtime {
interface RuntimeUpdateAvailableEvent extends chrome.events.Event {
addListener(callback: (details: UpdateAvailableDetails) => void): void;
}
export function connect(connectInfo?: ConnectInfo): Port;
export function connect(extensionId: string, connectInfo?: ConnectInfo): Port;
export function connectNative(application: string): Port;
@@ -1608,7 +1608,7 @@ declare module chrome.runtime {
export function sendMessage(message: any, options: MessageOptions, responseCallback?: (response: any) => void): void;
export function sendMessage(extensionId: string, message: any, responseCallback?: (response: any) => void): void;
export function sendMessage(extensionId: string, message: any, options: MessageOptions, responseCallback?: (response: any) => void): void;
export function sendNativeMessage(application: string, message: any, responseCallback?: (response: any) => void ): void;
export function sendNativeMessage(application: string, message: any, responseCallback?: (response: any) => void): void;
export function setUninstallUrl(url: string): void;
var onConnect: ExtensionConnectEvent;
@@ -2095,88 +2095,59 @@ declare module chrome.webNavigation {
interface GetAllFrameDetails {
tabId: number;
}
interface GetAllFrameResultDetails extends GetFrameResultDetails {
processId: number;
frameId: number;
}
interface ReferenceFragmentUpdatedDetails {
processId: number;
interface CallbackBasicDetails {
tabId: number;
transitionType: string;
url: string;
timeStamp: number;
frameId: number;
transitionQualifiers: string;
}
interface CompletedDetails {
interface CallbackDetails extends CallbackBasicDetails {
processId: number;
tabId: number;
url: string;
timeStamp: number;
frameId: number;
}
interface HistoryStateUpdatedDetails {
processId: number;
tabId: number;
interface CallbackTransitionDetails extends CallbackDetails {
transitionType: string;
url: string;
timeStamp: number;
frameId: number;
transitionQualifiers: string[];
}
interface CreatedNavigationTargetDetails {
tabId: number;
interface ReferenceFragmentUpdatedDetails extends CallbackTransitionDetails {
}
interface CompletedDetails extends CallbackDetails {
}
interface HistoryStateUpdatedDetails extends CallbackTransitionDetails {
}
interface CreatedNavigationTargetDetails extends CallbackBasicDetails {
url: string;
timeStamp: number;
sourceTabId: number;
sourceProcessId: number;
sourceFrameId: number;
}
interface TabReplacedDetails {
tabId: number;
interface TabReplacedDetails extends CallbackBasicDetails {
replacedTabId: number;
timeStamp: number;
}
interface BeforeNavigateDetails {
processId: number;
tabId: number;
url: string;
timeStamp: number;
frameId: number;
interface BeforeNavigateDetails extends CallbackDetails {
parentFrameId: number;
}
interface CommittedDetails {
processId: number;
tabId: number;
transitionType: string;
url: string;
timeStamp: number;
frameId: number;
transitionQualifiers: string[];
interface CommittedDetails extends CallbackTransitionDetails {
}
interface DomContentLoadedDetails {
processId: number;
tabId: number;
url: string;
timeStamp: number;
frameId: number;
interface DomContentLoadedDetails extends CallbackDetails {
}
interface ErrorOccurredDetails {
processId: number;
tabId: number;
url: string;
timeStamp: number;
frameId: number;
interface ErrorOccurredDetails extends CallbackDetails {
error: string;
}
@@ -2185,11 +2156,11 @@ declare module chrome.webNavigation {
}
interface WebNavigationReferenceFragmentUpdatedEvent extends chrome.events.Event {
addListener(callback: (details: ReferenceFragmentUpdatedDetails) => void, filters? : WebNavigationEventFilters): void;
addListener(callback: (details: ReferenceFragmentUpdatedDetails) => void, filters?: WebNavigationEventFilters): void;
}
interface WebNavigationCompletedEvent extends chrome.events.Event {
addListener(callback: (details: CompletedDetails) => void, filters? : WebNavigationEventFilters): void;
addListener(callback: (details: CompletedDetails) => void, filters?: WebNavigationEventFilters): void;
}
interface WebNavigationHistoryStateUpdatedEvent extends chrome.events.Event {
@@ -2222,7 +2193,7 @@ declare module chrome.webNavigation {
export function getFrame(details: GetFrameDetails, callback: (details?: GetFrameResultDetails) => void): void;
export function getAllFrames(details: GetAllFrameDetails, callback: (details?: GetAllFrameResultDetails[]) => void): void;
var onReferenceFragmentUpdated: WebNavigationReferenceFragmentUpdatedEvent;
var onCompleted: WebNavigationCompletedEvent;
var onHistoryStateUpdated: WebNavigationHistoryStateUpdatedEvent;
@@ -2242,13 +2213,13 @@ declare module chrome.webRequest {
username: string;
password: string;
}
interface HttpHeader {
name: string;
value?: string;
binaryValue?: ArrayBuffer;
}
interface BlockingResponse {
cancel?: boolean;
redirectUrl?: string;
@@ -2269,9 +2240,9 @@ declare module chrome.webRequest {
file?: string;
}
interface WebRequestCallbackDetails {
interface CallbackDetails {
requestId: string;
url: string;
url: string;
method: string;
tabId: number;
frameId: number;
@@ -2280,20 +2251,20 @@ declare module chrome.webRequest {
type: string;
}
interface OnCompletedDetails extends WebRequestCallbackDetails {
interface OnCompletedDetails extends CallbackDetails {
ip?: string;
statusLine?: string;
responseHeaders?: HttpHeader[];
fromCache: boolean;
fromCache: boolean;
statusCode: number;
}
interface OnHeadersReceivedDetails extends WebRequestCallbackDetails {
interface OnHeadersReceivedDetails extends CallbackDetails {
statusLine?: string;
responseHeaders?: HttpHeader[];
}
interface OnBeforeRedirectDetails extends WebRequestCallbackDetails {
interface OnBeforeRedirectDetails extends CallbackDetails {
ip?: string;
statusLine?: string;
responseHeaders?: HttpHeader[];
@@ -2307,7 +2278,7 @@ declare module chrome.webRequest {
port: number;
}
interface OnAuthRequiredDetails extends WebRequestCallbackDetails {
interface OnAuthRequiredDetails extends CallbackDetails {
statusLine?: string;
challenger: Challenger;
responseHeaders?: HttpHeader[];
@@ -2316,17 +2287,17 @@ declare module chrome.webRequest {
scheme: string;
}
interface OnBeforeSendHeadersDetails extends WebRequestCallbackDetails {
interface OnBeforeSendHeadersDetails extends CallbackDetails {
requestHeaders?: HttpHeader[];
}
interface OnErrorOccurredDetails extends WebRequestCallbackDetails {
interface OnErrorOccurredDetails extends CallbackDetails {
ip?: string;
fromCache: boolean;
error: string;
}
interface OnResponseStartedDetails extends WebRequestCallbackDetails {
interface OnResponseStartedDetails extends CallbackDetails {
ip?: string;
statusLine?: string;
responseHeaders?: HttpHeader[];
@@ -2334,7 +2305,7 @@ declare module chrome.webRequest {
statusCode: number;
}
interface OnSendHeadersDetails extends WebRequestCallbackDetails {
interface OnSendHeadersDetails extends CallbackDetails {
requestHeaders?: HttpHeader[];
}
@@ -2344,51 +2315,51 @@ declare module chrome.webRequest {
formData?: Object;
}
interface OnBeforeRequestDetails extends WebRequestCallbackDetails {
interface OnBeforeRequestDetails extends CallbackDetails {
requestBody?: RequestBody;
}
interface WebRequestCompletedEvent extends chrome.events.Event {
interface WebRequestCompletedEvent extends chrome.events.Event {
addListener(callback: (details: OnCompletedDetails) => BlockingResponse, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
removeListener(callback: (details: OnCompletedDetails) => BlockingResponse): void;
}
interface WebRequestHeadersReceivedEvent extends chrome.events.Event {
interface WebRequestHeadersReceivedEvent extends chrome.events.Event {
addListener(callback: (details: OnHeadersReceivedDetails) => BlockingResponse, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
removeListener(callback: (details: OnHeadersReceivedDetails) => BlockingResponse): void;
}
interface WebRequestBeforeRedirectEvent extends chrome.events.Event {
interface WebRequestBeforeRedirectEvent extends chrome.events.Event {
addListener(callback: (details: OnBeforeRedirectDetails) => BlockingResponse, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
removeListener(callback: (details: OnBeforeRedirectDetails) => BlockingResponse): void;
}
interface WebRequestAuthRequiredEvent extends chrome.events.Event {
interface WebRequestAuthRequiredEvent extends chrome.events.Event {
addListener(callback: (details: OnAuthRequiredDetails, callback?: (response: BlockingResponse) => void) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
removeListener(callback: (details: OnAuthRequiredDetails, callback?: (response: BlockingResponse) => void) => void): void;
}
interface WebRequestBeforeSendHeadersEvent extends chrome.events.Event {
interface WebRequestBeforeSendHeadersEvent extends chrome.events.Event {
addListener(callback: (details: OnBeforeSendHeadersDetails) => BlockingResponse, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
removeListener(callback: (details: OnBeforeSendHeadersDetails) => BlockingResponse): void;
}
interface WebRequestErrorOccurredEvent extends chrome.events.Event {
interface WebRequestErrorOccurredEvent extends chrome.events.Event {
addListener(callback: (details: OnErrorOccurredDetails) => BlockingResponse, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
removeListener(callback: (details: OnErrorOccurredDetails) => BlockingResponse): void;
}
interface WebRequestResponseStartedEvent extends chrome.events.Event {
interface WebRequestResponseStartedEvent extends chrome.events.Event {
addListener(callback: (details: OnResponseStartedDetails) => BlockingResponse, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
removeListener(callback: (details: OnResponseStartedDetails) => BlockingResponse): void;
}
interface WebRequestSendHeadersEvent extends chrome.events.Event {
interface WebRequestSendHeadersEvent extends chrome.events.Event {
addListener(callback: (details: OnSendHeadersDetails) => BlockingResponse, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
removeListener(callback: (details: OnSendHeadersDetails) => BlockingResponse): void;
}
interface WebRequestBeforeRequestEvent extends chrome.events.Event {
interface WebRequestBeforeRequestEvent extends chrome.events.Event {
addListener(callback: (details: OnBeforeRequestDetails) => BlockingResponse, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
removeListener(callback: (details: OnBeforeRequestDetails) => BlockingResponse): void;
}
@@ -2396,7 +2367,7 @@ declare module chrome.webRequest {
var MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES: number;
export function handlerBehaviorChanged(callback?: Function): void;
var onCompleted: WebRequestCompletedEvent;
var onHeadersReceived: WebRequestHeadersReceivedEvent;
var onBeforeRedirect: WebRequestBeforeRedirectEvent;
+25 -24
View File
@@ -287,8 +287,8 @@ interface JQueryPromiseCallback<T> {
}
interface JQueryPromiseOperator<T, R> {
(callback: JQueryPromiseCallback<T>, ...callbacks: JQueryPromiseCallback<T>[]): JQueryPromise<R>;
(callback: JQueryPromiseCallback<T>[], ...callbacks: JQueryPromiseCallback<T>[]): JQueryPromise<R>;
(callback: JQueryPromiseCallback<T>, ...callbacks: JQueryPromiseCallback<T>[]): JQueryPromise<R>;
(callback: JQueryPromiseCallback<T>[], ...callbacks: JQueryPromiseCallback<T>[]): JQueryPromise<R>;
}
/**
@@ -301,28 +301,28 @@ interface JQueryPromise<T> {
* @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
* @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
*/
always: JQueryPromiseOperator<any, T>;
always: JQueryPromiseOperator<any, T>;
/**
* Add handlers to be called when the Deferred object is resolved.
*
* @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
* @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
*/
done: JQueryPromiseOperator<T, T>;
done: JQueryPromiseOperator<T, T>;
/**
* Add handlers to be called when the Deferred object is rejected.
*
* @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
* @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
*/
fail: JQueryPromiseOperator<any, T>;
fail: JQueryPromiseOperator<any, T>;
/**
* Add handlers to be called when the Deferred object generates progress notifications.
*
* @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
*/
progress(progressCallback: JQueryPromiseCallback<T>): JQueryPromise<T>;
progress(progressCallbacks: JQueryPromiseCallback<T>[]): JQueryPromise<T>;
progress(progressCallback: JQueryPromiseCallback<T>): JQueryPromise<T>;
progress(progressCallbacks: JQueryPromiseCallback<T>[]): JQueryPromise<T>;
/**
* Determine the current state of a Deferred object.
@@ -393,7 +393,7 @@ interface JQueryDeferred<T> extends JQueryPromise<T> {
*/
progress(progressCallback: JQueryPromiseCallback<T>): JQueryDeferred<T>;
progress(progressCallbacks: JQueryPromiseCallback<T>[]): JQueryDeferred<T>;
/**
* Call the progressCallbacks on a Deferred object with the given args.
*
@@ -1259,7 +1259,7 @@ interface JQuery {
* @param attributeName The name of the attribute to set.
* @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments.
*/
attr(attributeName: string, func: (index: number, attr: any) => any): JQuery;
attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery;
/**
* Set one or more attributes for the set of matched elements.
*
@@ -1481,12 +1481,12 @@ interface JQuery {
*/
outerHeight(includeMargin?: boolean): number;
/**
* Sets the outer height on elements in the set of matched elements, including padding and border.
*
* @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
*/
outerHeight(height: number|string): JQuery;
/**
* Sets the outer height on elements in the set of matched elements, including padding and border.
*
* @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
*/
outerHeight(height: number|string): JQuery;
/**
* Get the current computed width for the first element in the set of matched elements, including padding and border.
@@ -2587,7 +2587,7 @@ interface JQuery {
*
* param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
*/
after(func: (index: number) => any): JQuery;
after(func: (index: number, html: string) => string|Element|JQuery): JQuery;
/**
* Insert content, specified by the parameter, to the end of each element in the set of matched elements.
@@ -2601,7 +2601,7 @@ interface JQuery {
*
* param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
*/
append(func: (index: number, html: string) => any): JQuery;
append(func: (index: number, html: string) => string|Element|JQuery): JQuery;
/**
* Insert every element in the set of matched elements to the end of the target.
@@ -2622,7 +2622,7 @@ interface JQuery {
*
* param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
*/
before(func: (index: number) => any): JQuery;
before(func: (index: number, html: string) => string|Element|JQuery): JQuery;
/**
* Create a deep copy of the set of matched elements.
@@ -2670,7 +2670,7 @@ interface JQuery {
*
* param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
*/
prepend(func: (index: number, html: string) => any): JQuery;
prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery;
/**
* Insert every element in the set of matched elements to the beginning of the target.
@@ -2704,7 +2704,7 @@ interface JQuery {
*
* param func A function that returns content with which to replace the set of matched elements.
*/
replaceWith(func: () => any): JQuery;
replaceWith(func: () => Element|JQuery): JQuery;
/**
* Get the combined text contents of each element in the set of matched elements, including their descendants.
@@ -2744,7 +2744,7 @@ interface JQuery {
*
* @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
*/
wrap(func: (index: number) => any): JQuery;
wrap(func: (index: number) => string|JQuery): JQuery;
/**
* Wrap an HTML structure around all elements in the set of matched elements.
@@ -2752,6 +2752,7 @@ interface JQuery {
* @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
*/
wrapAll(wrappingElement: JQuery|Element|string): JQuery;
wrapAll(func: (index: number) => string): JQuery;
/**
* Wrap an HTML structure around the content of each element in the set of matched elements.
@@ -2764,7 +2765,7 @@ interface JQuery {
*
* @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
*/
wrapInner(func: (index: number) => any): JQuery;
wrapInner(func: (index: number) => string): JQuery;
/**
* Iterate over a jQuery object, executing a function for each matched element.
@@ -2965,7 +2966,7 @@ interface JQuery {
*
* @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element.
*/
is(func: (index: number) => any): boolean;
is(func: (index: number, element: Element) => boolean): boolean;
/**
* Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
*
@@ -3038,7 +3039,7 @@ interface JQuery {
*
* @param func A function used as a test for each element in the set. this is the current DOM element.
*/
not(func: (index: number) => any): JQuery;
not(func: (index: number, element: Element) => boolean): JQuery;
/**
* Remove elements from the set of matched elements.
*
+10 -3
View File
@@ -98,7 +98,7 @@ Tracker.autorun(function () {
});
console.log("Current room has " +
Counts.findOne(Session.get("roomId")).count +
Counts.find(Session.get("roomId")).count +
" messages.");
/**
@@ -144,8 +144,15 @@ var result = Meteor.call('foo', 1, 2);
* From Collections, Mongo.Collection section
*/
// DA: I added the "var" keyword in there
var Chatrooms = new Mongo.Collection("chatrooms");
Messages = new Mongo.Collection("messages");
interface ChatroomsDAO {
_id?: string;
}
interface MessagesDAO {
_id?: string;
}
var Chatrooms = new Mongo.Collection<ChatroomsDAO>("chatrooms");
Messages = new Mongo.Collection<MessagesDAO>("messages");
var myMessages = Messages.find({userId: Session.get('myUserId')}).fetch();
+85 -76
View File
@@ -8,8 +8,9 @@
*/
interface EJSON extends JSON {}
interface Template {
[templateName: string]: Meteor.Template;
interface TemplateStatic {
new(): Template;
[templateName: string]: Meteor.TemplatePage;
}
declare module Match {
@@ -61,12 +62,7 @@ declare module Meteor {
[id:string]:Meteor.EventHandlerFunction;
}
// Same definition as top-level Template Interface
interface TemplateBase {
[templateName: string]: Meteor.Template;
}
interface Template {
interface TemplatePage {
rendered: Function;
created: Function;
destroyed: Function;
@@ -326,12 +322,15 @@ declare module Blaze {
function getData(elementOrView?: HTMLElement | Blaze.View): Object;
function getView(element?: HTMLElement): Blaze.View;
function Template(viewName?: string, renderFunction?: Function): void;
interface Template{
}
function TemplateInstance(view: Blaze.View): void;
interface TemplateInstance {
data(): Object;
view(): Object;
firstNode(): Object;
lastNode(): Object;
interface TemplateInstance{
data: Object;
view: Object;
firstNode: Object;
lastNode: Object;
$(selector: string): Node[];
findAll(selector: string): HTMLElement[];
find(selector?: string): HTMLElement;
@@ -339,6 +338,9 @@ declare module Blaze {
}
function View(name?: string, renderFunction?: Function): void;
interface View{
}
}
declare module Match {
@@ -365,8 +367,8 @@ declare module EJSON {
}): boolean;
function clone<T>(val:T): T;
function CustomType(): void;
interface CustomType {
typeName(): string;
interface CustomType{
typeName(): string;
toJSONValue(): JSON;
clone(): EJSON.CustomType;
equals(other: Object): boolean;
@@ -418,6 +420,9 @@ declare module Meteor {
rootUrl?: string;
}): string;
function Error(error: string, reason?: string, details?: string): void;
interface Error{
}
}
declare module Mongo {
@@ -426,8 +431,8 @@ declare module Mongo {
idGeneration?: string;
transform?: Function;
}): void;
interface Collection<T> {
insert(doc: Object, callback?: Function): string;
interface Collection<T>{
insert(doc: Object, callback?: Function): string;
update(selector: Mongo.Selector, modifier: Mongo.Modifier, options?: {
multi?: boolean;
upsert?: Boolean;
@@ -468,9 +473,12 @@ declare module Mongo {
}
function ObjectID(hexString: string): void;
interface ObjectID{
}
function Cursor<T>(): void;
interface Cursor<T> {
forEach(callback: Function, thisArg?: any): void;
interface Cursor<T>{
forEach(callback: Function, thisArg?: any): void;
map(callback: Function, thisArg?: any): void;
fetch(): Array<T>;
count(): number;
@@ -484,10 +492,10 @@ declare module Tracker {
var active: boolean;
var currentComputation: Tracker.Computation;
function Computation(): void;
interface Computation {
stopped(): boolean;
invalidated(): boolean;
firstRun(): boolean;
interface Computation{
stopped: boolean;
invalidated: boolean;
firstRun: boolean;
onInvalidate(callback: Function): void;
invalidate(): void;
stop(): void;
@@ -499,8 +507,8 @@ declare module Tracker {
function onInvalidate(callback: Function): void;
function afterFlush(callback: Function): void;
function Dependency(): void;
interface Dependency {
depend(fromComputation?: Tracker.Computation): boolean
interface Dependency{
depend(fromComputation?: Tracker.Computation): boolean
changed(): void;
hasDependents(): boolean
}
@@ -594,79 +602,80 @@ declare module Email {
}
declare function Subscription(): void;
declare module Subscription {
var connection: Meteor.Connection;
var userId: string;
function error(error: Error): void;
function stop(): void;
function onStop(func: Function): void;
function added(collection: string, id: string, fields: Object): void;
function changed(collection: string, id: string, fields: Object): void;
function removed(collection: string, id: string): void;
function ready(): void;
interface Subscription{
connection: Meteor.Connection;
userId: string;
error(error: Error): void;
stop(): void;
onStop(func: Function): void;
added(collection: string, id: string, fields: Object): void;
changed(collection: string, id: string, fields: Object): void;
removed(collection: string, id: string): void;
ready(): void;
}
declare function ReactiveVar(initialValue: any, equalsFunc?: (oldVal:any, newVal:any)=>boolean): void;
declare module ReactiveVar {
function get(): any;
function set(newValue: any): void;
declare function ReactiveVar<T>(initialValue: T, equalsFunc?: Function): void;
interface ReactiveVar<T>{
get(): T;
set(newValue: T): void;
}
declare function Template(): void;
declare module Template {
var onCreated; /** TODO: add return value **/
var onRendered; /** TODO: add return value **/
var onDestroyed; /** TODO: add return value **/
var created: Function;
var rendered: Function;
var destroyed: Function;
var body: Meteor.TemplateBase;
function helpers(helpers:{[id:string]: any}): void;
function events(eventMap: {[actions: string]: Function}): void;
function instance(): Blaze.TemplateInstance;
function currentData(): {};
function parentData(numLevels?: number): {};
function registerHelper(name: string, helperFunction: Function): void;
declare var Template: TemplateStatic;
// TemplateStatic interface should be defined separately at top with static methods
interface Template{
onCreated: Function;
onRendered: Function;
onDestroyed: Function;
created: Function;
rendered: Function;
destroyed: Function;
body: TemplateStatic;
helpers(helpers:{[id:string]: any}): void;
events(eventMap: {[actions: string]: Function}): void;
instance(): Blaze.TemplateInstance;
currentData(): {};
parentData(numLevels?: number): {};
registerHelper(name: string, helperFunction: Function): void;
}
declare function CompileStep(): void;
declare module CompileStep {
var inputSize; /** TODO: add return value **/
var inputPath; /** TODO: add return value **/
var fullInputPath; /** TODO: add return value **/
var pathForSourceMap; /** TODO: add return value **/
var packageName; /** TODO: add return value **/
var rootOutputPath; /** TODO: add return value **/
var arch; /** TODO: add return value **/
var fileOptions; /** TODO: add return value **/
var declaredExports; /** TODO: add return value **/
function read(n?: number); /** TODO: add return value **/
function addHtml(options: {
interface CompileStep{
inputSize; /** TODO: add return value **/
inputPath; /** TODO: add return value **/
fullInputPath; /** TODO: add return value **/
pathForSourceMap; /** TODO: add return value **/
packageName; /** TODO: add return value **/
rootOutputPath; /** TODO: add return value **/
arch; /** TODO: add return value **/
fileOptions; /** TODO: add return value **/
declaredExports; /** TODO: add return value **/
read(n?: number); /** TODO: add return value **/
addHtml(options: {
section?: string;
data?: string;
}); /** TODO: add return value **/
function addStylesheet(options: {
addStylesheet(options: {
}, path: string, data: string, sourceMap: string); /** TODO: add return value **/
function addJavaScript(options: {
addJavaScript(options: {
path?: string;
data?: string;
sourcePath?: string;
}); /** TODO: add return value **/
function addAsset(options: {
addAsset(options: {
}, path: string, data: any /** Buffer **/ | string); /** TODO: add return value **/
function error(options: {
error(options: {
}, message: string, sourcePath?: string, line?: number, func?: string); /** TODO: add return value **/
}
declare function PackageAPI(): void;
declare module PackageAPI {
function use(packageNames: string | string[], architecture?: string, options?: {
interface PackageAPI{
use(packageNames: string | string[], architecture?: string, options?: {
weak?: boolean;
unordered?: Boolean;
}): void;
function imply(packageSpecs: string | string[]): void;
function addFiles(filename: string | string[], architecture?: string): void;
function versionsFrom(meteorRelease: string | string[]): void;
// function export(exportedObject: string, architecture?: string): void;
imply(packageSpecs: string | string[]): void;
addFiles(filename: string | string[], architecture?: string): void;
versionsFrom(meteorRelease: string | string[]): void;
export(exportedObject: string, architecture?: string): void;
}
+1334
View File
File diff suppressed because it is too large Load Diff
+1334 -1334
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -2,7 +2,6 @@
"private": true,
"name": "DefinitelyTyped",
"version": "0.0.1",
"private": true,
"homepage": "https://github.com/borisyankov/DefinitelyTyped",
"repository": {
"type": "git",
+3 -1
View File
@@ -211,4 +211,6 @@ declare module PageJS {
declare module "page" {
var page: PageJS.Static;
export = page;
}
}
declare var page: PageJS.Static;
+1 -1
View File
@@ -246,7 +246,7 @@ declare module SigmaJs{
// Global settings
autoResize?: boolean;
autoRescale?: boolean;
autoRescale?: any;
enableCamera?: boolean;
enableHovering?: boolean;
enableEdgeHovering?: boolean;
+127
View File
@@ -0,0 +1,127 @@
/// <reference path="twitter.d.ts" />
function load() {
twttr.widgets.load();
twttr.widgets.load(document.getElementById("elm"));
}
function createShareButton() {
twttr.widgets.createShareButton(
"https://dev.twitter.com/",
document.getElementById("new-button"),
{
count: "none",
text: "Sharing a URL using the Tweet Button"
}).then((el: HTMLElement) => {
console.log("Button created.")
});
}
function createFollowButton() {
twttr.widgets.createFollowButton(
"endform",
document.getElementById("new-button"),
{
size: "large"
}).then((el: HTMLElement) => {
console.log("Follow button created.")
});
}
function createTweet() {
twttr.widgets.createTweet(
"511181794914627584",
document.getElementById("first-tweet"),
{
align: "left"
}).then((el: HTMLElement) => {
console.log("@ev's Tweet has been displayed.")
});
}
function createTimeline() {
twttr.widgets.createTimeline(
"123456",
document.getElementById("timeline"),
{
width: "450",
height: "700",
related: "twitterdev,twitterapi"
}).then((el: HTMLElement) => {
console.log("Embedded a timeline.")
});
}
function bindEvent() {
twttr.events.bind(
"click",
ev => {
console.log(ev);
}
);
}
function getReady() {
twttr.ready(
twttr => {
// bind events here
}
);
}
function bindLoadedEvent() {
twttr.events.bind(
"loaded",
event => {
event.widgets.forEach((widget: any) => {
console.log("Created widget", widget.id);
});
}
);
}
function bindRenderedEvent() {
twttr.events.bind(
"rendered",
event => {
console.log("Created widget", event.target.id);
}
);
}
function bindTweetEvent() {
twttr.events.bind(
"tweet",
event => {
// Do something there
}
);
}
function bindFollowEvent() {
twttr.events.bind(
"follow",
event => {
var followedUserId = event.data.user_id;
var followedScreenName = event.data.screen_name;
}
);
}
function bindRetweetEvent() {
twttr.events.bind(
"retweet",
event => {
var retweetedTweetId = event.data.source_tweet_id;
}
);
}
function bindFavoriteEvent() {
twttr.events.bind(
"favorite",
event => {
var favoritedTweetId = event.data.tweet_id;
}
);
}
+342
View File
@@ -0,0 +1,342 @@
// Type definitions for Twitter for Websites
// Project: https://dev.twitter.com/web/
// Definitions by: Chitoku <https://github.com/chitoku-k>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/**
* The interface for Twitter for Websites.
*/
interface Twitter {
/**
* All JavaScript code depending on widgets.js should execute on or after this function.
*
* @param callback A callback function which will be invoked when widgets.js is ready.
*/
ready(callback: (twttr: Twitter) => void): void;
/**
* Twitter widgets.
*/
widgets: TwitterWidgets;
/**
* Twitter events.
*/
events: TwitterEvents;
}
/**
* The interface for Twitter for Websites widgets.
*/
interface TwitterWidgets {
/**
* Initialize Twitter for Websites widgets contained within a page.
*/
load(): void;
/**
* Initialize Twitter for Websites widgets contained within children of the element.
*/
load(element: HTMLElement): void;
/**
* Initialize Twitter for Websites widgets contained within children of the elements.
*/
load(elements: HTMLElement[]): void;
/**
* Create a share button for a URL.
*
* @param url The URL to be shared.
* @param target The element in which to render the widget.
* @param options An object hash of additional options to configure the widget.
*/
createShareButton(url: string, target: HTMLElement, options?: TwitterButtonWidgetOptions): any;
/**
* Create a follow button for a user.
*
* @param screen_name The screen_name of a user to be followed.
* @param target The element in which to render the widget.
* @param options An object hash of additional options to configure the widget.
*/
createFollowButton(screen_name: string, target: HTMLElement, options?: TwitterButtonWidgetOptions): any;
/**
* Create a hashtag button for a hashtag.
*
* @param hashtag Hashtag to be Tweeted and displayed on the button.
* @param target The element in which to render the widget.
* @param options An object hash of additional options to configure the widget.
*/
createHashtagButton(hashtag: string, target: HTMLElement, options?: TwitterButtonWidgetOptions): any;
/**
* Create a mention button for a user.
*
* @param screen_name The screen_name of a user to be mentioned.
* @param target The element in which to render the widget.
* @param options An object hash of additional options to configure the widget.
*/
createMentionButton(screen_name: string, target: HTMLElement, options?: TwitterButtonWidgetOptions): any;
/**
* Create a timeline widget.
*
* @param widgetId The ID of a timeline widget to be rendered.
* @param target The element in which to render the widget.
* @param options An object hash of additional options to configure the widget.
*/
createTimeline(widgetId: string, target: HTMLElement, options?: TwitterTimelineWidgetOptions): any;
/**
* Create an embedded Tweet for a Tweet.
*
* @param tweetId The ID of a Tweet to be rendered.
* @param target The element in which to render the widget.
* @param options An object hash of additional options to configure the widget.
*/
createTweet(tweetId: string, target: HTMLElement, options?: TwitterTweetWidgetOptions): any;
}
/**
* The interface for additional configuration for all widgets.
*/
interface TwitterWidgetOptions {
/**
* Enable Do Not Track for this widget.
*/
dnt?: boolean;
/**
* A list of hashtags to be appended to default Tweet text where appropriate.
*/
hashtags?: string;
/**
* The language in which to render a widget, if supported.
*/
lang?: string;
/**
* A list of Twitter screen names to be suggested for following after a Tweet is posted.
*/
related?: string;
/**
* A Twitter user mentioned in the default Tweet text as /via @user where appropriate.
*/
via?: string;
}
/**
* The interface for additional configuration for button widgets.
*/
interface TwitterButtonWidgetOptions extends TwitterWidgetOptions {
/**
* The alignment of the button within an iframe; use this to ensure flush layout when aligning buttons against opposite edges of your grid.
*/
align?: string;
/**
* Share button and Follow button only. (Vertical count only available for share buttons.)
*/
count?: string;
/**
* If the canonical URL to be counted is different from the URL to be shared, you can provide this URL to reference the count. (Share button only.)
*/
counturl?: string;
/**
* medium or large
*/
size?: string;
/**
* The default, highlighted text a user sees in the Tweet Web Intent.
*/
text?: string;
}
/**
* The interface for additional options for embedded Tweets.
*/
interface TwitterTweetWidgetOptions extends TwitterWidgetOptions {
/**
* Float the embedded Tweet to the left or right so that text wraps around it, or align center so it floats in the middle of a paragraph.
*/
align?: string;
/**
* For Tweets that are replies, the previous Tweet in the thread will be displayed by default. Use none to hide the thread and show a Tweet alone.
*/
conversation?: string;
/**
* Toggle whether to render expanded media through Twitter Cards in Tweets. Also applies to images uploaded to Twitter.
*/
cards?: string;
/**
* Fix the width of the embedded widget.
*/
width?: string|number;
/**
* Adjust the color of links inside the widget.
*/
linkColor?: string;
/**
* Toggle the default colorscheme of the widget.
*/
theme?: string;
}
/**
* The interface for additional options for embedded Timelines.
*/
interface TwitterTimelineWidgetOptions extends TwitterWidgetOptions, TwitterButtonWidgetOptions, TwitterTweetWidgetOptions {
/**
* Apply the specified aria-polite behavior to the rendered timeline.
*/
ariaPolite?: string;
/**
* Fix the height of the embedded widget.
*/
height?: string|number;
/**
* Adjust the color of borders inside the widget.
*/
borderColor?: string;
/**
* Toggle the display of design elements in the widget. This parameter is a space-separated list of values.
*/
chrome?: string;
/**
* Render a timeline statically, displaying only n number of Tweets.
*/
tweetLimit?: number;
/**
* Override the timeline source with this users Tweets.
*/
screenName?: string;
/**
* Override the timeline source with this users Tweets.
*/
userId?: string;
/**
* When overriding a user timeline, include Tweets that are in reply to to other users.
*/
showReplies?: boolean;
/**
* Override the timeline source with favourite Tweets from this user.
*/
favoritesScreenName?: string;
/**
* Override the timeline source with favourite Tweets from this user.
*/
favoritesUserId?: string;
/**
* Override the timeline source with Tweets from a list owned by this user. Must be used in combination with listId or listSlug.
*/
listOwnerScreenName?: string;
/**
* Override the timeline source with Tweets from a list owned by this user. Must be used in combination with listId or listSlug.
*/
listOwnerId?: string;
/**
* Override the timeline source with Tweets from this list. Must be used in combination with listOwnerId or listOwnerScreenName.
*/
listId?: string;
/**
* Override the timeline source with Tweets from this list. Must be used in combination with listOwnerId or listOwnerScreenName.
*/
listSlug?: string;
}
/**
* The interface for Twitter events.
*/
interface TwitterEvents {
/**
* Occurs after twttr.widgets.load has initialized widgets in a page, from an embed code. Includes an array of references to the newly created widget nodes.
*
* @param name The name of an event.
* @param callback A callback function which will be invoked.
*/
bind(name: "loaded", callback: (ev: any) => void): void;
/**
* Bind an event occurs after an individual widget in a page is rendered. Includes a of reference to the newly created widget node. Occurs at the same time as loaded, but for each individual widget. Also triggered when creating a widget with a factory function.
*
* @param name The name of an event.
* @param callback A callback function which will be invoked.
*/
bind(name: "rendered", callback: (ev: any) => void): void;
/**
* Bind an event which will be triggered when the user publishes a Tweet (either new, or a reply) through the Tweet Web Intent.
*
* @param name The name of an event.
* @param callback A callback function which will be invoked.
*/
bind(name: "tweet", callback: (ev: TwitterIntentEvent) => void): void;
/**
* Bind an event which will populate the followed user_id in the event objects data argument.
*
* @param name The name of an event.
* @param callback A callback function which will be invoked.
*/
bind(name: "follow", callback: (ev: TwitterIntentEvent) => void): void;
/**
* Bind an event which will populate the original Tweet that was retweeteds source_tweet_id in the event objects data argument.
*
* @param name The name of an event.
* @param callback A callback function which will be invoked.
*/
bind(name: "retweet", callback: (ev: TwitterIntentEvent) => void): void;
/**
* Bind an event which will populate the favorited tweet_id in the event objects data argument.
*
* @param name The name of an event.
* @param callback A callback function which will be invoked.
*/
bind(name: "favorite", callback: (ev: TwitterIntentEvent) => void): void;
/**
* Bind an event occurs when the user invokes a Web Intent from within an embedded widget.
*
* @param name The name of an event.
* @param callback A callback function which will be invoked.
*/
bind(name: "click", callback: (ev: TwitterIntentEvent) => void): void;
/**
* Bind an event.
*
* @param name The name of an event.
* @param callback A callback function which will be invoked.
*/
bind(name: string, callback: (ev: any) => void): void;
}
/**
* The interface for an object representing the event is passed to your JavaScript callback.
*/
interface TwitterIntentEvent {
/**
* The DOM node where the widget is instantiated. Most like an iframe, but may also be the original embed code element if the widget failed to initialize, or another sandboxed element. Use this value to differentiate between different intents or buttons on the same page.
*/
target: HTMLElement;
/**
* Extended detail indicating where in a widget a user clicked. For example, button, count, or screen name portions of Tweet button or Follow button integrations, or tweet actions within embedded Tweets.
*/
region: string;
/**
* Key/value pairs relevant to the Web Intent just actioned.
*/
data: TwitterIntentEventData;
/**
* The type of the event.
*/
type: string;
}
/**
* The interface for a data relevants to the Web Intent just actioned.
*/
interface TwitterIntentEventData {
/**
* The ID of a Tweet.
*/
tweet_id?: string;
/**
* The ID of a source Tweet.
*/
source_tweet_id?: string;
/**
* The screen_name of a user;
*/
screen_name?: string;
/**
* The ID of a user.
*/
user_id?: string;
}
declare var twttr: Twitter;
+10 -1
View File
@@ -37,11 +37,20 @@ declare module WebCola{
right: number;
}
interface FlowLayout{
interface FlowLayout {
axis: string;
minSeparation?: number;
}
interface Node {
height: number;
id: string;
size: number;
width: number;
x: number;
y: number;
}
interface Options {
avoidOverlaps?: boolean;
convergenceThreshold?: number;