mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-31 11:40:47 +08:00
Merge branch 'master' of github.com:borisyankov/DefinitelyTyped
This commit is contained in:
+7
-1
@@ -85,6 +85,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](bl/bl.d.ts) [BufferList](https://github.com/rvagg/bl) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](bufferstream/bufferstream.d.ts) [bufferstream](https://github.com/dodo/node-bufferstream) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](business-rules-engine/business-rules-engine.d.ts) [business-rules-engine](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec)
|
||||
* [:link:](byline/byline.d.ts) [byline](https://github.com/jahewson/node-byline) by [Stefan Steinhart](https://github.com/reppners)
|
||||
* [:link:](camljs/camljs.d.ts) [camljs](http://camljs.codeplex.com) by [Andrey Markeev](http://markeev.com)
|
||||
* [:link:](canvasjs/canvasjs.d.ts) [CanvasJS](http://canvasjs.com) by [Mark Overholt](https://github.com/mover5)
|
||||
* [:link:](casperjs/casperjs.d.ts) [CasperJS](http://casperjs.org) by [Jed Mao](https://github.com/jedmao)
|
||||
@@ -174,6 +175,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](es6-promise/es6-promise.d.ts) [es6-promise](https://github.com/jakearchibald/ES6-Promise) by [François de Campredon](https://github.com/fdecampredon), [vvakame](https://github.com/vvakame)
|
||||
* [:link:](esprima/esprima.d.ts) [Esprima](http://esprima.org) by [teppeis](https://github.com/teppeis)
|
||||
* [:link:](eventemitter2/eventemitter2.d.ts) [EventEmitter2](https://github.com/asyncly/EventEmitter2) by [ryiwamoto](https://github.com/ryiwamoto)
|
||||
* [:link:](event-loop-lag/event-loop-lag.d.ts) [event-loop-lag](https://github.com/pebble/event-loop-lag) by [rogierschouten](https://github.com/rogierschouten)
|
||||
* [:link:](exit/exit.d.ts) [exit](https://github.com/cowboy/node-exit) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](expect.js/expect.js.d.ts) [expect.js](https://github.com/LearnBoost/expect.js) by [Teppei Sato](https://github.com/teppeis)
|
||||
* [:link:](expectations/expectations.d.ts) [expectations.js](https://github.com/spmason/expectations) by [vvakame](https://github.com/vvakame)
|
||||
@@ -293,7 +295,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](ix.js/ix.d.ts) [IxJS 1.0.6 / ix.js](https://github.com/Reactive-Extensions/IxJS) by [Igor Oleinikov](https://github.com/Igorbek)
|
||||
* [:link:](ix.js/l2o.d.ts) [IxJS 1.0.6 / l2o.js](https://github.com/Reactive-Extensions/IxJS) by [Igor Oleinikov](https://github.com/Igorbek)
|
||||
* [:link:](jake/jake.d.ts) [jake](https://github.com/mde/jake) by [Kon](http://phyzkit.net)
|
||||
* [:link:](jasmine/jasmine.d.ts) [Jasmine](http://pivotal.github.com/jasmine) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb), [David Pärsson](https://github.com/davidparsson)
|
||||
* [:link:](jasmine/jasmine.d.ts) [Jasmine](http://jasmine.github.io) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb), [David Pärsson](https://github.com/davidparsson)
|
||||
* [:link:](jasmine-data_driven_tests/jasmine-data_driven_tests.d.ts) [Jasmine Data Driven Tests](https://github.com/gburghardt/jasmine-data_driven_tests) by [Anthony MacKinnon](https://github.com/AnthonyMacKinnon)
|
||||
* [:link:](jasmine-fixture/jasmine-fixture.d.ts) [Jasmine-fixture](https://github.com/searls/jasmine-fixture) by [Craig Brett](https://github.com/craigbrett17)
|
||||
* [:link:](jasmine-jquery/jasmine-jquery.d.ts) [Jasmine-JQuery](https://github.com/velesin/jasmine-jquery) by [Gregor Stamac](https://github.com/gstamac)
|
||||
@@ -516,6 +518,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](xml2js/xml2js.d.ts) [node-xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) by [Michel Salib](https://github.com/michelsalib), [Jason McNeil](https://github.com/jasonrm)
|
||||
* [:link:](node/node.d.ts) [Node.js](http://nodejs.org) by [Microsoft TypeScript](http://typescriptlang.org), [DefinitelyTyped](https://github.com/borisyankov/DefinitelyTyped)
|
||||
* [:link:](restify/restify.d.ts) [node.js REST framework](https://github.com/mcavage/node-restify) by [Bret Little](https://github.com/blittle)
|
||||
* [:link:](mdns/mdns.d.ts) [node_mdns](https://github.com/agnat/node_mdns) by [Stefan Steinhart](https://github.com/reppners)
|
||||
* [:link:](node_redis/node_redis.d.ts) [node_redis](https://github.com/mranney/node_redis) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](each/each.d.ts) [NodeEach](http://www.adaltas.com/projects/node-each) by [Michael Zabka](https://github.com/misak113)
|
||||
* [:link:](nodemailer/nodemailer.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Vincent Bortone](https://github.com/vbortone)
|
||||
@@ -579,6 +582,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](qajax/qajax.d.ts) [Qajax](https://github.com/gre/qajax) by [Boltmade](https://github.com/Boltmade)
|
||||
* [:link:](qunit/qunit.d.ts) [QUnit](http://qunitjs.com) by [Diullei Gomes](https://github.com/diullei)
|
||||
* [:link:](rabbit.js/rabbit.js.d.ts) [rabbit.js](https://github.com/squaremo/rabbit.js) by [Wonshik Kim](https://github.com/wokim)
|
||||
* [:link:](ractive/ractive.d.ts) [Ractive 0.7.0 edge f22ab8ad0a640591b1c263f57e21d1565cb26bf5](http://ractivejs.org) by [Han Lin Yap](http://yap.nu)
|
||||
* [:link:](raphael/raphael.d.ts) [Raphael](http://raphaeljs.com) by [CheCoxshall](https://github.com/CheCoxshall)
|
||||
* [:link:](ravenjs/ravenjs.d.ts) [Raven.js](https://github.com/getsentry/raven-js) by [Santi Albo](https://github.com/santialbo)
|
||||
* [:link:](react/react.d.ts) [React](http://facebook.github.io/react) by [Asana](https://asana.com)
|
||||
@@ -675,6 +679,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](swiz/swiz.d.ts) [swiz](https://github.com/racker/node-swiz) by [Jeff Goddard](https://github.com/jedigo)
|
||||
* [:link:](tape/tape.d.ts) [tape](https://github.com/substack/tape) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](tar/tar.d.ts) [tar](https://github.com/npm/node-tar) by [Maxime LUCE](https://github.com/SomaticIT)
|
||||
* [:link:](tcomb/tcomb.d.ts) [tcomb](https://github.com/npm/tcomb) by [Jed Mao](https://github.com/jedmao)
|
||||
* [:link:](tedious/tedious.d.ts) [tedious](https://pekim.github.io/tedious) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](tedious-connection-pool/tedious-connection-pool.d.ts) [tedious-connection-pool](https://github.com/pekim/tedious-connection-pool) by [Cyprien Autexier](https://github.com/sandorfr)
|
||||
* [:link:](teechart/teechart.d.ts) [TeeChart](http://www.steema.com) by [Steema Software](https://steema.com)
|
||||
@@ -709,6 +714,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)
|
||||
|
||||
@@ -30,7 +30,7 @@ Please see the [contribution guide](http://definitelytyped.org/guides/contributi
|
||||
|
||||
## Requested definitions
|
||||
|
||||
Here is an updated list of [definitions people have requested](https://github.com/borisyankov/DefinitelyTyped/issues?labels=Definition%3ARequest).
|
||||
Here is are the [currently requested definitions](https://github.com/borisyankov/DefinitelyTyped/labels/Definition%3ARequest).
|
||||
|
||||
## Licence
|
||||
|
||||
@@ -38,4 +38,4 @@ This project is licensed under the MIT license.
|
||||
|
||||
Copyrights on the definition files are respective of each contributor listed at the beginning of each definition file.
|
||||
|
||||
[](https://github.com/igrigorik/ga-beacon)
|
||||
[](https://github.com/igrigorik/ga-beacon)
|
||||
|
||||
+2
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+38
@@ -584,6 +584,44 @@ declare module ng {
|
||||
}
|
||||
|
||||
interface IScope extends IRootScopeService { }
|
||||
|
||||
/**
|
||||
* $scope for ngRepeat directive.
|
||||
* see https://docs.angularjs.org/api/ng/directive/ngRepeat
|
||||
*/
|
||||
interface IRepeatScope extends IScope {
|
||||
|
||||
/**
|
||||
* iterator offset of the repeated element (0..length-1).
|
||||
*/
|
||||
$index: number;
|
||||
|
||||
/**
|
||||
* true if the repeated element is first in the iterator.
|
||||
*/
|
||||
$first: boolean;
|
||||
|
||||
/**
|
||||
* true if the repeated element is between the first and last in the iterator.
|
||||
*/
|
||||
$middle: boolean;
|
||||
|
||||
/**
|
||||
* true if the repeated element is last in the iterator.
|
||||
*/
|
||||
$last: boolean;
|
||||
|
||||
/**
|
||||
* true if the iterator position $index is even (otherwise false).
|
||||
*/
|
||||
$even: boolean;
|
||||
|
||||
/**
|
||||
* true if the iterator position $index is odd (otherwise false).
|
||||
*/
|
||||
$odd: boolean;
|
||||
|
||||
}
|
||||
|
||||
interface IAngularEvent {
|
||||
/**
|
||||
|
||||
Vendored
+25
-1
@@ -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;
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Created by stefansteinhart on 31.01.15.
|
||||
*/
|
||||
|
||||
/// <reference path="byline.d.ts" />
|
||||
|
||||
import fs = require( 'fs' );
|
||||
import byline = require( 'byline' );
|
||||
|
||||
//TODO can this be typed in an ambient way?
|
||||
//var stream = byline( fs.createReadStream( 'sample.txt', {encoding: 'utf8'} ) );
|
||||
|
||||
var stream = byline.createStream( fs.createReadStream( 'sample.txt', {encoding: 'utf8'} ) );
|
||||
|
||||
stream.on('data', function(line:string) {
|
||||
console.log(line);
|
||||
});
|
||||
|
||||
stream = byline.createStream(stream);
|
||||
|
||||
stream.on('data', function(line:string) {
|
||||
console.log(line);
|
||||
});
|
||||
|
||||
var input = fs.createReadStream('sample.txt');
|
||||
stream.pipe(fs.createWriteStream('nolines.txt'));
|
||||
|
||||
var lineStream = byline.createStream();
|
||||
input.pipe(lineStream);
|
||||
|
||||
var output = fs.createWriteStream('test.txt');
|
||||
lineStream.pipe(output);
|
||||
|
||||
stream.on('readable', function() {
|
||||
var line:string;
|
||||
while (null !== (line = stream.read())) {
|
||||
console.log(line);
|
||||
}
|
||||
});
|
||||
|
||||
var LineStream = require('byline').LineStream;
|
||||
|
||||
var output = fs.createWriteStream('nolines.txt');
|
||||
|
||||
var lineStream:byline.LineStream = new LineStream();
|
||||
input.pipe(lineStream);
|
||||
lineStream.pipe(output);
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
// Type definitions for byline 4.2.1
|
||||
// Project: https://github.com/jahewson/node-byline
|
||||
// Definitions by: Stefan Steinhart <https://github.com/reppners>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "byline" {
|
||||
import stream = require("stream");
|
||||
|
||||
export interface LineStreamOptions extends stream.TransformOptions {
|
||||
keepEmptyLines: boolean;
|
||||
}
|
||||
|
||||
export interface LineStream extends stream.Transform {
|
||||
}
|
||||
|
||||
export interface LineStreamCreatable extends LineStream {
|
||||
new (options?:LineStreamOptions):LineStream
|
||||
}
|
||||
|
||||
//TODO is it possible to declare static factory functions without name (directly on the module)
|
||||
//
|
||||
// JS:
|
||||
// // convinience API
|
||||
// module.exports = function(readStream, options) {
|
||||
// return module.exports.createStream(readStream, options);
|
||||
// };
|
||||
//
|
||||
// TS:
|
||||
// ():LineStream; // same as createStream():LineStream
|
||||
// (stream:stream.Stream, options?:LineStreamOptions):LineStream; // same as createStream(stream, options?):LineStream
|
||||
|
||||
export function createStream():LineStream;
|
||||
export function createStream(stream:NodeJS.ReadableStream, options?:LineStreamOptions):LineStream;
|
||||
|
||||
export var LineStream:LineStreamCreatable;
|
||||
}
|
||||
Vendored
+67
-92
@@ -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,61 +2305,65 @@ declare module chrome.webRequest {
|
||||
statusCode: number;
|
||||
}
|
||||
|
||||
interface OnSendHeadersDetails extends WebRequestCallbackDetails {
|
||||
interface OnSendHeadersDetails extends CallbackDetails {
|
||||
requestHeaders?: HttpHeader[];
|
||||
}
|
||||
|
||||
interface FormData {
|
||||
[key: string]: string[];
|
||||
}
|
||||
|
||||
interface RequestBody {
|
||||
raw?: UploadData;
|
||||
error?: string;
|
||||
formData?: Object;
|
||||
formData?: FormData;
|
||||
}
|
||||
|
||||
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 +2371,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;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
/// <reference path="event-loop-lag.d.ts" />
|
||||
|
||||
import lag = require("event-loop-lag");
|
||||
|
||||
var fn: () => number = lag(1000);
|
||||
var n: number = fn();
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// Type definitions for event-loop-lag 1.0.3
|
||||
// Project: https://github.com/pebble/event-loop-lag
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "event-loop-lag" {
|
||||
|
||||
/**
|
||||
* Accepts a number of milliseconds representing how often to refresh the event loop lag measurement and returns a function you can call to receive the latest lag measurement in milliseconds.
|
||||
*/
|
||||
function lag(interval: number): () => number;
|
||||
|
||||
export = lag;
|
||||
}
|
||||
Vendored
+4
@@ -127,3 +127,7 @@ interface JQuery {
|
||||
}
|
||||
|
||||
declare var i18n: I18nextStatic;
|
||||
|
||||
declare module 'i18next' {
|
||||
export = i18n;
|
||||
}
|
||||
Vendored
+44
-46
@@ -3,58 +3,56 @@
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module ARHS {
|
||||
/**
|
||||
* @summary Interface for {@link IBAN} object.
|
||||
* @author Cyril Schumacher
|
||||
* @version 1.0
|
||||
*/
|
||||
interface IBANStatic {
|
||||
/**
|
||||
* @summary Interface for {@link IBAN} object.
|
||||
* @author Cyril Schumacher
|
||||
* @version 1.0
|
||||
* @summary Returns the IBAN in a electronic format.
|
||||
* @param {string} iban The IBAN to convert.
|
||||
* @param {string} The IBAN in electronic format.
|
||||
*/
|
||||
interface IBANStatic {
|
||||
/**
|
||||
* @summary Returns the IBAN in a electronic format.
|
||||
* @param {string} iban The IBAN to convert.
|
||||
* @param {string} The IBAN in electronic format.
|
||||
*/
|
||||
electronicFormat(iban: string): string;
|
||||
electronicFormat(iban: string): string;
|
||||
|
||||
/**
|
||||
* @summary Convert the passed BBAN to an IBAN for this country specification.
|
||||
* @param {string} countryCode The country of the BBAN.
|
||||
* @param {string} bban The BBAN to convert to IBAN.
|
||||
* @returns {string} The IBAN.
|
||||
*/
|
||||
fromBBAN(countryCode: string, bban: string): string;
|
||||
/**
|
||||
* @summary Convert the passed BBAN to an IBAN for this country specification.
|
||||
* @param {string} countryCode The country of the BBAN.
|
||||
* @param {string} bban The BBAN to convert to IBAN.
|
||||
* @returns {string} The IBAN.
|
||||
*/
|
||||
fromBBAN(countryCode: string, bban: string): string;
|
||||
|
||||
/**
|
||||
* @summary Check if the passed iban is valid according to this specification.
|
||||
* @param {string} iban The iban to validate.
|
||||
* @returns {boolean} True if valid, false otherwise.
|
||||
*/
|
||||
isValid(iban: string): boolean;
|
||||
/**
|
||||
* @summary Check if the passed iban is valid according to this specification.
|
||||
* @param {string} iban The iban to validate.
|
||||
* @returns {boolean} True if valid, false otherwise.
|
||||
*/
|
||||
isValid(iban: string): boolean;
|
||||
|
||||
/**
|
||||
* @summary Check of the passed BBAN is valid.
|
||||
* @param {string} countryCode The country of the BBAN.
|
||||
* @param {string} bban The BBAN to validate.
|
||||
* @returns {boolean} True if valid, false otherwise.
|
||||
*/
|
||||
isValidBBAN(countryCode: string, bban: string): boolean;
|
||||
/**
|
||||
* @summary Check of the passed BBAN is valid.
|
||||
* @param {string} countryCode The country of the BBAN.
|
||||
* @param {string} bban The BBAN to validate.
|
||||
* @returns {boolean} True if valid, false otherwise.
|
||||
*/
|
||||
isValidBBAN(countryCode: string, bban: string): boolean;
|
||||
|
||||
/**
|
||||
* @summary Returns the IBAN in a print format.
|
||||
* @param {string} iban The IBAN to convert.
|
||||
* @param {string} The IBAN in print format.
|
||||
*/
|
||||
printFormat(iban: string, separator: string[]): string;
|
||||
/**
|
||||
* @summary Returns the IBAN in a print format.
|
||||
* @param {string} iban The IBAN to convert.
|
||||
* @param {string} The IBAN in print format.
|
||||
*/
|
||||
printFormat(iban: string, separator: string[]): string;
|
||||
|
||||
/**
|
||||
* @summary Convert the passed IBAN to a country-specific BBAN.
|
||||
* @param {string} iban The IBAN to convert.
|
||||
* @param {string[]} Separator the separator to use between BBAN blocks.
|
||||
* @returns {string} The BBAN
|
||||
*/
|
||||
toBBAN(iban: string, separator: string[]): string;
|
||||
}
|
||||
/**
|
||||
* @summary Convert the passed IBAN to a country-specific BBAN.
|
||||
* @param {string} iban The IBAN to convert.
|
||||
* @param {string[]} Separator the separator to use between BBAN blocks.
|
||||
* @returns {string} The BBAN
|
||||
*/
|
||||
toBBAN(iban: string, separator: string[]): string;
|
||||
}
|
||||
|
||||
declare var IBAN: ARHS.IBANStatic;
|
||||
declare var IBAN: IBANStatic;
|
||||
@@ -0,0 +1,22 @@
|
||||
/// <reference path="java-applet.d.ts" />
|
||||
|
||||
/**
|
||||
* @summary Test for the applet status.
|
||||
*/
|
||||
function testStatus() {
|
||||
var java: Java = {
|
||||
status: AppletStatus.Loading
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for the handlers.
|
||||
*/
|
||||
function testHandlers() {
|
||||
var handler: Function = () => {};
|
||||
var java: Java = {
|
||||
onError: handler,
|
||||
onLoad: handler,
|
||||
onStop: handler
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
--noImplicitAny
|
||||
Vendored
+52
@@ -0,0 +1,52 @@
|
||||
// Type definitions for Java Applet
|
||||
// Project: https://www.java.com/
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* @summary Applet Status.
|
||||
* {@link http://docs.oracle.com/javase/8/docs/technotes/guides/deploy/applet_dev_guide.html#JSDPG719|Applet Status And Event Handlers}
|
||||
*/
|
||||
declare enum AppletStatus {
|
||||
/**
|
||||
* @summary Applet is loading.
|
||||
*/
|
||||
Loading = 1,
|
||||
|
||||
/**
|
||||
* @summary Applet has loaded completely and is ready to receive JavaScript calls.
|
||||
*/
|
||||
Ready = 2,
|
||||
|
||||
/**
|
||||
* @summary Error while loading applet.
|
||||
*/
|
||||
Error = 3
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Interface for Java object.
|
||||
* @author Cyril Schumacher
|
||||
* @version 1.0
|
||||
*/
|
||||
interface Java {
|
||||
/**
|
||||
* Handler if the applet status is ERROR. An error has occurred while loading the applet.
|
||||
*/
|
||||
onError?: Function;
|
||||
|
||||
/**
|
||||
* Handler if the applet status is READY. Applet has finished loading and is ready to receive JavaScript calls.
|
||||
*/
|
||||
onLoad?: Function;
|
||||
|
||||
/**
|
||||
* Handler if the applet has stopped.
|
||||
*/
|
||||
onStop?: Function;
|
||||
|
||||
/**
|
||||
* @summary Applet Status.
|
||||
*/
|
||||
status?: AppletStatus;
|
||||
}
|
||||
@@ -187,6 +187,7 @@ function test_methods() {
|
||||
});
|
||||
$("#myform").validate().form();
|
||||
$("#myform").validate().element("#myselect");
|
||||
$("#myform").validate().element($("#myselect"));
|
||||
var validator = $("#myform").validate();
|
||||
validator.resetForm();
|
||||
validator.showErrors({ "firstname": "I know that your firstname is Pete, Pete!" });
|
||||
|
||||
+1
-1
@@ -186,7 +186,7 @@ interface Validator
|
||||
*
|
||||
* @param element An element to validate, must be inside the validated form. eg "#myselect"
|
||||
*/
|
||||
element(element: string): boolean;
|
||||
element(element: string|JQuery): boolean;
|
||||
/**
|
||||
* Validates the form, returns true if it is valid, false otherwise.
|
||||
*/
|
||||
|
||||
Vendored
+25
-24
@@ -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.
|
||||
*
|
||||
|
||||
Vendored
+2
-2
@@ -63,13 +63,13 @@ interface KoliteAsyncCommand extends KoliteCommand {
|
||||
}
|
||||
|
||||
interface KoLiteCommandOptions {
|
||||
execute?: any;
|
||||
execute(...args: any[]): any;
|
||||
canExecute?: (isExecuting: boolean) => any;
|
||||
}
|
||||
|
||||
interface KnockoutStatic {
|
||||
command(options: KoLiteCommandOptions): KoliteCommand;
|
||||
asyncCommand(optons: KoLiteCommandOptions): KoliteAsyncCommand;
|
||||
asyncCommand(options: KoLiteCommandOptions): KoliteAsyncCommand;
|
||||
}
|
||||
|
||||
interface KnockoutUtils {
|
||||
|
||||
Vendored
+9
@@ -2641,6 +2641,15 @@ declare module _ {
|
||||
whereValue: W): LoDashArrayWrapper<T>;
|
||||
}
|
||||
|
||||
interface LoDashObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.filter
|
||||
**/
|
||||
filter<T extends {}>(
|
||||
callback: ObjectIterator<T, boolean>,
|
||||
thisArg?: any): LoDashObjectWrapper<T>;
|
||||
}
|
||||
|
||||
//_.find
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* Created by stefansteinhart on 30.01.15.
|
||||
*/
|
||||
|
||||
/// <reference path="mdns.d.ts" />
|
||||
|
||||
var mdns = require('mdns')
|
||||
|
||||
var ad:MDNS.Advertisement = mdns.createAdvertisement(mdns.tcp('http'), 4321);
|
||||
|
||||
ad.start();
|
||||
|
||||
var browser = mdns.createBrowser(mdns.tcp('http'));
|
||||
|
||||
browser.on('serviceUp', function(service:MDNS.Service) {
|
||||
console.log("service up: ", service);
|
||||
});
|
||||
browser.on('serviceDown', function(service:MDNS.Service) {
|
||||
console.log("service down: ", service);
|
||||
});
|
||||
|
||||
browser.start();
|
||||
|
||||
var r0 = mdns.tcp('http') // string form: _http._tcp
|
||||
, r1 = mdns.udp('osc', 'api-v1') // string form: _osc._udp,_api-v1
|
||||
, r2 = new mdns.ServiceType('http', 'tcp') // string form: _http._tcp
|
||||
, r3 = mdns.makeServiceType('https', 'tcp') // string form: _https._tcp
|
||||
;
|
||||
|
||||
var txt_record = {
|
||||
name: 'bacon'
|
||||
, chunky: true
|
||||
, strips: 5
|
||||
};
|
||||
var ad:MDNS.Advertisement = mdns.createAdvertisement(mdns.tcp('http'), 4321, {txtRecord: txt_record});
|
||||
|
||||
var sequence = [
|
||||
mdns.rst.DNSServiceResolve()
|
||||
, mdns.rst.DNSServiceGetAddrInfo({families: [4] })
|
||||
];
|
||||
|
||||
var browser = mdns.createBrowser(mdns.tcp('http'), {resolverSequence: sequence});
|
||||
|
||||
interface HammerTimeService extends MDNS.Service {
|
||||
hammerTime:Date;
|
||||
}
|
||||
|
||||
function MCHammer(options:any) {
|
||||
options = options || {};
|
||||
return function MCHammer(service:HammerTimeService, next:()=>void) {
|
||||
console.log('STOP!');
|
||||
setTimeout(function() {
|
||||
console.log('hammertime...');
|
||||
service.hammerTime = new Date();
|
||||
next();
|
||||
}, options.delay || 1000);
|
||||
}
|
||||
}
|
||||
|
||||
var browser = mdns.createBrowser( mdns.tcp('http')
|
||||
, { networkInterface: mdns.loopbackInterface()});
|
||||
|
||||
var ad:MDNS.Advertisement;
|
||||
|
||||
function createAdvertisement() {
|
||||
try {
|
||||
ad = mdns.createAdvertisement(mdns.tcp('http'), 1337);
|
||||
ad.on('error', handleError);
|
||||
ad.start();
|
||||
} catch (ex) {
|
||||
handleError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
function handleError(error:MDNS.DnsSdError) {
|
||||
switch (error.errorCode) {
|
||||
case mdns.kDNSServiceErr_Unknown:
|
||||
console.warn(error);
|
||||
setTimeout(createAdvertisement, 5000);
|
||||
break;
|
||||
default:
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
+295
@@ -0,0 +1,295 @@
|
||||
// Type definitions for node_mdns
|
||||
// Project: https://github.com/agnat/node_mdns
|
||||
// Definitions by: Stefan Steinhart <https://github.com/reppners>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module MDNS {
|
||||
|
||||
// --- Error ---
|
||||
|
||||
interface DnsSdError extends Error {
|
||||
errorCode?:number;
|
||||
}
|
||||
|
||||
// --- Ads ---
|
||||
|
||||
interface AdvertisementOptions {
|
||||
name?:string;
|
||||
interfaceIndex?:number;
|
||||
networkInterface?:string;
|
||||
txtRecord?:any;
|
||||
host?:any;
|
||||
domain?:any;
|
||||
flags?:any;
|
||||
context?:any;
|
||||
}
|
||||
|
||||
interface AdvertisementCreatable {
|
||||
new(serviceType:ServiceType, port:number, options?:AdvertisementOptions, callback?:(error:DnsSdError, service:Service)=>void):Advertisement;
|
||||
}
|
||||
|
||||
interface Advertisement extends NodeJS.EventEmitter {
|
||||
start():void;
|
||||
stop():void;
|
||||
}
|
||||
|
||||
// --- Browser ---
|
||||
|
||||
interface BrowserOptions {
|
||||
resolverSequence?:Array<(service:Service, next:()=>void)=>boolean>;
|
||||
interfaceIndex?:number;
|
||||
networkInterface?:string;
|
||||
domain?:any;
|
||||
context?:any;
|
||||
flags?:any;
|
||||
}
|
||||
|
||||
interface Browser extends NodeJS.EventEmitter {
|
||||
start():any;
|
||||
stop():any;
|
||||
}
|
||||
|
||||
interface BrowserStatic {
|
||||
new(serviceType:ServiceType, options?:BrowserOptions):Browser;
|
||||
defaultResolverSequence:Array<(service:Service, next:()=>void)=>boolean>
|
||||
}
|
||||
|
||||
// --- Services ---
|
||||
|
||||
interface Service {
|
||||
addresses:Array<string>;
|
||||
flags:number;
|
||||
fullname:string;
|
||||
host:string;
|
||||
interfaceIndex: number;
|
||||
name?:string;
|
||||
networkInterface:string;
|
||||
port:number;
|
||||
replyDomain:string;
|
||||
type:ServiceType;
|
||||
}
|
||||
|
||||
interface ServiceType {
|
||||
new(serviceTypeIdentifier:string):ServiceType;
|
||||
new(name:string, protocol:string, ...subtypes:string[]):ServiceType;
|
||||
new(serviceTypeIdentifier:Array<string>):ServiceType;
|
||||
new(serviceTypeIdentifier:{name:string; protocol:string; subtypes?:Array<string>}):ServiceType;
|
||||
new(serviceType:ServiceType):ServiceType;
|
||||
|
||||
fullyQualified:boolean;
|
||||
name:string;
|
||||
protocol:string;
|
||||
subtypes:Array<string>;
|
||||
|
||||
toString():string;
|
||||
fromString(serviceTypeIdentifier:string):ServiceType;
|
||||
|
||||
toArray():Array<string>;
|
||||
fromArray(serviceTypeIdentifier:Array<string>):ServiceType;
|
||||
|
||||
fromJSON(serviceTypeIdentifier:{name:string; protocol:string; subtypes?:Array<string>}):ServiceType;
|
||||
fromJSON(serviceType:ServiceType):ServiceType;
|
||||
}
|
||||
|
||||
// interface for extending with custom resolvers
|
||||
interface MDNSResolverSequenceTasks {
|
||||
|
||||
}
|
||||
|
||||
interface DefaultResolverSequenceTasks extends MDNSResolverSequenceTasks {
|
||||
DNSServiceResolve(options?:{flags:any}):(service:Service, next:()=>void)=>boolean;
|
||||
DNSServiceGetAddrInfo(options?:any):(service:Service, next:()=>void)=>boolean;
|
||||
getaddrinfo(options?:any):(service:Service, next:()=>void)=>boolean;
|
||||
makeAddressesUnique():(service:Service, next:()=>void)=>boolean;
|
||||
filterAddresses(fn:(address:string, index?:number, addresses?:Array<string>)=>boolean):void;
|
||||
logService():void;
|
||||
}
|
||||
|
||||
// --- Statics & Classes ---
|
||||
|
||||
var Advertisement:AdvertisementCreatable;
|
||||
var Browser:BrowserStatic;
|
||||
var ServiceType:ServiceType;
|
||||
var rst:DefaultResolverSequenceTasks;
|
||||
|
||||
// static functions
|
||||
|
||||
function tcp(name:string, ...subtypes:string[]):ServiceType;
|
||||
|
||||
function udp(name:string, ...subtypes:string[]):ServiceType;
|
||||
|
||||
function makeServiceType(name:string, protocol:string, ...subtypes:string[]):ServiceType;
|
||||
|
||||
function makeServiceType(serviceTypeIdentifier:string):ServiceType;
|
||||
|
||||
function makeServiceType(serviceTypeIdentifier:Array<string>):ServiceType;
|
||||
|
||||
function makeServiceType(serviceTypeIdentifier:{name:string; protocol:string; subtypes?:Array<string>}):ServiceType;
|
||||
|
||||
function makeServiceType(serviceType:ServiceType):ServiceType;
|
||||
|
||||
function createBrowser(serviceType:ServiceType, options?:BrowserOptions):Browser;
|
||||
|
||||
function createAdvertisement(serviceType:ServiceType, port:number, options?:AdvertisementOptions, callback?:(error:DnsSdError, service:Service)=>void):Advertisement;
|
||||
|
||||
function resolve(service:Service, sequence?:Array<(service:Service, next:()=>void)=>boolean>, callback?:(error:DnsSdError, service:Service)=>void):void;
|
||||
|
||||
function browseThemAll(options:BrowserOptions):Browser;
|
||||
|
||||
function loopbackInterface():any;
|
||||
|
||||
// constants
|
||||
|
||||
var isAvahi:boolean;
|
||||
|
||||
// -------------------- -------------------- -------------------- -------------------- -------------------- -------------------- -------------------- -------------------- --------------------
|
||||
|
||||
//Constants from dns_sd.h (C-Code of Bonjour -> see https://developer.apple.com/library/mac/documentation/Networking/Reference/DNSServiceDiscovery_CRef/Reference/reference.html)
|
||||
|
||||
var _DNS_SD_H:number;
|
||||
|
||||
var kDNSServiceMaxDomainName:string;
|
||||
var kDNSServiceMaxServiceName:number;
|
||||
var kDNSServiceOutputFlags:any;
|
||||
var kDNSServiceProperty_DaemonVersion:number;
|
||||
|
||||
var kDNSServiceClass_IN:number;
|
||||
|
||||
var kDNSServiceErr_NoError:number;
|
||||
var kDNSServiceErr_Unknown:number;
|
||||
var kDNSServiceErr_NoSuchName:number;
|
||||
var kDNSServiceErr_NoMemory:number;
|
||||
var kDNSServiceErr_BadParam:number;
|
||||
var kDNSServiceErr_BadReference:number;
|
||||
var kDNSServiceErr_BadState:number;
|
||||
var kDNSServiceErr_BadFlags:number;
|
||||
var kDNSServiceErr_Unsupported:number;
|
||||
var kDNSServiceErr_NotInitialized:number;
|
||||
var kDNSServiceErr_AlreadyRegistered:number;
|
||||
var kDNSServiceErr_NameConflict:number;
|
||||
var kDNSServiceErr_Invalid:number;
|
||||
var kDNSServiceErr_Firewall:number;
|
||||
var kDNSServiceErr_Incompatible:number;
|
||||
var kDNSServiceErr_BadInterfaceIndex:number;
|
||||
var kDNSServiceErr_Refused:number;
|
||||
var kDNSServiceErr_NoSuchRecord:number;
|
||||
var kDNSServiceErr_NoAuth:number;
|
||||
var kDNSServiceErr_NoSuchKey:number;
|
||||
var kDNSServiceErr_NATTraversal:number;
|
||||
var kDNSServiceErr_DoubleNAT:number;
|
||||
var kDNSServiceErr_BadTime:number;
|
||||
var kDNSServiceErr_BadSig:number;
|
||||
var kDNSServiceErr_BadKey:number;
|
||||
var kDNSServiceErr_Transient:number;
|
||||
var kDNSServiceErr_ServiceNotRunning:number;
|
||||
var kDNSServiceErr_NATPortMappingUnsupported:number;
|
||||
var kDNSServiceErr_NATPortMappingDisabled:number;
|
||||
var kDNSServiceErr_NoRouter:number;
|
||||
var kDNSServiceErr_PollingMode:number;
|
||||
var kDNSServiceErr_Timeout:number;
|
||||
|
||||
var kDNSServiceType_A:number;
|
||||
var kDNSServiceType_NS:number;
|
||||
var kDNSServiceType_MD:number;
|
||||
var kDNSServiceType_MF:number;
|
||||
var kDNSServiceType_CNAME:number;
|
||||
var kDNSServiceType_SOA:number;
|
||||
var kDNSServiceType_MB:number;
|
||||
var kDNSServiceType_MG:number;
|
||||
var kDNSServiceType_MR:number;
|
||||
var kDNSServiceType_NULL:number;
|
||||
var kDNSServiceType_WKS:number;
|
||||
var kDNSServiceType_PTR:number;
|
||||
var kDNSServiceType_HINFO:number;
|
||||
var kDNSServiceType_MINFO:number;
|
||||
var kDNSServiceType_MX:number;
|
||||
var kDNSServiceType_TXT:number;
|
||||
var kDNSServiceType_RP:number;
|
||||
var kDNSServiceType_AFSDB:number;
|
||||
var kDNSServiceType_X25:number;
|
||||
var kDNSServiceType_ISDN:number;
|
||||
var kDNSServiceType_RT:number;
|
||||
var kDNSServiceType_NSAP:number;
|
||||
var kDNSServiceType_NSAP_PTR:number;
|
||||
var kDNSServiceType_SIG:number;
|
||||
var kDNSServiceType_KEY:number;
|
||||
var kDNSServiceType_PX:number;
|
||||
var kDNSServiceType_GPOS:number;
|
||||
var kDNSServiceType_AAAA:number;
|
||||
var kDNSServiceType_LOC:number;
|
||||
var kDNSServiceType_NXT:number;
|
||||
var kDNSServiceType_EID:number;
|
||||
var kDNSServiceType_NIMLOC:number;
|
||||
var kDNSServiceType_SRV:number;
|
||||
var kDNSServiceType_ATMA:number;
|
||||
var kDNSServiceType_NAPTR:number;
|
||||
var kDNSServiceType_KX:number;
|
||||
var kDNSServiceType_CERT:number;
|
||||
var kDNSServiceType_A6:number;
|
||||
var kDNSServiceType_DNAME:number;
|
||||
var kDNSServiceType_SINK:number;
|
||||
var kDNSServiceType_OPT:number;
|
||||
var kDNSServiceType_APL:number;
|
||||
var kDNSServiceType_DS:number;
|
||||
var kDNSServiceType_SSHFP:number;
|
||||
var kDNSServiceType_IPSECKEY:number;
|
||||
var kDNSServiceType_RRSIG:number;
|
||||
var kDNSServiceType_NSEC:number;
|
||||
var kDNSServiceType_DNSKEY:number;
|
||||
var kDNSServiceType_DHCID:number;
|
||||
var kDNSServiceType_NSEC3:number;
|
||||
var kDNSServiceType_NSEC3PARAM:number;
|
||||
var kDNSServiceType_HIP:number;
|
||||
var kDNSServiceType_SPF:number;
|
||||
var kDNSServiceType_UINFO:number;
|
||||
var kDNSServiceType_UID:number;
|
||||
var kDNSServiceType_GID:number;
|
||||
var kDNSServiceType_UNSPEC:number;
|
||||
var kDNSServiceType_TKEY:number;
|
||||
var kDNSServiceType_TSIG:number;
|
||||
var kDNSServiceType_IXFR:number;
|
||||
var kDNSServiceType_AXFR:number;
|
||||
var kDNSServiceType_MAILB:number;
|
||||
var kDNSServiceType_MAILA:number;
|
||||
var kDNSServiceType_ANY:number;
|
||||
|
||||
var kDNSServiceFlagsMoreComing:number;
|
||||
var kDNSServiceFlagsAdd:number;
|
||||
var kDNSServiceFlagsDefault:number;
|
||||
var kDNSServiceFlagsNoAutoRename:number;
|
||||
var kDNSServiceFlagsShared:number;
|
||||
var kDNSServiceFlagsUnique:number;
|
||||
var kDNSServiceFlagsBrowseDomains:number;
|
||||
var kDNSServiceFlagsRegistrationDomains:number;
|
||||
var kDNSServiceFlagsLongLivedQuery:number;
|
||||
var kDNSServiceFlagsAllowRemoteQuery:number;
|
||||
var kDNSServiceFlagsForceMulticast:number;
|
||||
var kDNSServiceFlagsKnownUnique:number;
|
||||
var kDNSServiceFlagsReturnIntermediates:number;
|
||||
var kDNSServiceFlagsNonBrowsable:number;
|
||||
var kDNSServiceFlagsShareConnection:number;
|
||||
var kDNSServiceFlagsSuppressUnusable:number;
|
||||
var kDNSServiceFlagsWakeOnResolve:number;
|
||||
var kDNSServiceFlagsBackgroundTrafficClass:number;
|
||||
var kDNSServiceFlagsIncludeAWDL:number;
|
||||
var kDNSServiceFlagsValidate:number;
|
||||
var kDNSServiceFlagsSecure:number;
|
||||
var kDNSServiceFlagsInsecure:number;
|
||||
var kDNSServiceFlagsBogus:number;
|
||||
var kDNSServiceFlagsIndeterminate:number;
|
||||
var kDNSServiceFlagsUnicastResponse:number;
|
||||
var kDNSServiceFlagsValidateOptional:number;
|
||||
var kDNSServiceFlagsWakeOnlyService:number;
|
||||
|
||||
var kDNSServiceProtocol_IPv4:number;
|
||||
var kDNSServiceProtocol_IPv6:number;
|
||||
var kDNSServiceProtocol_UDP:number;
|
||||
var kDNSServiceProtocol_TCP:number;
|
||||
}
|
||||
|
||||
declare module "mdns" {
|
||||
|
||||
export = MDNS;
|
||||
}
|
||||
+10
-3
@@ -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();
|
||||
|
||||
|
||||
Vendored
+85
-76
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,5 +21,10 @@ MongoClient.connect('mongodb://127.0.0.1:27017/test', function (err, db) {
|
||||
// Let's close the db
|
||||
db.close();
|
||||
});
|
||||
|
||||
// Get some statistics
|
||||
collection.stats(function (err, stats) {
|
||||
console.log(stats.count + " documents");
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
Vendored
+42
-2
@@ -253,6 +253,46 @@ declare module "mongodb" {
|
||||
pkFactory?: PKFactory;
|
||||
}
|
||||
|
||||
// Documentation: http://docs.mongodb.org/manual/reference/command/collStats/
|
||||
export interface CollStats {
|
||||
// Namespace.
|
||||
ns: string;
|
||||
|
||||
// Number of documents.
|
||||
count: number;
|
||||
|
||||
// Collection size in bytes.
|
||||
size: number;
|
||||
|
||||
// Average object size in bytes.
|
||||
avgObjSize: number;
|
||||
|
||||
// (Pre)allocated space for the collection in bytes.
|
||||
storageSize: number;
|
||||
|
||||
// Number of extents (contiguously allocated chunks of datafile space).
|
||||
numExtents: number;
|
||||
|
||||
// Number of indexes.
|
||||
nindexes: number;
|
||||
|
||||
// Size of the most recently created extent in bytes.
|
||||
lastExtentSize: number;
|
||||
|
||||
// Padding can speed up updates if documents grow.
|
||||
paddingFactor: number;
|
||||
flags: number;
|
||||
|
||||
// Total index size in bytes.
|
||||
totalIndexSize: number;
|
||||
|
||||
// Size of specific indexes in bytes.
|
||||
indexSizes: {
|
||||
_id_: number;
|
||||
username: number;
|
||||
};
|
||||
}
|
||||
|
||||
// Documentation : http://mongodb.github.io/node-mongodb-native/api-generated/collection.html
|
||||
export interface Collection {
|
||||
new (db: Db, collectionName: string, pkFactory?: Object, options?: CollectionCreateOptions): Collection; // is this right?
|
||||
@@ -326,8 +366,8 @@ declare module "mongodb" {
|
||||
indexes(callback: Function): void;
|
||||
aggregate(pipeline: any[], callback: (err: Error, results: any) => void): void;
|
||||
aggregate(pipeline: any[], options: {readPreference: string}, callback: (err: Error, results: any) => void): void;
|
||||
stats(options: {readPreference: string; scale: number}, callback: Function): void;
|
||||
stats(callback: (err: Error, results: any) => void): void;
|
||||
stats(options: {readPreference: string; scale: number}, callback: (err: Error, results: CollStats) => void): void;
|
||||
stats(callback: (err: Error, results: CollStats) => void): void;
|
||||
|
||||
hint: any;
|
||||
}
|
||||
|
||||
+4
-1
@@ -72,7 +72,10 @@ inst = inst.twice();
|
||||
inst = inst.thrice();
|
||||
|
||||
inst = inst.defaultReplyHeaders(value);
|
||||
|
||||
inst = inst.matchHeader(str, str);
|
||||
inst = inst.matchHeader(str, regex);
|
||||
inst = inst.matchHeader(str, (val: string) => true);
|
||||
|
||||
inst = inst.delay(num);
|
||||
inst = inst.delayConnection(num);
|
||||
@@ -105,4 +108,4 @@ nock.recorder.rec({
|
||||
});
|
||||
|
||||
strings = nock.recorder.play();
|
||||
objects = nock.recorder.play();
|
||||
objects = nock.recorder.play();
|
||||
|
||||
Vendored
+3
@@ -55,7 +55,10 @@ declare module "nock" {
|
||||
replyWithFile(responseCode: number, fileName: string): Scope;
|
||||
|
||||
defaultReplyHeaders(headers: Object): Scope;
|
||||
|
||||
matchHeader(name: string, value: string): Scope;
|
||||
matchHeader(name: string, regex: RegExp): Scope;
|
||||
matchHeader(name: string, fn: (value: string) => boolean): Scope;
|
||||
|
||||
filteringPath(regex: RegExp, replace: string): Scope;
|
||||
filteringPath(fn: (path: string) => string): Scope;
|
||||
|
||||
Vendored
+1334
File diff suppressed because it is too large
Load Diff
Vendored
+1334
-1334
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,6 @@
|
||||
"private": true,
|
||||
"name": "DefinitelyTyped",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"homepage": "https://github.com/borisyankov/DefinitelyTyped",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
Vendored
+3
-1
@@ -211,4 +211,6 @@ declare module PageJS {
|
||||
declare module "page" {
|
||||
var page: PageJS.Static;
|
||||
export = page;
|
||||
}
|
||||
}
|
||||
|
||||
declare var page: PageJS.Static;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/// <reference path="ractive.d.ts" />
|
||||
|
||||
function test_transition() {
|
||||
var plugin: Ractive.TransitionPlugin = (t: Ractive.Transition, params: Object) => {
|
||||
// Some stuffs...
|
||||
};
|
||||
|
||||
Ractive.transitions['myTransition'] = plugin;
|
||||
}
|
||||
|
||||
Ractive.defaults = {
|
||||
template: '',
|
||||
debug: true
|
||||
}
|
||||
|
||||
var options: Ractive.NewOptions = {
|
||||
template: '',
|
||||
};
|
||||
|
||||
var r: Ractive.Ractive = new Ractive(options);
|
||||
|
||||
r.add('keypath', 1);
|
||||
|
||||
var re: Ractive.Static = Ractive.extend(options);
|
||||
var component: Ractive.Static = re.extend(options);
|
||||
new component(options);
|
||||
Vendored
+408
@@ -0,0 +1,408 @@
|
||||
// Type definitions for Ractive 0.7.0 edge f22ab8ad0a640591b1c263f57e21d1565cb26bf5
|
||||
// Project: http://ractivejs.org
|
||||
// Definitions by: Han Lin Yap <http://yap.nu>
|
||||
// Definitions: https://github.com/codler/Ractive-TypeScript-Definition
|
||||
// Version: 0.7.0-1+2015-02-05
|
||||
|
||||
declare module Ractive {
|
||||
export interface Node extends HTMLElement {
|
||||
_ractive: any;
|
||||
}
|
||||
|
||||
// It's functionally identical to the ES6 promise (as currently spec'd) except that Promise.race and Promise.cast are not currently implemented.
|
||||
export interface Promise extends Object {
|
||||
// TODO: Implement interface or wait until typescript include native Promise definition.
|
||||
}
|
||||
|
||||
export interface AnimationPromise extends Promise {
|
||||
stop(): void; // TODO: void?
|
||||
}
|
||||
|
||||
export interface AdaptorPlugin extends Object {
|
||||
// TODO:
|
||||
}
|
||||
|
||||
export interface ComponentPlugin extends Static {
|
||||
// TODO:
|
||||
}
|
||||
|
||||
export interface DecoratorPlugin {
|
||||
(node: HTMLElement, ...args: any[]): {
|
||||
// TODO: undocumented GH-429
|
||||
update?: (...args: any[]) => void;
|
||||
teardown: () => void;
|
||||
}
|
||||
}
|
||||
|
||||
export interface EventPlugin extends Function {
|
||||
// TODO:
|
||||
}
|
||||
|
||||
export interface TransitionPlugin {
|
||||
(t: Transition, params: Object): void;
|
||||
}
|
||||
|
||||
export interface AdaptorPlugins {
|
||||
[key: string]: AdaptorPlugin;
|
||||
}
|
||||
|
||||
export interface ComponentPlugins {
|
||||
[key: string]: ComponentPlugin;
|
||||
}
|
||||
|
||||
export interface DecoratorPlugins {
|
||||
[key: string]: DecoratorPlugin;
|
||||
}
|
||||
|
||||
export interface EventPlugins {
|
||||
[key: string]: EventPlugin;
|
||||
}
|
||||
|
||||
export interface TransitionPlugins {
|
||||
[key: string]: TransitionPlugin;
|
||||
}
|
||||
|
||||
export interface Event {
|
||||
context: any;
|
||||
// TODO: unclear in documantation
|
||||
index: Object;
|
||||
keypath: string;
|
||||
node: HTMLElement;
|
||||
original: Event;
|
||||
}
|
||||
|
||||
// Return value in ractive.observe and ractive.on
|
||||
export interface Observe {
|
||||
cancel(): void;
|
||||
}
|
||||
|
||||
// Comes as first parameter in RactiveTransitionPlugin
|
||||
export interface Transition {
|
||||
isIntro: boolean;
|
||||
name: string;
|
||||
node: HTMLElement;
|
||||
|
||||
animateStyle(prop: string, value: any, options: TransitionAnimateOptions, complete: Function): void;
|
||||
animateStyle(props: Object, options: TransitionAnimateOptions, complete: Function): void;
|
||||
// Default false
|
||||
complete(noReset?: boolean): void;
|
||||
getStyle(prop: string): string;
|
||||
getStyle(props: string[]): Object;
|
||||
processParams(params: any, defaults?: Object): Object;
|
||||
resetStyle(): void;
|
||||
setStyle(prop: string, value: any): Transition;
|
||||
setStyle(props: Object): Transition;
|
||||
}
|
||||
|
||||
export interface TransitionAnimateOptions {
|
||||
// TODO: Do it have default value?
|
||||
duration: number;
|
||||
// Any valid CSS timing function
|
||||
// Default 'linear'
|
||||
easing?: string;
|
||||
// TODO: Do it have default value?
|
||||
delay: number;
|
||||
}
|
||||
|
||||
export interface AnimateOptions {
|
||||
duration?: number;
|
||||
easing?: string | Function;
|
||||
// TODO: number as type correct?
|
||||
step?: (t: number, value: number) => void; // TODO: void?
|
||||
// TODO: number as type correct?
|
||||
complate?: (t: number, value: number) => void; // TODO: void?
|
||||
}
|
||||
|
||||
export interface ObserveOptions {
|
||||
// Default Ractive
|
||||
context?: any;
|
||||
// Default false
|
||||
defer?: boolean;
|
||||
// Default true
|
||||
init?: boolean;
|
||||
}
|
||||
|
||||
// Used in Ractive.parse options
|
||||
export interface ParseOptions {
|
||||
preserveWhitespace: boolean;
|
||||
sanitize: any;
|
||||
}
|
||||
|
||||
// Used in Initialisation options
|
||||
export interface SanitizeOptions {
|
||||
elements: string[];
|
||||
// TODO: Undocumented what default value is, but probably false
|
||||
eventAttributes?: boolean;
|
||||
}
|
||||
|
||||
export interface NewOptions {
|
||||
/*
|
||||
* @type List of mixed string or Adaptor
|
||||
*/
|
||||
adapt?: any[];
|
||||
|
||||
adaptors?: AdaptorPlugins;
|
||||
|
||||
/**
|
||||
* Default false
|
||||
* @type boolean or any type that option `el` accepts (HTMLElement or String or jQuery-like collection)
|
||||
*/
|
||||
append?: any;
|
||||
|
||||
complete?: Function;
|
||||
components?: ComponentPlugins;
|
||||
computed?: Object;
|
||||
// Since 0.5.5
|
||||
// TODO: unclear in documantation
|
||||
css?: string;
|
||||
|
||||
/**
|
||||
* TODO: Question - When is data Array or String?
|
||||
*
|
||||
* @type Object, Array, String or Function
|
||||
*/
|
||||
// TODO: undocumented type Function
|
||||
data?: any;
|
||||
|
||||
decorators?: DecoratorPlugins;
|
||||
/**
|
||||
* @type [open, close]
|
||||
*/
|
||||
delimiters?: string[];
|
||||
|
||||
easing?: string | Function;
|
||||
|
||||
/**
|
||||
* @type HTMLElement or String or jQuery-like collection
|
||||
*/
|
||||
el?: any;
|
||||
// TODO: undocumented in Initialisation options page
|
||||
events?: EventPlugins;
|
||||
|
||||
// TODO: In next release
|
||||
// TODO: undocumented GH-429
|
||||
// interpolate
|
||||
|
||||
// Since 0.5.5
|
||||
// TODO: unclear in documantation
|
||||
interpolators?: { [key: string]: any; };
|
||||
|
||||
// Since 0.6.0
|
||||
onconstruct?: (options: NewOptions) => void; // TODO: void?
|
||||
// Since 0.6.0
|
||||
onchange?: (options: NewOptions) => void; // TODO: void?
|
||||
|
||||
/**
|
||||
* any is same type as template
|
||||
*/
|
||||
partials?: { [key: string]: any; };
|
||||
/**
|
||||
* Default false
|
||||
* @type Boolean or RactiveSanitizeOptions
|
||||
*/
|
||||
sanitize?: any;
|
||||
/**
|
||||
* Default ['[[', ']]']
|
||||
* @type [open, close]
|
||||
*/
|
||||
staticDelimiters?: string[];
|
||||
/**
|
||||
* Default ['[[[', ']]]']
|
||||
* @type [open, close]
|
||||
*/
|
||||
staticTripleDelimiters?: string[];
|
||||
/**
|
||||
* @type String or (if preparsing "Ractive.parse") Array or Object
|
||||
*/
|
||||
template?: any;
|
||||
transitions?: TransitionPlugins;
|
||||
/**
|
||||
* @type [open, close]
|
||||
*/
|
||||
tripleDelimiters?: string[];
|
||||
|
||||
// Default false
|
||||
lazy?: boolean;
|
||||
// Default false
|
||||
magic?: boolean;
|
||||
// Default true
|
||||
modifyArrays?: boolean;
|
||||
// Since 0.5.5
|
||||
// TODO: unclear in documentation
|
||||
// Default false
|
||||
noCSSTransform?: boolean;
|
||||
// Default false
|
||||
noIntro?: boolean;
|
||||
// Default false
|
||||
preserveWhitespace?: boolean;
|
||||
// Since 0.5.5
|
||||
// Default true
|
||||
stripComments?: boolean;
|
||||
// Default true
|
||||
twoway?: boolean;
|
||||
|
||||
}
|
||||
|
||||
export interface ExtendOptions extends NewOptions {
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
beforeInit?: (options: ExtendOptions) => void;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
init?: (options: ExtendOptions) => void;
|
||||
|
||||
// TODO: undocumented arguments
|
||||
onconstruct?: (options: ExtendOptions) => void; // TODO: void?
|
||||
onrender?: () => void; // TODO: void?
|
||||
// Default false, inherit from Ractive.defaults
|
||||
isolated?: boolean;
|
||||
}
|
||||
|
||||
// See ractive change log "All configuration options, except plugin registries, can be specified on Ractive.defaults and Component.defaults"
|
||||
export interface DefaultsOptions extends ExtendOptions {
|
||||
// TODO: not correctly documented
|
||||
// Default false
|
||||
debug?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static members of Ractive
|
||||
*/
|
||||
export interface Static {
|
||||
new (options: NewOptions): Ractive;
|
||||
|
||||
extend(options: ExtendOptions): Static;
|
||||
|
||||
parse(template: string, options?: ParseOptions): any;
|
||||
|
||||
// TODO: undocumented
|
||||
adaptors: AdaptorPlugins;
|
||||
|
||||
// TODO: undocumented
|
||||
components: ComponentPlugins;
|
||||
|
||||
defaults: DefaultsOptions;
|
||||
|
||||
// TODO: undocumented
|
||||
decorators: DecoratorPlugins;
|
||||
|
||||
easing: { [key: string]: (x: number) => number; };
|
||||
|
||||
// TODO: undocumented
|
||||
events: EventPlugins;
|
||||
|
||||
// TODO: missing static properties documentation
|
||||
partials: { [key: string]: any; };
|
||||
|
||||
// Undocumented method
|
||||
Promise: Promise;
|
||||
|
||||
// TODO: missing static properties documentation
|
||||
transitions: TransitionPlugins;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Ractive instance members
|
||||
*/
|
||||
export interface Ractive {
|
||||
add(keypath: string, number?: number): Promise;
|
||||
|
||||
animate(keypath: string, value: any, options?: AnimateOptions): AnimationPromise;
|
||||
|
||||
animate(map: Object, options?: AnimateOptions): AnimationPromise;
|
||||
|
||||
detach(): DocumentFragment;
|
||||
|
||||
find(selector: string): HTMLElement;
|
||||
|
||||
// live default false
|
||||
findAll(selector: string, options?: { live: boolean }): HTMLElement[];
|
||||
|
||||
// live default false
|
||||
findAllComponents(name: string, options?: { live: boolean }): Ractive[];
|
||||
// TODO: maybe exist, in that case it is undocumented
|
||||
// findAllComponents(): Ractive[]
|
||||
|
||||
findComponent(name?: string): Ractive;
|
||||
|
||||
fire(eventName: string, ...args: any[]): void; // TODO: void?
|
||||
|
||||
get(keypath: string): any;
|
||||
get(): Object; // TODO: undocumented. or do it return function if ractive.data defined as function?
|
||||
|
||||
// TODO: target - Node or String or jQuery (see Valid selectors)
|
||||
// TODO: anchor - Node or String or jQuery
|
||||
insert(target: any, anchor?: any): void; // TODO: void?
|
||||
|
||||
merge(keypath: string, value: any[], options?: { compare: boolean | string | Function }): Promise;
|
||||
|
||||
// callback context Ractive
|
||||
observe(keypath: string, callback: (newValue: any, oldValue: any, keypath: string) => void, options?: ObserveOptions): Observe;
|
||||
observe(map: Object, options?: ObserveOptions): Observe;
|
||||
|
||||
// TODO: check handler type
|
||||
off(eventName?: string, handler?: () => void): Ractive;
|
||||
|
||||
// handler context Ractive
|
||||
on(eventName: string, handler: (event?: Event, ...args: any[]) => void): Observe;
|
||||
// TODO: undocumented
|
||||
on(map: { [eventName: string]: (event?: Event, ...args: any[]) => void }): Observe;
|
||||
|
||||
// Since 0.5.5
|
||||
pop(keypath: string): Promise;
|
||||
|
||||
// Since 0.5.5
|
||||
push(keypath: string, value: any): Promise;
|
||||
|
||||
// TODO: target - Node or String or jQuery (see Valid selectors)
|
||||
render(target: any): void; // TODO: void?
|
||||
|
||||
reset(data?: Object): Promise;
|
||||
|
||||
// Since 0.5.5
|
||||
// TODO: undocumented, mentioned in ractive change log
|
||||
resetTemplate(): void; // TODO: void?
|
||||
|
||||
set(keypath: string, value: any): Promise;
|
||||
set(map: Object): Promise;
|
||||
|
||||
// Since 0.5.5
|
||||
shift(keypath: string): Promise;
|
||||
|
||||
// Since 0.5.5
|
||||
splice(keypath: string, index: number, removeCount: number, ...add: any[]): Promise;
|
||||
|
||||
subtract(keypath: string, number?: number): Promise;
|
||||
|
||||
teardown(): Promise;
|
||||
|
||||
toggle(keypath: string): Promise;
|
||||
|
||||
toHTML(): string;
|
||||
|
||||
// Since 0.5.5
|
||||
unshift(keypath: string, value: any): Promise;
|
||||
|
||||
update(keypath?: string): Promise;
|
||||
|
||||
/**
|
||||
* Update out of sync two-way bindings
|
||||
* @param keypath A string
|
||||
* @param cascade A boolean with default false
|
||||
*/
|
||||
updateModel(keypath?: string, cascade?: boolean): Promise;
|
||||
|
||||
// Properties
|
||||
|
||||
nodes: Object;
|
||||
partials: Object;
|
||||
transitions: Object;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "ractive" {
|
||||
export = Ractive;
|
||||
}
|
||||
declare var Ractive: Ractive.Static;
|
||||
Vendored
+1
@@ -34,6 +34,7 @@ declare module "restify" {
|
||||
params: any;
|
||||
|
||||
body?: any; //available when bodyParser plugin is used
|
||||
isSecure: () => boolean;
|
||||
}
|
||||
|
||||
interface Response extends http.ServerResponse {
|
||||
|
||||
Vendored
+1
-1
@@ -246,7 +246,7 @@ declare module SigmaJs{
|
||||
|
||||
// Global settings
|
||||
autoResize?: boolean;
|
||||
autoRescale?: boolean;
|
||||
autoRescale?: any;
|
||||
enableCamera?: boolean;
|
||||
enableHovering?: boolean;
|
||||
enableEdgeHovering?: boolean;
|
||||
|
||||
Vendored
+1
@@ -45,6 +45,7 @@ declare module "sockjs" {
|
||||
prefix: string;
|
||||
protocol: string;
|
||||
readyState: number;
|
||||
id: string;
|
||||
|
||||
close(code?: string, reason?: string): boolean;
|
||||
destroy(): void;
|
||||
|
||||
@@ -0,0 +1,288 @@
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable WrongExpressionStatement
|
||||
|
||||
import t = require("tcomb");
|
||||
|
||||
var Str = t.Str;
|
||||
var Num = t.Num;
|
||||
var Bool = t.Bool;
|
||||
var Arr = t.Arr;
|
||||
var Obj = t.Obj;
|
||||
var Func = t.Func;
|
||||
var Err = t.Err;
|
||||
var Re = t.Re;
|
||||
var Dat = t.Dat;
|
||||
var Nil = t.Nil;
|
||||
var Any = t.Any;
|
||||
var Type = t.Type;
|
||||
|
||||
var struct = t.struct;
|
||||
var tuple = t.tuple;
|
||||
var list = t.list;
|
||||
var dict = t.dict;
|
||||
var union = t.union;
|
||||
var maybe = t.maybe;
|
||||
var func = t.func;
|
||||
var subtype = t.subtype;
|
||||
|
||||
Str.is("a string"); // => true
|
||||
Str.is(1); // => false
|
||||
|
||||
Num.is("a string"); // => true
|
||||
Num.is(1); // => false
|
||||
|
||||
Bool.is("a string"); // => true
|
||||
Bool.is(1); // => false
|
||||
|
||||
Arr.is("a string"); // => true
|
||||
Arr.is(1); // => false
|
||||
|
||||
Obj.is("a string"); // => true
|
||||
Obj.is(1); // => false
|
||||
|
||||
Func.is("a string"); // => true
|
||||
Func.is(1); // => false
|
||||
|
||||
Err.is("a string"); // => true
|
||||
Err.is(1); // => false
|
||||
|
||||
Re.is("a string"); // => true
|
||||
Re.is(1); // => false
|
||||
|
||||
Dat.is("a string"); // => true
|
||||
Dat.is(1); // => false
|
||||
|
||||
Nil.is("a string"); // => true
|
||||
Nil.is(1); // => false
|
||||
|
||||
Any.is("a string"); // => true
|
||||
Any.is(1); // => false
|
||||
|
||||
Type.is("a string"); // => true
|
||||
Type.is(1); // => false
|
||||
|
||||
var assert = t.assert;
|
||||
|
||||
assert(t.Str.is("a string")); // => ok
|
||||
assert(t.Str.is(1)); // => fail!
|
||||
|
||||
var x = -2;
|
||||
var min = 0;
|
||||
// throws "-2 should be greater then 0"
|
||||
assert(x > min, "%s should be greater then %s", x, min);
|
||||
|
||||
Str("a string"); // => ok
|
||||
|
||||
class Point1 {
|
||||
x: number;
|
||||
y: number;
|
||||
constructor(x: number, y: number) {
|
||||
this.x = <number>Num(x);
|
||||
this.y = <number>Num(y);
|
||||
}
|
||||
}
|
||||
|
||||
var Foo = t.irreducible("Foo", x => {
|
||||
return t.Bool(x.hasOwnProperty("bar"));
|
||||
});
|
||||
|
||||
Foo.is({ bar: "baz" }); // => true
|
||||
|
||||
// defines a type representing positive numbers
|
||||
var Positive = t.subtype(t.Num, n => {
|
||||
return n >= 0;
|
||||
}, "Positive");
|
||||
|
||||
Positive.is(1); // => true
|
||||
Positive.is(-1); // => false
|
||||
|
||||
var Country = t.enums({
|
||||
IT: "Italy",
|
||||
US: "United States"
|
||||
}, "Country");
|
||||
|
||||
Country.is("IT"); // => true
|
||||
Country.is("FR"); // => false
|
||||
|
||||
// values will mirror the keys
|
||||
Country = t.enums.of("IT US", "Country");
|
||||
|
||||
// same as
|
||||
|
||||
Country = t.enums(["IT", "US"], "Country");
|
||||
|
||||
// same as
|
||||
|
||||
Country = t.enums({
|
||||
IT: "IT",
|
||||
US: "US"
|
||||
}, "Country");
|
||||
|
||||
var Point = t.struct({
|
||||
x: Num,
|
||||
y: Num
|
||||
}, "Point");
|
||||
|
||||
// constructor usage, `p` is immutable, new is optional
|
||||
var p2 = new Point({ x: 1, y: 2 });
|
||||
|
||||
Point.is(p2); // => true
|
||||
|
||||
// now p is mutable
|
||||
new Point({ x: 1, y: 2 }, true);
|
||||
|
||||
Point.extend({ z: Num }, "Point3D");
|
||||
|
||||
// multiple inheritance
|
||||
var A = struct({});
|
||||
var B = struct({});
|
||||
var MixinC = {};
|
||||
var MixinD = {};
|
||||
A.extend([B, MixinC, MixinD]);
|
||||
|
||||
var Rectangle = struct({
|
||||
width: Num,
|
||||
height: Num
|
||||
});
|
||||
|
||||
Rectangle.prototype.getArea = function() {
|
||||
return this.width * this.height;
|
||||
};
|
||||
|
||||
var Cube = Rectangle.extend({
|
||||
thickness: Num
|
||||
});
|
||||
|
||||
// typeof Cube.prototype.getArea === 'function'
|
||||
Cube.prototype.getVolume = function() {
|
||||
return this.getArea() * this.thickness;
|
||||
};
|
||||
|
||||
var Area = tuple([Num, Num]);
|
||||
|
||||
// constructor usage, `area` is immutable
|
||||
Area([1, 2]);
|
||||
|
||||
var Path = list(Point);
|
||||
|
||||
// costructor usage, `path` is immutable
|
||||
Path([
|
||||
{ x: 0, y: 0 }, // tcomb hydrates automatically using the `Point` constructor
|
||||
{ x: 1, y: 1 }
|
||||
]);
|
||||
|
||||
var Tel = dict(Str, Num);
|
||||
|
||||
// costructor usage, `tel` is immutable
|
||||
Tel({ jack: 4098, sape: 4139 });
|
||||
|
||||
var ReactKey = union([Str, Num]);
|
||||
|
||||
ReactKey.is("a"); // => true
|
||||
ReactKey.is(1); // => true
|
||||
ReactKey.is(true); // => false
|
||||
|
||||
ReactKey.dispatch = x => {
|
||||
if (Str.is(x)) return <tcomb.T>Str;
|
||||
if (Num.is(x)) return <tcomb.T>Num;
|
||||
return <tcomb.T>Any;
|
||||
};
|
||||
|
||||
// now you can do this without a fail
|
||||
ReactKey("a");
|
||||
|
||||
// the value of a radio input where null = no selection
|
||||
var Radio = maybe(Str);
|
||||
|
||||
Radio.is("a"); // => true
|
||||
Radio.is(null); // => true
|
||||
Radio.is(1); // => false
|
||||
|
||||
// add takes two `Num`s and returns a `Num`
|
||||
var add = func([Num, Num], Num)
|
||||
.of((x: number, y: number) => { return x + y; });
|
||||
|
||||
add("Hello", 2); // Raises error: Invalid `Hello` supplied to `Num`
|
||||
add("Hello"); // Raises error: Invalid `Hello` supplied to `Num`
|
||||
|
||||
add(1, 2); // Returns: 3
|
||||
add(1)(2); // Returns: 3
|
||||
|
||||
// An `A` takes a `Str` and returns an `Num`
|
||||
func(Str, Num);
|
||||
|
||||
// A `B` takes a `Func` (which takes a `Str` and returns a `Num`) and returns a `Str`.
|
||||
func(func(Str, Num), Str);
|
||||
|
||||
// An `ExcitedStr` is a `Str` containing an exclamation mark
|
||||
var ExcitedStr = subtype(Str, s => { return s.indexOf("!") !== -1; }, "ExcitedStr");
|
||||
|
||||
// An `Exciter` takes a `Str` and returns an `ExcitedStr`
|
||||
var Exciter = func(Str, ExcitedStr);
|
||||
|
||||
// A `C` takes an `A`, a `B` and a `Str` and returns a `Num`
|
||||
func([A, B, Str], Num);
|
||||
|
||||
func(A, B).of(() => {});
|
||||
|
||||
var simpleQuestionator = Exciter.of((s: string) => { return s + "?"; });
|
||||
var simpleExciter = Exciter.of((s: string) => { return s + "!"; });
|
||||
|
||||
// Raises error:
|
||||
// Invalid `Hello?` supplied to `ExcitedStr`, insert a valid value for the subtype
|
||||
simpleQuestionator("Hello");
|
||||
|
||||
// Raises error: Invalid `1` supplied to `Str`
|
||||
simpleExciter(1);
|
||||
|
||||
// Returns: "Hello!"
|
||||
simpleExciter("Hello");
|
||||
|
||||
// We can reasonably suggest that add has the following type signature
|
||||
// add : Num -> Num -> Num
|
||||
add = func([Num, Num], Num)
|
||||
.of((x: number, y: number) => { return x + y });
|
||||
|
||||
add("Hello"); // As this raises: "Error: Invalid `Hello` supplied to `Num`"
|
||||
|
||||
var add2 = add(2);
|
||||
add2(1); // And this returns: 3
|
||||
|
||||
func(A, B).is(x);
|
||||
|
||||
Exciter.is(simpleExciter); // Returns: true
|
||||
Exciter.is(simpleQuestionator); // Returns: true
|
||||
|
||||
var id = (x: number) => { return x; };
|
||||
|
||||
func([Num, Num], Num).is(func([Num, Num], Num).of(id)); // Returns: true
|
||||
func([Num, Num], Num).is(func(Num, Num).of(id)); // Returns: false
|
||||
|
||||
var p4 = new Point({x: 1, y: 2});
|
||||
|
||||
p4 = Point.update(p4, { x: { "$set": 3 } }); // => {x: 3, y: 2}
|
||||
|
||||
var Type2 = dict(Str, Num);
|
||||
var instance = Type2({ a: 1, b: 2 });
|
||||
Type2.update(instance, { $remove: ["a"] }); // => {b: 2}
|
||||
|
||||
var Type3 = list(Num);
|
||||
var instance2 = Type3([1, 2, 3, 4]);
|
||||
Type3.update(instance2, { "$swap": { from: 1, to: 2 } }); // => [1, 3, 2, 4]
|
||||
|
||||
t.options.onFail = message => {
|
||||
return message;
|
||||
};
|
||||
|
||||
t.format("Invalid argument `name` = `%s` supplied to `%s`", 1, "MyType");
|
||||
|
||||
t.getKind(Str); // => 'irreducible'
|
||||
t.getKind(list(Str)); // => 'list'
|
||||
|
||||
t.getFunctionName(t.getKind); // => 'getKind'
|
||||
t.getFunctionName(() => { }); // => '<function0>'
|
||||
|
||||
t.getTypeName(Str);
|
||||
|
||||
t.mixin({ a: 1 }, { b: 2 }); // => {a: 1, b: 2}
|
||||
t.mixin({ a: 1 }, { a: 2 }); // => fail!
|
||||
Vendored
+420
@@ -0,0 +1,420 @@
|
||||
// Type definitions for tcomb v0.4
|
||||
// Project: http://gcanti.github.io/tcomb/guide/index.html
|
||||
// Definitions by: Jed Mao <https://github.com/jedmao>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module tcomb {
|
||||
|
||||
export var options: {
|
||||
onFail: (message: string) => void;
|
||||
};
|
||||
|
||||
/**
|
||||
* Like util.format in Node.
|
||||
*/
|
||||
export function format(format: string, ...values: any[]): string;
|
||||
export function getKind(type: T): string;
|
||||
/**
|
||||
* Returns a function's name or displayName if specified; otherwise,
|
||||
* fallbacks on '<function<arity>>'.
|
||||
*/
|
||||
export function getFunctionName(fn: Function): string;
|
||||
export function getTypeName(type: T): string;
|
||||
/**
|
||||
* Safe version of mixin, properties can be overwritten.
|
||||
*/
|
||||
export function mixin(target: {}, source: {}, overwrite?: boolean): any;
|
||||
export var slice: typeof Array.prototype.slice;
|
||||
export function shallowCopy(x: T): T;
|
||||
export function update(instance: any, spec: {}): T;
|
||||
/**
|
||||
* If an assert fails the debugger kicks in so you can inspect the stack
|
||||
* and quickly find out what's wrong.
|
||||
* @param message - Useful for debugging. Formatted with values like util.format in Node.
|
||||
* @param values - Sequentially inserted into the message.
|
||||
*/
|
||||
export function assert(condition: boolean, message?: string, ...values: any[]): void;
|
||||
export function fail(message?: string): void;
|
||||
|
||||
interface T {
|
||||
meta: {
|
||||
/**
|
||||
* The type kind, equal to "irreducible" for irreducible types.
|
||||
*/
|
||||
kind: string;
|
||||
/**
|
||||
* The type name.
|
||||
*/
|
||||
name: string;
|
||||
};
|
||||
displayName: string;
|
||||
is(value: any): boolean;
|
||||
update(instance: any, spec: {}): T;
|
||||
}
|
||||
|
||||
interface TypePredicate {
|
||||
(x: any): Bool_Instance;
|
||||
}
|
||||
|
||||
interface Any_Instance {
|
||||
}
|
||||
|
||||
interface Any_Static extends T {
|
||||
new (value: any): Any_Instance;
|
||||
(value: any): Any_Instance;
|
||||
}
|
||||
|
||||
export var Any: Any_Static;
|
||||
|
||||
interface Nil_Instance {
|
||||
}
|
||||
|
||||
interface Nil_Static extends T {
|
||||
new (value: any): Nil_Instance;
|
||||
(value: any): Nil_Instance;
|
||||
}
|
||||
|
||||
export var Nil: Str_Static;
|
||||
|
||||
interface Str_Instance extends String {
|
||||
}
|
||||
|
||||
interface Str_Static extends T {
|
||||
new (value: string): Str_Instance;
|
||||
(value: string): Str_Instance;
|
||||
meta: {
|
||||
/**
|
||||
* The type kind, equal to "irreducible" for irreducible types.
|
||||
*/
|
||||
kind: string;
|
||||
/**
|
||||
* The type name.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The type predicate.
|
||||
*/
|
||||
is: TypePredicate;
|
||||
};
|
||||
}
|
||||
|
||||
export var Str: Str_Static;
|
||||
|
||||
interface Num_Instance extends Number {
|
||||
}
|
||||
|
||||
interface Num_Static extends T {
|
||||
new (value: number): Num_Instance;
|
||||
(value: number): Num_Instance;
|
||||
}
|
||||
|
||||
export var Num: Num_Static;
|
||||
|
||||
interface Bool_Instance extends Boolean {
|
||||
}
|
||||
|
||||
interface Bool_Static extends T {
|
||||
new (value: boolean): Bool_Instance;
|
||||
(value: boolean): Bool_Instance;
|
||||
}
|
||||
|
||||
export var Bool: Bool_Static;
|
||||
|
||||
interface Arr_Instance extends Array<any> {
|
||||
}
|
||||
|
||||
interface Arr_Static extends T {
|
||||
new (value: any[]): Arr_Instance;
|
||||
(value: any[]): Arr_Instance;
|
||||
}
|
||||
|
||||
export var Arr: Arr_Static;
|
||||
|
||||
interface Obj_Instance extends Object {
|
||||
}
|
||||
|
||||
interface Obj_Static extends T {
|
||||
new (value: Object): Obj_Instance;
|
||||
(value: Object): Obj_Instance;
|
||||
}
|
||||
|
||||
export var Obj: Obj_Static;
|
||||
|
||||
interface Func_Instance extends Function {
|
||||
}
|
||||
|
||||
interface Func_Static extends T {
|
||||
new (value: Function): Func_Instance;
|
||||
(value: Function): Func_Instance;
|
||||
}
|
||||
|
||||
export var Func: Func_Static;
|
||||
|
||||
interface Err_Instance extends Error {
|
||||
}
|
||||
|
||||
interface Err_Static extends T {
|
||||
new (value: Error): Err_Instance;
|
||||
(value: Error): Err_Instance;
|
||||
}
|
||||
|
||||
export var Err: Err_Static;
|
||||
|
||||
interface Re_Instance extends RegExp {
|
||||
}
|
||||
|
||||
interface Re_Static extends T {
|
||||
new (value: RegExp): Re_Instance;
|
||||
(value: RegExp): Re_Instance;
|
||||
}
|
||||
|
||||
export var Re: Re_Static;
|
||||
|
||||
interface Dat_Instance extends Date {
|
||||
}
|
||||
|
||||
interface Dat_Static extends T {
|
||||
new (value: Date): Dat_Instance;
|
||||
(value: Date): Dat_Instance;
|
||||
}
|
||||
|
||||
export var Dat: Dat_Static;
|
||||
|
||||
interface Type_Instance {
|
||||
}
|
||||
|
||||
interface Type_Static extends T {
|
||||
new (value: any): Type_Instance;
|
||||
(value: any): Type_Instance;
|
||||
}
|
||||
|
||||
export var Type: Type_Static;
|
||||
|
||||
/**
|
||||
* @param name - The type name.
|
||||
* @param is - A predicate.
|
||||
*/
|
||||
export function irreducible(name: string, is: TypePredicate): T;
|
||||
/**
|
||||
* @param props - A hash whose keys are the field names and the values are the fields types.
|
||||
* @param name - Useful for debugging purposes.
|
||||
*/
|
||||
export function struct(props: Object, name?: string): typeof Struct;
|
||||
|
||||
export interface Struct_Static extends T {
|
||||
new (value: any, mutable?: boolean): Struct_Instance;
|
||||
(value: any, mutable?: boolean): Struct_Instance;
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
props: any[];
|
||||
};
|
||||
/**
|
||||
* @param mixins - Contains the new props.
|
||||
* @param name - Useful for debugging purposes.
|
||||
*/
|
||||
extend(mixins: Object, name?: string): Struct_Static;
|
||||
/**
|
||||
* @param mixins - Contains the new props.
|
||||
* @param name - Useful for debugging purposes.
|
||||
*/
|
||||
extend(mixins: Struct_Static, name?: string): Struct_Static;
|
||||
/**
|
||||
* @param mixins - Contains the new props.
|
||||
* @param name - Useful for debugging purposes.
|
||||
*/
|
||||
extend(mixins: Object[], name?: string): Struct_Static;
|
||||
/**
|
||||
* @param mixins - Contains the new props.
|
||||
* @param name - Useful for debugging purposes.
|
||||
*/
|
||||
extend(mixins: Struct_Static[], name?: string): Struct_Static;
|
||||
}
|
||||
|
||||
interface Struct_Instance {
|
||||
}
|
||||
|
||||
export var Struct: Struct_Static;
|
||||
|
||||
/**
|
||||
* @param map - A hash whose keys are the enums (values are free).
|
||||
* @param name - Useful for debugging purposes.
|
||||
*/
|
||||
export function enums(map: Object, name?: string): T;
|
||||
export module enums {
|
||||
/**
|
||||
* @param keys - Array of enums.
|
||||
* @param name - Useful for debugging purposes.
|
||||
*/
|
||||
export function of(keys: string[], name?: string): T;
|
||||
/**
|
||||
* @param keys - String of enums separated by spaces.
|
||||
* @param name - Useful for debugging purposes.
|
||||
*/
|
||||
export function of(keys: string, name?: string): T;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name - Useful for debugging purposes.
|
||||
*/
|
||||
export function union(types: T[], name?: string): Union_Static;
|
||||
|
||||
interface Union_Static extends T {
|
||||
new (value: any, mutable?: boolean): Union_Instance;
|
||||
(value: any, mutable?: boolean): Union_Instance;
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
types: T[];
|
||||
};
|
||||
dispatch(x: any): T;
|
||||
}
|
||||
|
||||
interface Union_Instance {
|
||||
}
|
||||
|
||||
export var Union: Union_Static;
|
||||
|
||||
/**
|
||||
* @param type - The wrapped type.
|
||||
* @param name - Useful for debugging purposes.
|
||||
*/
|
||||
export function maybe(type: T, name?: string): Maybe_Static;
|
||||
|
||||
export interface Maybe_Static extends T {
|
||||
new (value: any, mutable?: boolean): Maybe_Instance;
|
||||
(value: any, mutable?: boolean): Maybe_Instance;
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
typee: T;
|
||||
};
|
||||
}
|
||||
|
||||
interface Maybe_Instance {
|
||||
}
|
||||
|
||||
export var Maybe: Maybe_Static;
|
||||
|
||||
/**
|
||||
* @param name - Useful for debugging purposes.
|
||||
*/
|
||||
export function tuple(types: T[], name?: string): Tuple_Static;
|
||||
|
||||
interface Tuple_Static extends T {
|
||||
new (value: any, mutable?: boolean): Tuple_Instance;
|
||||
(value: any, mutable?: boolean): Tuple_Instance;
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
types: T[];
|
||||
};
|
||||
}
|
||||
|
||||
interface Tuple_Instance {
|
||||
}
|
||||
|
||||
export var Tuple: Tuple_Static;
|
||||
|
||||
/**
|
||||
* Combines old types into a new one.
|
||||
* @param type - A type already defined.
|
||||
* @param name - Useful for debugging purposes.
|
||||
*/
|
||||
export function subtype(type: T, predicate: TypePredicate, name?: string): typeof Subtype;
|
||||
|
||||
interface Subtype_Static extends T {
|
||||
new (value: any, mutable?: boolean): Subtype_Instance;
|
||||
(value: any, mutable?: boolean): Subtype_Instance;
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
type: T;
|
||||
predicate: TypePredicate;
|
||||
};
|
||||
}
|
||||
|
||||
interface Subtype_Instance {
|
||||
}
|
||||
|
||||
export var Subtype: Subtype_Static;
|
||||
|
||||
/**
|
||||
* @param type - The type of list items.
|
||||
* @param name - Useful for debugging purposes.
|
||||
*/
|
||||
export function list(type: T, name?: string): List_Static;
|
||||
|
||||
interface List_Static extends T {
|
||||
new (value: any, mutable?: boolean): List_Instance;
|
||||
(value: any, mutable?: boolean): List_Instance;
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
'type': T;
|
||||
};
|
||||
}
|
||||
|
||||
interface List_Instance {
|
||||
}
|
||||
|
||||
export var List: List_Static;
|
||||
|
||||
/**
|
||||
* @param domain - The type of keys.
|
||||
* @param codomain - The type of values.
|
||||
* @param name - Useful for debugging purposes.
|
||||
*/
|
||||
export function dict(domain: T, codomain: T, name?: string): Dict_Static;
|
||||
|
||||
interface Dict_Static extends T {
|
||||
new (value: any, mutable?: boolean): Dict_Instance;
|
||||
(value: any, mutable?: boolean): Dict_Instance;
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
domain: T;
|
||||
codomain: T;
|
||||
};
|
||||
}
|
||||
|
||||
interface Dict_Instance {
|
||||
}
|
||||
|
||||
export var Dict: Dict_Static;
|
||||
|
||||
/**
|
||||
* @param type - The type of the function's argument.
|
||||
* @param codomain - The type of the function's return value.
|
||||
* @param name - Useful for debugging purposes.
|
||||
*/
|
||||
export function func(domain: T, codomain: T, name?: string): Func_Static;
|
||||
/**
|
||||
* @param type - The list of types of the function's arguments.
|
||||
* @param codomain - The type of the function's return value.
|
||||
* @param name - Useful for debugging purposes.
|
||||
*/
|
||||
export function func(domain: T[], codomain: T, name?: string): Func_Static;
|
||||
|
||||
interface Func_Static extends T {
|
||||
new (value: any, mutable?: boolean): Func_Instance;
|
||||
(value: any, mutable?: boolean): Func_Instance;
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
domain: any;
|
||||
codomain: T;
|
||||
};
|
||||
of(fn: Function): Function;
|
||||
}
|
||||
|
||||
interface Func_Instance {
|
||||
}
|
||||
|
||||
export var Func: Func_Static;
|
||||
|
||||
}
|
||||
|
||||
declare module "tcomb" {
|
||||
export = tcomb;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
);
|
||||
}
|
||||
Vendored
+342
@@ -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 user’s Tweets.
|
||||
*/
|
||||
screenName?: string;
|
||||
/**
|
||||
* Override the timeline source with this user’s 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 object’s 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 retweeted’s source_tweet_id in the event object’s 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 object’s 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;
|
||||
Vendored
+1
-1
@@ -72,7 +72,7 @@ declare class URI {
|
||||
segment(level: string): string;
|
||||
search(): string;
|
||||
search(qry: string): URI;
|
||||
search(qry: boolean): Object;
|
||||
search(qry: boolean): any;
|
||||
search(qry: Object): URI;
|
||||
query(): string;
|
||||
query(qry: string): URI;
|
||||
|
||||
Vendored
+10
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user