Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Sheron Benedict
2016-03-10 18:54:34 +05:30
95 changed files with 14168 additions and 817 deletions
+106
View File
@@ -0,0 +1,106 @@
///<reference path="agenda.d.ts"/>
import * as Agenda from "agenda";
var mongoConnectionString = "mongodb://127.0.0.1/agenda";
var agenda = new Agenda({ db: { address: mongoConnectionString } });
agenda.define('delete old users', (job, done) => {
});
agenda.on('ready', () => {
agenda.every('3 minutes', 'delete old users');
// Alternatively, you could also do:
agenda.every('*/3 * * * *', 'delete old users');
agenda.start();
});
agenda.define('send email report', { priority: 'high', concurrency: 10 }, (job, done) => {
});
agenda.on('ready', () => {
agenda.schedule('in 20 minutes', 'send email report', { to: 'admin@example.com' });
agenda.start();
});
agenda.on('ready', () => {
var weeklyReport = agenda.create('send email report', { to: 'another-guy@example.com' });
weeklyReport.repeatEvery('1 week').save();
agenda.start();
});
var agenda = new Agenda({ processEvery: '30 seconds' });
agenda.defaultConcurrency(5);
var agenda = new Agenda({ defaultConcurrency: 5 });
agenda.lockLimit(0);
var agenda = new Agenda({ lockLimit: 0 });
agenda.defaultLockLimit(0);
var agenda = new Agenda({ defaultLockLimit: 0 });
agenda.defaultLockLifetime(10000);
var agenda = new Agenda({ defaultLockLifetime: 10000 });
agenda.define('some long running job', function(job, done) {
done();
});
agenda.every('15 minutes', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']);
agenda.schedule('tomorrow at noon', 'printAnalyticsReport', { userCount: 100 });
agenda.schedule('tomorrow at noon', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']);
agenda.now('do the hokey pokey');
var job = agenda.create('printAnalyticsReport', { userCount: 100 });
job.save(function(err) {
console.log("Job successfully saved");
});
agenda.jobs({ name: 'printAnalyticsReport' }, function(err, jobs) {
// Work with jobs (see below)
});
agenda.cancel({ name: 'printAnalyticsReport' }, function(err, numRemoved) {
});
agenda.purge(function(err, numRemoved) {
});
agenda.stop(function() {
process.exit(0);
});
job.repeatEvery('10 minutes');
job.repeatAt('3:30pm');
job.schedule('tomorrow at 6pm');
job.priority('low');
job.priority(10);
job.unique({ 'data.type': 'active', 'data.userId': '123' });
job.fail('insuficient disk space');
job.fail(new Error('insufficient disk space'));
job.run(function(err, job) {
console.log("I don't know why you would need to do this...");
});
job.remove(function(err) {
if (!err) console.log("Successfully removed job from collection");
})
+443
View File
@@ -0,0 +1,443 @@
// Type definitions for Agenda v0.8.9
// Project: https://github.com/rschmukler/agenda
// Definitions by: Meir Gottlieb <https://github.com/meirgottlieb>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path='../node/node.d.ts' />
/// <reference path='../mongodb/mongodb.d.ts' />
declare module "agenda" {
import {EventEmitter} from "events";
import {Db, Collection, ObjectID} from "mongodb";
interface Callback {
(err?: Error): void;
}
interface ResultCallback<T> {
(err?: Error, result?: T): void;
}
/**
* Agenda Configuration.
*/
interface AgendaConfiguration {
/**
* Sets the interval with which the queue is checked. A number in milliseconds or a frequency string.
*/
processEvery?: string | number;
/**
* Takes a number which specifies the default number of a specific job that can be running at any given moment.
* By default it is 5.
*/
defaultConcurrency?: number;
/**
* Takes a number which specifies the max number of jobs that can be running at any given moment. By default it
* is 20.
*/
maxConcurrency?: number;
/**
* Takes a number which specifies the default number of a specific job that can be locked at any given moment.
* By default it is 0 for no max.
*/
defaultLockLimit?: number;
/**
* Takes a number shich specifies the max number jobs that can be locked at any given moment. By default it is
* 0 for no max.
*/
lockLimit?: number;
/**
* Takes a number which specifies the default lock lifetime in milliseconds. By default it is 10 minutes. This
* can be overridden by specifying the lockLifetime option to a defined job.
*/
defaultLockLifetime?: number;
/**
* Specifies that Agenda should be initialized using and existing MongoDB connection.
*/
mongo?: {
/**
* The MongoDB database connection to use.
*/
db: Db;
/**
* The name of the collection to use.
*/
collection?: string;
}
/**
* Specifies that Agenda should connect to MongoDB.
*/
db?: {
/**
* The connection URL.
*/
address: string;
/**
* The name of the collection to use.
*/
collection?: string;
/**
* Connection options to pass to MongoDB.
*/
options?: any;
}
}
/**
* The database record associated with a job.
*/
interface JobAttributes {
/**
* The record identity.
*/
_id: ObjectID;
/**
* The name of the job.
*/
name: string;
/**
* The type of the job (single|normal).
*/
type: string;
/**
* The job details.
*/
data: { [name: string]: any };
/**
* The priority of the job.
*/
priority: number;
/**
* How often the job is repeated using a human-readable or cron format.
*/
repeatInterval: string | number;
/**
* The timezone that conforms to [moment-timezone](http://momentjs.com/timezone/).
*/
repeatTimezone: string;
/**
* Date/time the job was las modified.
*/
lastModifiedBy: string;
/**
* Date/time the job will run next.
*/
nextRunAt: Date;
/**
* Date/time the job was locked.
*/
lockedAt: Date;
/**
* Date/time the job was last run.
*/
lastRunAt: Date;
/**
* Date/time the job last finished running.
*/
lastFinishedAt: Date;
/**
* The reason the job failed.
*/
failReason: string;
/**
* The number of times the job has failed.
*/
failCount: number;
/**
* The date/time the job last failed.
*/
failedAt: Date;
}
/**
* A scheduled job.
*/
interface Job {
/**
* The database record associated with the job.
*/
attrs: JobAttributes;
/**
* Specifies an interval on which the job should repeat.
* @param interval A human-readable format String, a cron format String, or a Number.
* @param options An optional argument that can include a timezone field. The timezone should be a string as
* accepted by moment-timezone and is considered when using an interval in the cron string format.
*/
repeatEvery(interval: string | number, options?: { timezone?: string }): Job
/**
* Specifies a time when the job should repeat. [Possible values](https://github.com/matthewmueller/date#examples).
* @param time
*/
repeatAt(time: string): Job
/**
* Disables the job.
*/
disable(): Job;
/**
* Enables the job.
*/
enable(): Job;
/**
* Ensure that only one instance of this job exists with the specified properties
* @param value The properties associated with the job that must be unqiue.
* @param opts
*/
unique(value: any, opts?: { insertOnly?: boolean }): Job;
/**
* Specifies the next time at which the job should run.
* @param time The next time at which the job should run.
*/
schedule(time: string | Date): Job;
/**
* Specifies the priority weighting of the job.
* @param value The priority of the job (lowest|low|normal|high|highest|number).
*/
priority(value: string | number): Job;
/**
* Sets job.attrs.failedAt to now, and sets job.attrs.failReason to reason.
* @param reason A message or Error object that indicates why the job failed.
*/
fail(reason: string | Error): Job;
/**
* Runs the given job and calls callback(err, job) upon completion. Normally you never need to call this manually
* @param cb Called when the job is completed.
*/
run(cb?: ResultCallback<Job>): Job;
/**
* Returns true if the job is running; otherwise, returns false.
*/
isRunning(): boolean;
/**
* Saves the job into the database.
* @param cb Called when the job is saved.
*/
save(cb?: ResultCallback<Job>): Job;
/**
* Removes the job from the database and cancels the job.
* @param cb Called after the job has beeb removed from the database.
*/
remove(cb?: Callback): void;
/**
* Resets the lock on the job. Useful to indicate that the job hasn't timed out when you have very long running
* jobs.
* @param cb Called after the job has been saved to the database.
*/
touch(cb?: Callback): void;
}
interface JobOptions {
/**
* Maximum number of that job that can be running at once (per instance of agenda)
*/
concurrency?: number;
/**
* Maximum number of that job that can be locked at once (per instance of agenda)
*/
lockLimit?: number;
/**
* Interval in ms of how long the job stays locked for (see multiple job processors for more info). A job will
* automatically unlock if done() is called.
*/
lockLifetime?: number;
/**
* (lowest|low|normal|high|highest|number) specifies the priority of the job. Higher priority jobs will run
* first.
*/
priority?: string | number;
}
class Agenda extends EventEmitter {
/**
* Constructs a new Agenda object.
* @param config Optional configuration to initialize the Agenda.
* @param cb Optional callback called with the MongoDB colleciton.
*/
constructor(config?: AgendaConfiguration, cb?: ResultCallback<Collection>);
/**
* Connect to the specified MongoDB server and database.
*/
database(url: string, collection?: string, options?: any, cb?: ResultCallback<Collection>): Agenda;
/**
* Initialize agenda with an existing MongoDB connection.
*/
mongo(db: Db, collection?: string, cb?: ResultCallback<Collection>): Agenda;
/**
* Sets the agenda name.
*/
name(value: string): Agenda;
/**
* Sets the interval with which the queue is checked. A number in milliseconds or a frequency string.
*/
processEvery(interval: string | number): Agenda;
/**
* Takes a number which specifies the max number of jobs that can be running at any given moment. By default it
* is 20.
* @param value The value to set.
*/
maxConcurrency(value: number): Agenda;
/**
* Takes a number which specifies the default number of a specific job that can be running at any given moment.
* By default it is 5.
* @param value The value to set.
*/
defaultConcurrency(value: number): Agenda;
/**
* Takes a number shich specifies the max number jobs that can be locked at any given moment. By default it is
* 0 for no max.
* @param value The value to set.
*/
lockLimit(value: number): Agenda;
/**
* Takes a number which specifies the default number of a specific job that can be locked at any given moment.
* By default it is 0 for no max.
* @param value The value to set.
*/
defaultLockLimit(value: number): Agenda;
/**
* Takes a number which specifies the default lock lifetime in milliseconds. By default it is 10 minutes. This
* can be overridden by specifying the lockLifetime option to a defined job.
* @param value The value to set.
*/
defaultLockLifetime(value: number): Agenda;
/**
* Returns an instance of a jobName with data. This does NOT save the job in the database. See below to learn
* how to manually work with jobs.
* @param name The name of the job.
* @param data Data to associated with the job.
*/
create(name: string, data?: any): Job;
/**
* Find all Jobs matching `query` and pass same back in cb().
* @param query
* @param cb
*/
jobs(query: any, cb: ResultCallback<Job[]>): void;
/**
* Removes all jobs in the database without defined behaviors. Useful if you change a definition name and want
* to remove old jobs.
* @param cb Called with the number of jobs removed.
*/
purge(cb?: ResultCallback<number>): void;
/**
* Defines a job with the name of jobName. When a job of job name gets run, it will be passed to fn(job, done).
* To maintain asynchronous behavior, you must call done() when you are processing the job. If your function is
* synchronous, you may omit done from the signature.
* @param name The name of the jobs.
* @param options The options for the job.
* @param handler The handler to execute.
*/
define(name: string, handler: (job?: Job, done?: (err?: Error) => void) => void): void;
define(name: string, options: JobOptions, handler: (job?: Job, done?: (err?: Error) => void) => void): void;
/**
* Runs job name at the given interval. Optionally, data and options can be passed in.
* @param interval Can be a human-readable format String, a cron format String, or a Number.
* @param names The name or names of the job(s) to run.
* @param data An optional argument that will be passed to the processing function under job.attrs.data.
* @param options An optional argument that will be passed to job.repeatEvery.
* @param cb An optional callback function which will be called when the job has been persisted in the database.
*/
every(interval: number | string, names: string, data?: any, options?: any, cb?: ResultCallback<Job>): Job;
every(interval: number | string, names: string[], data?: any, options?: any, cb?: ResultCallback<Job[]>): Job[];
/**
* Schedules a job to run name once at a given time.
* @param when A Date or a String such as tomorrow at 5pm.
* @param names The name or names of the job(s) to run.
* @param data An optional argument that will be passed to the processing function under job.attrs.data.
* @param cb An optional callback function which will be called when the job has been persisted in the database.
*/
schedule(when: Date | string, names: string, data?: any, cb?: ResultCallback<Job>): Job;
schedule(when: Date | string, names: string[], data?: any, cb?: ResultCallback<Job[]>): Job[];
/**
* Schedules a job to run name once immediately.
* @param name The name of the job to run.
* @param data An optional argument that will be passed to the processing function under job.attrs.data.
* @param cb An optional callback function which will be called when the job has been persisted in the database.
*/
now(name: string, data?: any, cb?: ResultCallback<Job>): Job;
/**
* Cancels any jobs matching the passed mongodb-native query, and removes them from the database.
* @param query Mongodb native query.
* @param cb Called with the number of jobs removed.
*/
cancel(query: any, cb?: ResultCallback<number>): void;
/**
* Starts the job queue processing, checking processEvery time to see if there are new jobs.
*/
start(): void;
/**
* Stops the job queue processing. Unlocks currently running jobs.
* @param cb Called after the job processing queue shuts down and unlocks all jobs.
*/
stop(cb: Callback): void;
}
module Agenda {
}
export = Agenda;
}
@@ -0,0 +1,12 @@
/// <reference path="angular-fullscreen.d.ts" />
angular
.module('TestApp', ['FBAngular'])
.controller('TestCtrl', (Fullscreen: ng.fullscreen.IFullscreen) => {
Fullscreen.all();
Fullscreen.toggleAll();
Fullscreen.enable(document.getElementById('test-id'));
Fullscreen.cancel();
Fullscreen.isEnabled();
Fullscreen.isSupported();
});
+34
View File
@@ -0,0 +1,34 @@
// Type definitions for AngularJS HTML5 Fullscreen v1.0.1
// Project: https://github.com/fabiobiondi/angular-fullscreen
// Definitions by: Julien Paroche <https://github.com/julienpa>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/angular-fullscreen
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.fullscreen {
/**
* Prefixing interface name with "I" is not recommended: http://www.typescriptlang.org/Handbook#writing-dts-files
* However, we let it here to keep consistency with all the other Angular-related definitions
*/
interface IFullscreen {
// enable document fullscreen
all(): void;
// enable or disable the document fullscreen
toggleAll(): void;
// enable fullscreen to a specific element
enable(element: Element|HTMLElement): void;
// disable fullscreen
cancel(): void;
// return true if fullscreen is enabled, otherwise false
isEnabled(): boolean;
// return true if fullscreen API is supported by your browser
isSupported(): boolean;
}
}
+25 -25
View File
@@ -63,6 +63,26 @@ declare module angular.resource {
responseType?: string;
interceptor?: any;
}
// Allow specify more resource methods
// No need to add duplicates for all four overloads.
interface IResourceMethod<T> {
(): T;
(params: Object): T;
(success: Function, error?: Function): T;
(params: Object, success: Function, error?: Function): T;
(params: Object, data: Object, success?: Function, error?: Function): T;
}
// Allow specify resource moethod which returns the array
// No need to add duplicates for all four overloads.
interface IResourceArrayMethod<T> {
(): IResourceArray<T>;
(params: Object): IResourceArray<T>;
(success: Function, error?: Function): IResourceArray<T>;
(params: Object, success: Function, error?: Function): IResourceArray<T>;
(params: Object, data: Object, success?: Function, error?: Function): IResourceArray<T>;
}
// Baseclass for everyresource with default actions.
// If you define your new actions for the resource, you will need
@@ -83,35 +103,15 @@ declare module angular.resource {
// https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L538-L549
interface IResourceClass<T> {
new(dataOrParams? : any) : T;
get(): T;
get(params: Object): T;
get(success: Function, error?: Function): T;
get(params: Object, success: Function, error?: Function): T;
get(params: Object, data: Object, success?: Function, error?: Function): T;
get: IResourceMethod<T>;
query(): IResourceArray<T>;
query(params: Object): IResourceArray<T>;
query(success: Function, error?: Function): IResourceArray<T>;
query(params: Object, success: Function, error?: Function): IResourceArray<T>;
query(params: Object, data: Object, success?: Function, error?: Function): IResourceArray<T>;
query: IResourceArrayMethod<T>;
save(): T;
save(data: Object): T;
save(success: Function, error?: Function): T;
save(data: Object, success: Function, error?: Function): T;
save(params: Object, data: Object, success?: Function, error?: Function): T;
save: IResourceMethod<T>;
remove(): T;
remove(params: Object): T;
remove(success: Function, error?: Function): T;
remove(params: Object, success: Function, error?: Function): T;
remove(params: Object, data: Object, success?: Function, error?: Function): T;
remove: IResourceMethod<T>;
delete(): T;
delete(params: Object): T;
delete(success: Function, error?: Function): T;
delete(params: Object, success: Function, error?: Function): T;
delete(params: Object, data: Object, success?: Function, error?: Function): T;
delete: IResourceMethod<T>;
}
// Instance calls always return the the promise of the request which retrieved the object
+10 -1
View File
@@ -379,6 +379,15 @@ module TestDeferred {
}
}
module TestInjector {
let $injector: angular.auto.IInjectorService;
$injector.strictDi = true;
$injector.annotate(() => {});
$injector.annotate(() => {}, true);
}
// Promise signature tests
module TestPromise {
@@ -957,7 +966,7 @@ function NgModelControllerTyping() {
};
}
var $filter: angular.IFilterService;
var $filter: angular.IFilterService;
function testFilter() {
+2 -1
View File
@@ -1833,13 +1833,14 @@ declare module angular {
// see http://docs.angularjs.org/api/AUTO.$injector
///////////////////////////////////////////////////////////////////////
interface IInjectorService {
annotate(fn: Function): string[];
annotate(fn: Function, strictDi?: boolean): string[];
annotate(inlineAnnotatedFunction: any[]): string[];
get<T>(name: string, caller?: string): T;
has(name: string): boolean;
instantiate<T>(typeConstructor: Function, locals?: any): T;
invoke(inlineAnnotatedFunction: any[]): any;
invoke(func: Function, context?: any, locals?: any): any;
strictDi: boolean;
}
///////////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -78,6 +78,6 @@ interface Auth0LockStatic {
declare var Auth0Lock: Auth0LockStatic;
declare module "Auth0Lock" {
declare module "auth0-lock" {
export = Auth0Lock;
}
+2 -2
View File
@@ -67,8 +67,8 @@ declare module Microsoft.Maps {
export class Events {
static addHandler(target: any, eventName: string, handler: () => void): any;
static addThrottledHandler(target: any, eventName: string, handler: () => void, throttleInterval: number): any;
static addHandler(target: any, eventName: string, handler: (e: any) => void): any;
static addThrottledHandler(target: any, eventName: string, handler: (e: any) => void, throttleInterval: number): any;
static hasHandler(target: any, eventName: string): boolean;
static invoke(target: any, eventName: string, args: any): void;
static removeHandler(handlerId: any): void;
+1 -1
View File
@@ -88,7 +88,7 @@ declare module 'bookshelf' {
belongsTo<R extends Model<any>>(target : {new(...args : any[]) : R}, foreignKey? : string) : R;
belongsToMany<R extends Model<any>>(target : {new(...args : any[]) : R}, table? : string, foreignKey? : string, otherKey? : string) : Collection<R>;
count(column? : string, options? : SyncOptions) : Promise<number>;
destroy(options : SyncOptions) : void;
destroy(options : SyncOptions) : Promise<T>;
fetch(options? : FetchOptions) : Promise<T>;
fetchAll(options? : FetchAllOptions) : Promise<Collection<T>>;
hasMany<R extends Model<any>>(target : {new(...args : any[]) : R}, foreignKey? : string) : Collection<R>;
+27
View File
@@ -0,0 +1,27 @@
/// <reference path="bugsnag.d.ts" />
Bugsnag.apiKey = "API-KEY";
Bugsnag.releaseStage = "beta";
Bugsnag.appVersion = "2.4.56";
Bugsnag.user = <BugsnagUser>{
name: "Robert K. User",
email: "robbie@example.com"
};
Bugsnag.metaData = {
account: {
name: "Acme Co",
plan: "hacker"
}
}
Bugsnag.notifyException(new Error("Something broke"));
Bugsnag.notify("Serious Problem", "We are out of cookies");
Bugsnag.notify("Serious Problem",
"We are out of cookies",
{ remaining_snacks: ["carrots", "biscuits"] },
"error");
+90
View File
@@ -0,0 +1,90 @@
// Type definitions for Bugsnag v2.5.0
// Project: https://github.com/bugsnag/bugsnag-js
// Definitions by: Delisa Mason <https://github.com/kattrali>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface BugsnagUser {
id?: string,
name?: string,
email?: string
}
interface BugsnagStatic {
/** Bugsnag project API key */
apiKey: string;
/** The client application version */
appVersion: string;
/** true if Bugsnag should be automatically notified of errors which are
* sent to `window.onerror`
*/
autoNotify: boolean;
/** Callback run before error reports are sent to Bugsnag.
* Payload and metadata information can be altered or removed altogether.
* To cancel sending the report, return false from this function.
*/
beforeNotify: (payload: any, metaData: any) => boolean;
/** The pathname of the current page, not including the fragment identifier
* nor search parameters
*/
context: string;
/** Disables console-based logging. Defaults to false. */
disableLog: boolean;
/** The address used to send errors to Bugsnag. The default is
* `https://notify.bugsnag.com/js`
*/
endpoint: string;
/** Enables sending inline scripts on the page to Bugsnag to assist with
* debugging. Defaults to true
*/
inlineScript: boolean;
/** The maximum depth to parse the error stack */
maxDepth: number;
/** Additional metadata to send to Bugsnag with every error. */
metaData: any;
/** The method used for the notify request. The default is a temporary
* JavaScript image object, however Chrome apps/extensions and other
* applications where XHR is needed can use `xhr` instead.
*/
notifyHandler: string;
/** The releases stages during which Bugsnag will be notified of errors. */
notifyReleaseStages: string[];
/** The recorded root of the project. The default is the current host
* address (protocol and domain).
*/
projectRoot: string;
/** Current phase of the application release process. The default is
* `production`
*/
releaseStage: string;
/** Information about the current user which is sent to Bugsnag with
* exception reports
*/
user: BugsnagUser;
/** Continue catching exceptions after the page error limit is reached.
* Useful for long-running single-page apps
*/
refresh(): void;
/** Remove Bugsnag from the window object and restore the previous
* binding
*/
noConflict(): BugsnagStatic;
/** Send caught exceptions to Bugsnag. Valid severity values are `info`,
* `warning`, and `error`, in order of increasing severity.
*/
notifyException(exception: Error, name?: string, metaData?: any,
severity?: string): void;
/** Send custom errors to Bugsnag */
notify(name: string, message: string, metaData?: any,
severity?: string): void;
}
declare var Bugsnag: BugsnagStatic;
declare module "Bugsnag" {
export = Bugsnag;
}
+4 -4
View File
@@ -167,7 +167,7 @@ declare module CKEDITOR {
// Properties
type: number;
// Methods
// Methods
constructor(element: string, ownerDocument?: document);
constructor(element: HTMLElement, ownerDocument?: document);
addClass(className: string): void;
@@ -1024,7 +1024,7 @@ declare module CKEDITOR {
function get(name: string): any;
function getFilePath(name: string): string;
function getPath(name: string): string;
function load(name: string, callback: string, scope: any): void;
function load(name: string, callback: Function, scope?: Object): void;
function setLang(pluginName: string, languageCode: string, languageEntries: any): void;
}
@@ -1460,7 +1460,7 @@ declare module CKEDITOR {
show(): void;
showPage(id: string): void;
updateStyle(): void;
// NOTE: Static methods are added to dialog module
}
@@ -1771,4 +1771,4 @@ declare module CKEDITOR {
function load(languageCode: string, defaultLanguage: string, callback: Function): void;
function detect(defaultLanguage: string, probeLanguage: string): string;
}
}
}
+21 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for Cldr.js 0.4.4
// Project: https://github.com/rxaviers/cldrjs
// Definitions by: Raman But-Husaim <https://github.com/RamanBut-Husaim>
// Definitions by: Raman But-Husaim <https://github.com/RamanBut-Husaim>, Grégoire Castre <https://github.com/gcastre/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module cldr {
@@ -91,6 +91,19 @@ declare module cldr {
* Maximized Language Id {@link http://www.unicode.org/reports/tr35/#Likely_Subtags}
*/
maxLanguageId: any;
/**
* @name minLanguageId
* @memberof cldr.Attributes
* @kind property
* @access public
*
* @type {any}
*
* @description
* Minimized Language Id {@link http://www.unicode.org/reports/tr35/#Likely_Subtags}
*/
minLanguageId: any;
}
/**
@@ -229,6 +242,13 @@ declare module cldr {
* @returns {cldr.CldrStatic} The instance of {@link cldr.CldrStatic} class.
*/
new (locale: string): CldrStatic;
/**
* Allow user to override locale separator "-" (default) | "_".
* According to http://www.unicode.org/reports/tr35/#Unicode_language_identifier, both "-" and "_" are valid locale separators (eg. "en_GB", "en-GB").
* According to http://unicode.org/cldr/trac/ticket/6786 its usage must be consistent throughout the data set.
*/
localeSep: "-" | "_";
}
}
+4 -4
View File
@@ -39,10 +39,7 @@ var annotation: CodeMirror.Annotation = {
ch: 0,
line: 0
},
to: {
ch: 1,
line: 0
},
to: CodeMirror.Pos(1),
message: "test",
severity: "warning"
};
@@ -50,3 +47,6 @@ var annotation: CodeMirror.Annotation = {
myCodeMirror.getValue();
myCodeMirror.getValue("foo")
myCodeMirror.setValue("bar");
CodeMirror.registerHelper("lint", "javascript", {});
+9 -4
View File
@@ -32,6 +32,11 @@ declare module CodeMirror {
whenever a new CodeMirror instance is initialized. */
function defineInitHook(func: Function): void;
/** Registers a helper value with the given name in the given namespace (type). This is used to define functionality
that may be looked up by mode. Will create (if it doesn't already exist) a property on the CodeMirror object for
the given type, pointing to an object that maps names to values. I.e. after doing
CodeMirror.registerHelper("hint", "foo", myFoo), the value CodeMirror.hint.foo will point to myFoo. */
function registerHelper(namespace: string, name: string, helper: any): void;
function on(element: any, eventName: string, handler: Function): void;
@@ -651,8 +656,8 @@ declare module CodeMirror {
}
interface PositionConstructor {
new (line: number, ch: number): Position;
(line: number, ch: number): Position;
new (line: number, ch?: number): Position;
(line: number, ch?: number): Position;
}
interface Range{
@@ -811,8 +816,8 @@ declare module CodeMirror {
/** Optional lint configuration to be used in conjunction with CodeMirror's linter addon. */
lint?: boolean | LintOptions;
/** Optional value to be used in conduction with CodeMirrors placeholder add-on. */
placeholder?: string;
/** Optional value to be used in conjunction with CodeMirrors placeholder add-on. */
placeholder?: string;
}
interface TextMarkerOptions {
+3 -1
View File
@@ -1,6 +1,8 @@
/// <reference path="config.d.ts" />
import config = require('config');
import * as config from "config";
var class1: config.IConfig = config;
var value1: string = config.get<string>("");
var value2: any = config.get("");
+30 -20
View File
@@ -4,31 +4,41 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "config" {
// see https://github.com/lorenwest/node-config/wiki/Using-Config-Utilities
interface IUtil {
// Extend an object (and any object it contains) with one or more objects (and objects contained in them).
extendDeep(mergeInto: any, mergeFrom: any, depth?: number): any;
// Return a deep copy of the specified object.
cloneDeep(copyFrom: any, depth?: number): any;
var c: c.IConfig;
// Return true if two objects have equal contents.
equalsDeep(object1: any, object2: any, dept?: number): boolean;
module c {
// Returns an object containing all elements that differ between two objects.
diffDeep(object1: any, object2: any, depth?: number): any;
// see https://github.com/lorenwest/node-config/wiki/Using-Config-Utilities
interface IUtil {
// Extend an object (and any object it contains) with one or more objects (and objects contained in them).
extendDeep(mergeInto: any, mergeFrom: any, depth?: number): any;
// Make a javascript object property immutable (assuring it cannot be changed from the current value).
makeImmutable(object: any, propertyName?: string, propertyValue?: string): any;
// Return a deep copy of the specified object.
cloneDeep(copyFrom: any, depth?: number): any;
// Make an object property hidden so it doesn't appear when enumerating elements of the object.
makeHidden(object: any, propertyName: string, propertyValue?: string): any;
// Return true if two objects have equal contents.
equalsDeep(object1: any, object2: any, dept?: number): boolean;
// Get the current value of a config environment variable
getEnv(varName: string): string;
}
// Returns an object containing all elements that differ between two objects.
diffDeep(object1: any, object2: any, depth?: number): any;
export function get<T>(setting: string): T;
export function has(setting: string): boolean;
export var util: IUtil;
// Make a javascript object property immutable (assuring it cannot be changed from the current value).
makeImmutable(object: any, propertyName?: string, propertyValue?: string): any;
// Make an object property hidden so it doesn't appear when enumerating elements of the object.
makeHidden(object: any, propertyName: string, propertyValue?: string): any;
// Get the current value of a config environment variable
getEnv(varName: string): string;
}
interface IConfig {
get<T>(setting: string): T;
has(setting: string): boolean;
util: IUtil;
}
}
export = c;
}
+1 -1
View File
@@ -4,7 +4,7 @@
/// <reference path="../express/express.d.ts" />
import * as express from "express";
import timeout from "connect-timeout";
import * as timeout from "connect-timeout";
import * as bodyParser from "body-parser";
import * as cookieParser from "cookie-parser";
+12 -9
View File
@@ -23,17 +23,20 @@ declare module Express {
declare module "connect-timeout" {
import express = require("express");
/**
* @summary Interface for timeout options.
* @interface
*/
interface TimeoutOptions extends Object {
module e {
/**
* @summary Controls if this module will "respond" in the form of forwarding an error.
* @type {boolean}
* @summary Interface for timeout options.
* @interface
*/
respond: boolean;
interface TimeoutOptions {
/**
* @summary Controls if this module will "respond" in the form of forwarding an error.
* @type {boolean}
*/
respond?: boolean;
}
}
export default function timeout(timeout: string, options?: TimeoutOptions): express.RequestHandler;
function e(timeout: string, options?: e.TimeoutOptions): express.RequestHandler;
export = e;
}
+39
View File
@@ -0,0 +1,39 @@
/// <reference path="cookie-session.d.ts" />
import express = require('express');
import cookieSession = require('cookie-session');
var app = express()
app.set('trust proxy', 1) // trust first proxy
app.use(cookieSession({
name: 'session',
keys: ['key1', 'key2']
}))
app.use(function (req, res, next) {
// Update views
req.session['views'] = (req.session['views'] || 0) + 1
// Write response
res.end(req.session['views'] + ' views')
})
app.listen(3000);
var app2 = express()
app2.set('trust proxy', 1) // trust first proxy
app2.use(cookieSession({
name: 'session',
keys: ['key1', 'key2']
}))
// This allows you to set req.session.maxAge to let certain sessions
// have a different value than the default.
app2.use(function (req, res, next) {
req.sessionOptions.maxAge = req.session['maxAge'] || req.sessionOptions.maxAge
});
+113
View File
@@ -0,0 +1,113 @@
// Type definitions for cookie-session v2.0.0-alpha.1
// Project: https://github.com/expressjs/cookie-session
// Definitions by: Borislav Zhivkov <https://github.com/borislavjivkov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
declare module Express {
interface Request extends CookieSessionInterfaces.CookieSessionRequest {}
}
declare module CookieSessionInterfaces {
interface CookieSessionOptions {
/**
* The name of the cookie to set, defaults to session.
*/
name: string;
/**
* The list of keys to use to sign & verify cookie values. Set cookies are always signed with keys[0], while the other keys are valid for verification, allowing for key rotation.
*/
keys?: Array<string>;
/**
* A string which will be used as single key if keys is not provided.
*/
secret?: string;
/**
* a number representing the milliseconds from Date.now() for expiry.
*/
maxAge?: number;
/**
* a Date object indicating the cookie's expiration date (expires at the end of session by default).
*/
expires?: Date;
/**
* a string indicating the path of the cookie (/ by default).
*/
path?: string;
/**
* a string indicating the domain of the cookie (no default).
*/
domain?: string;
/**
* a boolean indicating whether the cookie is only to be sent over HTTPS (false by default for HTTP, true by default for HTTPS).
*/
secure?: boolean;
/**
* a boolean indicating whether the cookie is only to be sent over HTTPS (use this if you handle SSL not in your node process).
*/
secureProxy?: boolean;
/**
* a boolean indicating whether the cookie is only to be sent over HTTP(S), and not made available to client JavaScript (true by default).
*/
httpOnly?: boolean;
/**
* a boolean indicating whether the cookie is to be signed (true by default). If this is true, another cookie of the same name with the .sig suffix appended will also be sent, with a 27-byte url-safe base64 SHA1 value representing the hash of cookie-name=cookie-value against the
* first Keygrip key. This signature key is used to detect tampering the next time a cookie is received.
*/
signed?: boolean;
/**
* a boolean indicating whether to overwrite previously set cookies of the same name (true by default). If this is true, all cookies set during the same request with the same name (regardless of path or domain) are filtered out of the Set-Cookie header when setting this cookie.
*/
overwrite?: boolean;
}
interface CookieSessionObject {
/**
* Is true if the session has been changed during the request.
*/
isChanged: boolean;
/**
* Is true if the session is new.
*/
isNew: boolean;
/**
* Determine if the session has been populated with data or is empty.
*/
isPopulated: boolean;
[propertyName: string]: any;
}
interface CookieSessionRequest {
/**
* Represents the session for the given request.
*/
session: CookieSessionObject;
/**
* Represents the session options for the current request. These options are a shallow clone of what was provided at middleware construction and can be altered to change cookie setting behavior on a per-request basis.
*/
sessionOptions: CookieSessionOptions;
}
}
declare module "cookie-session" {
import express = require('express');
function cookieSession(options?: CookieSessionInterfaces.CookieSessionOptions): express.RequestHandler;
export = cookieSession;
}
+4 -4
View File
@@ -107,9 +107,9 @@ interface InAppBrowser extends Window {
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
* passed an Event object as a parameter.
*/
addEventListener(type: string, callback: (event: InAppBrowserEvent) => void): void;
addEventListener(type: string, callback: (event: Event) => void): void;
// removeEventListener overloads
/**
* Removes a listener for an event from the InAppBrowser.
@@ -163,9 +163,9 @@ interface InAppBrowser extends Window {
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
* passed an Event object as a parameter.
*/
removeEventListener(type: string, callback: (event: InAppBrowserEvent) => void): void;
removeEventListener(type: string, callback: (event: Event) => void): void;
/** Closes the InAppBrowser window. */
close(): void;
/**
Vendored
+2 -2
View File
@@ -2492,11 +2492,11 @@ declare module d3 {
source(): (d: Link, i: number) => Node;
source(source: Node): Diagonal<Link, Node>;
source(source: (d: Link, i: number) => Node): Diagonal<Link, Node>;
source(source: (d: Link, i: number) => { x: number; y: number; }): Diagonal<Link, Node>;
target(): (d: Link, i: number) => Node;
target(target: Node): Diagonal<Link, Node>;
target(target: (d: Link, i: number) => Node): Diagonal<Link, Node>;
target(target: (d: Link, i: number) => { x: number; y: number; }): Diagonal<Link, Node>;
projection(): (d: Node, i: number) => [number, number];
projection(projection: (d: Node, i: number) => [number, number]): Diagonal<Link, Node>;
+9
View File
@@ -0,0 +1,9 @@
/// <reference path="./deep-equal.d.ts" />
import * as deepEqual from "deep-equal";
let isDeepEqual1: boolean = deepEqual({}, {});
let isDeepEqual2: boolean = deepEqual({}, {}, { strict: true });
let isDeepEqual3: boolean = deepEqual({}, {}, { strict: false });
console.log(isDeepEqual1, isDeepEqual2, isDeepEqual3);
Vendored Executable
+18
View File
@@ -0,0 +1,18 @@
// Type definitions for deep-equal
// Project: https://github.com/substack/node-deep-equal
// Definitions by: remojansen <https://github.com/remojansen>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "deep-equal" {
interface DeepEqualOptions {
strict: boolean;
}
let deepEqual: (
actual: Object,
expected: Object,
opts?: DeepEqualOptions) => boolean;
export = deepEqual;
}
+7383
View File
File diff suppressed because it is too large Load Diff
+56 -10
View File
@@ -1,4 +1,4 @@
// Type definitions for DevExtreme 15.2.5
// Type definitions for DevExtreme 15.2.7
// Project: http://js.devexpress.com/
// Definitions by: DevExpress Inc. <http://devexpress.com/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -1197,7 +1197,7 @@ declare module DevExpress.ui {
/** Updates the dimensions of the scrollable contents. */
update(): void;
}
export interface dxRadioGroupOptions extends CollectionWidgetOptions, DataExpressionMixinOptions {
export interface dxRadioGroupOptions extends EditorOptions, DataExpressionMixinOptions {
activeStateEnabled?: boolean;
/** Specifies the radio group layout. */
layout?: string;
@@ -1300,6 +1300,7 @@ declare module DevExpress.ui {
onShowing?: Function;
/** A handler for the shown event. */
onShown?: Function;
onContentReady?: Function;
/** A Boolean value specifying whether or not the widget is visible. */
visible?: boolean;
/** The widget width in pixels. */
@@ -1334,6 +1335,8 @@ declare module DevExpress.ui {
step?: number;
/** The current number box value. */
value?: number;
/** The "mode" attribute value of the actual HTML input element representing the widget. */
mode?: string;
}
/** A textbox widget that enables a user to enter numeric values. */
export class dxNumberBox extends dxTextEditor {
@@ -1366,7 +1369,7 @@ declare module DevExpress.ui {
constructor(element: Element, options?: dxMultiViewOptions);
}
export interface dxMapOptions extends WidgetOptions {
/** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route. */
/** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route or when creating a widget if it initially contains markers or routes. */
autoAdjust?: boolean;
center?: {
/** The latitude location displayed in the center of the widget. */
@@ -1502,6 +1505,8 @@ declare module DevExpress.ui {
onTitleRendered?: Function;
/** A Boolean value specifying whether or not to display the title in the popup window. */
showPopupTitle?: boolean;
/** The template to be used for rendering the widget text field. */
fieldTemplate?: any;
}
/** A widget that allows a user to select predefined values from a lookup window. */
export class dxLookup extends dxDropDownList {
@@ -1764,6 +1769,10 @@ declare module DevExpress.ui {
invalidDateMessage?: string;
/** Specifies the message displayed if the specified date is later than the max value or earlier than the min value. */
dateOutOfRangeMessage?: string;
/** The text displayed on the Apply button. */
applyButtonText?: string;
/** The text displayed on the Cancel button. */
cancelButtonText?: string;
}
/** A date box widget. */
export class dxDateBox extends dxDropDownEditor {
@@ -2055,6 +2064,10 @@ declare module DevExpress.ui {
/** Specifies the number of columns spanned by the item. */
colSpan?: number;
}
export interface dxFormEmptyItem extends dxFormItem {
/** Specifies the form item name. */
name?: string;
}
export interface dxFormSimpleItem extends dxFormItem {
/** Specifies the path to the formData object field bound to the current form item. */
dataField?: string;
@@ -2096,6 +2109,16 @@ declare module DevExpress.ui {
alignItemLabels?: boolean;
/** Holds an array of form items displayed within the tab. */
items?: Array<dxFormItem>;
/** Specifies a badge text for the tab. */
badge?: string;
/** A Boolean value specifying whether or not the tab can respond to user interaction. */
disabled?: boolean;
/** Specifies the icon to be displayed on the tab. */
icon?: string;
/** The template to be used for rendering the tab. */
tabTemplate?: any;
/** The template to be used for rendering the tab content. */
template?: any;
}
export interface dxFormTabbedItem extends dxFormItem {
/** Holds a configuration object for the dxTabPanel widget used to display the current form item. */
@@ -2126,7 +2149,7 @@ declare module DevExpress.ui {
alignItemLabelsInAllGroups?: boolean;
/** Specifies whether or not a colon is displayed at the end of form labels. */
showColonAfterLabel?: boolean;
/** Specifies whether or not the required mark is displayed for optional fields. */
/** Specifies whether or not the required mark is displayed for required fields. */
showRequiredMark?: boolean;
/** Specifies whether or not the optional mark is displayed for optional fields. */
showOptionalMark?: boolean;
@@ -2134,6 +2157,8 @@ declare module DevExpress.ui {
requiredMark?: string;
/** The text displayed for optional fields. */
optionalMark?: string;
/** Specifies the message that is shown for end-users a required field value is not specified. */
requiredMessage?: string;
/** Specifies whether or not the total validation summary is displayed on the form. */
showValidationSummary?: boolean;
/** Holds an array of form items. */
@@ -2629,6 +2654,7 @@ declare module DevExpress.data {
catalog?: string;
/** The cube name. */
cube?: string;
/** A function used to customize a web request before it is sent. */
beforeSend?: (request: Object) => void;
}
/** A Store that provides access to an OLAP cube using the XMLA standard. */
@@ -2910,11 +2936,11 @@ declare module DevExpress.ui {
horizontalScrollingEnabled?: boolean;
/** Specifies whether a user can switch views using tabs or a drop-down menu. */
useDropDownViewSwitcher?: boolean;
/** Specifies the name of the data source item field that defines the start of the appointment. */
/** Specifies the name of the data source item field that defines the start of an appointment. */
startDateExpr?: string;
/** Specifies the name of the data source item field that defines the ending of the appointment. */
/** Specifies the name of the data source item field that defines the ending of an appointment. */
endDateExpr?: string;
/** Specifies the name of the data source item field that holds the subject of the appointment. */
/** Specifies the name of the data source item field that holds the subject of an appointment. */
textExpr?: string;
/** Specifies the name of the data source item field whose value holds the description of the corresponding appointment. */
descriptionExpr?: string;
@@ -3088,7 +3114,7 @@ declare module DevExpress.ui {
showFirstSubmenuMode?: {
/** Specifies the mode name. */
name?: string;
/** Specifies the delay of submenu showing and hiding. */
/** Specifies the delay in submenu showing and hiding. */
delay?: {
/** The time span after which the submenu is shown. */
show?: number;
@@ -3162,6 +3188,16 @@ declare module DevExpress.ui {
/** Specifies whether or not summaries calculation must be performed on the server side. */
summary?: boolean;
}
export interface dxDataGridRow {
/** The data object represented by the row. */
data: Object;
/** The key of the data object represented by the row. */
key: any;
/** The visible index of the row. */
rowIndex: number;
/** The type of the row. */
rowType: string;
}
export interface dxDataGridColumn {
/** Specifies the content alignment within column cells. */
alignment?: string;
@@ -3634,7 +3670,6 @@ declare module DevExpress.ui {
/** A handler for the exporting event. */
onExporting?: (e: {
fileName: string;
format: string;
cancel: boolean;
}) => void;
/** A handler for the fileSaving event. */
@@ -4037,7 +4072,6 @@ declare module DevExpress.ui {
/** A handler for the exporting event. */
onExporting?: (e: {
fileName: string;
format: string;
cancel: boolean;
}) => void;
/** A handler for the fileSaving event. */
@@ -5757,6 +5791,12 @@ declare module DevExpress.viz.charts {
visible?: boolean;
/** Specifies font options for the text of the crosshair labels. */
font?: viz.core.Font;
/** Specifies the format of the values displayed by crosshair labels. */
format?: string;
/** Specifies a precision for formatted values. */
precision?: number;
/** Customizes the text displayed by the crosshair labels. */
customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string;
}
};
/** Specifies a default pane for the chart's series. */
@@ -5815,6 +5855,12 @@ declare module DevExpress.viz.charts {
visible?: boolean;
/** Specifies font options for the text of the label that belongs to the horizontal crosshair line. */
font?: viz.core.Font;
/** Specifies the format of the values displayed by crosshair labels. */
format?: string;
/** Specifies a precision for formatted values. */
precision?: number;
/** Customizes the text displayed by the crosshair label that accompany the horizontal line. */
customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string;
}
}
export interface PolarChartTooltip extends BaseChartTooltip {
+1
View File
@@ -51,6 +51,7 @@ declare module Promise {
* Make a promise that rejects to obj. For consistency and debugging (eg stack traces), obj should be an instanceof Error
*/
function reject(error: any): Promise<any>;
function reject<T>(error: T): Promise<T>;
/**
* Make a promise that fulfills when every item in the array fulfills, and rejects if (and when) any item rejects.
@@ -2,9 +2,9 @@
/// <reference path="../mongodb/mongodb.d.ts"/>
/// <reference path="express-brute-memcached.d.ts"/>
import express = require("express");
import ExpressBrute = require("express-brute");
import MemcachedStore = require("express-brute-memcached");
import * as express from "express";
import * as ExpressBrute from "express-brute";
import MemcachedStore from "express-brute-memcached";
var app = express();
var store = new MemcachedStore("127.0.0.1");
+1 -1
View File
@@ -102,7 +102,7 @@ declare module "express-brute-memcached" {
* @summary A memcached store adapter.
* @class
*/
export = class MemcachedStore {
export default class MemcachedStore {
/**
* @summary Constructor.
* @constructor
+10
View File
@@ -0,0 +1,10 @@
/// <reference path="./express-graphql.d.ts" />
/// <reference path="../express/express.d.ts" />
var express = require("express");
var graphqlHTTP = require("express-graphql");
var app = express();
var schema = {};
app.use("/graphql", graphqlHTTP({ schema: schema, graphiql: true }));
+52
View File
@@ -0,0 +1,52 @@
// Type definitions for express-graphql
// Project: https://www.npmjs.org/package/express-graphql
// Definitions by: Isman Usoh <https://github.com/isman-usoh>, Nitin Tutlani <https://github.com/nitintutlani>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
declare module "express-graphql" {
import { Request, Response } from "express";
/**
* Used to configure the graphQLHTTP middleware by providing a schema
* and other configuration options.
*/
export type Options = ((req: Request) => OptionsObj) | OptionsObj
export type OptionsObj = {
/**
* A GraphQL schema from graphql-js.
*/
schema: Object,
/**
* An object to pass as the rootValue to the graphql() function.
*/
rootValue?: Object,
/**
* A boolean to configure whether the output should be pretty-printed.
*/
pretty?: boolean,
/**
* An optional function which will be used to format any errors produced by
* fulfilling a GraphQL operation. If no function is provided, GraphQL's
* default spec-compliant `formatError` function will be used.
*/
formatError?: Function,
/**
* A boolean to optionally enable GraphiQL mode.
*/
graphiql?: boolean,
};
type Middleware = (request: Request, response: Response) => void;
/**
* Middleware for express; takes an options object or function as input to
* configure behavior, and returns an express middleware.
*/
export default function graphqlHTTP(options: Options): Middleware;
}
+174
View File
@@ -27,9 +27,43 @@ var firebaseRef = new Firebase('https://samplechat.firebaseio-demo.com/');
});
}
() => {
var dataRef = new Firebase('https://samplechat.firebaseio-demo.com');
var onComplete = function (authData: FirebaseAuthData) {
console.log('Synchronization succeeded');
};
var onError = function (error: any) {
if (error) {
console.log('Synchronization failed');
}
};
// Log me in
dataRef.authWithCustomToken(AUTH_TOKEN).then(onComplete, onError);
// Same as before but use returned Promise to handle the result
}
/*
* Firebase.authAnonymously()
*/
() => {
var dataRef = new Firebase('https://samplechat.firebaseio-demo.com');
var onComplete = function (authData: FirebaseAuthData) {
console.log('Synchronization succeeded');
};
var onError = function (error: any) {
if (error) {
console.log('Synchronization failed');
}
};
// Log me in
dataRef.authAnonymously().then(onComplete, onError);
// Same as before but use returned Promise to handle the result
}
() => {
var dataRef = new Firebase('https://samplechat.firebaseio-demo.com');
// Log me in
@@ -60,6 +94,25 @@ var firebaseRef = new Firebase('https://samplechat.firebaseio-demo.com/');
});
}
() => {
var dataRef = new Firebase('https://samplechat.firebaseio-demo.com');
var onComplete = function (authData: FirebaseAuthData) {
console.log('Synchronization succeeded');
};
var onError = function (error: any) {
if (error) {
console.log('Synchronization failed');
}
};
// Log me in
dataRef.authWithPassword({
"email": "bobtony@firebase.com",
"password": "correcthorsebatterystaple"
}).then(onComplete, onError);
// Same as before but use returned Promise to handle the result
}
/*
* Firebase.authWithOAuthPopup()
*/
@@ -75,6 +128,23 @@ var firebaseRef = new Firebase('https://samplechat.firebaseio-demo.com/');
});
}
() => {
var dataRef = new Firebase('https://samplechat.firebaseio-demo.com');
var onComplete = function (authData: FirebaseAuthData) {
console.log('Synchronization succeeded');
};
var onError = function (error: any) {
if (error) {
console.log('Synchronization failed');
}
};
// Log me in
dataRef.authWithOAuthPopup("twitter").then(onComplete, onError);
// Same as before but use returned Promise to handle the result
}
/*
* Firebase.authWithOAuthRedirect
*/
@@ -90,6 +160,23 @@ var firebaseRef = new Firebase('https://samplechat.firebaseio-demo.com/');
});
}
() => {
var dataRef = new Firebase('https://samplechat.firebaseio-demo.com');
var onComplete = function () {
// We'll never get here, as the page will redirect on success.
};
var onError = function (error: any) {
if (error) {
console.log('Synchronization failed');
}
};
// Log me in
dataRef.authWithOAuthRedirect("twitter").then(onComplete, onError);
// Same as before but use returned Promise to handle the result
}
/*
* Firebase.authWithOAuthToken()
*/
@@ -104,6 +191,24 @@ var firebaseRef = new Firebase('https://samplechat.firebaseio-demo.com/');
}
});
}
() => {
var dataRef = new Firebase('https://samplechat.firebaseio-demo.com');
var onComplete = function (authData: FirebaseAuthData) {
console.log('Synchronization succeeded');
};
var onError = function (error: any) {
if (error) {
console.log('Synchronization failed');
}
};
// Authenticate with Facebook using an existing OAuth 2.0 access token
dataRef.authWithOAuthToken("facebook", "<ACCESS-TOKEN>").then(onComplete, onError);
// Same as before but use returned Promise to handle the result
}
() => {
var dataRef = new Firebase('https://samplechat.firebaseio-demo.com');
// Authenticate with Twitter using an existing OAuth 1.0a credential set
@@ -226,6 +331,20 @@ var x4:string = fredRef3.name();
// when the data has finished synchronizing
}
() => {
var fredNameRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred/name');
var onComplete = function () {
console.log('Synchronization succeeded');
};
var onError = function (error: any) {
if (error) {
console.log('Synchronization failed');
}
};
fredNameRef.set({ first: 'Fred', last: 'Flintstone' }).then(onComplete, onError);
// Same as the previous example but use returned Promise to handle the result
}
/*
* Firebase.update()
*/
@@ -247,6 +366,21 @@ var x4:string = fredRef3.name();
};
fredNameRef.update({ first: 'Wilma', last: 'Flintstone' }, onComplete);
}
() => {
var fredNameRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred/name');
var onComplete = function () {
console.log('Synchronization succeeded');
};
var onError = function (error: any) {
if (error) {
console.log('Synchronization failed');
}
};
fredNameRef.update({ first: 'Fred', last: 'Flintstone' }).then(onComplete, onError);
// Same as the previous example but use returned Promise to handle the result
}
() => {
var fredRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred');
//The following 2 function calls are equivalent
@@ -276,6 +410,19 @@ var x4:string = fredRef3.name();
// a message when the delete has finished synchronizing
}
() => {
var onComplete = function () {
console.log('Synchronization succeeded');
};
var onError = function (error: any) {
if (error) {
console.log('Synchronization failed');
}
};
fredRef.remove().then(onComplete, onError);
// Same as the previous example but use returned Promise to handle the result
}
/*
* Firebase.push()
*/
@@ -313,6 +460,33 @@ var x4:string = fredRef3.name();
// priority of the data so he'll be ordered relative to other users by his rank
}
() => {
var fredRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred');
var user = {
name: {
first: 'Fred',
last: 'Flintstone'
},
rank: 1000
};
fredRef.setWithPriority(user, 1000);
var onComplete = function () {
console.log('Synchronization succeeded');
};
var onError = function (error: any) {
if (error) {
console.log('Synchronization failed');
}
};
fredRef.setWithPriority(user, 1000).then(onComplete, onError);
// Same as the previous example but use returned Promise to handle the result
}
/*
* Firebase.setPriority()
*/
+36 -22
View File
@@ -1,6 +1,6 @@
// Type definitions for Firebase API 2.0.2
// Type definitions for Firebase API 2.4.1
// Project: https://www.firebase.com/docs/javascript/firebase
// Definitions by: Vincent Botone <https://github.com/vbortone/>, Shin1 Kashimura <https://github.com/in-async/>, Sebastien Dubois <https://github.com/dsebastien/>
// Definitions by: Vincent Botone <https://github.com/vbortone/>, Shin1 Kashimura <https://github.com/in-async/>, Sebastien Dubois <https://github.com/dsebastien/>, Szymon Stasik <https://github.com/ciekawy/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface FirebaseAuthResult {
@@ -68,27 +68,31 @@ interface FirebaseOnDisconnect {
* Ensures the data at this location is set to the specified value when the client is disconnected
* (due to closing the browser, navigating to a new page, or network issues).
*/
set(value: any, onComplete?: (error: any) => void): void;
set(value: any, onComplete: (error: any) => void): void;
set(value: any): Promise<void>;
/**
* Ensures the data at this location is set to the specified value and priority when the client is disconnected
* (due to closing the browser, navigating to a new page, or network issues).
*/
setWithPriority(value: any, priority: string, onComplete?: (error: any) => void): void;
setWithPriority(value: any, priority: number, onComplete?: (error: any) => void): void;
setWithPriority(value: any, priority: string|number, onComplete: (error: any) => void): void;
setWithPriority(value: any, priority: string|number): Promise<void>;
/**
* Writes the enumerated children at this Firebase location when the client is disconnected
* (due to closing the browser, navigating to a new page, or network issues).
*/
update(value: Object, onComplete?: (error: any) => void): void;
update(value: Object, onComplete: (error: any) => void): void;
update(value: Object): Promise<void>;
/**
* Ensures the data at this location is deleted when the client is disconnected
* (due to closing the browser, navigating to a new page, or network issues).
*/
remove(onComplete?: (error: any) => void): void;
remove(onComplete: (error: any) => void): void;
remove(): Promise<void>;
/**
* Cancels all previously queued onDisconnect() set or update events for this location and all children.
*/
cancel(onComplete?: (error: any) => void): void;
cancel(onComplete: (error: any) => void): void;
cancel(): Promise<void>;
}
interface FirebaseQuery {
@@ -141,9 +145,7 @@ interface FirebaseQuery {
/**
* Creates a Query which includes children which match the specified value.
*/
equalTo(value: string, key?: string): FirebaseQuery;
equalTo(value: number, key?: string): FirebaseQuery;
equalTo(value: boolean, key?: string): FirebaseQuery;
equalTo(value: string|number|boolean, key?: string): FirebaseQuery;
/**
* Generates a new Query object limited to the first certain number of children.
*/
@@ -163,32 +165,38 @@ interface Firebase extends FirebaseQuery {
* @deprecated Use authWithCustomToken() instead.
* Authenticates a Firebase client using the provided authentication token or Firebase Secret.
*/
auth(authToken: string, onComplete?: (error: any, result: FirebaseAuthResult) => void, onCancel?:(error: any) => void): void;
auth(authToken: string, onComplete: (error: any, result: FirebaseAuthResult) => void, onCancel?:(error: any) => void): void;
auth(authToken: string): Promise<FirebaseAuthResult>;
/**
* Authenticates a Firebase client using an authentication token or Firebase Secret.
*/
authWithCustomToken(autoToken: string, onComplete: (error: any, authData: FirebaseAuthData) => void, options?:Object): void;
authWithCustomToken(autoToken: string, options?:Object): Promise<FirebaseAuthData>;
/**
* Authenticates a Firebase client using a new, temporary guest account.
*/
authAnonymously(onComplete: (error: any, authData: FirebaseAuthData) => void, options?: Object): void;
authAnonymously(options?: Object): Promise<FirebaseAuthData>;
/**
* Authenticates a Firebase client using an email / password combination.
*/
authWithPassword(credentials: FirebaseCredentials, onComplete: (error: any, authData: FirebaseAuthData) => void, options?: Object): void;
authWithPassword(credentials: FirebaseCredentials, options?: Object): Promise<FirebaseAuthData>;
/**
* Authenticates a Firebase client using a popup-based OAuth flow.
*/
authWithOAuthPopup(provider: string, onComplete:(error: any, authData: FirebaseAuthData) => void, options?: Object): void;
authWithOAuthPopup(provider: string, options?: Object): Promise<FirebaseAuthData>;
/**
* Authenticates a Firebase client using a redirect-based OAuth flow.
*/
authWithOAuthRedirect(provider: string, onComplete: (error: any) => void, options?: Object): void;
authWithOAuthRedirect(provider: string, options?: Object): Promise<void>;
/**
* Authenticates a Firebase client using OAuth access tokens or credentials.
*/
authWithOAuthToken(provider: string, credentials: string, onComplete: (error: any, authData: FirebaseAuthData) => void, options?: Object): void;
authWithOAuthToken(provider: string, credentials: Object, onComplete: (error: any, authData: FirebaseAuthData) => void, options?: Object): void;
authWithOAuthToken(provider: string, credentials: string|Object, onComplete: (error: any, authData: FirebaseAuthData) => void, options?: Object): void;
authWithOAuthToken(provider: string, credentials: string|Object, options?: Object): Promise<FirebaseAuthData>;
/**
* Synchronously access the current authentication state of the client.
*/
@@ -233,30 +241,33 @@ interface Firebase extends FirebaseQuery {
/**
* Writes data to this Firebase location.
*/
set(value: any, onComplete?: (error: any) => void): void;
set(value: any, onComplete: (error: any) => void): void;
set(value: any): Promise<void>;
/**
* Writes the enumerated children to this Firebase location.
*/
update(value: Object, onComplete?: (error: any) => void): void;
update(value: Object, onComplete: (error: any) => void): void;
update(value: Object): Promise<void>;
/**
* Removes the data at this Firebase location.
*/
remove(onComplete?: (error: any) => void): void;
remove(onComplete: (error: any) => void): void;
remove(): Promise<void>;
/**
* Generates a new child location using a unique name and returns a Firebase reference to it.
* @returns {Firebase} A Firebase reference for the generated location.
*/
push(value?: any, onComplete?: (error: any) => void): Firebase;
push(value?: any, onComplete?: (error: any) => void): FirebaseWithPromise<void>;
/**
* Writes data to this Firebase location. Like set() but also specifies the priority for that data.
*/
setWithPriority(value: any, priority: string, onComplete?: (error: any) => void): void;
setWithPriority(value: any, priority: number, onComplete?: (error: any) => void): void;
setWithPriority(value: any, priority: string|number, onComplete: (error: any) => void): void;
setWithPriority(value: any, priority: string|number): Promise<void>;
/**
* Sets a priority for the data at this Firebase location.
*/
setPriority(priority: string, onComplete?: (error: any) => void): void;
setPriority(priority: number, onComplete?: (error: any) => void): void;
setPriority(priority: string|number, onComplete: (error: any) => void): void;
setPriority(priority: string|number): Promise<void>;
/**
* Atomically modifies the data at this location.
*/
@@ -283,6 +294,9 @@ interface Firebase extends FirebaseQuery {
resetPassword(credentials: FirebaseResetPasswordCredentials, onComplete: (error: any) => void): void;
onDisconnect(): FirebaseOnDisconnect;
}
interface FirebaseWithPromise<T> extends Firebase, Promise<T> {}
interface FirebaseStatic {
/**
* Constructs a new Firebase reference from a full Firebase URL.
+14
View File
@@ -0,0 +1,14 @@
/// <reference path="gravatar.d.ts" />
import gravatar = require('gravatar');
gravatar.url("email@example.com");
gravatar.url("email@example.com", { s: "200", r: "pg", d: "404" });
gravatar.url("email@example.com", { size: "200", r: "pg", d: "404" });
gravatar.url("email@example.com", { s: "200" });
gravatar.url("email@example.com", { default: "404" });
gravatar.url("email@example.com", { s: "200", rating: "pg", d: "404" }, true);
gravatar.url("email@example.com", { s: "200", r: "pg", default: "404" }, false);
gravatar.url("email@example.com", { d: "404" }, false);
gravatar.url("email@example.com", { forcedefault: "y" }, false);
gravatar.url("email@example.com", { f: "y" });
+23
View File
@@ -0,0 +1,23 @@
// Type definitions for gravatar v1.4.0
// Project: https://github.com/emerleite/node-gravatar
// Definitions by: Denis Sokolov <https://github.com/denis-sokolov>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module GravatarModule {
type Options = {
d?: string
default?: string
f?: string
forcedefault?: string
r?: string
rating?: string
s?: string
size?: string
}
function url(email: string, options?: Options, forceProtocol?: boolean): string;
}
declare module "gravatar" {
export = GravatarModule;
}
@@ -0,0 +1,45 @@
/// <reference path="../i18next/i18next.d.ts"/>
/// <reference path="i18next-browser-languagedetector.d.ts"/>
import * as i18next from 'i18next';
import LngDetector from 'i18next-browser-languagedetector';
var options = {
// order and from where user language should be detected
order: ['querystring', 'cookie', 'localStorage', 'navigator'],
// keys or params to lookup language from
lookupQuerystring: 'lng',
lookupCookie: 'i18next',
lookupLocalStorage: 'i18nextLng',
// cache user language on
caches: ['localStorage', 'cookie'],
// optional expire and domain for set cookie
cookieMinutes: 10,
cookieDomain: 'myDomain'
};
var myDetector = {
name: 'myDetectorsName',
lookup(options: Object) {
// options -> are passed in options
return 'en';
},
cacheUserLanguage(lng: string, options: Object) {
// options -> are passed in options
// lng -> current language, will be called after init and on changeLanguage
// store it
}
};
i18next.use(LngDetector).init({
detection: options
});
const lngDetector = new LngDetector(null, options);
lngDetector.init(options);
lngDetector.addDetector(myDetector);
@@ -0,0 +1,88 @@
// Type definitions for i18next-browser-languagedetector 0.0.14
// Project: http://i18next.com/
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path="../express/express.d.ts"/>
///<reference path="../i18next/i18next.d.ts"/>
declare module I18next {
interface I18nextStatic extends i18nextBrowserLanguageDetector.I18nextStatic { }
interface I18nextOptions extends i18nextBrowserLanguageDetector.I18nextOptions { }
}
declare module i18nextBrowserLanguageDetector {
/**
* @summary Interface for Language detector options.
* @interface
*/
interface LanguageDetectorOptions {
caches?: Array<string>|boolean;
cookieDomain?: string;
cookieExpirationDate?: Date;
lookupCookie?: string;
lookupFromPathIndex?: number;
lookupQuerystring?: string;
lookupSession?: string;
order?: Array<string>;
}
/**
* @summary Interface for custom detector.
* @interface
*/
interface CustomDetector {
name: string;
//todo: Checks paramters type.
cacheUserLanguage: (lng: string, options: Object) => void;
lookup: (options: Object) => string;
}
/**
* @summary i18next options.
* @interface
*/
interface I18nextOptions {
detection?: LanguageDetectorOptions;
}
/**
* @summary i18next interface.
* @interface
*/
interface I18nextStatic {
use(module: LngDetector): I18nextStatic;
}
/**
* @summary i18next language detection.
* @class
*/
class LngDetector {
/**
* @summary Constructor.
* @constructor
*/
constructor(services?: any, options?: LanguageDetectorOptions);
/**
* @summary Adds detector.
* @param {CustomDetector} detector The custom detector.
*/
addDetector(detector: CustomDetector): LngDetector;
/**
* @summary Initializes detector.
* @param {LanguageDetectorOptions} options The options.
*/
init(options?: LanguageDetectorOptions): void;
}
}
declare module "i18next-browser-languagedetector" {
import * as express from "express";
import * as i18next from "i18next";
export default i18nextBrowserLanguageDetector.LngDetector;
}
+27 -13
View File
@@ -6,19 +6,33 @@
///<reference path="../express/express.d.ts"/>
///<reference path="../i18next/i18next.d.ts"/>
/**
* @summary Interface for Language detector options.
* @interface
*/
interface LanguageDetectorOptions {
caches?: boolean;
cookieDomain?: string;
cookieExpirationDate?: Date;
lookupCookie?: string;
lookupFromPathIndex?: number;
lookupQuerystring?: string;
lookupSession?: string;
order?: Array<string>;
declare module I18next {
interface I18nextOptions extends i18nextExpressMiddleware.I18nextOptions { }
}
declare module i18nextExpressMiddleware {
/**
* @summary Interface for Language detector options.
* @interface
*/
interface LanguageDetectorOptions {
caches?: Array<string>|boolean;
cookieDomain?: string;
cookieExpirationDate?: Date;
lookupCookie?: string;
lookupFromPathIndex?: number;
lookupQuerystring?: string;
lookupSession?: string;
order?: Array<string>;
}
/**
* @summary i18next options.
* @interface
*/
interface I18nextOptions {
detection?: LanguageDetectorOptions;
}
}
declare module "i18next-express-middleware" {
@@ -0,0 +1,25 @@
///<reference path="i18next-node-fs-backend.d.ts"/>
import * as i18next from 'i18next';
import * as Backend from 'i18next-node-fs-backend';
var options = {
backend: {
// path where resources get loaded from
loadPath: '/locales/{{lng}}/{{ns}}.json',
// path to post missing resources
addPath: '/locales/{{lng}}/{{ns}}.missing.json',
// jsonIndent to use when storing json files
jsonIndent: 2
}
};
i18next.use(Backend).init(options);
i18next.use(Backend).init({ backend: options.backend });
var backend = new Backend(null, options.backend);
backend = new Backend();
backend.init(options.backend);
+58
View File
@@ -0,0 +1,58 @@
// Type definitions for i18next-node-fs-backend
// Project: https://github.com/i18next/i18next-node-fs-backend
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path="../i18next/i18next.d.ts"/>
declare module I18next {
interface I18nextOptions extends i18nextNodeFsBackEnd.I18nextOptions { }
}
declare module i18nextNodeFsBackEnd {
/**
* @summary Options for "i18next-node-fs-backend".
* @interface
*/
interface i18nextNodeFsBackEndOptions {
// path where resources get loaded from
/**
* @summary Path where resources get loaded from.
* @type {string}
*/
loadPath: string;
/**
* @summary Path to post missing resources
* @type {string}
*/
addPath: string;
/**
* @summary jsonIndent to use when storing json files
* @type {number}
*/
//
jsonIndent: number;
}
/**
* @summary Options for "i18next".
* @interface
*/
interface I18nextOptions {
backend?: i18nextNodeFsBackEndOptions;
}
}
declare module "i18next-node-fs-backend" {
import * as i18next from "i18next";
class BackEnd {
constructor(services?: any, options?: Object);
init(options?: Object): void;
}
var out: typeof BackEnd;
export = out;
}
@@ -6,6 +6,17 @@
///<reference path="../express/express.d.ts"/>
///<reference path="../i18next/i18next.d.ts"/>
declare module I18next {
interface I18nextOptions extends i18nextSprintfPostProcessor.I18nextOptions {}
}
declare module i18nextSprintfPostProcessor {
interface I18nextOptions {
overloadTranslationOptionHandler?(args: Array<any>): void;
process?(value: any, key: string, options: Object): void;
}
}
declare module "i18next-sprintf-postprocessor" {
import i18next = require("i18next");
+8 -8
View File
@@ -10,6 +10,11 @@
/// <reference path="../i18next-express-middleware/i18next-express-middleware.d.ts" />
/// <reference path="../i18next-sprintf-postprocessor/i18next-sprintf-postprocessor.d.ts" />
declare module I18next {
export interface I18nextStatic {}
export interface I18nextOptions {}
}
interface IResourceStore {
[language: string]: IResourceStoreLanguage;
}
@@ -30,12 +35,7 @@ interface I18nTranslateOptions extends I18nextOptions {
context?: any;
}
interface i18nextSprintfPostProcessorStatic {
overloadTranslationOptionHandler?(args: Array<any>): void;
process?(value: any, key: string, options: Object): void;
}
interface I18nextOptions extends i18nextSprintfPostProcessorStatic {
interface I18nextOptions extends I18next.I18nextOptions {
lng?: string; // Default value: undefined
load?: string; // Default value: 'all'
preload?: string[]; // Default value: []
@@ -85,7 +85,7 @@ interface I18nextOptions extends i18nextSprintfPostProcessorStatic {
replace?: any;
}
interface I18nextStatic {
interface I18nextStatic extends I18next.I18nextStatic {
addPostProcessor(name: string, fn: (value: any, key: string, options: any) => string): void;
addResources(language: string, namespace: string, resources: IResourceStoreKey): void;
@@ -107,7 +107,7 @@ interface I18nextStatic {
regexEscape(str: string): string;
};
init(callback?: (err: any, t: (key: string, options?: any) => string) => void ): JQueryDeferred<any>;
init(options?: I18nextOptions|any, callback?: (err: any, t: (key: string, options?: any) => string) => void ): JQueryDeferred<any>; // NOTE: remove any for 'options' parameter.
init(options?: I18nextOptions, callback?: (err: any, t: (key: string, options?: any) => string) => void ): JQueryDeferred<any>;
lng(): string;
loadNamespace(namespace: string, callback?: () => void ): void;
loadNamespaces(namespaces: string[], callback?: () => void ): void;
+3 -3
View File
@@ -512,21 +512,21 @@ describe("A spy", function () {
it("can provide the context and arguments to all calls", function () {
foo.setBar(123);
expect(foo.setBar.calls.all()).toEqual([{ object: foo, args: [123] }]);
expect(foo.setBar.calls.all()).toEqual([{ object: foo, args: [123], returnValue: undefined }]);
});
it("has a shortcut to the most recent call", function () {
foo.setBar(123);
foo.setBar(456, "baz");
expect(foo.setBar.calls.mostRecent()).toEqual({ object: foo, args: [456, "baz"] });
expect(foo.setBar.calls.mostRecent()).toEqual({ object: foo, args: [456, "baz"], returnValue: undefined });
});
it("has a shortcut to the first call", function () {
foo.setBar(123);
foo.setBar(456, "baz");
expect(foo.setBar.calls.first()).toEqual({ object: foo, args: [123] });
expect(foo.setBar.calls.first()).toEqual({ object: foo, args: [123], returnValue: undefined });
});
it("can be reset", function () {
+2
View File
@@ -456,6 +456,8 @@ declare module jasmine {
object: any;
/** All arguments passed to the call */
args: any[];
/** The return value of the call */
returnValue: any;
}
interface Util {
+472 -28
View File
@@ -1,40 +1,484 @@
// Type definitions for jQuery UI Layout Plug-in
// Project: http://layout.jquery-dev.net/
// Definitions by: Steve Fenton <https://github.com/Steve-Fenton>
// Definitions by: Steve Fenton <https://github.com/Steve-Fenton>, Douglas Armstrong <https://github.com/drarmstr>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
/// <reference path="../jqueryui/jqueryui.d.ts"/>
interface JQueryLayoutOptions {
north: any;
east: any;
south: any;
west: any;
declare module JQueryUILayout {
interface PaneOptions {
applyDefaultStyles?: boolean;
scrollToBookmarkOnLoad?: boolean;
showOverflowOnHover?: boolean;
closable?: boolean;
resizable?: boolean;
slidable?: boolean;
paneSelector?: string;
contentSelector?: string;
contentIgnoreSelector?: string;
paneClass?: string;
resizerClass?: string;
togglerClass?: string;
buttonClass?: string;
size?: string | number;
minSize?: number;
maxSize?: number;
spacing_open?: number;
spacing_closed?: number;
resizerTip?: string;
resizerCursor?: string;
resizerDragOpacity?: number;
maskIframesOnResize?: boolean | string;
sliderTip?: string;
sliderCursor?: string;
slideTrigger_open?: string;
slideTrigger_close?: string;
togglerTip_open?: string;
togglerTip_closed?: string;
togglerLength_open?: number | string;
togglerLength_closed?: number | string;
hideTogglerOnSlide?: boolean;
togglerAlign_open?: string | number;
togglerAlign_closed?: string | number;
togglerContent_open?: string;
togglerContent_closed?: string;
enableCursorHotkey?: boolean;
customHotkeyModifier?: string;
customHotkey?: string | number;
fxName?: string;
fxSpeed?: string | number;
fxSettings?: JQueryAnimationOptions;
initClosed?: boolean;
initHidden?: boolean;
onshow_start?: string | { (name:string, pane:JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
onshow_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
onshow?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
onhide_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
onhide_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
onhide?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
onopen_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
onopen_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
onopen?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
onclose_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
onclose_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
onclose?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
onresize_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
onresize_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
onresize?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
}
interface Options extends PaneOptions {
defaults?: PaneOptions;
north?: PaneOptions;
east?: PaneOptions;
south?: PaneOptions;
west?: PaneOptions;
center?: PaneOptions;
defaults__applyDefaultStyles?: boolean;
defaults__scrollToBookmarkOnLoad?: boolean;
defaults__showOverflowOnHover?: boolean;
defaults__closable?: boolean;
defaults__resizable?: boolean;
defaults__slidable?: boolean;
defaults__paneSelector?: string;
defaults__contentSelector?: string;
defaults__contentIgnoreSelector?: string;
defaults__paneClass?: string;
defaults__resizerClass?: string;
defaults__togglerClass?: string;
defaults__buttonClass?: string;
defaults__size?: string | number;
defaults__minSize?: number;
defaults__maxSize?: number;
defaults__spacing_open?: number;
defaults__spacing_closed?: number;
defaults__resizerTip?: string;
defaults__resizerCursor?: string;
defaults__resizerDragOpacity?: number;
defaults__maskIframesOnResize?: boolean | string;
defaults__sliderTip?: string;
defaults__sliderCursor?: string;
defaults__slideTrigger_open?: string;
defaults__slideTrigger_close?: string;
defaults__togglerTip_open?: string;
defaults__togglerTip_closed?: string;
defaults__togglerLength_open?: number | string;
defaults__togglerLength_closed?: number | string;
defaults__hideTogglerOnSlide?: boolean;
defaults__togglerAlign_open?: string | number;
defaults__togglerAlign_closed?: string | number;
defaults__togglerContent_open?: string;
defaults__togglerContent_closed?: string;
defaults__enableCursorHotkey?: boolean;
defaults__customHotkeyModifier?: string;
defaults__customHotkey?: string | number;
defaults__fxName?: string;
defaults__fxSpeed?: string | number;
defaults__fxSettings?: JQueryAnimationOptions;
defaults__initClosed?: boolean;
defaults__initHidden?: boolean;
defaults__onshow_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
defaults__onshow_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
defaults__onshow?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
defaults__onhide_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
defaults__onhide_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
defaults__onhide?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
defaults__onopen_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
defaults__onopen_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
defaults__onopen?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
defaults__onclose_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
defaults__onclose_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
defaults__onclose?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
defaults__onresize_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
defaults__onresize_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
defaults__onresize?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
north__applyDefaultStyles?: boolean;
north__scrollToBookmarkOnLoad?: boolean;
north__showOverflowOnHover?: boolean;
north__closable?: boolean;
north__resizable?: boolean;
north__slidable?: boolean;
north__paneSelector?: string;
north__contentSelector?: string;
north__contentIgnoreSelector?: string;
north__paneClass?: string;
north__resizerClass?: string;
north__togglerClass?: string;
north__buttonClass?: string;
north__size?: string | number;
north__minSize?: number;
north__maxSize?: number;
north__spacing_open?: number;
north__spacing_closed?: number;
north__resizerTip?: string;
north__resizerCursor?: string;
north__resizerDragOpacity?: number;
north__maskIframesOnResize?: boolean | string;
north__sliderTip?: string;
north__sliderCursor?: string;
north__slideTrigger_open?: string;
north__slideTrigger_close?: string;
north__togglerTip_open?: string;
north__togglerTip_closed?: string;
north__togglerLength_open?: number | string;
north__togglerLength_closed?: number | string;
north__hideTogglerOnSlide?: boolean;
north__togglerAlign_open?: string | number;
north__togglerAlign_closed?: string | number;
north__togglerContent_open?: string;
north__togglerContent_closed?: string;
north__enableCursorHotkey?: boolean;
north__customHotkeyModifier?: string;
north__customHotkey?: string | number;
north__fxName?: string;
north__fxSpeed?: string | number;
north__fxSettings?: JQueryAnimationOptions;
north__initClosed?: boolean;
north__initHidden?: boolean;
north__onshow_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
north__onshow_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
north__onshow?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
north__onhide_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
north__onhide_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
north__onhide?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
north__onopen_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
north__onopen_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
north__onopen?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
north__onclose_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
north__onclose_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
north__onclose?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
north__onresize_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
north__onresize_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
north__onresize?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
east__applyDefaultStyles?: boolean;
east__scrollToBookmarkOnLoad?: boolean;
east__showOverflowOnHover?: boolean;
east__closable?: boolean;
east__resizable?: boolean;
east__slidable?: boolean;
east__paneSelector?: string;
east__contentSelector?: string;
east__contentIgnoreSelector?: string;
east__paneClass?: string;
east__resizerClass?: string;
east__togglerClass?: string;
east__buttonClass?: string;
east__size?: string | number;
east__minSize?: number;
east__maxSize?: number;
east__spacing_open?: number;
east__spacing_closed?: number;
east__resizerTip?: string;
east__resizerCursor?: string;
east__resizerDragOpacity?: number;
east__maskIframesOnResize?: boolean | string;
east__sliderTip?: string;
east__sliderCursor?: string;
east__slideTrigger_open?: string;
east__slideTrigger_close?: string;
east__togglerTip_open?: string;
east__togglerTip_closed?: string;
east__togglerLength_open?: number | string;
east__togglerLength_closed?: number | string;
east__hideTogglerOnSlide?: boolean;
east__togglerAlign_open?: string | number;
east__togglerAlign_closed?: string | number;
east__togglerContent_open?: string;
east__togglerContent_closed?: string;
east__enableCursorHotkey?: boolean;
east__customHotkeyModifier?: string;
east__customHotkey?: string | number;
east__fxName?: string;
east__fxSpeed?: string | number;
east__fxSettings?: JQueryAnimationOptions;
east__initClosed?: boolean;
east__initHidden?: boolean;
east__onshow_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
east__onshow_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
east__onshow?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
east__onhide_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
east__onhide_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
east__onhide?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
east__onopen_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
east__onopen_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
east__onopen?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
east__onclose_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
east__onclose_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
east__onclose?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
east__onresize_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
east__onresize_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
east__onresize?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
south__applyDefaultStyles?: boolean;
south__scrollToBookmarkOnLoad?: boolean;
south__showOverflowOnHover?: boolean;
south__closable?: boolean;
south__resizable?: boolean;
south__slidable?: boolean;
south__paneSelector?: string;
south__contentSelector?: string;
south__contentIgnoreSelector?: string;
south__paneClass?: string;
south__resizerClass?: string;
south__togglerClass?: string;
south__buttonClass?: string;
south__size?: string | number;
south__minSize?: number;
south__maxSize?: number;
south__spacing_open?: number;
south__spacing_closed?: number;
south__resizerTip?: string;
south__resizerCursor?: string;
south__resizerDragOpacity?: number;
south__maskIframesOnResize?: boolean | string;
south__sliderTip?: string;
south__sliderCursor?: string;
south__slideTrigger_open?: string;
south__slideTrigger_close?: string;
south__togglerTip_open?: string;
south__togglerTip_closed?: string;
south__togglerLength_open?: number | string;
south__togglerLength_closed?: number | string;
south__hideTogglerOnSlide?: boolean;
south__togglerAlign_open?: string | number;
south__togglerAlign_closed?: string | number;
south__togglerContent_open?: string;
south__togglerContent_closed?: string;
south__enableCursorHotkey?: boolean;
south__customHotkeyModifier?: string;
south__customHotkey?: string | number;
south__fxName?: string;
south__fxSpeed?: string | number;
south__fxSettings?: JQueryAnimationOptions;
south__initClosed?: boolean;
south__initHidden?: boolean;
south__onshow_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
south__onshow_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
south__onshow?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
south__onhide_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
south__onhide_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
south__onhide?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
south__onopen_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
south__onopen_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
south__onopen?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
south__onclose_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
south__onclose_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
south__onclose?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
south__onresize_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
south__onresize_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
south__onresize?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
west__applyDefaultStyles?: boolean;
west__scrollToBookmarkOnLoad?: boolean;
west__showOverflowOnHover?: boolean;
west__closable?: boolean;
west__resizable?: boolean;
west__slidable?: boolean;
west__paneSelector?: string;
west__contentSelector?: string;
west__contentIgnoreSelector?: string;
west__paneClass?: string;
west__resizerClass?: string;
west__togglerClass?: string;
west__buttonClass?: string;
west__size?: string | number;
west__minSize?: number;
west__maxSize?: number;
west__spacing_open?: number;
west__spacing_closed?: number;
west__resizerTip?: string;
west__resizerCursor?: string;
west__resizerDragOpacity?: number;
west__maskIframesOnResize?: boolean | string;
west__sliderTip?: string;
west__sliderCursor?: string;
west__slideTrigger_open?: string;
west__slideTrigger_close?: string;
west__togglerTip_open?: string;
west__togglerTip_closed?: string;
west__togglerLength_open?: number | string;
west__togglerLength_closed?: number | string;
west__hideTogglerOnSlide?: boolean;
west__togglerAlign_open?: string | number;
west__togglerAlign_closed?: string | number;
west__togglerContent_open?: string;
west__togglerContent_closed?: string;
west__enableCursorHotkey?: boolean;
west__customHotkeyModifier?: string;
west__customHotkey?: string | number;
west__fxName?: string;
west__fxSpeed?: string | number;
west__fxSettings?: JQueryAnimationOptions;
west__initClosed?: boolean;
west__initHidden?: boolean;
west__onshow_start?: string | { (name:string, pane:JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
west__onshow_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
west__onshow?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
west__onhide_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
west__onhide_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
west__onhide?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
west__onopen_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
west__onopen_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
west__onopen?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
west__onclose_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
west__onclose_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
west__onclose?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
west__onresize_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
west__onresize_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
west__onresize?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
center__applyDefaultStyles?: boolean;
center__scrollToBookmarkOnLoad?: boolean;
center__showOverflowOnHover?: boolean;
center__closable?: boolean;
center__resizable?: boolean;
center__slidable?: boolean;
center__paneSelector?: string;
center__contentSelector?: string;
center__contentIgnoreSelector?: string;
center__paneClass?: string;
center__resizerClass?: string;
center__togglerClass?: string;
center__buttonClass?: string;
center__size?: string | number;
center__minSize?: number;
center__maxSize?: number;
center__spacing_open?: number;
center__spacing_closed?: number;
center__resizerTip?: string;
center__resizerCursor?: string;
center__resizerDragOpacity?: number;
center__maskIframesOnResize?: boolean | string;
center__sliderTip?: string;
center__sliderCursor?: string;
center__slideTrigger_open?: string;
center__slideTrigger_close?: string;
center__togglerTip_open?: string;
center__togglerTip_closed?: string;
center__togglerLength_open?: number | string;
center__togglerLength_closed?: number | string;
center__hideTogglerOnSlide?: boolean;
center__togglerAlign_open?: string | number;
center__togglerAlign_closed?: string | number;
center__togglerContent_open?: string;
center__togglerContent_closed?: string;
center__enableCursorHotkey?: boolean;
center__customHotkeyModifier?: string;
center__customHotkey?: string | number;
center__fxName?: string;
center__fxSpeed?: string | number;
center__fxSettings?: JQueryAnimationOptions;
center__initClosed?: boolean;
center__initHidden?: boolean;
center__onshow_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
center__onshow_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
center__onshow?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
center__onhide_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
center__onhide_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
center__onhide?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
center__onopen_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
center__onopen_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
center__onopen?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
center__onclose_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
center__onclose_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
center__onclose?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
center__onresize_start?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): (boolean | void) };
center__onresize_end?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
center__onresize?: string | { (name: string, pane: JQuery, state: PaneState, options: PaneOptions, layout_name: string): void };
}
interface PaneState {
isClosed: boolean;
isSliding: boolean;
isResizing: boolean;
isHidden: boolean;
noRoom: boolean;
size: number;
minSize: number;
maxSize: number;
}
interface Layout {
panes: {
north: JQuery | boolean;
east: JQuery | boolean;
south: JQuery | boolean;
west: JQuery | boolean;
};
options: Options;
state: {
north: PaneState;
east: PaneState;
south: PaneState;
west: PaneState;
}
toggle(pane: string): JQuery;
open(pane: string): JQuery;
close(pane: string): JQuery;
show(pane: string, openPane?: boolean): JQuery;
hide(pane: string): JQuery;
sizePane(pane: string, sizeInPixels: number): JQuery;
resizeContent(pane: string): JQuery;
resizeAll(): JQuery;
addToggleBtn(selector: string, pane: string): JQuery;
addCloseBtn(selector: string, pane: string): JQuery;
addOpenBtn(selector: string, pane: string): JQuery;
addPinBtn(selector: string, pane: string): JQuery;
allowOverflow(elemOrPane: HTMLElement | string): JQuery;
resetOverflow(elemOrPane: HTMLElement | string): JQuery;
}
}
interface JQueryLayout {
panes: any;
options: JQueryLayoutOptions;
state: any;
toggle(pane: any): any;
open(pane: any): any;
close(pane: any): any;
show(pane: any, openPane?: boolean): any;
hide(pane: any): any;
sizePane(pane: any, sizeInPixels: number): any;
resizeContent(pane: any): any;
resizeAll(): any;
addToggleBtn(selector: string, pane: any): any;
addCloseBtn(selector: string, pane: any): any;
addOpenBtn(selector: string, pane: any): any;
addPinBtn(selector: string, pane: any): any;
allowOverflow(elemOrPane: any): any;
resetOverflow(elemOrPane: any): any;
}
interface JQuery {
layout(options?: JQueryLayoutOptions): JQueryLayout;
layout(options?: JQueryUILayout.Options): JQueryUILayout.Layout;
}
+5
View File
@@ -199,6 +199,11 @@ function test_ajax() {
console.log(jqXHR, textStatus, errorThrown);
});
// generic then method
var p: JQueryPromise<number> = $.ajax({ url: "test.js" })
.then(() => "Hello")
.then((x) => x.length);
// jqXHR object
var jqXHR = $.ajax({
url: "test.js"
+1 -1
View File
@@ -180,7 +180,7 @@ interface JQueryXHR extends XMLHttpRequest, JQueryPromise<any> {
/**
* Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details.
*/
then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => void, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise<any>;
then<R>(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => R, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise<R>;
/**
* Property containing the parsed response if the response Content-Type is json
*/
+1 -1
View File
@@ -1704,7 +1704,7 @@ interface JQuery {
sortable(methodName: string): JQuery;
sortable(options: JQueryUI.SortableOptions): JQuery;
sortable(optionLiteral: string, optionName: string): any;
sortable(methodName: 'serialize', options: { key?: string; attribute?: string; expression?: RegExp }): string;
sortable(methodName: 'serialize', options?: { key?: string; attribute?: string; expression?: RegExp }): string;
sortable(optionLiteral: string, options: JQueryUI.SortableOptions): any;
sortable(optionLiteral: string, optionName: string, optionValue: any): JQuery;
+159 -45
View File
@@ -1,4 +1,4 @@
// Type definitions for Kendo UI Professional v2016.1.112
// Type definitions for Kendo UI Professional v2016.1.226
// Project: http://www.telerik.com/kendo-ui
// Definitions by: Telerik <https://github.com/telerik/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -301,7 +301,7 @@ declare module kendo {
class Layout extends View {
containers: { [selector: string]: ViewContainer; };
showIn(selector: string, view: View, transitionClass?: string): void;
showIn(selector: string, view: View): void;
}
class History extends Observable {
@@ -316,13 +316,9 @@ declare module kendo {
var history: History;
interface RouterOptions {
pushState?: boolean;
hashBang?: boolean;
root?: string;
ignoreCase?: boolean;
change?(e: RouterChangeEvent): void;
routeMissing?(e: RouterRouteMissingEvent): void;
same?(e: RouterEvent): void;
init?: (e: RouterEvent) => void;
routeMissing?: (e: RouterEvent) => void;
change?: (e: RouterEvent) => void;
}
interface RouterEvent {
@@ -331,15 +327,6 @@ declare module kendo {
preventDefault: Function;
isDefaultPrevented(): boolean;
}
interface RouterChangeEvent extends RouterEvent {
params: any;
backButtonPressed: boolean;
}
interface RouterRouteMissingEvent extends RouterEvent {
params: any;
}
class Route extends Class {
route: RegExp;
@@ -945,7 +932,6 @@ declare module kendo.data {
interface DataSourceSchemaModel {
id?: string;
fields?: any;
[index: string]: any;
}
interface DataSourceSchemaModelWithFieldsArray extends DataSourceSchemaModel {
@@ -1469,11 +1455,6 @@ declare module kendo.dataviz.ui {
function plugin(widget: any): void;
}
declare module kendo.dataviz.map {
class Marker {
}
}
declare module kendo.dataviz.map.layer {
class Shape {
}
@@ -2489,6 +2470,7 @@ declare module kendo.ui {
destroy(): void;
enable(enable: boolean): void;
focus(): void;
items(): any;
readonly(readonly: boolean): void;
refresh(): void;
search(word: string): void;
@@ -2812,9 +2794,10 @@ declare module kendo.ui {
dataItem(index?: number): any;
destroy(): void;
enable(enable: boolean): void;
readonly(readonly: boolean): void;
focus(): void;
items(): any;
open(): void;
readonly(readonly: boolean): void;
refresh(): void;
search(word: string): void;
select(): number;
@@ -2846,6 +2829,12 @@ declare module kendo.ui {
open?: ComboBoxAnimationOpen;
}
interface ComboBoxPopup {
appendTo?: string;
origin?: string;
position?: string;
}
interface ComboBoxVirtual {
itemHeight?: number;
valueMapper?: Function;
@@ -2867,11 +2856,11 @@ declare module kendo.ui {
groupTemplate?: string|Function;
height?: number;
highlightFirst?: boolean;
ignoreCase?: string;
ignoreCase?: boolean;
index?: number;
minLength?: number;
placeholder?: string;
popup?: any;
popup?: ComboBoxPopup;
suggest?: boolean;
headerTemplate?: string|Function;
template?: string|Function;
@@ -3236,8 +3225,9 @@ declare module kendo.ui {
dataItem(index?: number): any;
destroy(): void;
focus(): void;
open(): void;
items(): any;
enable(enable: boolean): void;
open(): void;
readonly(readonly: boolean): void;
refresh(): void;
search(word: string): void;
@@ -3269,6 +3259,12 @@ declare module kendo.ui {
open?: DropDownListAnimationOpen;
}
interface DropDownListPopup {
appendTo?: string;
origin?: string;
position?: string;
}
interface DropDownListVirtual {
itemHeight?: number;
valueMapper?: Function;
@@ -3289,10 +3285,10 @@ declare module kendo.ui {
fixedGroupTemplate?: string|Function;
groupTemplate?: string|Function;
height?: number;
ignoreCase?: string;
ignoreCase?: boolean;
index?: number;
minLength?: number;
popup?: any;
popup?: DropDownListPopup;
optionLabel?: string|any;
optionLabelTemplate?: string|Function;
headerTemplate?: string|Function;
@@ -4112,6 +4108,7 @@ declare module kendo.ui {
hideColumn(column: number): void;
hideColumn(column: string): void;
hideColumn(column: any): void;
items(): any;
lockColumn(column: number): void;
lockColumn(column: string): void;
refresh(): void;
@@ -4601,6 +4598,7 @@ declare module kendo.ui {
dataItems(): void;
destroy(): void;
edit(item: JQuery): void;
items(): any;
refresh(): void;
remove(item: any): void;
save(): void;
@@ -4821,9 +4819,10 @@ declare module kendo.ui {
dataItems(): any;
destroy(): void;
enable(enable: boolean): void;
readonly(readonly: boolean): void;
focus(): void;
items(): any;
open(): void;
readonly(readonly: boolean): void;
refresh(): void;
search(word: string): void;
setDataSource(dataSource: kendo.data.DataSource): void;
@@ -4849,6 +4848,12 @@ declare module kendo.ui {
open?: MultiSelectAnimationOpen;
}
interface MultiSelectPopup {
appendTo?: string;
origin?: string;
position?: string;
}
interface MultiSelectVirtual {
itemHeight?: number;
valueMapper?: Function;
@@ -4869,11 +4874,11 @@ declare module kendo.ui {
groupTemplate?: string|Function;
height?: number;
highlightFirst?: boolean;
ignoreCase?: string;
ignoreCase?: boolean;
minLength?: number;
maxSelectedItems?: number;
placeholder?: string;
popup?: any;
popup?: MultiSelectPopup;
headerTemplate?: string|Function;
itemTemplate?: string|Function;
tagTemplate?: string;
@@ -4941,6 +4946,9 @@ declare module kendo.ui {
show(data: any, type: string): void;
show(data: string, type: string): void;
show(data: Function, type: string): void;
showText(data: any, type: string): void;
showText(data: string, type: string): void;
showText(data: Function, type: string): void;
success(data: any): void;
success(data: string): void;
success(data: Function): void;
@@ -5075,7 +5083,8 @@ declare module kendo.ui {
totalPages(): number;
pageSize(): number;
page(page: number): number;
page(): number;
page(page: number): void;
refresh(): void;
destroy(): void;
@@ -5726,6 +5735,7 @@ declare module kendo.ui {
destroy(): void;
editEvent(event: string): void;
editEvent(event: kendo.data.SchedulerEvent): void;
items(): any;
occurrenceByUid(uid: string): kendo.data.SchedulerEvent;
occurrencesInRange(start: Date, end: Date): any;
refresh(): void;
@@ -6573,6 +6583,7 @@ declare module kendo.ui {
sheets?: SpreadsheetSheet[];
sheetsbar?: boolean;
toolbar?: boolean;
change?(e: SpreadsheetChangeEvent): void;
render?(e: SpreadsheetRenderEvent): void;
excelExport?(e: SpreadsheetExcelExportEvent): void;
excelImport?(e: SpreadsheetExcelImportEvent): void;
@@ -6584,6 +6595,10 @@ declare module kendo.ui {
isDefaultPrevented(): boolean;
}
interface SpreadsheetChangeEvent extends SpreadsheetEvent {
range?: kendo.spreadsheet.Range;
}
interface SpreadsheetRenderEvent extends SpreadsheetEvent {
}
@@ -7170,6 +7185,7 @@ declare module kendo.ui {
expand(): void;
itemFor(model: kendo.data.TreeListModel): JQuery;
itemFor(model: any): JQuery;
items(): any;
refresh(): void;
removeRow(row: string): void;
removeRow(row: Element): void;
@@ -7524,6 +7540,7 @@ declare module kendo.ui {
findByUid(text: string): JQuery;
insertAfter(nodeData: any, referenceNode: JQuery): void;
insertBefore(nodeData: any, referenceNode: JQuery): void;
items(): any;
parent(node: JQuery): JQuery;
parent(node: Element): JQuery;
parent(node: string): JQuery;
@@ -7916,6 +7933,8 @@ declare module kendo.ui {
dragend?(e: WindowEvent): void;
dragstart?(e: WindowEvent): void;
error?(e: WindowErrorEvent): void;
maximize?(e: WindowEvent): void;
minimize?(e: WindowEvent): void;
open?(e: WindowEvent): void;
refresh?(e: WindowEvent): void;
resize?(e: WindowEvent): void;
@@ -10106,6 +10125,7 @@ declare module kendo.dataviz.ui {
interface ChartExportImageOptions {
width?: string;
height?: string;
cors?: string;
}
interface ChartExportSVGOptions {
@@ -10313,6 +10333,7 @@ declare module kendo.dataviz.ui {
dataSource: kendo.data.DataSource;
connections: DiagramConnection[];
connectionsDataSource: kendo.data.DataSource;
shapes: DiagramShape[];
element: JQuery;
@@ -10371,10 +10392,11 @@ declare module kendo.dataviz.ui {
transformPoint(p: any): void;
transformRect(r: any): void;
undo(): void;
viewToDocument(point: any): any;
viewToModel(point: any): any;
viewport(): void;
zoom(zoom: number, point: any): void;
viewToDocument(point: kendo.dataviz.diagram.Point): kendo.dataviz.diagram.Point;
viewToModel(point: kendo.dataviz.diagram.Point): kendo.dataviz.diagram.Point;
viewport(): kendo.dataviz.diagram.Rect;
zoom(): number;
zoom(zoom: number, point: kendo.dataviz.diagram.Point): void;
}
@@ -10429,6 +10451,8 @@ declare module kendo.dataviz.ui {
interface DiagramConnectionDefaultsSelectionHandles {
fill?: DiagramConnectionDefaultsSelectionHandlesFill;
stroke?: DiagramConnectionDefaultsSelectionHandlesStroke;
width?: number;
height?: number;
}
interface DiagramConnectionDefaultsSelection {
@@ -10529,6 +10553,8 @@ declare module kendo.dataviz.ui {
interface DiagramConnectionSelectionHandles {
fill?: DiagramConnectionSelectionHandlesFill;
stroke?: DiagramConnectionSelectionHandlesStroke;
width?: number;
height?: number;
}
interface DiagramConnectionSelection {
@@ -10895,6 +10921,7 @@ declare module kendo.dataviz.ui {
interface DiagramExportImageOptions {
width?: string;
height?: string;
cors?: string;
}
interface DiagramExportSVGOptions {
@@ -14594,19 +14621,85 @@ declare module kendo.dataviz.map {
}
class Marker extends Observable {
options: MarkerOptions;
constructor(options?: MarkerOptions);
location(): kendo.dataviz.map.Location;
location(location: any): void;
location(location: kendo.dataviz.map.Location): void;
}
interface MarkerTooltipAnimationClose {
effects?: string;
duration?: number;
}
interface MarkerTooltipAnimationOpen {
effects?: string;
duration?: number;
}
interface MarkerTooltipAnimation {
close?: MarkerTooltipAnimationClose;
open?: MarkerTooltipAnimationOpen;
}
interface MarkerTooltipContent {
url?: string;
}
interface MarkerTooltip {
autoHide?: boolean;
animation?: MarkerTooltipAnimation;
content?: MarkerTooltipContent;
template?: string;
callout?: boolean;
iframe?: boolean;
height?: number;
width?: number;
position?: string;
showAfter?: number;
showOn?: string;
}
interface MarkerOptions {
name?: string;
location?: any|kendo.dataviz.map.Location;
shape?: string;
title?: string;
tooltip?: MarkerTooltip;
}
interface MarkerEvent {
sender: Marker;
preventDefault: Function;
isDefaultPrevented(): boolean;
}
class MarkerLayer extends kendo.dataviz.map.Layer {
options: MarkerLayerOptions;
map: kendo.dataviz.ui.Map;
items: any;
constructor(map: kendo.dataviz.ui.Map, options?: MarkerLayerOptions);
show(): void;
add(marker: kendo.dataviz.map.Marker): void;
clear(): void;
hide(): void;
setDataSource(): void;
remove(marker: kendo.dataviz.map.Marker): void;
setDataSource(dataSource: any): void;
show(): void;
}
@@ -14771,6 +14864,11 @@ declare module kendo.dataviz.diagram {
options: ConnectionOptions;
dataItem: any;
from: kendo.dataviz.diagram.Shape;
sourceConnector: kendo.dataviz.diagram.Connector;
targetConnector: kendo.dataviz.diagram.Connector;
to: kendo.dataviz.diagram.Shape;
constructor(options?: ConnectionOptions);
@@ -14790,7 +14888,7 @@ declare module kendo.dataviz.diagram {
type(value: string): void;
points(): any;
allPoints(): any;
redraw(): void;
redraw(options?: any): void;
}
@@ -14853,6 +14951,8 @@ declare module kendo.dataviz.diagram {
name?: string;
content?: ConnectionContent;
fromConnector?: string;
fromX?: number;
fromY?: number;
stroke?: ConnectionStroke;
hover?: ConnectionHover;
startCap?: ConnectionStartCap;
@@ -14860,6 +14960,8 @@ declare module kendo.dataviz.diagram {
points?: ConnectionPoint[];
selectable?: boolean;
toConnector?: string;
toX?: number;
toY?: number;
type?: string;
}
interface ConnectionEvent {
@@ -14874,6 +14976,8 @@ declare module kendo.dataviz.diagram {
options: ConnectorOptions;
connections: any;
shape: kendo.dataviz.diagram.Shape;
constructor(options?: ConnectorOptions);
@@ -15136,8 +15240,10 @@ declare module kendo.dataviz.diagram {
options: PointOptions;
x: number;
y: number;
constructor(options?: PointOptions);
constructor(x: number, y: number);
@@ -15145,8 +15251,6 @@ declare module kendo.dataviz.diagram {
interface PointOptions {
name?: string;
x?: number;
y?: number;
}
interface PointEvent {
sender: Point;
@@ -15337,6 +15441,10 @@ declare module kendo.dataviz.diagram {
options: ShapeOptions;
connectors: any;
dataItem: any;
shapeVisual: any;
visual: kendo.dataviz.diagram.Group;
constructor(options?: ShapeOptions);
@@ -15348,7 +15456,7 @@ declare module kendo.dataviz.diagram {
connections(type: string): void;
getConnector(): void;
getPosition(side: string): void;
redraw(): void;
redraw(options: any): void;
}
@@ -15560,6 +15668,10 @@ declare module kendo {
function unbind(element: JQuery): void;
function unbind(element: Element): void;
module pdf {
function defineFont(map: any): void;
}
}
declare module kendo.spreadsheet {
class CustomFilter extends Observable {
@@ -15697,6 +15809,7 @@ declare module kendo.spreadsheet {
clearFilter(indexes: any): void;
columnWidth(): void;
columnWidth(index: number, width?: number): void;
batch(callback: Function, changeEventArgs: any): void;
deleteColumn(index: number): void;
fromJSON(data: any): void;
frozenColumns(): number;
@@ -16819,6 +16932,7 @@ declare module kendo.ooxml {
fontName?: string;
fontSize?: number;
format?: string;
formula?: string;
hAlign?: string;
index?: any;
italic?: boolean;
+38
View File
@@ -0,0 +1,38 @@
// Type definitions for KoLite 1.1
// Project: https://github.com/CodeSeven/kolite
// Definitions by: Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="../knockout/knockout.d.ts" />
// Activity /////////////////////////////////////////////
interface KoLiteActivityOptions {
color?: any;
segments?: number;
space?: number;
length?: number;
width?: number;
speed?: number;
align?: string;
valign?: string;
padding?: number;
}
interface KoLiteActivity {
(options: KoLiteActivityOptions): JQuery;
defaults: KoLiteActivityOptions;
getOpacity(options: { steps?: number; segments?: number; opacity?: number; }, i: number): number;
}
interface KnockoutBindingHandlers {
activity: KnockoutBindingHandler;
}
interface JQuery {
activity: KoLiteActivity;
activityEx(isLoading: boolean): JQuery;
}
+52
View File
@@ -0,0 +1,52 @@
// Type definitions for KoLite 1.1
// Project: https://github.com/CodeSeven/kolite
// Definitions by: Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="../knockout/knockout.d.ts" />
// Command /////////////////////////////////////////////
interface KoliteCommand {
canExecute: KnockoutComputed<boolean>;
execute(...args: any[]): any;
}
interface KoliteAsyncCommand extends KoliteCommand {
isExecuting: KnockoutObservable<boolean>;
}
interface KoLiteCommandOptions {
execute(...args: any[]): any;
canExecute?: (isExecuting: boolean) => any;
}
// when not AMD, add to ko object
interface KnockoutStatic {
command(options: KoLiteCommandOptions): KoliteCommand;
asyncCommand(options: KoLiteCommandOptions): KoliteAsyncCommand;
}
// when using AMD, it is exported
interface KnockoutCommandStatic {
command(options: KoLiteCommandOptions): KoliteCommand;
asyncCommand(options: KoLiteCommandOptions): KoliteAsyncCommand;
}
interface KnockoutUtils {
wrapAccessor(accessor: any): Function;
}
interface KnockoutBindingHandlers {
command: KnockoutBindingHandler;
}
// Ambient declarations for typescript+requirejs
declare var kocommand: KnockoutCommandStatic;
declare module 'kocommand'{
export = kocommand;
}
+30
View File
@@ -0,0 +1,30 @@
// Type definitions for KoLite 1.1
// Project: https://github.com/CodeSeven/kolite
// Definitions by: Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="../knockout/knockout.d.ts" />
// DirtyFlag /////////////////////////////////////////////
interface DirtyFlag {
isDirty: KnockoutComputed<boolean>;
new (objectToTrack: any, isInitiallyDirty?: boolean, hashFunction?: () => any): any;
reset(): void;
}
interface KnockoutStatic {
DirtyFlag: DirtyFlag;
}
interface KnockoutDirtyFlagStatic {
DirtyFlag: DirtyFlag;
}
// AMD
declare var kodirtyflag: KnockoutDirtyFlagStatic;
declare module 'kodirtyflag'{
export = kodirtyflag;
}
+3 -75
View File
@@ -4,78 +4,6 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="../knockout/knockout.d.ts" />
// Activity /////////////////////////////////////////////
interface KoLiteActivityOptions {
color?: any;
segments?: number;
space?: number;
length?: number;
width?: number;
speed?: number;
align?: string;
valign?: string;
padding?: number;
}
interface KoLiteActivity {
(options: KoLiteActivityOptions): JQuery;
defaults: KoLiteActivityOptions;
getOpacity(options: { steps?: number; segments?: number; opacity?: number; }, i: number): number;
}
interface KnockoutBindingHandlers {
activity: KnockoutBindingHandler;
}
interface JQuery {
activity: KoLiteActivity;
activityEx(isLoading: boolean): JQuery;
}
// DirtyFlag /////////////////////////////////////////////
interface DirtyFlag {
isDirty: KnockoutComputed<boolean>;
new (objectToTrack: any, isInitiallyDirty?: boolean, hashFunction?: () => any);
reset(): void;
}
interface KnockoutStatic {
DirtyFlag: DirtyFlag;
}
// Command /////////////////////////////////////////////
interface KoliteCommand {
canExecute: KnockoutComputed<boolean>;
execute(...args: any[]): any;
}
interface KoliteAsyncCommand extends KoliteCommand {
isExecuting: KnockoutObservable<boolean>;
}
interface KoLiteCommandOptions {
execute(...args: any[]): any;
canExecute?: (isExecuting: boolean) => any;
}
interface KnockoutStatic {
command(options: KoLiteCommandOptions): KoliteCommand;
asyncCommand(options: KoLiteCommandOptions): KoliteAsyncCommand;
}
interface KnockoutUtils {
wrapAccessor(accessor): Function;
}
interface KnockoutBindingHandlers {
command: KnockoutBindingHandler;
}
/// <reference path="knockout.activity.d.ts" />
/// <reference path="knockout.command.d.ts" />
/// <reference path="knockout.dirtyFlag.d.ts" />
@@ -0,0 +1,20 @@
/// <reference path="microsoft-sdk-soap.d.ts" />
// QueryByAttribute
var queryByAttribute = new Sdk.Query.QueryByAttribute( "account" );
queryByAttribute.addColumn( "accountnumber" );
queryByAttribute.addAttributeValue( new Sdk.String( "name", "acme" ) );
Sdk.Q.retrieveMultiple( queryByAttribute ).then( entityCollection =>
{
var accountNumber = entityCollection.getEntity( 0 ).getAttributes( "accountnumber" ).getValue();
console.log( "Account 'acme' has the Account Number '" + accountNumber + "'" );
} );
// QueryExpression
var queryExpression = new Sdk.Query.QueryExpression( "account" );
queryExpression.setColumnSet( new Sdk.ColumnSet( true ) );
queryExpression.addCondition( "account", "accountname", Sdk.Query.ConditionOperator.BeginsWith, new Sdk.Query.Strings( [ "abc", "xyz" ] ) );
Sdk.Q.retrieveMultiple( queryExpression ).then( entityCollection =>
{
console.log( "Query matches " + entityCollection.getTotalRecordCount() + " records." );
} );
File diff suppressed because it is too large Load Diff
+6
View File
@@ -379,11 +379,17 @@ declare module moment {
meridiem?: (hour: number, minute: number, isLowercase: boolean) => string;
calendar?: MomentCalendar;
ordinal?: (num: number) => string;
week?: MomentLanguageWeek;
}
interface MomentLanguage extends BaseMomentLanguage {
longDateFormat?: MomentLongDateFormat;
}
interface MomentLanguageWeek {
dow?: number;
doy?: number;
}
interface MomentLanguageData {
/**
+4
View File
@@ -315,6 +315,10 @@ moment.locale('en', {
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
},
week: {
dow: 1,
doy: 4
}
});
+32 -7
View File
@@ -1,20 +1,35 @@
// Type definitions for node-gcm 0.9.15
// Type definitions for node-gcm 0.14.0
// Project: https://www.npmjs.org/package/node-gcm
// Definitions by: Hiroki Horiuchi <https://github.com/horiuchi>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "node-gcm" {
export interface INotificationOptions {
title: string;
body?: string;
icon: string;
sound?: string;
badge?: string;
tag?: string;
color?: string;
click_action?: string;
}
export interface IMessageOptions {
collapseKey?: string;
priority?: string;
contentAvailable?: boolean;
delayWhileIdle?: boolean;
timeToLive?: number;
restrictedPackageName?: string;
dryRun?: boolean;
data: {
data?: {
[key: string]: string;
};
notification?: INotificationOptions;
}
export class Message {
constructor(options?: IMessageOptions);
collapseKey: string;
@@ -24,6 +39,8 @@ declare module "node-gcm" {
addData(key: string, value: string): void;
addData(data: { [key: string]: string }): void;
addNotification(value: INotificationOptions): void;
addNotification(key: string, value:INotificationOptions): void;
}
@@ -37,15 +54,23 @@ declare module "node-gcm" {
backoff?: number;
}
export interface IRecipient {
to?: string,
topic?: string,
notificationKey?: string,
registrationIds?: string[],
registrationTokens?: string[]
}
export class Sender {
constructor(key: string, options?: ISenderOptions);
key: string;
options: ISenderOptions;
send(message: Message, registrationIds: string|string[], callback: (err: any, resJson: IResponseBody) => void): void;
send(message: Message, registrationIds: string|string[], retries: number, callback: (err: any, resJson: IResponseBody) => void): void;
send(message: Message, registrationIds: string|string[], options: ISenderSendOptions, callback: (err: any, resJson: IResponseBody) => void): void;
sendNoRetry(message: Message, registrationIds: string|string[], callback: (err: any, resJson: IResponseBody) => void): void;
send(message: Message, registrationIds: string|string[]|IRecipient, callback: (err: any, resJson: IResponseBody) => void): void;
send(message: Message, registrationIds: string|string[]|IRecipient, retries: number, callback: (err: any, resJson: IResponseBody) => void): void;
send(message: Message, registrationIds: string|string[]|IRecipient, options: ISenderSendOptions, callback: (err: any, resJson: IResponseBody) => void): void;
sendNoRetry(message: Message, registrationIds: string|string[]|IRecipient, callback: (err: any, resJson: IResponseBody) => void): void;
}
+24
View File
@@ -0,0 +1,24 @@
/// <reference path='notie.d.ts' />
notie.alert(1, 'Success!', 1.5);
notie.alert(2, 'Warning<br><b>with</b><br><i>HTML</i><br><u>included.</u>', 2);
notie.alert(3, 'Error.', 2.5);
notie.alert(4, 'Information.', 2);
notie.confirm('Are you sure you want to do that?', 'Yes', 'Cancel', function() {
notie.alert(1, 'Good choice!', 2);
});
notie.confirm('Are you sure?', 'Yes', 'Cancel', function() {
notie.confirm('Are you <b>really</b> sure?', 'Yes', 'Cancel', function() {
notie.confirm('Are you really <b>really</b> sure?', 'Yes', 'Cancel', function() {
notie.alert(1, 'Okay, jeez...', 2);
});
});
});
notie.input('Please enter your email address:', 'Submit', 'Cancel', 'email', 'name@example.com', function(value_entered) {
notie.alert(1, 'You entered: ' + value_entered, 2);
});
notie.input('What city do you live in?', 'Submit', 'Cancel', 'text', 'Enter your city:', function(value_entered) {
notie.alert(1, 'You entered: ' + value_entered, 2);
}, 'New York');
+10
View File
@@ -0,0 +1,10 @@
// Type definitions for notie.js
// Project: https://github.com/jaredreich/notie.js
// Definitions by: Mateus Demboski <https://github.com/mateusdemboski>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare var notie: {
alert: (type: number, message: string, seconds: number) => void;
confirm: (title: string, yes_text: string, no_text: string, yes_callback: () => void) => void;
input: (title: string, submit_text: string, cancel_text: string, type: string, placeholder: string, submit_callback: (value_entered: string) => void, prefilled_value_optional?: string) => void;
};
+5
View File
@@ -4180,6 +4180,11 @@ declare module ol {
* Get all features on the source
*/
getFeatures(): ol.Feature[];
/**
* Get all features whose geometry intersects the provided coordinate.
*/
getFeaturesAtCoordinate(coordinate: ol.Coordinate): ol.Feature[];
}
class VectorEvent {
+47 -3
View File
@@ -1,5 +1,49 @@
/// <reference path="./pegjs.d.ts" />
{
let input: string;
let result = PEG.parse(input);
console.log(result);
}
var input: string;
var result = PEG.parse(input);
console.log(result);
import * as pegjs from 'pegjs';
{
let pegparser: pegjs.Parser = pegjs.buildParser("start = ('a' / 'b')+");
try {
let result: string = pegparser.parse("abba");
} catch (error) {
if (error instanceof pegparser.SyntaxError) {
}
}
}
{
let parser = pegjs.buildParser("A = 'test'", {
cache: true,
allowedStartRules: ["A"],
optimize: "speed",
plugins: []
})
}
try {
let parserOrSource: pegjs.Parser | string = pegjs.buildParser("A = 'test'", {output: "source"});
} catch (error) {
if (error instanceof pegjs.GrammarError) {
let e: pegjs.GrammarError = error;
} else if (error instanceof pegjs.parser.SyntaxError) {
let e: pegjs.parser.SyntaxError = error;
}
let e: pegjs.PegjsError = error;
console.log(e.expected[0].description);
console.log(e.expected[0].type);
console.log(e.expected[0].value);
console.log(e.location.end.column);
console.log(e.location.end.offset);
console.log(e.location.end.line);
console.log(e.message);
console.log(e.name);
}
+55 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for PEG.js
// Project: http://pegjs.majda.cz/
// Definitions by: vvakame <https://github.com/vvakame>
// Definitions by: vvakame <https://github.com/vvakame>, Tobias Kahlert <https://github.com/SrTobi>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module PEG {
@@ -28,3 +28,57 @@ declare module PEG {
message:string;
}
}
declare module "pegjs" {
type Location = PEG.Location;
type LocationRange = PEG.LocationRange;
interface ExpectedItem {
type: string;
value?: string;
description: string;
}
interface PegjsError extends Error {
name: string;
message: string;
location: LocationRange;
found?: any;
expected?: ExpectedItem[];
stack?: any;
}
type GrammarError = PegjsError;
var GrammarError: any;
interface ParserOptions {
startRule: string;
tracer: any;
}
interface Parser {
parse(input: string, options?:ParserOptions): any;
SyntaxError: any;
}
interface BuildOptions {
cache?: boolean;
allowedStartRules?: string[];
optimize?: string;
plugins?: any[];
}
interface OutputBuildOptions extends BuildOptions {
output?: string;
}
function buildParser(grammar: string, options?: BuildOptions): Parser;
function buildParser(grammar: string, options?: OutputBuildOptions): Parser | string;
module parser {
type SyntaxError = PegjsError;
var SyntaxError: any;
}
}
+5 -1
View File
@@ -1,7 +1,11 @@
/// <reference path="pg.d.ts" />
import pg = require("pg");
import * as pg from "pg";
var conString = "postgres://username:password@localhost/database";
// https://github.com/brianc/node-pg-types
pg.types.setTypeParser(20, (val) => Number(val));
// Client pooling
pg.connect(conString, (err, client, done) => {
if (err) {
Vendored
+4
View File
@@ -85,4 +85,8 @@ declare module "pg" {
public on(event: "error", listener: (err: Error, client: Client) => void): this;
public on(event: string, listener: Function): this;
}
namespace types {
function setTypeParser<T>(typeId: number, parser: (value: string) => T): void;
}
}
+1 -1
View File
@@ -58,7 +58,7 @@ interface RavenStatic {
/** Raven.js version. */
VERSION: string;
Plugins: RavenPlugin[];
Plugins: { [id: string]: RavenPlugin };
/*
* Allow Raven to be configured as soon as it is loaded
+12 -1
View File
@@ -7,7 +7,7 @@
// --------------------------------------------------------------------------------
import * as React from 'react';
import { Component, CSSProperties } from 'react';
import { Button, ButtonToolbar, Modal, Well, ButtonGroup, DropdownButton, MenuItem, Panel, ListGroup, ListGroupItem, Accordion, Tooltip, OverlayTrigger, Popover, ProgressBar, Nav, NavItem, Navbar, NavDropdown, Tabs, Tab, Pager, PageItem, Pagination, Alert, Carousel, CarouselItem, Grid, Row, Col, Thumbnail, Label, Badge, Jumbotron, PageHeader, Glyphicon, Table, Input, ButtonInput } from 'react-bootstrap';
import { Button, ButtonToolbar, Modal, Well, ButtonGroup, DropdownButton, MenuItem, Panel, ListGroup, ListGroupItem, Accordion, Tooltip, OverlayTrigger, Popover, ProgressBar, Nav, NavItem, Navbar, NavDropdown, Tabs, Tab, Pager, PageItem, Pagination, Alert, Carousel, CarouselItem, Grid, Row, Col, Thumbnail, Label, Badge, Jumbotron, PageHeader, Glyphicon, Table, Input, ButtonInput, FormControls } from 'react-bootstrap';
export class ReactBootstrapTest extends Component<any, any> {
@@ -375,6 +375,9 @@ export class ReactBootstrapTest extends Component<any, any> {
<OverlayTrigger trigger='focus' placement='bottom' overlay={<Popover title='Popover bottom'><strong>Holy guacamole!</strong> Check this info.</Popover>}>
<Button bsStyle='default'>Focus</Button>
</OverlayTrigger>
<OverlayTrigger trigger={['click', 'hover', 'focus']} placement='bottom' overlay={<Popover title='Popover bottom'><strong>Holy guacamole!</strong> Check this info.</Popover>}>
<Button bsStyle='default'>Click or hover or focus</Button>
</OverlayTrigger>
<OverlayTrigger trigger='click' rootClose placement='bottom' overlay={<Popover title='Popover bottom'><strong>Holy guacamole!</strong> Check this info.</Popover>}>
<Button bsStyle='default'>Click + rootClose</Button>
</OverlayTrigger>
@@ -851,6 +854,14 @@ export class ReactBootstrapTest extends Component<any, any> {
</form>
</div>
<div style={style}>
<form>
<FormControls.Static className="col-xs-10 col-xs-offset-2" value="I'm in a form" />
<FormControls.Static label="First Name" labelClassName="col-xs-2" wrapperClassName="col-xs-10" value="Billy" />
<FormControls.Static label="Last Name" labelClassName="col-xs-2" wrapperClassName="col-xs-10">Bob</FormControls.Static>
</form>
</div>
<div style={style}>
<form>
<Input type='text' addonBefore='@' />
+222 -308
View File
File diff suppressed because it is too large Load Diff
+23 -7
View File
@@ -42,13 +42,17 @@ declare module reactInputCalendar {
*/
computableFormat?: string;
/**
* Set an function that will be triggered whenever there is a change in the selected date. It will return the date in the props.computableFormat format.
* Set a function that will be triggered whenever there is a change in the selected date. It will return the date in the props.computableFormat format.
*/
onChange?:(selectedDate: string)=>any;
onChange?: (computableDate: string) => void;
/**
* Set a function that will be triggered the when input field is blurred. It will return the event and the date in the props.computableFormat format.
*/
onBlur?: (event: __React.SyntheticEvent, computableDate: string) => void;
/**
* Define state when date picker would close once the user has clicked on a date.
*/
closeOnSelect?:boolean;
closeOnSelect?: boolean;
/**
* Setting this value to true makes the calendar widget open when the iput field is focused.
*/
@@ -56,14 +60,26 @@ declare module reactInputCalendar {
/**
* Value to show in the input text box if no date is set.
*/
placeholder?:string
placeholder?: string;
/**
* Id that should be applied to the input field. Useful when using it with a label element.
*/
inputFieldId?: string;
/**
* Define the class name of the input field where the date picker represents its value.
*/
inputFieldClass?: string;
/**
* If true, the input field gets disabled and the icon next to it disappears.
*/
disabled?: boolean;
}
interface ReactInputCalendarState { }
export class ReactInputCalendar extends __React.Component<ReactInputCalendarProps, ReactInputCalendarState>{
render(): __React.DOMElement<any>
export class ReactInputCalendar extends __React.Component<ReactInputCalendarProps, ReactInputCalendarState> {
render(): __React.DOMElement<any>;
}
}
declare var ReactInputCalendar: typeof reactInputCalendar.ReactInputCalendar
declare module "react-input-calendar" {
export = ReactInputCalendar
export = ReactInputCalendar;
}
+280
View File
@@ -0,0 +1,280 @@
/// <reference path="react-redux-2.1.2.d.ts" />
/// <reference path="../react/react.d.ts"/>
/// <reference path="../react/react-dom.d.ts"/>
/// <reference path="../redux/redux.d.ts" />
/// <reference path="../react-router/react-router-0.13.3.d.ts" />
/// <reference path="../object-assign/object-assign.d.ts" />
import { Component, ReactElement } from 'react';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import * as Router from 'react-router';
import { Route, RouterState } from 'react-router';
import { Store, Dispatch, bindActionCreators } from 'redux';
import { connect, Provider } from 'react-redux';
import objectAssign = require('object-assign');
//
// Quick Start
// https://github.com/rackt/react-redux/blob/master/docs/quick-start.md#quick-start
//
interface CounterState {
counter: number;
}
declare var increment: Function;
class Counter extends Component<any, any> {
render() {
return (
<button onClick={this.props.onIncrement}>
{this.props.value}
</button>
);
}
}
function mapStateToProps(state: CounterState) {
return {
value: state.counter
};
}
// Which action creators does it want to receive by props?
function mapDispatchToProps(dispatch: Dispatch) {
return {
onIncrement: () => dispatch(increment())
};
}
connect(
mapStateToProps,
mapDispatchToProps
)(Counter);
@connect(mapStateToProps)
class CounterContainer extends Component<any, any> {
}
class App extends Component<any, any> {
render(): JSX.Element {
// ...
return null;
}
}
const targetEl = document.getElementById('root');
ReactDOM.render((
<Provider store={store}>
{() => <App />}
</Provider>
), targetEl);
//
// API
// https://github.com/rackt/react-redux/blob/master/docs/api.md
//
declare var routes: Route;
declare var store: Store;
declare var routerState: RouterState;
class MyRootComponent extends Component<any, any> {
}
class TodoApp extends Component<any, any> {
}
interface TodoState {
todos: string[]|string;
}
interface TodoProps {
userId: number;
}
interface DispatchProps {
addTodo(userId: number, text: string): void;
}
declare var actionCreators: () => {
action: Function;
}
declare var addTodo: () => { type: string; };
declare var todoActionCreators: { [type: string]: (...args: any[]) => any; };
declare var counterActionCreators: { [type: string]: (...args: any[]) => any; };
ReactDOM.render(
<Provider store={store}>
{() => <MyRootComponent />}
</Provider>,
document.body
);
Router.run(routes, Router.HistoryLocation, (Handler, routerState) => { // note "routerState" here
ReactDOM.render(
<Provider store={store}>
{/*
//TODO: error TS2339: Property 'routerState' does not exist on type 'RouteProp'.
{() => <Handler routerState={routerState} />} // note "routerState" here: important to pass it down
*/}
</Provider>,
document.getElementById('root')
);
});
//TODO: for React Router 1.0
//TODO: error TS2604: JSX element type 'Router' does not have any construct or call signatures.
//ReactDOM.render(
// <Provider store={store}>
// {() => <Router history={history}>...</Router>}
// </Provider>,
// targetEl
//);
// Inject just dispatch and don't listen to store
connect()(TodoApp);
// Inject dispatch and every field in the global state
connect((state: TodoState) => state)(TodoApp);
// Inject dispatch and todos
function mapStateToProps2(state: TodoState) {
return { todos: state.todos };
}
export default connect(mapStateToProps2)(TodoApp);
// Inject todos and all action creators (addTodo, completeTodo, ...)
//function mapStateToProps(state) {
// return { todos: state.todos };
//}
connect(mapStateToProps2, actionCreators)(TodoApp);
// Inject todos and all action creators (addTodo, completeTodo, ...) as actions
//function mapStateToProps(state) {
// return { todos: state.todos };
//}
function mapDispatchToProps2(dispatch: Dispatch) {
return { actions: bindActionCreators(actionCreators, dispatch) };
}
connect(mapStateToProps2, mapDispatchToProps2)(TodoApp);
// Inject todos and a specific action creator (addTodo)
//function mapStateToProps(state) {
// return { todos: state.todos };
//}
function mapDispatchToProps3(dispatch: Dispatch) {
return bindActionCreators({ addTodo }, dispatch);
}
connect(mapStateToProps2, mapDispatchToProps3)(TodoApp);
// Inject todos, todoActionCreators as todoActions, and counterActionCreators as counterActions
//function mapStateToProps(state) {
// return { todos: state.todos };
//}
function mapDispatchToProps4(dispatch: Dispatch) {
return {
todoActions: bindActionCreators(todoActionCreators, dispatch),
counterActions: bindActionCreators(counterActionCreators, dispatch)
};
}
connect(mapStateToProps2, mapDispatchToProps4)(TodoApp);
// Inject todos, and todoActionCreators and counterActionCreators together as actions
//function mapStateToProps(state) {
// return { todos: state.todos };
//}
function mapDispatchToProps5(dispatch: Dispatch) {
return {
actions: bindActionCreators(objectAssign({}, todoActionCreators, counterActionCreators), dispatch)
};
}
connect(mapStateToProps2, mapDispatchToProps5)(TodoApp);
// Inject todos, and all todoActionCreators and counterActionCreators directly as props
//function mapStateToProps(state) {
// return { todos: state.todos };
//}
function mapDispatchToProps6(dispatch: Dispatch) {
return bindActionCreators(objectAssign({}, todoActionCreators, counterActionCreators), dispatch);
}
connect(mapStateToProps2, mapDispatchToProps6)(TodoApp);
// Inject todos of a specific user depending on props
function mapStateToProps3(state: TodoState, ownProps: TodoProps): TodoState {
return { todos: state.todos[ownProps.userId] };
}
connect(mapStateToProps3)(TodoApp);
// Inject todos of a specific user depending on props, and inject props.userId into the action
//function mapStateToProps(state) {
// return { todos: state.todos };
//}
function mergeProps(stateProps: TodoState, dispatchProps: DispatchProps, ownProps: TodoProps): DispatchProps & TodoState {
return objectAssign({}, ownProps, {
todos: stateProps.todos[ownProps.userId],
addTodo: (text: string) => dispatchProps.addTodo(ownProps.userId, text)
});
}
connect(mapStateToProps2, actionCreators, mergeProps)(TodoApp);
interface TestProp {
property1: number;
someOtherProperty?: string;
}
interface TestState {
isLoaded: boolean;
state1: number;
}
class TestComponent extends Component<TestProp, TestState> { }
const WrappedTestComponent = connect()(TestComponent);
// return value of the connect()(TestComponent) is of the type TestComponent
let ATestComponent: typeof TestComponent = null;
ATestComponent = TestComponent;
ATestComponent = WrappedTestComponent;
let anElement: ReactElement<TestProp>;
<TestComponent property1={42} />;
<WrappedTestComponent property1={42} />;
<ATestComponent property1={42} />;
class NonComponent {}
// this doesn't compile
//connect()(NonComponent);
// connect()(SomeClass) has the same constructor as SomeClass itself
class SomeClass extends Component<any, any> {
constructor(public foo: string) { super() }
public bar: number;
}
let bar: number = new (connect()(SomeClass))("foo").bar;
+69
View File
@@ -0,0 +1,69 @@
// Type definitions for react-redux 2.1.2
// Project: https://github.com/rackt/react-redux
// Definitions by: Qubo <https://github.com/tkqubo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../react/react.d.ts" />
/// <reference path="../redux/redux.d.ts" />
declare module "react-redux" {
import { Component } from 'react';
import { Store, Dispatch, ActionCreator } from 'redux';
export class ElementClass extends Component<any, any> { }
export interface ClassDecorator {
<T extends (typeof ElementClass)>(component: T): T
}
/**
* Connects a React component to a Redux store.
* @param mapStateToProps
* @param mapDispatchToProps
* @param mergeProps
* @param options
*/
export function connect(mapStateToProps?: MapStateToProps,
mapDispatchToProps?: MapDispatchToPropsFunction|MapDispatchToPropsObject,
mergeProps?: MergeProps,
options?: Options): ClassDecorator;
interface MapStateToProps {
(state: any, ownProps?: any): any;
}
interface MapDispatchToPropsFunction {
(dispatch: Dispatch, ownProps?: any): any;
}
interface MapDispatchToPropsObject {
[name: string]: ActionCreator;
}
interface MergeProps {
(stateProps: any, dispatchProps: any, ownProps: any): any;
}
interface Options {
/**
* If true, implements shouldComponentUpdate and shallowly compares the result of mergeProps,
* preventing unnecessary updates, assuming that the component is a “pure” component
* and does not rely on any input or state other than its props and the selected Redux stores state.
* Defaults to true.
* @default true
*/
pure: boolean;
}
export interface Property {
/**
* The single Redux store in your application.
*/
store?: Store;
children?: Function;
}
/**
* Makes the Redux store available to the connect() calls in the component hierarchy below.
*/
export class Provider extends Component<Property, {}> { }
}
+35 -22
View File
@@ -2,14 +2,14 @@
/// <reference path="../react/react.d.ts"/>
/// <reference path="../react/react-dom.d.ts"/>
/// <reference path="../redux/redux.d.ts" />
/// <reference path="../react-router/react-router-0.13.3.d.ts" />
/// <reference path="../history/history.d.ts" />
/// <reference path="../react-router/react-router.d.ts" />
/// <reference path="../object-assign/object-assign.d.ts" />
import { Component, ReactElement } from 'react';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import * as Router from 'react-router';
import { Route, RouterState } from 'react-router';
import { Router, RouterState } from 'react-router';
import { Store, Dispatch, bindActionCreators } from 'redux';
import { connect, Provider } from 'react-redux';
import objectAssign = require('object-assign');
@@ -77,9 +77,9 @@ ReactDOM.render((
// API
// https://github.com/rackt/react-redux/blob/master/docs/api.md
//
declare var routes: Route;
declare var store: Store;
declare var routerState: RouterState;
declare var history: HistoryModule.History;
class MyRootComponent extends Component<any, any> {
}
@@ -109,26 +109,30 @@ ReactDOM.render(
document.body
);
Router.run(routes, Router.HistoryLocation, (Handler, routerState) => { // note "routerState" here
ReactDOM.render(
<Provider store={store}>
{/*
//TODO: error TS2339: Property 'routerState' does not exist on type 'RouteProp'.
{() => <Handler routerState={routerState} />} // note "routerState" here: important to pass it down
*/}
</Provider>,
document.getElementById('root')
);
});
//TODO: for React Router 0.13
////TODO: error TS2339: Property 'run' does not exist on type 'typeof "react-router"'.
////TODO: error TS2339: Property 'HistoryLocation' does not exist on type 'typeof "react-router"'.
//declare var routes: any;
//Router.run(routes, Router.HistoryLocation, (Handler, routerState) => { // note "routerState" here
// ReactDOM.render(
// <Provider store={store}>
// {/*
// //TODO: error TS2339: Property 'routerState' does not exist on type 'RouteProp'.
// {() => <Handler routerState={routerState} />} // note "routerState" here: important to pass it down
// */}
// </Provider>,
// document.getElementById('root')
// );
//});
//TODO: for React Router 1.0
//TODO: error TS2604: JSX element type 'Router' does not have any construct or call signatures.
//ReactDOM.render(
// <Provider store={store}>
// {() => <Router history={history}>...</Router>}
// </Provider>,
// targetEl
//);
ReactDOM.render(
<Provider store={store}>
{() => <Router history={history}>...</Router>}
</Provider>,
targetEl
);
// Inject just dispatch and don't listen to store
@@ -278,3 +282,12 @@ class SomeClass extends Component<any, any> {
}
let bar: number = new (connect()(SomeClass))("foo").bar;
// stateless functions
interface HelloMessageProps { name: string; }
function HelloMessage(props: HelloMessageProps) {
return <div>Hello {props.name}</div>;
}
let ConnectedHelloMessage = connect()(HelloMessage);
ReactDOM.render(<HelloMessage name="Sebastian" />, document.getElementById('content'));
ReactDOM.render(<ConnectedHelloMessage name="Sebastian" />, document.getElementById('content'));
+8 -9
View File
@@ -1,4 +1,4 @@
// Type definitions for react-redux 2.1.2
// Type definitions for react-redux 4.4.0
// Project: https://github.com/rackt/react-redux
// Definitions by: Qubo <https://github.com/tkqubo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -7,12 +7,11 @@
/// <reference path="../redux/redux.d.ts" />
declare module "react-redux" {
import { Component } from 'react';
import { ComponentClass, Component, StatelessComponent } from 'react';
import { Store, Dispatch, ActionCreator } from 'redux';
export class ElementClass extends Component<any, any> { }
export interface ClassDecorator {
<T extends (typeof ElementClass)>(component: T): T
export interface ComponentConstructDecorator<P> {
<TComponentConstruct extends (ComponentClass<P>|StatelessComponent<P>)>(component: TComponentConstruct): TComponentConstruct
}
/**
@@ -22,10 +21,10 @@ declare module "react-redux" {
* @param mergeProps
* @param options
*/
export function connect(mapStateToProps?: MapStateToProps,
mapDispatchToProps?: MapDispatchToPropsFunction|MapDispatchToPropsObject,
mergeProps?: MergeProps,
options?: Options): ClassDecorator;
export function connect<P>(mapStateToProps?: MapStateToProps,
mapDispatchToProps?: MapDispatchToPropsFunction|MapDispatchToPropsObject,
mergeProps?: MergeProps,
options?: Options): ComponentConstructDecorator<P>;
interface MapStateToProps {
(state: any, ownProps?: any): any;
+132
View File
@@ -0,0 +1,132 @@
/// <reference path="./history.d.ts" />
import { createHistory, createLocation, useBeforeUnload, useQueries, useBasename } from 'history'
import { getUserConfirmation } from 'history/lib/DOMUtils'
interface Promise<T> {
then<TResult>(onfulfilled?: (value: T) => TResult): Promise<TResult>;
}
let doSomethingAsync: () => Promise<Function>;
let input = { value: "" };
{
let history = createHistory()
// Listen for changes to the current location. The
// listener is called once immediately.
let unlisten = history.listen(function(location) {
console.log(location.pathname)
})
// When you're finished, stop the listener.
unlisten()
// Push a new entry onto the history stack.
history.push('/home')
// Replace the current entry on the history stack.
history.replace('/profile')
// Push a new entry with state onto the history stack.
history.push({
pathname: '/about',
search: '?the=search',
state: { some: 'state' }
});
// Change just the search on an existing location.
//history.push({ ...location, search: '?the=other+search' })
// Go back to the previous history entry. The following
// two lines are synonymous.
history.go(-1)
history.goBack()
let href = history.createHref('/the/path')
}
{
let history = createHistory()
// Pushing a path string.
history.push('/the/path')
// Omitting location state when pushing a location descriptor.
history.push({ pathname: '/the/path', search: '?the=search' })
// Extending an existing location object.
//history.push({ ...location, search: '?other=search' })
let location = createLocation('/a/path?a=query', { the: 'state' })
location = history.createLocation('/a/path?a=query', { the: 'state' })
}
{
let history = createHistory()
history.listenBefore(function(location) {
if (input.value !== '')
return 'Are you sure you want to leave this page?'
})
history.listenBefore(function(location, callback) {
doSomethingAsync().then(callback)
})
}
{
let history = createHistory({
getUserConfirmation(message, callback) {
callback(window.confirm(message)) // The default behavior
}
})
}
{
let history = useBeforeUnload(createHistory)()
history.listenBeforeUnload(function() {
return 'Are you sure you want to leave this page?'
})
}
{
let history = useQueries(createHistory)()
history.listen(function(location) {
console.log(location.query)
})
}
{
let history = useQueries(createHistory)({
parseQueryString: function(queryString) {
// TODO: return a parsed version of queryString
return {};
},
stringifyQuery: function(query) {
// TODO: return a query string created from query
return "";
}
})
history.createPath({ pathname: '/the/path', query: { the: 'query' } })
history.push({ pathname: '/the/path', query: { the: 'query' } })
}
{
// Run our app under the /base URL.
let history = useBasename(createHistory)({
basename: '/base'
})
// At the /base/hello/world URL:
history.listen(function(location) {
console.log(location.pathname) // /hello/world
console.log(location.basename) // /base
})
history.createPath('/the/path') // /base/the/path
history.push('/the/path') // push /base/the/path
}
+56 -15
View File
@@ -1,6 +1,6 @@
// Type definitions for history v1.13.1
// Type definitions for history v2.0.0
// Project: https://github.com/rackt/history
// Definitions by: Sergey Buturlakin <http://github.com/sergey-buturlakin>
// Definitions by: Sergey Buturlakin <https://github.com/sergey-buturlakin>, Nathan Brown <https://github.com/ngbrown>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -17,21 +17,25 @@ declare namespace HistoryModule {
type CreateHistoryEnhancer<T, E> = (createHistory: CreateHistory<T>) => CreateHistory<T & E>
interface History {
listenBefore(hook: TransitionHook): Function
listen(listener: LocationListener): Function
listenBefore(hook: TransitionHook): () => void
listen(listener: LocationListener): () => void
transitionTo(location: Location): void
pushState(state: LocationState, path: Path): void
replaceState(state: LocationState, path: Path): void
push(path: Path): void
replace(path: Path): void
push(path: LocationDescriptor): void
replace(path: LocationDescriptor): void
go(n: number): void
goBack(): void
goForward(): void
createKey(): LocationKey
createPath(path: Path): Path
createHref(path: Path): Href
createLocation(path?: Path, state?: LocationState, action?: Action, key?: LocationKey): Location
createPath(path: LocationDescriptor): Path
createHref(path: LocationDescriptor): Href
createLocation(path?: LocationDescriptor, action?: Action, key?: LocationKey): Location
/** @deprecated use a location descriptor instead */
createLocation(path?: Path, state?: LocationState, action?: Action, key?: LocationKey): Location
/** @deprecated use location.key to save state instead */
pushState(state: LocationState, path: Path): void
/** @deprecated use location.key to save state instead */
replaceState(state: LocationState, path: Path): void
/** @deprecated use location.key to save state instead */
setState(state: LocationState): void
/** @deprecated use listenBefore instead */
@@ -40,19 +44,42 @@ declare namespace HistoryModule {
unregisterTransitionHook(hook: TransitionHook): void
}
type HistoryOptions = Object
type HistoryOptions = {
getCurrentLocation?: () => Location
finishTransition?: (nextLocation: Location) => boolean
saveState?: (key: LocationKey, state: LocationState) => void
go?: (n: number) => void
getUserConfirmation?: (message: string, callback: (result: boolean) => void) => void
keyLength?: number
queryKey?: string | boolean
stringifyQuery?: (obj: any) => string
parseQueryString?: (str: string) => any
basename?: string
entries?: string | [any]
current?: number
}
type Href = string
type Location = {
pathname: Pathname
search: QueryString
search: Search
query: Query
state: LocationState
action: Action
key: LocationKey
basename?: string
}
type LocationDescriptorObject = {
pathname?: Pathname
search?: Search
query?: Query
state?: LocationState
}
type LocationDescriptor = LocationDescriptorObject | Path
type LocationKey = string
type LocationListener = (location: Location) => void
@@ -67,11 +94,13 @@ declare namespace HistoryModule {
type QueryString = string
type TransitionHook = (location: Location, callback: Function) => any
type Search = string
type TransitionHook = (location: Location, callback: (result: any) => void) => any
interface HistoryBeforeUnload {
listenBeforeUnload(hook: BeforeUnloadHook): Function
listenBeforeUnload(hook: BeforeUnloadHook): () => void
}
interface HistoryQueries {
@@ -168,6 +197,18 @@ declare module "history/lib/actions" {
}
declare module "history/lib/DOMUtils" {
export function addEventListener(node: EventTarget, event: string, listener: EventListenerOrEventListenerObject): void;
export function removeEventListener(node: EventTarget, event: string, listener: EventListenerOrEventListenerObject): void;
export function getHashPath(): string;
export function replaceHashPath(path: string): void;
export function getWindowPath(): string;
export function go(n: number): void;
export function getUserConfirmation(message: string, callback: (result: boolean) => void): void;
export function supportsHistory(): boolean;
export function supportsGoWithoutReloadUsingHash(): boolean;
}
declare module "history" {
+19
View File
@@ -10,8 +10,27 @@ import * as ReactDOM from "react-dom"
import { browserHistory, hashHistory, Router, Route, IndexRoute, Link } from "react-router"
interface MasterContext {
router: ReactRouter.RouterOnContext;
}
class Master extends React.Component<React.Props<{}>, {}> {
static contextTypes: React.ValidationMap<any> = {
router: React.PropTypes.object
};
context: MasterContext;
navigate() {
var router = this.context.router;
router.push("/users");
router.push({
pathname: "/users/12",
query: { modal: true },
state: { fromDashboard: true }
});
}
render() {
return <div>
<h1>Master</h1>
+8 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for react-router v2.0.0-rc5
// Type definitions for react-router v2.0.0
// Project: https://github.com/rackt/react-router
// Definitions by: Sergey Buturlakin <http://github.com/sergey-buturlakin>, Yuichi Murata <https://github.com/mrk21>, Václav Ostrožlík <https://github.com/vasek17>
// Definitions by: Sergey Buturlakin <https://github.com/sergey-buturlakin>, Yuichi Murata <https://github.com/mrk21>, Václav Ostrožlík <https://github.com/vasek17>, Nathan Brown <https://github.com/ngbrown>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -195,6 +195,10 @@ declare namespace ReactRouter {
interface IndexRedirectElement extends React.ReactElement<IndexRedirectProps> {}
const IndexRedirect: IndexRedirect
interface RouterOnContext extends H.History {
setRouteLeaveHook(route: PlainRoute, hook?: RouteHook): () => void;
isActive(pathOrLoc: H.LocationDescriptor, indexOnly?: boolean): boolean;
}
/* mixins */
@@ -220,6 +224,7 @@ declare namespace ReactRouter {
listenBeforeLeavingRoute(route: PlainRoute, hook: RouteHook): void
match(location: H.Location, callback: (error: any, nextState: RouterState, nextLocation: H.Location) => void): void
isActive(pathname: H.Pathname, query?: H.Query, indexOnly?: boolean): boolean
setRouteLeaveHook(route: PlainRoute, callback: RouteHook): void
}
function useRoutes<T>(createHistory: HistoryModule.CreateHistory<T>): HistoryModule.CreateHistory<T & HistoryRoutes>
@@ -447,6 +452,7 @@ declare module "react-router" {
export type RouterListener = ReactRouter.RouterListener
export type RouterState = ReactRouter.RouterState
export type HistoryBase = ReactRouter.HistoryBase
export type RouterOnContext = ReactRouter.RouterOnContext
export {
Router,
+4 -10
View File
@@ -130,19 +130,13 @@ declare namespace __React {
root: Component<any, any>,
tagName: string): Element;
export function scryRenderedComponentsWithType<P>(
export function scryRenderedComponentsWithType<T extends Component<{}, {}>>(
root: Component<any, any>,
type: ComponentClass<P>): Component<P, {}>[];
export function scryRenderedComponentsWithType<C extends Component<any, any>>(
root: Component<any, any>,
type: ComponentClass<any>): C[];
type: { new(): T }): T[];
export function findRenderedComponentWithType<P>(
export function findRenderedComponentWithType<T extends Component<{}, {}>>(
root: Component<any, any>,
type: ComponentClass<P>): Component<P, {}>;
export function findRenderedComponentWithType<C extends Component<any, any>>(
root: Component<any, any>,
type: ComponentClass<any>): C;
type: { new(): T }): T;
export function createRenderer(): ShallowRenderer;
}
+12 -3
View File
@@ -187,13 +187,17 @@ var domElement: React.ReactHTMLElement =
// React.cloneElement
var clonedElement: React.ReactElement<Props> =
React.cloneElement(element, props);
React.cloneElement(element, { foo: 43 });
var clonedStatelessElement: React.ReactElement<SCProps> =
React.cloneElement(statelessElement, props);
// known problem: cloning with optional props don't work properly
// workaround: cast to actual props type
React.cloneElement(statelessElement, <SCProps>{ foo: 44 });
var clonedClassicElement: React.ClassicElement<Props> =
React.cloneElement(classicElement, props);
var clonedDOMElement: React.ReactHTMLElement =
React.cloneElement(domElement);
React.cloneElement(domElement, {
className: "clonedElement"
});
// React.render
var component: React.Component<Props, any> =
@@ -537,6 +541,11 @@ renderer.render(React.createElement(Timer));
var output: React.ReactElement<React.Props<Timer>> =
renderer.getRenderOutput();
var foundComponent: ModernComponent = TestUtils.findRenderedComponentWithType(
inst, ModernComponent);
var foundComponents: ModernComponent[] = TestUtils.scryRenderedComponentsWithType(
inst, ModernComponent);
//
// TransitionGroup addon
// --------------------------------------------------------------------------
+166 -45
View File
@@ -10,30 +10,32 @@ declare namespace __React {
// ----------------------------------------------------------------------
type ReactType = string | ComponentClass<any> | StatelessComponent<any>;
type Key = string | number;
type Ref<T> = string | ((instance: T) => any);
interface ReactElement<P extends Props<any>> {
type: string | ComponentClass<P> | StatelessComponent<P>;
props: P;
key: string | number;
ref: string | ((component: Component<P, any> | Element) => any);
key: Key;
ref: Ref<Component<P, any> | Element>;
}
interface ClassicElement<P> extends ReactElement<P> {
type: ClassicComponentClass<P>;
ref: string | ((component: ClassicComponent<P, any>) => any);
ref: Ref<ClassicComponent<P, any>>;
}
interface DOMElement<P extends Props<Element>> extends ReactElement<P> {
type: string;
ref: string | ((element: Element) => any);
ref: Ref<Element>;
}
interface ReactHTMLElement extends DOMElement<HTMLProps<HTMLElement>> {
ref: string | ((element: HTMLElement) => any);
ref: Ref<HTMLElement>;
}
interface ReactSVGElement extends DOMElement<SVGProps> {
ref: string | ((element: SVGElement) => any);
ref: Ref<SVGElement>;
}
//
@@ -90,17 +92,21 @@ declare namespace __React {
props?: P,
...children: ReactNode[]): ReactElement<P>;
function cloneElement<P>(
element: DOMElement<P>,
props?: P,
...children: ReactNode[]): DOMElement<P>;
function cloneElement<P>(
function cloneElement(
element: ReactHTMLElement,
props?: HTMLProps<HTMLElement>,
...children: ReactNode[]): ReactHTMLElement;
function cloneElement(
element: ReactSVGElement,
props?: SVGProps,
...children: ReactNode[]): ReactSVGElement;
function cloneElement<P extends Q, Q>(
element: ClassicElement<P>,
props?: P,
props?: Q,
...children: ReactNode[]): ClassicElement<P>;
function cloneElement<P>(
function cloneElement<P extends Q, Q>(
element: ReactElement<P>,
props?: P,
props?: Q,
...children: ReactNode[]): ReactElement<P>;
function isValidElement(object: {}): boolean;
@@ -321,8 +327,8 @@ declare namespace __React {
interface Props<T> {
children?: ReactNode;
key?: string | number;
ref?: string | ((component: T) => any);
key?: Key;
ref?: Ref<T>;
}
interface HTMLProps<T> extends HTMLAttributes, Props<T> {
@@ -427,31 +433,7 @@ declare namespace __React {
// This interface is not complete. Only properties accepting
// unitless numbers are listed here (see CSSProperty.js in React)
interface CSSProperties {
boxFlex?: number;
boxFlexGroup?: number;
columnCount?: number;
flex?: number | string;
flexGrow?: number;
flexShrink?: number;
fontWeight?: number | string;
lineClamp?: number;
lineHeight?: number | string;
opacity?: number;
order?: number;
orphans?: number;
widows?: number;
zIndex?: number;
zoom?: number;
fontSize?: number | string;
// SVG-related properties
fillOpacity?: number;
strokeOpacity?: number;
strokeWidth?: number;
// Remaining properties auto-extracted from http://docs.webplatform.org.
// License: http://docs.webplatform.org/wiki/Template:CC-by-3.0
/**
* Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis.
*/
@@ -509,12 +491,30 @@ declare namespace __React {
*/
backfaceVisibility?: any;
/**
* Shorthand property to set the values for one or more of:
* background-clip, background-color, background-image,
* background-origin, background-position, background-repeat,
* background-size, and background-attachment.
*/
background?: any;
/**
* If a background-image is specified, this property determines
* whether that image's position is fixed within the viewport,
* or scrolls along with its containing block.
*/
backgroundAttachment?: "scroll" | "fixed" | "local";
/**
* This property describes how the element's background images should blend with each other and the element's background color.
* The value is a list of blend modes that corresponds to each background image. Each element in the list will apply to the corresponding element of background-image. If a property doesnt have enough comma-separated values to match the number of layers, the UA must calculate its used value by repeating the list of values until there are enough.
*/
backgroundBlendMode?: any;
/**
* Sets the background color of an element.
*/
backgroundColor?: any;
backgroundComposite?: any;
@@ -530,9 +530,9 @@ declare namespace __React {
backgroundOrigin?: any;
/**
* Sets the horizontal position of a background image.
* Sets the position of a background image.
*/
backgroundPositionX?: any;
backgroundPosition?: any;
/**
* Background-repeat defines if and how background images will be repeated after they have been sized and positioned
@@ -554,6 +554,17 @@ declare namespace __React {
*/
border?: any;
/**
* Shorthand that sets the values of border-bottom-color,
* border-bottom-style, and border-bottom-width.
*/
borderBottom?: any;
/**
* Sets the color of the bottom border of an element.
*/
borderBottomColor?: any;
/**
* Defines the shape of the border of the bottom-left corner.
*/
@@ -564,6 +575,11 @@ declare namespace __React {
*/
borderBottomRightRadius?: any;
/**
* Sets the line style of the bottom border of a box.
*/
borderBottomStyle?: any;
/**
* Sets the width of an element's bottom border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width.
*/
@@ -724,6 +740,16 @@ declare namespace __React {
*/
boxOrdinalGroup?: any;
/**
* Deprecated.
*/
boxFlex?: number;
/**
* Deprecated.
*/
boxFlexGroup?: number;
/**
* The CSS break-after property allows you to force a break on multi-column layouts. More specifically, it allows you to force a break after an element. It allows you to determine if a break should occur, and what type of break it should be. The break-after CSS property describes how the page, column or region break behaves after the generated box. If there is no generated box, the property is ignored.
*/
@@ -760,6 +786,11 @@ declare namespace __React {
*/
color?: any;
/**
* Describes the number of columns of the element.
*/
columnCount?: number;
/**
* Specifies how to fill columns (balanced or sequential).
*/
@@ -820,6 +851,11 @@ declare namespace __React {
*/
cueAfter?: any;
/**
* Specifies the mouse cursor displayed when the mouse pointer is over an element.
*/
cursor?: any;
/**
* The direction CSS property specifies the text direction/writing direction. The rtl is used for Hebrew or Arabic text, the ltr is for other languages.
*/
@@ -835,6 +871,11 @@ declare namespace __React {
*/
fill?: any;
/**
* SVG: Specifies the opacity of the color or the content the current object is filled with.
*/
fillOpacity?: number;
/**
* The fill-rule property indicates the algorithm which is to be used to determine what parts of the canvas are included inside the shape. For a simple, non-intersecting path, it is intuitively clear what region lies "inside"; however, for a more complex path, such as a path that intersects itself or where one subpath encloses another, the interpretation of "inside" is not so obvious.
* The fill-rule property provides two options for how the inside of a shape is determined:
@@ -846,6 +887,11 @@ declare namespace __React {
*/
filter?: any;
/**
* Shorthand for `flex-grow`, `flex-shrink`, and `flex-basis`.
*/
flex?: number | string;
/**
* Obsolete, do not use. This property has been renamed to align-items.
* Specifies the alignment (perpendicular to the layout axis defined by the flex-direction property) of child elements of the object.
@@ -867,6 +913,11 @@ declare namespace __React {
*/
flexFlow?: any;
/**
* Specifies the flex grow factor of a flex item.
*/
flexGrow?: number;
/**
* Do not use. This property has been renamed to align-self
* Specifies the alignment (perpendicular to the layout axis defined by flex-direction) of child elements of the object.
@@ -884,6 +935,11 @@ declare namespace __React {
*/
flexOrder?: any;
/**
* Specifies the flex shrink factor of a flex item.
*/
flexShrink?: number;
/**
* Elements which have the style float are floated horizontally. These elements can move as far to the left or right of the containing element. All elements after the floating element will flow around it, but elements before the floating element are not impacted. If several floating elements are placed after each other, they will float next to each other as long as there is room.
*/
@@ -909,6 +965,11 @@ declare namespace __React {
*/
fontKerning?: any;
/**
* Specifies the size of the font. Used to compute em and ex units.
*/
fontSize?: number | string;
/**
* The font-size-adjust property adjusts the font-size of the fallback fonts defined with font-family, so that the x-height is the same no matter what font is used. This preserves the readability of the text when fallback happens.
*/
@@ -939,6 +1000,11 @@ declare namespace __React {
*/
fontVariantAlternates?: any;
/**
* Specifies the weight or boldness of the font.
*/
fontWeight?: "normal" | "bold" | "lighter" | "bolder" | number;
/**
* Lays out one or more grid items bound by 4 grid lines. Shorthand for setting grid-column-start, grid-column-end, grid-row-start, and grid-row-end in a single declaration.
*/
@@ -1044,6 +1110,13 @@ declare namespace __React {
*/
lineBreak?: any;
lineClamp?: number;
/**
* Specifies the height of an inline block level element.
*/
lineHeight?: number | string;
/**
* Shorthand property that sets the list-style-type, list-style-position and list-style-image properties in one declaration.
*/
@@ -1164,6 +1237,23 @@ declare namespace __React {
*/
minWidth?: any;
/**
* Specifies the transparency of an element.
*/
opacity?: number;
/**
* Specifies the order used to lay out flex items in their flex container.
* Elements are laid out in the ascending order of the order value.
*/
order?: number;
/**
* In paged media, this property defines the minimum number of lines in
* a block container that must be left at the bottom of the page.
*/
orphans?: number;
/**
* The CSS outline property is a shorthand property for setting one or more of the individual outline properties outline-style, outline-width and outline-color in a single rule. In most cases the use of this shortcut is preferable and more convenient.
* Outlines differ from borders in the following ways: • Outlines do not take up space, they are drawn above the content.
@@ -1192,10 +1282,15 @@ declare namespace __React {
overflowStyle?: any;
/**
* The overflow-x property is a specific case of the generic overflow property. It controls how extra content exceeding the x-axis of the bounding box of an element is rendered.
* Controls how extra content exceeding the x-axis of the bounding box of an element is rendered.
*/
overflowX?: any;
/**
* Controls how extra content exceeding the y-axis of the bounding box of an element is rendered.
*/
overflowY?: any;
/**
* The padding optional CSS property sets the required padding space on one to four sides of an element. The padding area is the space between an element and its border. Negative values are not allowed but decimal values are permitted. The element size is treated as fixed, and the content of the element shifts toward the center as padding is increased.
* The padding property is a shorthand to avoid setting each side separately (padding-top, padding-right, padding-bottom, padding-left).
@@ -1341,6 +1436,16 @@ declare namespace __React {
*/
speakAs?: any;
/**
* SVG: Specifies the opacity of the outline on the current object.
*/
strokeOpacity?: number;
/**
* SVG: Specifies the width of the outline on the current object.
*/
strokeWidth?: number;
/**
* The tab-size CSS property is used to customise the width of a tab (U+0009) character.
*/
@@ -1649,6 +1754,12 @@ declare namespace __React {
*/
whiteSpaceTreatment?: any;
/**
* In paged media, this property defines the mimimum number of lines
* that must be left at the top of the second page.
*/
widows?: number;
/**
* Specifies the width of the content area of an element. The content area of the element width does not include the padding, border, and margin of the element.
*/
@@ -1690,6 +1801,16 @@ declare namespace __React {
*/
writingMode?: any;
/**
* The z-index property specifies the z-order of an element and its descendants.
* When elements overlap, z-order determines which one covers the other.
*/
zIndex?: "auto" | number;
/**
* Sets the initial zoom factor of a document defined by @viewport.
*/
zoom?: "auto" | number;
[propertyName: string]: any;
}
@@ -2136,11 +2257,11 @@ declare namespace JSX {
interface ElementAttributesProperty { props: {}; }
interface IntrinsicAttributes {
key?: string | number;
key?: React.Key;
}
interface IntrinsicClassAttributes<T> {
ref?: string | ((classInstance: T) => void);
ref?: React.Ref<T>;
}
interface IntrinsicElements {
+12
View File
@@ -364,6 +364,12 @@ declare module "redis" {
script(key: string, callback?: ResCallbackT<any>): boolean;
quit(args:any[], callback?:ResCallbackT<any>): boolean;
quit(...args:any[]): boolean;
scan(...args:any[]): boolean;
scan(args:any[], callback?:ResCallbackT<any>): boolean;
hscan(...args:any[]): boolean;
hscan(args:any[], callback?:ResCallbackT<any>): boolean;
zscan(...args:any[]): boolean;
zscan(args:any[], callback?:ResCallbackT<any>): boolean;
}
export interface Multi {
@@ -626,5 +632,11 @@ declare module "redis" {
evalsha(...args:any[]): Multi;
quit(args:any[], callback?:ResCallbackT<any>): Multi;
quit(...args:any[]): Multi;
scan(...args:any[]): Multi;
scan(args:any[], callback?:ResCallbackT<any>): Multi;
hscan(...args:any[]): Multi;
hscan(args:any[], callback?:ResCallbackT<any>): Multi;
zscan(...args:any[]): Multi;
zscan(args:any[], callback?:ResCallbackT<any>): Multi;
}
}
@@ -0,0 +1,6 @@
/// <reference path="./redux-immutable-state-invariant.d.ts" />
import { applyMiddleware } from "redux";
import * as immutableStateInvariantMiddleware from "redux-immutable-state-invariant";
applyMiddleware(immutableStateInvariantMiddleware());
+13
View File
@@ -0,0 +1,13 @@
// Type definitions for react-router-redux v1.2.0
// Project: https://github.com/leoasis/redux-immutable-state-invariant
// Definitions by: Remo H. Jansen <https://github.com/remojansen>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../redux/redux.d.ts" />
declare module "redux-immutable-state-invariant" {
type isImmutableDefault = (value: any) => boolean;
type immutableStateInvariantMiddlewareInterface = (isImmutable?: isImmutableDefault) => Redux.Middleware;
let immutableStateInvariantMiddleware: immutableStateInvariantMiddlewareInterface;
export = immutableStateInvariantMiddleware;
}
+82 -9
View File
@@ -1,21 +1,94 @@
/// <reference path="./redux-logger.d.ts" />
import createLogger from 'redux-logger';
import * as createLogger from 'redux-logger';
import { applyMiddleware, createStore } from 'redux'
let logger = createLogger();
let loggerWithOpts = createLogger({
actionTransformer: actn => actn,
collapsed: true,
let loggerSimpleOpts = createLogger({
duration: true,
level: 'error',
logger: console,
predicate: (getState, action) => true,
timestamp: true,
stateTransformer: state => state
logger: console,
logErrors: true,
predicate: (getState, action) => true,
stateTransformer: (state) => state,
actionTransformer: (action) => action,
errorTransformer: (error) => error
});
let loggerCollapsedBool = createLogger({
collapsed: true
});
let loggerCollapsedPredicate = createLogger({
collapsed: (getAction, action) => true
});
let loggerColorsBoolean = createLogger({
colors: {
title: false,
prevState: false,
action: false,
nextState: false,
error: false
}
});
let loggerColorsFunction = createLogger({
colors: {
title: (action) => '#000',
prevState: (state) => '#000',
action: (action) => '#000',
nextState: (state) => '#000',
error: (error, prevState) => '#000'
}
});
let loggerLevelString = createLogger({
level: 'log'
});
let loggerLevelFunction = createLogger({
level: (action) => 'log'
});
let loggerLevelObjectFunction = createLogger({
level: {
prevState: (state) => 'log',
action: (action) => 'log',
nextState: (state) => 'log',
error: (error, prevState) => 'log'
}
});
let loggerLevelObjectBoolean = createLogger({
level: {
prevState: false,
action: false,
nextState: false,
error: false
}
});
let loggerLevelObjectString = createLogger({
level: {
prevState: 'log',
action: 'log',
nextState: 'log',
error: 'log'
}
});
let createStoreWithMiddleware = applyMiddleware(
logger, loggerWithOpts
logger,
loggerSimpleOpts,
loggerCollapsedBool,
loggerCollapsedPredicate,
loggerColorsBoolean,
loggerColorsFunction,
loggerLevelString,
loggerLevelFunction,
loggerLevelObjectFunction,
loggerLevelObjectBoolean,
loggerLevelObjectString
)(createStore);
+39 -11
View File
@@ -1,4 +1,4 @@
// Type definitions for redux-logger v2.0.0
// Type definitions for redux-logger v2.6.0
// Project: https://github.com/fcomb/redux-logger
// Definitions by: Alexander Rusakov <https://github.com/arusakov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -7,16 +7,44 @@
declare module 'redux-logger' {
interface ReduxLoggerOptions {
actionTransformer?: (action: any) => any;
collapsed?: boolean;
duration?: boolean;
level?: string;
logger?: any;
predicate?: (getState: Function, action: any) => boolean;
timestamp?: boolean;
stateTransformer?: (state: any) => any;
type LoggerPredicate = (getState: () => any, action: any) => boolean;
type StateToString = (state: any) => string;
type ActionToString = (action: any) => string;
type ErrorToString = (error: any, prevState: any) => string;
interface ColorsObject {
title?: boolean | ActionToString;
prevState?: boolean | StateToString;
action?: boolean | ActionToString;
nextState?: boolean | StateToString;
error?: boolean | ErrorToString;
}
export default function createLogger(options?: ReduxLoggerOptions): Redux.Middleware;
interface LevelObject {
prevState?: string | boolean | StateToString;
action?: string | boolean | ActionToString;
nextState?: string | boolean | StateToString;
error?: string | boolean | ErrorToString;
}
interface ReduxLoggerOptions {
level?: string | ActionToString | LevelObject;
duration?: boolean;
timestamp?: boolean;
colors?: ColorsObject;
logger?: any;
logErrors?: boolean;
collapsed?: boolean | LoggerPredicate;
predicate?: LoggerPredicate;
stateTransformer?: (state: any) => any;
actionTransformer?: (action: any) => any;
errorTransformer?: (error: any) => any;
}
// Trickery to get TypeScript to accept that our anonymous, non-default export is a function.
// see https://github.com/Microsoft/TypeScript/issues/3612 for more
namespace createLogger {}
function createLogger(options?: ReduxLoggerOptions): Redux.Middleware;
export = createLogger;
}
+5
View File
@@ -4,6 +4,7 @@ var obj:Object;
var bool:boolean;
var num:number;
var str:string;
var diff:string;
var x:any = null;
var arr:any[];
var exp:RegExp;
@@ -21,6 +22,9 @@ str = mod.valid(str);
str = mod.valid(str, loose);
str = mod.inc(str, str, loose);
num = mod.major(str, loose);
num = mod.minor(str, loose);
num = mod.patch(str, loose);
// Comparison
bool = mod.gt(v1, v2, loose);
@@ -32,6 +36,7 @@ bool = mod.neq(v1, v2, loose);
bool = mod.cmp(v1, x, v2, loose);
num = mod.compare(v1, v2, loose);
num = mod.rcompare(v1, v2, loose);
diff = mod.diff(v1, v2, loose);
// Ranges
str = mod.validRange(str, loose);
+21 -3
View File
@@ -1,7 +1,9 @@
// Type definitions for semver v2.2.1
// Project: https://github.com/isaacs/node-semver
// Type definitions for semver v4.3.4
// Project: https://github.com/npm/node-semver
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/semver
declare var semver: SemVerModule.SemVer;
declare module SemVerModule {
/**
@@ -12,6 +14,18 @@ declare module SemVerModule {
* Return the version incremented by the release type (major, minor, patch, or prerelease), or null if it's not valid.
*/
function inc(v: string, release: string, loose?: boolean): string;
/**
* Return the major version number.
*/
function major(v: string, loose?: boolean): number;
/**
* Return the minor version number.
*/
function minor(v: string, loose?: boolean): number;
/**
* Return the patch version number.
*/
function patch(v: string, loose?: boolean): number;
// Comparison
/**
@@ -50,6 +64,10 @@ declare module SemVerModule {
* The reverse of compare. Sorts an array of versions in descending order when passed to Array.sort().
*/
function rcompare(v1: string, v2: string, loose?: boolean): number;
/**
* Returns difference between two versions by the release type (major, premajor, minor, preminor, patch, prepatch, or prerelease), or null if the versions are the same.
*/
function diff(v1: string, v2: string, loose?: boolean): string;
// Ranges
/**
+12 -1
View File
@@ -113,8 +113,19 @@ function test_hubs() {
proxy.on('addMessage', function (msg?) {
console.log(msg);
});
//a listener may have more than 1 parameter, and you should be able to subscribe and unsubscribe
function listenerWithMoreParams(id: number, anything: string){
console.log('listenerWithMoreParams -> ', arguments);
};
//subscribe
proxy.on('listenerWithMoreParams', listenerWithMoreParams);
var connection = $.hubConnection('http://localhost:8081/');
connection.start({ jsonp: true });
//unsubscribe
proxy.off('listenerWithMoreParams', listenerWithMoreParams);
}
// Sample from : https://github.com/SignalR/SignalR/wiki/QuickStart-Hubs#javascript--html
@@ -134,4 +145,4 @@ $(function () {
chat.server.send($('#msg').val());
});
});
});
});
+1 -1
View File
@@ -77,7 +77,7 @@ interface HubProxy {
init(connection: HubConnection, hubName: string): void;
hasSubscriptions(): boolean;
on(eventName: string, callback: (...msg: any[]) => void ): HubProxy;
off(eventName: string, callback: (msg: any) => void ): HubProxy;
off(eventName: string, callback: (...msg: any[]) => void ): HubProxy;
invoke(methodName: string, ...args: any[]): JQueryDeferred<any>;
}
+3
View File
@@ -41,6 +41,9 @@ columnDef.filter = {
selectOptions: [{value: 4, label: 'test'}],
disableCancelButton: false
};
columnDef.filter.condition = (searchTerm: string, cellValue: any, row: uiGrid.IGridRow, column: uiGrid.IGridColumn): boolean => {
return true;
};
columnDef.filterCellFiltered = false;
columnDef.filterHeaderTemplate = '<div blah="test"></div>';
columnDef.filters = [columnDef.filter];
+1 -1
View File
@@ -3844,7 +3844,7 @@ declare module uiGrid {
* or you can supply a custom filter function that gets passed the
* following arguments: [searchTerm, cellValue, row, column].
*/
condition?: number;
condition?: number | ((searchTerm: string, cellValue: any, row: IGridRow, column: IGridColumn) => boolean);
/**
* If set, the filter field will be pre-populated with this value
*/
+22 -19
View File
@@ -8,32 +8,35 @@ declare class Request extends Body {
method: string;
url: string;
headers: Headers;
context: string|RequestContext;
context: RequestContext;
referrer: string;
mode: string|RequestMode;
credentials: string|RequestCredentials;
cache: string|RequestCache;
mode: RequestMode;
credentials: RequestCredentials;
cache: RequestCache;
}
interface RequestInit {
method?: string;
headers?: HeaderInit|{ [index: string]: string };
body?: BodyInit;
mode?: string|RequestMode;
credentials?: string|RequestCredentials;
cache?: string|RequestCache;
mode?: RequestMode;
credentials?: RequestCredentials;
cache?: RequestCache;
}
declare enum RequestContext {
"audio", "beacon", "cspreport", "download", "embed", "eventsource", "favicon", "fetch",
"font", "form", "frame", "hyperlink", "iframe", "image", "imageset", "import",
"internal", "location", "manifest", "object", "ping", "plugin", "prefetch", "script",
"serviceworker", "sharedworker", "subresource", "style", "track", "video", "worker",
"xmlhttprequest", "xslt"
}
declare enum RequestMode { "same-origin", "no-cors", "cors" }
declare enum RequestCredentials { "omit", "same-origin", "include" }
declare enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" }
type RequestContext =
"audio" | "beacon" | "cspreport" | "download" | "embed" |
"eventsource" | "favicon" | "fetch" | "font" | "form" | "frame" |
"hyperlink" | "iframe" | "image" | "imageset" | "import" |
"internal" | "location" | "manifest" | "object" | "ping" | "plugin" |
"prefetch" | "script" | "serviceworker" | "sharedworker" |
"subresource" | "style" | "track" | "video" | "worker" |
"xmlhttprequest" | "xslt";
type RequestMode = "same-origin" | "no-cors" | "cors";
type RequestCredentials = "omit" | "same-origin" | "include";
type RequestCache =
"default" | "no-store" | "reload" | "no-cache" |
"force-cache" | "only-if-cached";
declare class Headers {
append(name: string, value: string): void;
@@ -58,7 +61,7 @@ declare class Response extends Body {
constructor(body?: BodyInit, init?: ResponseInit);
error(): Response;
redirect(url: string, status: number): Response;
type: string|ResponseType;
type: ResponseType;
url: string;
status: number;
ok: boolean;
@@ -67,7 +70,7 @@ declare class Response extends Body {
clone(): Response;
}
declare enum ResponseType { "basic", "cors", "default", "error", "opaque" }
type ResponseType = "basic" | "cors" | "default" | "error" | "opaque";
interface ResponseInit {
status: number;
+26 -46
View File
@@ -49,7 +49,7 @@ declare module "winston" {
export function addRewriter(rewriter: MetadataRewriter): void;
export interface MetadataRewriter {
(level: string, msg: string, meta: any): any;
(level: string, msg: string, meta: any): any;
}
export interface LoggerStatic {
@@ -182,27 +182,35 @@ declare module "winston" {
humanReadableUnhandledException?: boolean;
}
export interface ConsoleTransportOptions extends TransportOptions {
export interface GenericTextTransportOptions {
json?: boolean;
colorize?: boolean;
colors?: any;
prettyPrint?: boolean;
timestamp?: (Function|boolean);
showLevel?: boolean;
label?: string;
logstash?: boolean;
debugStdout?: boolean;
depth?: number;
stringify?: Function;
}
export interface DailyRotateFileTransportOptions extends TransportOptions {
json?: boolean;
colorize?: boolean;
prettyPrint?: boolean;
timestamp?: (Function|boolean);
showLevel?: boolean;
label?: string;
export interface GenericNetworkTransportOptions {
host?: string;
port?: number;
auth?: {
username: string;
password: string;
};
path?: string;
}
export interface ConsoleTransportOptions extends TransportOptions, GenericTextTransportOptions {
logstash?: boolean;
debugStdout?: boolean;
}
export interface DailyRotateFileTransportOptions extends TransportOptions, GenericTextTransportOptions {
logstash?: boolean;
depth?: number;
maxsize?: number;
maxFiles?: number;
eol?: string;
@@ -213,19 +221,12 @@ declare module "winston" {
options?: {
flags?: string;
highWaterMark?: number;
}
};
stream?: NodeJS.WritableStream;
}
export interface FileTransportOptions extends TransportOptions {
json?: boolean;
colorize?: boolean;
prettyPrint?: boolean;
timestamp?: (Function|boolean);
showLevel?: boolean;
label?: string;
export interface FileTransportOptions extends TransportOptions, GenericTextTransportOptions {
logstash?: boolean;
depth?: number;
maxsize?: number;
rotationFormat?: boolean;
zippedArchive?: boolean;
@@ -238,40 +239,19 @@ declare module "winston" {
options?: {
flags?: string;
highWaterMark?: number;
}
};
stream?: NodeJS.WritableStream;
}
export interface HttpTransportOptions extends TransportOptions {
export interface HttpTransportOptions extends TransportOptions, GenericNetworkTransportOptions {
ssl?: boolean;
host?: string;
port?: number;
auth?: {
username: string;
password: string;
};
path?: string;
}
export interface MemoryTransportOptions extends TransportOptions {
json?: boolean;
colorize?: boolean;
prettyPrint?: boolean;
timestamp?: (Function|boolean);
showLevel?: boolean;
label?: string;
depth?: number;
export interface MemoryTransportOptions extends TransportOptions, GenericTextTransportOptions {
}
export interface WebhookTransportOptions extends TransportOptions {
host?: string;
port?: number;
export interface WebhookTransportOptions extends TransportOptions, GenericNetworkTransportOptions {
method?: string;
path?: string;
auth?: {
username?: string;
password?: string;
};
ssl?: {
key?: any;
cert?: any;