Merge remote-tracking branch 'refs/remotes/DefinitelyTyped/master'

This commit is contained in:
Levi Baker
2016-02-03 17:06:32 -08:00
163 changed files with 12247 additions and 2695 deletions
-1
View File
@@ -1464,7 +1464,6 @@ declare module ag.grid {
addDropTarget(eDropTarget: any, dropTargetCallback: any): void;
}
}
declare function require(name: string): any;
declare module ag.grid {
class AgList {
private eGui;
+7 -7
View File
@@ -101,13 +101,13 @@ declare module AngularFormly {
type?: string;
//expression types
onBlur?: string;
onChange?: string;
onClick?: string;
onFocus?: string;
onKeydown?: string;
onKeypress?: string;
onKeyup?: string;
onBlur?: string | IExpressionFunction;
onChange?: string | IExpressionFunction;
onClick?: string | IExpressionFunction;
onFocus?: string | IExpressionFunction;
onKeydown?: string | IExpressionFunction;
onKeypress?: string | IExpressionFunction;
onKeyup?: string | IExpressionFunction;
//Bootstrap types
label?: string;
@@ -174,6 +174,7 @@ var user = odataResourceClass.odata()
.skip(10)
.take(20)
.orderBy("Name", "desc")
.transformUrl((s)=>s)
.single();
user.$save();
+1
View File
@@ -281,6 +281,7 @@ declare module OData {
constructor(callback: ProviderCallback<T>);
filter(operand1: any, operand2?: any, operand3?: any): Provider<T>;
orderBy(arg1: string, arg2?: string): Provider<T>;
transformUrl(transformMethod : (url:string)=>string): Provider<T>;
take(amount: number): Provider<T>;
skip(amount: number): Provider<T>;
private execute();
+11 -1
View File
@@ -406,9 +406,19 @@ function TestElementArrayFinder() {
elementArrayFinder.each(function(element: protractor.ElementFinder){
// nothing
});
stringPromise = elementArrayFinder.map(function(element: protractor.ElementFinder, index: number){
return 'abc';
})
});
stringPromise = elementArrayFinder.map<string>(function(element: protractor.ElementFinder, index: number): string {
return 'abc';
});
stringPromise = elementArrayFinder.map<string, webdriver.promise.Promise<string>>(function(element: protractor.ElementFinder, index: number): webdriver.promise.Promise<string> {
return element.getText();
});
elementArrayFinder = elementArrayFinder.filter(function(element: protractor.ElementFinder, index: number){
return element.getText().then((text: string) => {
return text === "foo";
+1
View File
@@ -992,6 +992,7 @@ declare module protractor {
* of values returned by the map function.
*/
map<T>(mapFn: (element: ElementFinder, index: number) => T): webdriver.promise.Promise<T[]>;
map<T, T2>(mapFn: (element: ElementFinder, index: number) => T2): webdriver.promise.Promise<T[]>;
/**
* Apply a filter function to each element within the ElementArrayFinder. Returns
+104
View File
@@ -0,0 +1,104 @@
/// <reference path="asana.d.ts" />
/// <reference path="../request/request.d.ts" />
import * as asana from 'asana';
import * as util from 'util';
let version: string = asana.VERSION;
// https://github.com/Asana/node-asana#usage
// Usage
var client = asana.Client.create().useAccessToken('my_access_token');
client.users.me().then(function(me) {
console.log(me);
});
client = asana.Client.create({
clientId: 123,
clientSecret: 'my_client_secret',
redirectUri: 'my_redirect_uri'
});
client.useOauth({
credentials: 'my_access_token'
});
var credentials = {
// access_token: 'my_access_token',
refresh_token: 'my_refresh_token'
};
client.useOauth({
credentials: credentials
});
// https://github.com/Asana/node-asana#collections
// Collections
let tagId: string = null;
client.tasks.findByTag(tagId, { limit: 5 }).then((collection: any) => {
console.log(collection.data);
// [ .. array of up to 5 task objects .. ]
client.tasks.findByTag(tagId).then((firstPage: any) => {
console.log(firstPage.data);
collection.nextPage().then((secondPage: any) => {
console.log(secondPage.data);
});
});
});
client.tasks.findByTag(tagId).then((collection: any) => {
// Fetch up to 200 tasks, using multiple pages if necessary
collection.fetch(200).then((tasks: any) => {
console.log(tasks);
});
});
client.tasks.findByTag(tagId).then((collection: any) => {
collection.stream().on('data', (task: any) => {
console.log(task);
});
});
// https://github.com/Asana/node-asana#examples
// Examples
var Asana = asana;
// Using the API key for basic authentication. This is reasonable to get
// started with, but Oauth is more secure and provides more features.
var client = Asana.Client.create().useBasicAuth(process.env.ASANA_API_KEY);
client.users.me()
.then((user: any) => {
var userId = user.id;
// The user's "default" workspace is the first one in the list, though
// any user can have multiple workspaces so you can't always assume this
// is the one you want to work with.
var workspaceId = user.workspaces[0].id;
return client.tasks.findAll({
assignee: userId,
workspace: workspaceId,
completed_since: 'now',
opt_fields: 'id,name,assignee_status,completed'
});
})
.then((response: any) => {
// There may be more pages of data, we could stream or return a promise
// to request those here - for now, let's just return the first page
// of items.
return response.data;
})
.filter((task: any) => {
return task.assignee_status === 'today' ||
task.assignee_status === 'new';
})
.then((list: any) => {
console.log(util.inspect(list, {
colors: true,
depth: null
}));
});
+2199
View File
File diff suppressed because it is too large Load Diff
+24
View File
@@ -0,0 +1,24 @@
/// <reference path="auth0-angular.d.ts" />
var authProvider: auth0.angular.IAuth0ServiceProvider;
// Initialize Auth0
authProvider.init({
clientID: 'myClientID',
domain: 'mydomain.auth0.com'
});
// Listen for authenticated event
authProvider.on('authenticated', ($location: any) => {
});
var authService: auth0.angular.IAuth0Service;
// Sign in to Auth0
authService.signin({}, (profile: string, idToken: string, acccessToken: string, state: string, refreshToken: string) => {
}, (err) => {
});
// Sign out of Auth0
authService.signout();
+167
View File
@@ -0,0 +1,167 @@
// Type definitions for auth0-angular
// Project: https://github.com/auth0/auth0-angular
// Definitions by: Matt Emory <https://github.com/homesar>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module auth0.angular {
interface IAuth0ClientOptions {
/**
* Login url if you're using ngRoute
*/
loginUrl?: string;
/**
* Login state if you're using ui-router
*/
loginState?: string;
/**
* Client identifier of your Auth0 application
*/
clientID: string;
/**
* Domain of your Auth0 account
*/
domain: string;
/**
* Use single signon
*/
sso?: boolean;
}
interface ITokenOptions {
targetClientId?: string;
api?: string;
}
interface IAuth0Options {
/**
* Connection name
*/
connection?: string;
/**
* Username
*/
username?: string;
/**
* Email address
*/
email?: string;
}
interface ISuccessCallback {
(profile?: string, idToken?: string, accessToken?: string, state?: string, refreshToken?: string): void;
}
interface IErrorCallback {
(error: any): void;
}
interface IAuth0Service {
/**
* Hooks to internal Angular events so that a user will be redirected to the login page if trying to visit a restricted resource
*/
hookEvents(): void;
/**
* Performs a token delegation request exchanging th ecurrent token for another one.
* @param options Token options
*/
getToken(options?: ITokenOptions): ng.IPromise<any>;
/**
* Refreshes the Id token
* @param refreshToken Refresh token to use when renewing
*/
refreshIdToken(refreshToken: string): ng.IPromise<any>;
/**
* Renews the Id Token with the same scopes as the original token
* @param id_token Id Token
*/
renewIdToken(id_token: string): ng.IPromise<any>;
/**
* Logs in a user, returning tokens and profile information
* @param options Options to bypass displaying the Lock UI
* @param successCallback Callback on successful login
* @param errorCallback Callback on failed login
*/
signin(options?: IAuth0Options, successCallback?: ISuccessCallback, errorCallback?: IErrorCallback): void;
/**
* Displays Lock in signup mode, and logs the user in immediately after a successful signup.
* @param options Options to bypass displaying the Lock UI
* @param successCallback Callback on successful signup
* @param errorCallback Callback on failed signup
*/
signup(options?: IAuth0Options, successCallback?: ISuccessCallback, errorCallback?: IErrorCallback): void;
/**
* Performs the "forgot your password" flow.
* @param options Options to bypass displaying the Lock UI
* @param successCallback Callback on successful reset
* @param errorCallback Callback on failed reset
*/
reset(options?: IAuth0Options, successCallback?: ISuccessCallback, errorCallback?: IErrorCallback): void;
/**
* Validates the user
* @param options Options to bypass displaying the Lock UI
* @param successCallback Callback on successful validation
* @param errorCallback Callback on failed validation
*/
validateUser(options: IAuth0Options, successCallback?: ISuccessCallback, errorCallback?: IErrorCallback): void;
/**
* Logs the user out locally by deleting their token from local storage.
*/
signout(): void;
/**
* Reauthenticates the user by using a stored profile and token without going through the login flow.
* @param profile Profile of the user
* @param idToken Id token
* @param accessToken Access token
* @param state State
* @param refreshToken Flag to indicate refreshing the token
*/
authenticate(profile?: any, idToken?: string, accessToken?: string, state?: any, refreshToken?: boolean): ng.IPromise<any>;
/**
* Gets the user's profile
* @param idToken Id token
*/
getProfile(idToken?: string): ng.IPromise<any>;
// Properties
accessToken: string;
idToken: string;
profile: any;
isAuthenticated: boolean;
config: any;
}
interface IAuth0ServiceProvider {
/**
* Configures the auth service
* @param options Client options passed into Auth0
*/
init(options: IAuth0ClientOptions): void;
/**
* @param event Name of the event to handle.
* @param handler Event handler
*/
on(event: string, handler: (...args: any[]) => any): void;
}
}
+44
View File
@@ -0,0 +1,44 @@
/// <reference path="blazy.d.ts" />
/* Constructor test */
var tester: BlazyInstance = new Blazy({
breakpoints: [
{
width: 420,
src: 'data-src-small'
},
{
width: 768,
src: 'data-src-medium'
}
],
container: '#scrolling-container',
error: function(ele: HTMLElement, msg: string) {
if (msg === 'missing') {
console.log('missing');
}
else if (msg === 'invalid') {
console.log('invalid');
}
},
errorClass: 'b-error',
loadInvisible: false,
offset: 100,
saveViewportOffsetDelay: 50,
selector: '.b-lazy',
separator: '|',
src: 'data-src',
success: function(ele: HTMLElement) {
console.log('success');
},
successClass: 'b-loaded',
validateDelay: 25
});
/* Functions tests */
tester.revalidate();
var elements = <NodeList>document.getElementsByTagName('img');
tester.load(elements, true);
tester.destroy();
+72
View File
@@ -0,0 +1,72 @@
// Type definitions for bLazy v1.5.2
// Project: https://github.com/dinbror/blazy
// Definitions by: Julien Paroche <https://github.com/julienpa>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/blazy
// Definitions based on: http://dinbror.dk/blog/blazy
declare var Blazy: Blazy;
interface Blazy {
new (options: BlazyOptions): BlazyInstance;
}
interface BlazyOptions {
breakpoints?: Breakpoint[];
container?: string;
error?: (ele: Element|HTMLElement, msg: string) => void;
errorClass?: string;
loadInvisible?: boolean;
offset?: number;
saveViewportOffsetDelay?: number;
selector?: string;
separator?: string;
src?: string;
success?: (ele: Element|HTMLElement) => void;
successClass?: string;
validateDelay?: number;
}
interface BlazyInstance {
/**
* Revalidates document for visible images. Useful if you add images with scripting or ajax.
*/
revalidate(): void;
/**
* Forces the given element(s) to load if not collapsed. If you also want to load a collapsed/hidden elements you can add true as the second parameter.
* You can pass a single element or a list of elements. Tested with getElementById, getElementsByClassName, querySelectorAll, querySelector and jQuery selector.
*/
load(elements: Element|Element[]|HTMLElement|HTMLElement[]|NodeList, force: boolean): void;
/**
* Unbind events and resets image array.
*/
destroy(): void;
}
interface Breakpoint {
width: number;
src: string;
}
declare module 'Blazy' {
export = Blazy;
}
+26 -1
View File
@@ -78,6 +78,8 @@ evt.on("init", function () {
browserSync(config);
var has = browserSync.has("My server");
var bs = browserSync.create();
bs.init({
@@ -85,7 +87,7 @@ bs.init({
});
bs.reload();
function browserSyncInit(): browserSync.BrowserSyncInstance {
var browser = browserSync.create();
browser.init();
@@ -95,3 +97,26 @@ function browserSyncInit(): browserSync.BrowserSyncInstance {
}
var browser = browserSyncInit();
browser.exit();
// Stream method.
// -- No options.
browser.stream();
// -- "once" option.
browser.stream({once: true});
// -- "match" option (string).
browser.stream({match: "**/*.js"});
// -- "match" option (RegExp).
browser.stream({match: /\.js$/});
// -- "match" option (function).
browser.stream({match: (testString) => true});
// -- "match" option (array).
browser.stream({match: ["**/*.js", /\.js$/, (testString) => true]});
// -- Both options.
browser.stream({once: true, match: ["**/*.js", /\.js$/, (testString) => true]});
+39 -27
View File
@@ -5,25 +5,27 @@
/// <reference path="../chokidar/chokidar.d.ts"/>
/// <reference path="../node/node.d.ts" />
/// <reference path="../micromatch/micromatch.d.ts" />
declare module "browser-sync" {
import chokidar = require("chokidar");
import fs = require("fs");
import http = require("http");
import mm = require("micromatch");
namespace browserSync {
interface Options {
/**
* Browsersync includes a user-interface that is accessed via a separate port. The UI allows to controls
* Browsersync includes a user-interface that is accessed via a separate port. The UI allows to controls
* all devices, push sync updates and much more.
*
*
* port - Default: 3001
* weinre.port - Default: 8080
* Note: requires at least version 2.0.0
*/
ui?: UIOptions;
/**
* Browsersync can watch your files as you work. Changes you make will either be injected into the page (CSS
* Browsersync can watch your files as you work. Changes you make will either be injected into the page (CSS
* & images) or will cause all browsers to do a full-page refresh. See anymatch for more information on glob
* patterns.
* Default: false
@@ -55,14 +57,14 @@ declare module "browser-sync" {
*/
port?: number;
/**
* Add additional directories from which static files should be served.
* Add additional directories from which static files should be served.
* Should only be used in proxy or snippet mode.
* Default: []
* Note: requires at least version 2.8.0
*/
serveStatic?: string[];
/**
* Enable https for localhost development.
* Enable https for localhost development.
* Note - this is not needed for proxy option as it will be inferred from your target url.
* Note: requires at least version 1.3.0
*/
@@ -102,7 +104,7 @@ declare module "browser-sync" {
*/
logSnippet?: boolean;
/**
* You can control how the snippet is injected onto each page via a custom regex + function.
* You can control how the snippet is injected onto each page via a custom regex + function.
* You can also provide patterns for certain urls that should be ignored from the snippet injection.
* Note: requires at least version 2.0.0
*/
@@ -119,13 +121,13 @@ declare module "browser-sync" {
*/
tunnel?: string | boolean;
/**
* Some features of Browsersync (such as xip & tunnel) require an internet connection, but if you're
* Some features of Browsersync (such as xip & tunnel) require an internet connection, but if you're
* working offline, you can reduce start-up time by setting this option to false
*/
online?: boolean;
/**
* Default: true
* Decide which URL to open automatically when Browsersync starts. Defaults to "local" if none set.
* Decide which URL to open automatically when Browsersync starts. Defaults to "local" if none set.
* Can be true, local, external, ui, ui-external, tunnel or false
*/
open?: string | boolean;
@@ -135,7 +137,7 @@ declare module "browser-sync" {
*/
browser?: string | string[];
/**
* Requires an internet connection - useful for services such as Typekit as it allows you to configure
* Requires an internet connection - useful for services such as Typekit as it allows you to configure
* domains such as *.xip.io in your kit settings
* Default: false
*/
@@ -154,14 +156,14 @@ declare module "browser-sync" {
* scrollProportionally: false // Sync viewports to TOP position
* Default: true
*/
scrollProportionally?: boolean
scrollProportionally?: boolean;
/**
* How often to send scroll events
* Default: 0
*/
scrollThrottle?: number;
/**
* Decide which technique should be used to restore scroll position following a reload.
* Decide which technique should be used to restore scroll position following a reload.
* Can be window.name or cookie
* Default: 'window.name'
*/
@@ -175,13 +177,13 @@ declare module "browser-sync" {
/**
* Default: []
* Note: requires at least version 2.9.0
* Sync the scroll position of any element on the page - where any scrolled element will cause
* all others to match scroll position. This is helpful when a breakpoint alters which element
* Sync the scroll position of any element on the page - where any scrolled element will cause
* all others to match scroll position. This is helpful when a breakpoint alters which element
* is actually scrolling
*/
scrollElementMapping?: string[];
/**
* Time, in milliseconds, to wait before instructing the browser to reload/inject following a file
* Time, in milliseconds, to wait before instructing the browser to reload/inject following a file
* change event
* Default: 0
*/
@@ -227,7 +229,7 @@ declare module "browser-sync" {
*/
timestamps?: boolean;
/**
* Alter the script path for complete control over where the Browsersync Javascript is served
* Alter the script path for complete control over where the Browsersync Javascript is served
* from. Whatever you return from this function will be used as the script path.
* Note: requires at least version 1.5.0
*/
@@ -250,7 +252,7 @@ declare module "browser-sync" {
[path: string]: T;
}
interface UIOptions {
interface UIOptions {
/** set the default port */
port?: number;
/** set the default weinre port */
@@ -266,9 +268,9 @@ declare module "browser-sync" {
directory?: boolean;
/** set index filename */
index?: string;
/**
* key-value object hash, where the key is the url to match,
* and the value is the folder to serve (relative to your working directory)
/**
* key-value object hash, where the key is the url to match,
* and the value is the folder to serve (relative to your working directory)
*/
routes?: Hash<string>;
/** configure custom middleware */
@@ -312,9 +314,14 @@ declare module "browser-sync" {
fn: (match: string) => string;
}
interface StreamOptions {
once?: boolean;
match?: mm.Pattern | mm.Pattern[];
}
interface BrowserSyncStatic extends BrowserSyncInstance {
/**
* Start the Browsersync service. This will launch a server, proxy or start the snippet mode
* Start the Browsersync service. This will launch a server, proxy or start the snippet mode
* depending on your use-case.
*/
(config?: Options, callback?: (err: Error, bs: Object) => any): BrowserSyncInstance;
@@ -328,36 +335,41 @@ declare module "browser-sync" {
* @param name the identifier used for retrieval
*/
get(name: string): BrowserSyncInstance;
/**
* Check if an instance has been created.
* @param name the name of the instance
*/
has(name: string): boolean;
}
interface BrowserSyncInstance {
/** the name of this instance of browser-sync */
name: string;
/**
* Start the Browsersync service. This will launch a server, proxy or start the snippet mode
* Start the Browsersync service. This will launch a server, proxy or start the snippet mode
* depending on your use-case.
*/
init(config?: Options, callback?: (err: Error, bs: Object) => any): BrowserSyncInstance;
/**
* Reload the browser
* The reload method will inform all browsers about changed files and will either cause the browser
* The reload method will inform all browsers about changed files and will either cause the browser
* to refresh, or inject the files where possible.
*/
reload(): void;
/**
* Reload a single file
* The reload method will inform all browsers about changed files and will either cause the browser
* The reload method will inform all browsers about changed files and will either cause the browser
* to refresh, or inject the files where possible.
*/
reload(file: string): void;
/**
* Reload multiple files
* The reload method will inform all browsers about changed files and will either cause the browser
* The reload method will inform all browsers about changed files and will either cause the browser
* to refresh, or inject the files where possible.
*/
reload(files: string[]): void;
/**
* The reload method will inform all browsers about changed files and will either cause the browser
* The reload method will inform all browsers about changed files and will either cause the browser
* to refresh, or inject the files where possible.
*/
reload(options: { stream: boolean }): NodeJS.ReadWriteStream;
@@ -365,7 +377,7 @@ declare module "browser-sync" {
* The stream method returns a transform stream and can act once or on many files.
* @param opts Configuration for the stream method
*/
stream(opts?: { once: boolean }): NodeJS.ReadWriteStream;
stream(opts?: StreamOptions): NodeJS.ReadWriteStream;
/**
* Helper method for browser notifications
* @param message Can be a simple message such as 'Connected' or HTML
@@ -390,7 +402,7 @@ declare module "browser-sync" {
*/
resume(): void;
/**
* The internal Event Emitter used by the running Browsersync instance (if there is one). You can use
* The internal Event Emitter used by the running Browsersync instance (if there is one). You can use
* this to emit your own events, such as changed files, logging etc.
*/
emitter: NodeJS.EventEmitter;
+21
View File
@@ -0,0 +1,21 @@
///<reference path="callsite.d.ts" />
import callsite = require("callsite");
var stack = callsite();
var p = stack[0];
console.log(p.getThis());
console.log(p.getTypeName());
console.log(p.getFunctionName());
console.log(p.getMethodName());
console.log(p.getFileName());
console.log(p.getLineNumber());
console.log(p.getColumnNumber());
console.log(p.getFunction());
console.log(p.getEvalOrigin());
console.log(p.isNative());
console.log(p.isToplevel());
console.log(p.isEval());
console.log(p.isConstructor());
+30
View File
@@ -0,0 +1,30 @@
// Type definitions for callsite 1.0.0
// Project: https://github.com/tj/callsite
// Definitions by: newclear <https://github.com/newclear>
// Definitions: https://github.com/newclear/DefinitelyTyped
declare module "callsite" {
module Callsite{
interface CallSite {
getThis(): any;
getTypeName(): string;
getFunctionName(): string;
getMethodName(): string;
getFileName(): string;
getLineNumber(): number;
getColumnNumber(): number;
getFunction(): Function;
getEvalOrigin(): string;
isNative(): boolean;
isToplevel(): boolean;
isEval(): boolean;
isConstructor(): boolean;
}
}
function Callsite(): Callsite.CallSite[];
export = Callsite;
}
+2 -2
View File
@@ -80,7 +80,7 @@ declare module CKEDITOR {
function getTemplate(name: string): template;
function getUrl(resource: string): string;
function inline(element: string, instanceConfig?: config): editor;
function inline(element: HTMLTextAreaElement, instanceConfig?: config): editor;
function inline(element: HTMLElement, instanceConfig?: config): editor;
function inlineAll(): void;
function loadFullCore(): void;
function replace(element: string, config?: config): editor;
@@ -1147,4 +1147,4 @@ declare module CKEDITOR {
function load(languageCode: string, defaultLanguage: string, callback: Function): void;
function detect(defaultLanguage: string, probeLanguage: string): string;
}
}
}
@@ -0,0 +1,33 @@
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="../jquery.dataTables/jquery.dataTables.d.ts" />
/// <reference path="datatables-buttons.d.ts" />
$(document).ready(function () {
var config: DataTables.Settings =
{
// Buttons extension options
buttons: [
{
extend: 'excel',
text: 'Excel',
className: 'class',
exportOptions: {
columns: ':visible'
}
},
{
action: function (e, dt, node, config) { },
available: function (dt, config) { return true; },
destroy: function (dt, node, config) { },
enabled: true,
init: function (dt, node, config) { },
key: 'a',
name: 'name',
namespace: 'namespace',
titleAttr: 'title',
}
],
}
});
+113
View File
@@ -0,0 +1,113 @@
// Type definitions for JQuery DataTables Buttons extension 1.1.0
// Project: http://datatables.net/extensions/buttons/
// Definitions by: Sam Germano <https://github.com/SammyG4Free>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="../jquery.dataTables/jquery.dataTables.d.ts"/>
declare module DataTables {
export interface Settings {
/**
* Buttons extension options
*/
buttons?: boolean | string[] | ButtonSettings[];
}
//#region "button-settings"
/**
* Buttons extension options
*/
export interface ButtonSettings {
/**
* Action to take when the button is activated
*/
action?: FunctionButtonAction;
/**
* Ensure that any requirements have been satisfied before initialising a button
*/
available?: FunctionButtonAvailable;
/**
* Set the class name for the button
*/
className?: string;
/**
* Function that is called when the button is destroyed
*/
destroy?: FunctionButtonInit;
/**
* Set a button's initial enabled state
*/
enabled?: boolean;
/**
* Define which button type the button should be based on
*/
extend?: string;
/**
* Initialisation function that can be used to add events specific to this button
*/
init?: FunctionButtonInit;
/**
* Define an activation key for a button
*/
key?: string | ButtonKey;
/**
* Set a name for each selection
*/
name?: string;
/**
* Unique namespace for every button
*/
namespace?: string;
/**
* The text to show in the button
*/
text?: string | ButtonText;
/**
* Button 'title' attribute text
*/
titleAttr?: string;
exportOptions?: ButtonExportOptions;
autoPrint?: boolean;
}
export interface FunctionButtonAvailable {
(dt: DataTables.DataTable, config: any): boolean
}
export interface ButtonExportOptions {
columns?: string;
}
export interface ButtonKey {
key?: string;
shiftKey?: boolean;
altKey?: boolean;
ctrlKey?: boolean;
metaKey?: boolean;
}
export interface ButtonText {
(dt: DataTables.DataTable, node: JQuery, config: any): string
}
export interface FunctionButtonInit {
(dt: DataTables.DataTable, node: JQuery, config: any): void
}
// api object?
export interface FunctionButtonAction {
(e: any, dt: DataTables.DataTable, node: JQuery, config: any): void
}
//#endregion "button-settings
}
-26
View File
@@ -180,32 +180,6 @@ interface Date {
format(mask?: string, utc?: boolean) : string;
}
declare var Date: {
new (): Date;
new (value: number): Date;
new (value: string): Date;
new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;
(): string;
prototype: Date;
/**
* Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.
* @param s A date string
*/
parse(s: string): number;
/**
* Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
* @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
* @param month The month as an number between 0 and 11 (January to December).
* @param date The date as an number between 1 and 31.
* @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.
* @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.
* @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.
* @param ms An number from 0 to 999 that specifies the milliseconds.
*/
UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;
now(): number;
};
// Some common format strings
interface DateFormatMasks {
"default": string;
+40 -30
View File
@@ -1,4 +1,4 @@
// Type definitions for DevExtreme 15.2.3
// Type definitions for DevExtreme 15.2.4
// Project: http://js.devexpress.com/
// Definitions by: DevExpress Inc. <http://devexpress.com/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -35,7 +35,7 @@ declare module DevExpress {
brokenRules: any[];
validators: IValidator[];
}
export interface GroupConfig extends EventsMixin<GroupConfig> {
export interface GroupConfig extends EventsMixin<GroupConfig> {
group: any;
validators: IValidator[];
validate(): ValidationGroupValidationResult;
@@ -56,7 +56,7 @@ declare module DevExpress {
/** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */
export function validateModel(model: Object): ValidationGroupValidationResult;
/** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */
export function registerModelForValidation(model: Object) : void;
export function registerModelForValidation(model: Object): void;
}
export var hardwareBackButton: JQueryCallback;
/** Processes the hardware back button click. */
@@ -2401,7 +2401,7 @@ declare module DevExpress.ui {
scrollPosition(): number;
}
export interface dxSwitchOptions extends EditorOptions {
activeStateEnabled?: boolean;
activeStateEnabled?: boolean;
/** Text displayed when the widget is in a disabled state. */
offText?: string;
/** Text displayed when the widget is in an enabled state. */
@@ -2534,6 +2534,7 @@ declare module DevExpress.ui {
/** Specifies whether or not the drop-down menu is displayed. */
opened?: boolean;
hoverStateEnabled?: boolean;
activeStateEnabled?: boolean;
}
/** A drop-down menu widget. */
export class dxDropDownMenu extends Widget {
@@ -4479,11 +4480,11 @@ declare module DevExpress.viz.core {
font?: viz.core.Font;
/** Specifies the widget title's horizontal position. */
horizontalAlignment?: string;
/** Specifies the widget title's position in the vertical direction. */
/** Specifies the widget title's position in the vertical direction. */
verticalAlignment?: string;
/** Specifies the distance between the title and surrounding widget elements in pixels. */
margin?: viz.core.Margins;
/** Specifies the height of the space reserved for the title. */
/** Specifies the height of the space reserved for the title. */
placeholderSize?: number;
/** Specifies text for the title. */
text?: string;
@@ -4491,7 +4492,7 @@ declare module DevExpress.viz.core {
subtitle?: {
/** Specifies font options for the subtitle. */
font?: viz.core.Font;
/** Specifies text for the subtitle. */
/** Specifies text for the subtitle. */
text?: string;
}
}
@@ -4602,16 +4603,16 @@ declare module DevExpress.viz.core {
}) => void;
/** A handler for the incidentOccurred event. */
onIncidentOccurred?: (
component: BaseWidget,
element: Element,
target: {
id: string;
type: string;
args: any;
text: string;
widget: string;
version: string;
}
component: BaseWidget,
element: Element,
target: {
id: string;
type: string;
args: any;
text: string;
widget: string;
version: string;
}
) => void;
/** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */
pathModified?: boolean;
@@ -5152,10 +5153,6 @@ declare module DevExpress.viz.charts {
valueField?: string;
}
export interface CommonPieSeriesSettings extends CommonPieSeriesConfig {
/**
* Sets a series type for all series.
* @deprecated use the 'type' option instead
*/
type?: string;
}
export interface PieSeriesConfig extends CommonPieSeriesConfig {
@@ -6389,8 +6386,12 @@ declare module DevExpress.viz.rangeSelector {
};
/** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */
logarithmBase?: number;
/** Specifies an interval between major ticks. */
/**
* Specifies an interval between major ticks.
* @deprecated ..\tickInterval\tickInterval.md
*/
majorTickInterval?: any;
tickInterval?: any;
/** Specifies options for the date-time scale's markers. */
marker?: {
/** Defines the options that can be set for the text that is displayed by the scale markers. */
@@ -6425,7 +6426,10 @@ declare module DevExpress.viz.rangeSelector {
setTicksAtUnitBeginning?: boolean;
/** Specifies whether or not to show ticks for the boundary scale values, when neither major ticks nor minor ticks are created for these values. */
showCustomBoundaryTicks?: boolean;
/** Indicates whether or not to show minor ticks on the scale. */
/**
* Indicates whether or not to show minor ticks on the scale.
* @deprecated minorTick\visible.md
*/
showMinorTicks?: boolean;
/** Specifies the scale's start value. */
startValue?: any;
@@ -6438,14 +6442,20 @@ declare module DevExpress.viz.rangeSelector {
/** Specifies the width of the scale's ticks (both major and minor ticks). */
width?: number;
};
minorTick?: {
color?: string;
opacity?: number;
width?: number;
visible?: boolean;
};
/** Specifies the type of the scale. */
type?: string;
/** Specifies whether or not to expand the current tick interval if labels overlap each other. */
useTicksAutoArrangement?: boolean;
/** Specifies the type of values on the scale. */
valueType?: string;
/** Specifies the order of arguments on a discrete scale. */
categories?: Array<any>;
/** Specifies the order of arguments on a discrete scale. */
categories?: Array<any>;
};
/** Specifies the range to be selected when displaying the dxRangeSelector. */
selectedRange?: {
@@ -6583,7 +6593,7 @@ declare module DevExpress.viz.map {
selected(): boolean;
/** Sets the selection state of the layer element. */
selected(state: boolean): void;
/** Applies the layer element settings and updates the element appearance. */
/** Applies the layer element settings and updates element appearance. */
applySettings(settings: any): void;
}
/**
@@ -6680,7 +6690,7 @@ declare module DevExpress.viz.map {
type?: string;
/** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */
elementType?: string;
/** Specifies a data source for the layer element. */
/** Specifies a data source for the layer. */
data?: any;
/** Specifies the width of the layer elements border in pixels. */
borderWidth?: number;
@@ -7040,9 +7050,9 @@ declare module DevExpress.viz.map {
center?: Array<number>;
/** A handler for the centerChanged event. */
onCenterChanged?: (e: {
center: Array<number>;
component: dxVectorMap;
element: Element;
center: Array<number>;
component: dxVectorMap;
element: Element;
}) => void;
/** A handler for the tooltipShown event. */
onTooltipShown?: (e: {
+27 -30
View File
@@ -1,17 +1,36 @@
// Type definitions for Drop v1.3.0
// Type definitions for Drop v1.4
// Project: http://github.hubspot.com/drop/
// Definitions by: Adi Dahiya <https://github.com/adidahiya>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path="../tether/tether.d.ts" />
declare module drop {
// global Drop constructor
declare class Drop {
constructor(options: Drop.IDropOptions);
interface DropStatic {
new(options: IDropOptions): Drop;
createContext(options: IDropContextOptions): DropStatic;
}
public content: HTMLElement;
public element: HTMLElement;
public tether: Tether;
public open(): void;
public close(): void;
public remove(): void;
public toggle(): void;
public isOpened(): boolean;
public position(): void;
public destroy(): void;
/*
* Drop instances fire "open" and "close" events.
*/
public on(event: string, handler: Function, context?: any): void;
public once(event: string, handler: Function, context?: any): void;
public off(event: string, handler?: Function): void;
public static createContext(options: Drop.IDropContextOptions): Drop;
}
declare module Drop {
interface IDropContextOptions {
classPrefix?: string;
defaults?: IDropOptions;
@@ -27,33 +46,11 @@ declare module drop {
constrainToScrollParent?: boolean;
remove?: boolean;
beforeClose?: () => boolean;
tetherOptions?: tether.ITetherOptions;
tetherOptions?: Tether.ITetherOptions;
}
interface Drop {
content: HTMLElement;
element: HTMLElement;
tether: tether.Tether;
open(): void;
close(): void;
remove(): void;
toggle(): void;
isOpened(): boolean;
position(): void;
destroy(): void;
/*
* Drop instances fire "open" and "close" events.
*/
on(event: string, handler: Function, context?: any): void;
once(event: string, handler: Function, context?: any): void;
off(event: string, handler?: Function): void;
}
}
declare module "drop" {
export = drop;
export = Drop;
}
declare var Drop: drop.DropStatic;
+5
View File
@@ -0,0 +1,5 @@
/// <reference path="fromjs.d.ts" />
var array = [1, 2, 3, 4];
from(array).each(function (value, key) {
console.log('Value ' + value + ' at index ' + key);
});
+46
View File
@@ -0,0 +1,46 @@
// Type definitions for fromjs v2.1.6.1
// Project: https://github.com/suckgamony/fromjs
// Definitions by: Glenn Dierckx <https://github.com/glenndierckx>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function from<T>(results: Array<T>): FromJS.IQueryable<T>;
declare function from<T>(results: any): FromJS.IQueryable<any>;
declare module FromJS {
export interface IOrderedQueryable<T> extends IQueryable<T> {
thenBy<TResult>(item: (item: T) => TResult): IOrderedQueryable<T>;
thenByDesc<TResult>(item: (item: T) => TResult): IOrderedQueryable<T>;
}
export interface IQueryable<T> {
where(predicate: (item: T) => boolean): IQueryable<T>;
select<TResult>(item: (item: T) => TResult): IQueryable<TResult>;
orderByDesc<TResult>(item: (item: T) => TResult): IOrderedQueryable<T>;
orderBy<TResult>(item: (item: T) => TResult): IOrderedQueryable<T>;
selectMany<TResult>(item: (item: T) => Array<TResult>): IQueryable<TResult>;
skip<TResult>(count: Number): IQueryable<TResult>;
take<TResult>(count: Number): IQueryable<TResult>;
single(): T;
single(predicate: (item: T) => boolean): T;
singleOrDefault(): T;
singleOrDefault(predicate: (item: T) => boolean): T;
first(): T;
last(): T;
max(): T;
distinct(): IQueryable<T>;
count(): number;
contains(item: T): boolean;
first(predicate: (item: T) => boolean): T;
firstOrDefault(): T;
each(action: (item: T) => void): void;
each<TKey>(action: (value: T, key: TKey) => void): void;
each(action: (item: T) => void, a: boolean): void;
toArray(): Array<T>;
concat(second: Array<T>): IQueryable<T>;
sum(): T;
distinct(): IQueryable<T>;
any(): boolean;
any(predicate: (item: T) => boolean): boolean;
all(predicate: (item: T) => boolean): boolean;
}
}
+8
View File
@@ -0,0 +1,8 @@
/// <reference path="gandi-livedns.d.ts" />
let zone: ZoneRecord = {
rrset_name: "MyZone",
rrset_type: "AAAA",
rrset_ttl: 10800,
rrset_values: []
}
+42
View File
@@ -0,0 +1,42 @@
// Type definitions for Gandi LiveDNS
// Project: http://doc.livedns.gandi.net/
// Definitions by: Xavier Stouder <https://github.com/xstoudi/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface Zone {
uuid: string;
name: string;
primary_ns: string;
apex_alias: string;
email: string;
serial: number;
refresh: number;
retry: number;
expire: number;
minimum: number;
}
interface ZoneRecord {
rrset_name: string;
/**
* One of A, AAA, CNAME, MX, NS, TXT, WKS, SRV, LOC, SPF, SSHFP, DNAME
*/
rrset_type: string;
rrset_ttl: number;
rrset_values: string[];
}
interface Domain {
fqdn: string;
zone_uuid: string;
}
interface Snapshot {
serial: number;
zone_uuid: string;
/**
* Can be used as a date with "new Date(change_time);"
*/
change_time: string;
zone_data: ZoneRecord[];
}
+39
View File
@@ -0,0 +1,39 @@
/// <reference path="gapi.auth2.d.ts" />
function test_init(){
var auth = gapi.auth2.init({
client_id: 'my-id',
cookie_policy: 'single_host_origin',
scope: 'https://www.googleapis.com/auth/plus.login',
fetch_basic_profile: true
});
}
function test_getAuthInstance(){
gapi.auth2.init({
client_id: 'my-id',
cookie_policy: 'single_host_origin',
scope: 'https://www.googleapis.com/auth/plus.login',
fetch_basic_profile: true
});
var auth = gapi.auth2.getAuthInstance();
}
function test_render(){
var success = (googleUser: gapi.auth2.GoogleUser): void => {
console.log(googleUser);
};
var failure = (): void => {
console.log('Failure callback');
};
gapi.signin2.render('testId', {
scope: 'https://www.googleapis.com/auth/plus.login',
width: 250,
height: 50,
longtitle: true,
theme: 'dark',
onsuccess: success,
onfailure: failure
});
}
+284
View File
@@ -0,0 +1,284 @@
// Type definitions for Google Sign-In API
// Project: https://developers.google.com/identity/sign-in/web/
// Definitions by: Derek Lawless <https://github.com/flawless2011>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../gapi/gapi.d.ts" />
declare module gapi.auth2 {
/**
* GoogleAuth is a singleton class that provides methods to allow the user to sign in with a Google account,
* get the user's current sign-in status, get specific data from the user's Google profile,
* request additional scopes, and sign out from the current account.
*/
export class GoogleAuth {
isSignedIn: IsSignedIn;
curretUser: CurrentUser;
/**
* Calls the onInit function when the GoogleAuth object is fully initialized, or calls the onFailure function if
* initialization fails.
*/
then(onInit: () => any, onFailure: (reason: string) => any): any;
/**
* Signs in the user with the options specified to gapi.auth2.init().
*/
signIn(): any;
/**
* Signs in the user using the specified options.
*/
signIn(options?: {
app_package_name?: string;
fetch_basic_profile?: boolean;
prompt?: boolean;
scope?: string;
}, optionBuilder?: SigninOptionsBuilder): any;
/**
* Signs out all accounts from the application.
*/
signOut(): any;
/**
* Revokes all of the scopes that the user granted.
*/
disconnect(): any;
/**
* Get permission from the user to access the specified scopes offline.
*/
grantOfflineAccess(options: {
scope?: string;
redirect_uri?: string;
}): any;
/**
* Attaches the sign-in flow to the specified container's click handler.
*/
attachClickHandler(container: any, options: {
app_package_name?: string;
fetch_basic_profile?: boolean;
prompt?: boolean;
scope?: string;
}, onsuccess: () => any, onfailure: (reason: string) => any): any;
}
export interface IsSignedIn{
/**
* Returns whether the current user is currently signed in.
*/
get(): boolean;
/**
* Listen for changes in the current user's sign-in state.
*/
listen(listener: (signedIn: boolean) => any): void;
}
export interface CurrentUser {
/**
* Returns a GoogleUser object that represents the current user. Note that in a newly-initialized
* GoogleAuth instance, the current user has not been set. Use the currentUser.listen() method or the
* GoogleAuth.then() to get an initialized GoogleAuth instance.
*/
get(): GoogleUser;
/**
* Listen for changes in currentUser.
*/
listen(listener: (user: GoogleUser) => any): void;
}
export class SigninOptionsBuilder {
setAppPackageName(name: string): any;
setFetchBasicProfile(fetch: boolean): any;
setPrompt(prompt: string): any;
setScope(scope: string): any;
}
export interface BasicProfile {
getId(): string;
getName(): string;
getImageUrl(): string;
getEmail(): string;
}
export interface AuthResponse {
access_token: string;
id_token: string;
login_hint: string;
scope: string;
expires_in: string;
first_issued_at: string;
expires_at: string;
}
/**
* A GoogleUser object represents one user account.
*/
export interface GoogleUser {
/**
* Get the user's unique ID string.
*/
getId(): string;
/**
* Returns true if the user is signed in.
*/
isSignedIn(): boolean;
/**
* Get the user's Google Apps domain if the user signed in with a Google Apps account.
*/
getHostedDomain(): string;
/**
* Get the scopes that the user granted as a space-delimited string.
*/
getGrantedScopes(): string;
/**
* Get the user's basic profile information.
*/
getBasicProfile(): BasicProfile;
/**
* Get the response object from the user's auth session.
*/
getAuthResponse(): AuthResponse;
/**
* Returns true if the user granted the specified scopes.
*/
hasGrantedScopes(scopes: string): boolean;
/**
* Signs in the user. Use this method to request additional scopes for incremental
* authorization or to sign in a user after the user has signed out.
* When you use GoogleUser.signIn(), the sign-in flow skips the account chooser step.
* See GoogleAuth.signIn().
*/
signIn(options?: {
app_package_name?: string;
fetch_basic_profile?: boolean;
prompt?: boolean;
scope?: string;
}, optionBuilder?: SigninOptionsBuilder): any;
/**
*
*/
grant(options?: {
app_package_name?: string;
fetch_basic_profile?: boolean;
prompt?: boolean;
scope?: string;
}, optionBuilder?: SigninOptionsBuilder): any;
/**
* Get permission from the user to access the specified scopes offline.
* When you use GoogleUser.grantOfflineAccess(), the sign-in flow skips the account chooser step.
* See GoogleUser.grantOfflineAccess().
*/
grantOfflineAccess(scopes: string): void;
/**
* Revokes all of the scopes that the user granted.
*/
disconnect(): void;
}
export function init(params: {
/**
* The app's client ID, found and created in the Google Developers Console.
*/
client_id?: string;
/**
* The domains for which to create sign-in cookies. Either a URI, single_host_origin, or none.
* Defaults to single_host_origin if unspecified.
*/
cookie_policy?: string;
/**
* The scopes to request, as a space-delimited string. Optional if fetch_basic_profile is not set to false.
*/
scope?: string;
/**
* Fetch users' basic profile information when they sign in. Adds 'profile' and 'email' to the requested scopes. True if unspecified.
*/
fetch_basic_profile?: boolean;
/**
* The Google Apps domain to which users must belong to sign in. This is susceptible to modification by clients,
* so be sure to verify the hosted domain property of the returned user. Use GoogleUser.getHostedDomain() on the client,
* and the hd claim in the ID Token on the server to verify the domain is what you expected.
*/
hosted_domain?: string;
/**
* Used only for OpenID 2.0 client migration. Set to the value of the realm that you are currently using for OpenID 2.0,
* as described in <a href="https://developers.google.com/accounts/docs/OpenID#openid-connect">OpenID 2.0 (Migration)</a>.
*/
openid_realm?: string;
}): GoogleAuth;
/**
* Returns the GoogleAuth object. You must initialize the GoogleAuth object with gapi.auth2.init() before calling this method.
*/
export function getAuthInstance(): GoogleAuth;
}
declare module gapi.signin2 {
export function render(id: any, options: {
/**
* The auth scope or scopes to authorize. Auth scopes for individual APIs can be found in their documentation.
*/
scope?: string;
/**
* The width of the button in pixels (default: 120).
*/
width?: number;
/**
* The height of the button in pixels (default: 36).
*/
height?: number;
/**
* Display long labels such as "Sign in with Google" rather than "Sign in" (default: false).
*/
longtitle?: boolean;
/**
* The color theme of the button: either light or dark (default: light).
*/
theme?: string;
/**
* The callback function to call when a user successfully signs in.
* This function must take one argument: an instance of gapi.auth2.GoogleUser (default: none).
*/
onsuccess?: any;
/**
* The callback function to call when sign-in fails. This function takes no arguments (default: none).
*/
onfailure?: any;
/**
* The package name of the Android app to install over the air. See
* <a href="https://developers.google.com/identity/sign-in/web/android-app-installs">Android app installs from your web site</a>.
* Optional. (default: none)
*/
app_package_name?: string;
}): void;
}
@@ -166,6 +166,10 @@ var dockMenu = Menu.buildFromTemplate([
},
]);
app.dock.setMenu(dockMenu);
app.dock.setBadge('foo');
var id = app.dock.bounce('informational');
app.dock.cancelBounce(id);
app.dock.setIcon('/path/to/icon.png');
app.setUserTasks([
<Electron.Task>{
+61 -53
View File
@@ -1048,7 +1048,7 @@ declare module Electron {
* Note: This API is only available on Windows.
*/
setUserTasks(tasks: Task[]): void;
dock: BrowserWindow;
dock: Dock;
commandLine: CommandLine;
/**
* This method makes your application a Single Instance Application instead of allowing
@@ -1075,6 +1075,64 @@ declare module Electron {
appendArgument(value: any): void;
}
interface Dock {
/**
* When critical is passed, the dock icon will bounce until either the
* application becomes active or the request is canceled.
*
* When informational is passed, the dock icon will bounce for one second.
* The request, though, remains active until either the application becomes
* active or the request is canceled.
*
* Note: This API is only available on Mac.
* @param type Can be critical or informational, the default is informational.
* @returns An ID representing the request
*/
bounce(type?: string): number;
/**
* Cancel the bounce of id.
*
* Note: This API is only available on Mac.
*/
cancelBounce(id: number): void;
/**
* Sets the string to be displayed in the docks badging area.
*
* Note: This API is only available on Mac.
*/
setBadge(text: string): void;
/**
* Returns the badge string of the dock.
*
* Note: This API is only available on Mac.
*/
getBadge(): string;
/**
* Hides the dock icon.
*
* Note: This API is only available on Mac.
*/
hide(): void;
/**
* Shows the dock icon.
*
* Note: This API is only available on Mac.
*/
show(): void;
/**
* Sets the application dock menu.
*
* Note: This API is only available on Mac.
*/
setMenu(menu: Menu): void;
/**
* Sets the image associated with this dock icon.
*
* Note: This API is only available on Mac.
*/
setIcon(icon: NativeImage | string): void;
}
interface Task {
/**
* Path of the program to execute, usually you should specify process.execPath
@@ -1106,57 +1164,7 @@ declare module Electron {
*/
iconIndex?: number;
commandLine?: CommandLine;
dock?: {
/**
* When critical is passed, the dock icon will bounce until either the
* application becomes active or the request is canceled.
*
* When informational is passed, the dock icon will bounce for one second.
* The request, though, remains active until either the application becomes
* active or the request is canceled.
*
* Note: This API is only available on Mac.
* @param type Can be critical or informational, the default is informational.
* @returns An ID representing the request
*/
bounce(type?: string): any;
/**
* Cancel the bounce of id.
*
* Note: This API is only available on Mac.
*/
cancelBounce(id: number): void;
/**
* Sets the string to be displayed in the docks badging area.
*
* Note: This API is only available on Mac.
*/
setBadge(text: string): void;
/**
* Returns the badge string of the dock.
*
* Note: This API is only available on Mac.
*/
getBadge(): string;
/**
* Hides the dock icon.
*
* Note: This API is only available on Mac.
*/
hide(): void;
/**
* Shows the dock icon.
*
* Note: This API is only available on Mac.
*/
show(): void;
/**
* Sets the application dock menu.
*
* Note: This API is only available on Mac.
*/
setMenu(menu: Menu): void;
};
dock?: Dock;
}
class AutoUpdater implements NodeJS.EventEmitter {
@@ -1225,7 +1233,7 @@ declare module Electron {
filters?: {
name: string;
extensions: string[];
}[]
}[];
}
/**
+1 -1
View File
@@ -353,7 +353,7 @@ declare module google.maps {
setDraggable(flag: boolean): void;
setIcon(icon: string|Icon|Symbol): void;
setMap(map: Map|StreetViewPanorama): void;
getOpacity(opacity: number): void;
setOpacity(opacity: number): void;
setOptions(options: MarkerOptions): void;
setPlace(place: Place): void;
setPosition(latlng: LatLng|LatLngLiteral): void;
+51 -3
View File
@@ -135,6 +135,51 @@ function originalTests() {
var multipleYAxisOptions: HighchartsOptions = {
yAxis: [{}, {}]
};
var renderToIdChart = new Highcharts.Chart("container", {
xAxis: {},
series: [<HighchartsLineChartSeriesOptions>{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
type: "line",
allowPointSelect: true
}]
});
var renderToElementChart = new Highcharts.Chart(div, {
xAxis: {},
series: [<HighchartsLineChartSeriesOptions>{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
type: "line",
allowPointSelect: true
}]
});
var createWithFunction = Highcharts.chart({
xAxis: {},
series: [<HighchartsLineChartSeriesOptions>{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
type: "line",
allowPointSelect: true
}]
});
var createWithFunctionRenderToId = Highcharts.chart("container", {
xAxis: {},
series: [<HighchartsLineChartSeriesOptions>{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
type: "line",
allowPointSelect: true
}]
});
var createWithFunctionRenderToElement = Highcharts.chart(div, {
xAxis: {},
series: [<HighchartsLineChartSeriesOptions>{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
type: "line",
allowPointSelect: true
}]
});
}
function test_alldefaults() {
@@ -1554,15 +1599,18 @@ function test_Line() {
series: [<HighchartsLineChartSeriesOptions>{
data: [1, 2, 3, 4, null, 6, 7, null, 9],
step: 'right',
name: 'Right'
name: 'Right',
linecap: 'round'
}, <HighchartsLineChartSeriesOptions>{
data: [5, 6, 7, 8, null, 10, 11, null, 13],
step: 'center',
name: 'Center'
name: 'Center',
linecap: 'round'
}, <HighchartsLineChartSeriesOptions>{
data: [9, 10, 11, 12, null, 14, 15, null, 17],
step: 'left',
name: 'Left'
name: 'Left',
linecap: 'round'
}]
});
}
+45 -7
View File
@@ -117,6 +117,13 @@ interface HighchartsAxisLabels {
* @default 5
*/
padding?: number;
/**
* Whether to reserve space for the labels. This can be turned off when for example the labels are rendered inside
* the plot area instead of outside.
* @default true
* @since 4.1.10
*/
reserveSpace?: boolean;
/**
* Rotation of the labels in degrees.
* @default 0
@@ -3666,6 +3673,11 @@ interface HighchartsSeriesChart {
* @default 2
*/
lineWidth?: number;
/**
* The line cap used for line ends and line joins on the graph.
* @default 'round'
*/
linecap?: string;
/**
* The id of another series to link to. Additionally, the value can be ':previous' to link to the previous series.
* When two series are linked, only the first one appears in the legend. Toggling the visibility of this also
@@ -4432,12 +4444,6 @@ interface HighchartsLineChart extends HighchartsSeriesChart {
* @since 1.2.5
*/
step?: boolean|string;
/**
* The line cap used for line ends and line joins on the graph.
* @default 'round'
*/
linecap?: string;
}
/**
@@ -4445,7 +4451,9 @@ interface HighchartsLineChart extends HighchartsSeriesChart {
*/
interface HighchartsPieChart extends HighchartsSeriesChart {
/**
* The color of the border surrounding each column or bar.
* The color of the border surrounding each slice. When null, the border takes the same color as the slice fill.
* This can be used together with a borderWidth to fill drawing gaps created by antialiazing artefacts in
* borderless pies.
* @default '#FFFFFF'
*/
borderColor?: string;
@@ -4724,6 +4732,11 @@ interface HighchartsTreeMapChart extends HighchartsSeriesChart {
* @since 4.1.8
*/
maxPointWidth?: number;
/**
* The sort index of the point inside the treemap level.
* @since 4.1.10
*/
sortIndex?: number;
/**
* A wrapper object for all the series options in specific states.
*/
@@ -5789,6 +5802,21 @@ interface HighchartsChart {
* @return {HighchartsChartObject}
*/
new (options: HighchartsOptions, callback: (chart: HighchartsChartObject) => void): HighchartsChartObject;
/**
* This is the constructor for creating a new chart object.
* @param {string|HTMLElement} renderTo The id or a reference to a DOM element where the chart should be rendered (since v4.2.0).
* @param {HighchartsOptions} options The chart options
* @return {HighchartsChartObject}
*/
new (renderTo: string | HTMLElement, options: HighchartsOptions): HighchartsChartObject;
/**
* This is the constructor for creating a new chart object.
* @param {string|HTMLElement} renderTo The id or a reference to a DOM element where the chart should be rendered (since v4.2.0).
* @param {HighchartsOptions} options The chart options
* @param callback A function to execute when the chart object is finished loading and rendering. In most cases the chart is built in one thread, but in Internet Explorer version 8 or less the chart is sometimes initiated before the document is ready, and in these cases the chart object will not be finished directly after callingnew Highcharts.Chart(). As a consequence, code that relies on the newly built Chart object should always run in the callback. Defining a chart.event.load handler is equivalent.
* @return {HighchartsChartObject}
*/
new (renderTo: string | HTMLElement, options: HighchartsOptions, callback: (chart: HighchartsChartObject) => void): HighchartsChartObject;
}
/**
@@ -5970,6 +5998,16 @@ interface HighchartsStatic {
Renderer: HighchartsRenderer;
Color(color: string | HighchartsGradient): string | HighchartsGradient;
/**
* As Highcharts.Chart, but without need for the new keyword.
* @since 4.2.0
*/
chart(options: HighchartsOptions, callback?: (chart: HighchartsChartObject) => void): HighchartsChartObject;
/**
* As Highcharts.Chart, but without need for the new keyword.
* @since 4.2.0
*/
chart(renderTo: string | HTMLElement, options: HighchartsOptions, callback?: (chart: HighchartsChartObject) => void): HighchartsChartObject;
/**
* An array containing the current chart objects in the page. A chart's position in the array is preserved
* throughout the page's lifetime. When a chart is destroyed, the array item becomes undefined.
+8 -3
View File
@@ -1,4 +1,4 @@
// Type definitions for highlight.js v8.2.0
// Type definitions for highlight.js v9.1.0
// Project: https://github.com/isagalaev/highlight.js
// Definitions by: Niklas Mollenhauer <https://github.com/nikeee/>, Jeremy Hull <https://github.com/sourrust>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -35,6 +35,11 @@ declare module hljs
export function inherit(parent: Object, obj: Object): Object;
export function COMMENT(
begin: (string|RegExp),
end: (string|RegExp),
inherits: IModeBase): IMode;
// Common regexps
export var IDENT_RE: string;
export var UNDERSCORE_IDENT_RE: string;
@@ -111,8 +116,8 @@ declare module hljs
{
className?: string;
aliases?: string[];
begin?: string;
end?: string;
begin?: (string|RegExp);
end?: (string|RegExp);
case_insensitive?: boolean;
beginKeyword?: string;
endsWithParent?: boolean;
@@ -0,0 +1,26 @@
/// <reference path="javascript-astar.d.ts" />
function test_create() {
let graph: Graph = new Graph([]);
}
function test_create_with_diagonals() {
let graph: Graph = new Graph([], {diagonal: true});
}
function test_get_node() {
let graph: Graph = new Graph([[5, 1, 0, 9], [0, 8, 7, 1]]);
let node: GridNode = graph.grid[0][1];
}
function test_search_returns_nodes() {
let nodes: Array<GridNode> = astar.search(new Graph([]), {x: 1, y: 1}, {x: 2, y: 2});
}
function test_search_alternative_heuristic() {
let nodes: Array<GridNode> = astar.search(new Graph([]), {x: 1, y: 1}, {x: 2, y: 2}, {heuristic: astar.heuristics.manhatten});
}
function test_search_or_closest() {
let nodes: Array<GridNode> = astar.search(new Graph([], {diagonal: true}), {x: 1, y: 1}, {x: 2, y: 2}, {closest: true});
}
+37
View File
@@ -0,0 +1,37 @@
// Type definitions for javascript-astar
// Project: https://github.com/bgrins/javascript-astar
// Definitions by: brian ridley <https://github.com/ptlis/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare class Graph {
grid: Array<Array<GridNode>>;
constructor(grid: Array<Array<number>>, options?: {diagonal?: boolean});
}
declare class GridNode {
x: number;
y: number;
}
interface Heuristic {
(pos0: {x: number, y: number}, pos1: {x: number, y: number}): number;
}
interface Heuristics {
manhatten: Heuristic;
diagonal: Heuristic;
}
declare module astar {
function search(
graph: Graph,
start: {x: number, y: number},
end: {x: number, y: number},
options?: {
closest?: boolean,
heuristic?: Heuristic
}
): Array<GridNode>;
var heuristics: Heuristics;
}
+10
View File
@@ -0,0 +1,10 @@
/// <reference path="jsend.d.ts" />
import jsend = require('jsend');
var valid: boolean = jsend.isValid({ status: 'success' });
var success = jsend.success('data');
var error = jsend.error('some error');
error = jsend.error({ message: 'nessage', code: 123 });
+46
View File
@@ -0,0 +1,46 @@
// Type definitions for jsend 1.0.2
// Project: https://github.com/Prestaul/jsend
// Definitions by: Federico Caselli <https://github.com/CaselIT>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module Express {
export interface Response {
jsend: jsend.jsendExpress;
}
}
declare module jsend {
interface JSendObject {
status: string;
code?: number;
data?: any;
message?: string;
}
interface jsendCore {
success(data: Object): JSendObject;
fail(data: Object): JSendObject;
error(message: string | { message: string, code?: number, data?: Object }): JSendObject;
}
interface jsendExpress extends jsendCore {
(err: string | Object, json?: Object): void
}
interface jsend extends jsendCore {
isValid(json: Object): boolean;
forward(json: Object, done: (err: any, data: any) => any):void;
fromArguments(err: string | Object, json?: Object): JSendObject;
middleware(req: any, res: any, next: Function): any;
}
interface jsendExport extends jsend {
(config?: { strict: boolean }, host?: Object): jsend
}
var jsend: jsendExport;
}
declare module "jsend" {
export = jsend.jsend;
}
+29 -5
View File
@@ -43,12 +43,16 @@ declare module "jsonwebtoken" {
maxAge?: string;
}
export interface VerifyCallbak {
export interface VerifyCallback {
(err: Error, decoded: any): void;
}
export interface SignCallback {
(err: Error, encoded: string): void;
}
/**
* Sign the given payload into a JSON Web Token string
* Synchronously sign the given payload into a JSON Web Token string
* @param {String|Object|Buffer} payload - Payload to sign, could be an literal, buffer or string
* @param {String|Buffer} secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA.
* @param {SignOptions} [options] - Options for the signature
@@ -57,14 +61,34 @@ declare module "jsonwebtoken" {
export function sign(payload: string | Buffer | Object, secretOrPrivateKey: string | Buffer, options?: SignOptions): string;
/**
* Verify given token using a secret or a public key to get a decoded token
* Sign the given payload into a JSON Web Token string
* @param {String|Object|Buffer} payload - Payload to sign, could be an literal, buffer or string
* @param {String|Buffer} secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA.
* @param {SignOptions} [options] - Options for the signature
* @param {Function} callback - Callback to get the encoded token on
*/
export function sign(payload: string | Buffer | Object, secretOrPrivateKey: string | Buffer, callback: SignCallback): void;
export function sign(payload: string | Buffer | Object, secretOrPrivateKey: string | Buffer, options: SignOptions, callback: SignCallback): void;
/**
* Synchronously verify given token using a secret or a public key to get a decoded token
* @param {String} token - JWT string to verify
* @param {String|Buffer} secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA.
* @param {VerifyOptions} [options] - Options for the verification
* @returns The decoded token.
*/
function verify(token: string, secretOrPublicKey: string | Buffer): any;
function verify(token: string, secretOrPublicKey: string | Buffer, options?: VerifyOptions): any;
/**
* Asynchronously verify given token using a secret or a public key to get a decoded token
* @param {String} token - JWT string to verify
* @param {String|Buffer} secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA.
* @param {VerifyOptions} [options] - Options for the verification
* @param {Function} callback - Callback to get the decoded token on
*/
function verify(token: string, secretOrPublicKey: string | Buffer, callback?: VerifyCallbak): void;
function verify(token: string, secretOrPublicKey: string | Buffer, options?: VerifyOptions, callback?: VerifyCallbak): void;
function verify(token: string, secretOrPublicKey: string | Buffer, callback?: VerifyCallback): void;
function verify(token: string, secretOrPublicKey: string | Buffer, options?: VerifyOptions, callback?: VerifyCallback): void;
/**
* Returns the decoded payload without verifying if the signature is valid.
+40 -14
View File
@@ -9601,16 +9601,17 @@ declare module _ {
* @param resolver The function to resolve the cache key.
* @return Returns the new memoizing function.
*/
memoize<TResult extends MemoizedFunction>(
func: Function,
resolver?: Function): TResult;
memoize: {
<T extends Function>(func: T, resolver?: Function): T & MemoizedFunction;
Cache: MapCache;
}
}
interface LoDashImplicitObjectWrapper<T> {
/**
* @see _.memoize
*/
memoize<TResult extends MemoizedFunction>(resolver?: Function): LoDashImplicitObjectWrapper<TResult>;
memoize(resolver?: Function): LoDashImplicitObjectWrapper<T & MemoizedFunction>;
}
//_.modArgs
@@ -13341,40 +13342,65 @@ declare module _ {
* @param value The value to set.
* @return Returns object.
*/
set<T>(
object: T,
set<TResult>(
object: Object,
path: StringRepresentable|StringRepresentable[],
value: any
): T;
): TResult;
/**
* @see _.set
*/
set<V, T>(
object: T,
set<V, TResult>(
object: Object,
path: StringRepresentable|StringRepresentable[],
value: V
): T;
): TResult;
/**
* @see _.set
*/
set<O, V, TResult>(
object: O,
path: StringRepresentable|StringRepresentable[],
value: V
): TResult;
}
interface LoDashImplicitObjectWrapper<T> {
/**
* @see _.set
*/
set<V>(
set<TResult>(
path: StringRepresentable|StringRepresentable[],
value: any
): LoDashImplicitObjectWrapper<TResult>;
/**
* @see _.set
*/
set<V, TResult>(
path: StringRepresentable|StringRepresentable[],
value: V
): LoDashImplicitObjectWrapper<T>;
): LoDashImplicitObjectWrapper<TResult>;
}
interface LoDashExplicitObjectWrapper<T> {
/**
* @see _.set
*/
set<V>(
set<TResult>(
path: StringRepresentable|StringRepresentable[],
value: any
): LoDashExplicitObjectWrapper<TResult>;
/**
* @see _.set
*/
set<V, TResult>(
path: StringRepresentable|StringRepresentable[],
value: V
): LoDashExplicitObjectWrapper<T>;
): LoDashExplicitObjectWrapper<TResult>;
}
//_.transform
+43 -28
View File
@@ -5959,17 +5959,28 @@ module TestFlowRight {
}
// _.memoize
var testMemoizedFunction: _.MemoizedFunction;
result = <_.MapCache>testMemoizedFunction.cache;
interface TestMemoizedResultFn extends _.MemoizedFunction {
(...args: any[]): any;
namespace TestMemoize {
var testMemoizedFunction: _.MemoizedFunction;
var cache = <_.MapCache>testMemoizedFunction.cache;
interface TestMemoizedResultFn extends _.MemoizedFunction {
(a1: string, a2: number): boolean;
}
var testMemoizeFn = (a1: string, a2: number) => a1.length > a2;
var testMemoizeResolverFn = (a1: string, a2: number) => a1 + a2;
var result: TestMemoizedResultFn;
result = _.memoize(testMemoizeFn);
result = _.memoize(testMemoizeFn, testMemoizeResolverFn);
result = _(testMemoizeFn).memoize().value();
result = _(testMemoizeFn).memoize(testMemoizeResolverFn).value();
result('foo', 1);
result.cache.get('foo1');
_.memoize.Cache = {
delete: key => false,
get: key => undefined,
has: key => false,
set(key, value) { return this; }
};
}
var testMemoizeFn: (...args: any[]) => any;
var testMemoizeResolverFn: (...args: any[]) => any;
result = <TestMemoizedResultFn>_.memoize<TestMemoizedResultFn>(testMemoizeFn);
result = <TestMemoizedResultFn>_.memoize<TestMemoizedResultFn>(testMemoizeFn, testMemoizeResolverFn);
result = <TestMemoizedResultFn>(_(testMemoizeFn).memoize<TestMemoizedResultFn>().value());
result = <TestMemoizedResultFn>(_(testMemoizeFn).memoize<TestMemoizedResultFn>(testMemoizeResolverFn).value());
// _.modArgs
module TestModArgs {
@@ -8676,39 +8687,43 @@ module TestPick {
// _.set
module TestSet {
type SampleValue = {a: number; b: string; c: boolean;};
type SampleObject = {a: {}};
type SampleResult = {a: {b: number[]}};
let object: TResult;
let value = {a: 1, b: '', c: true};
let object: SampleObject;
let value: number;
{
let result: TResult;
let result: SampleResult;
result = _.set(object, '', any);
result = _.set(object, ['a', 'b', 1], any);
result = _.set<SampleResult>(object, 'a.b[1]', value);
result = _.set<SampleResult>(object, ['a', 'b', 1], value);
result = _.set<SampleValue>(object, '', value);
result = _.set<SampleValue>(object, ['a', 'b', 1], value);
result = _.set<number, SampleResult>(object, 'a.b[1]', value);
result = _.set<number, SampleResult>(object, ['a', 'b', 1], value);
result = _.set<SampleObject, number, SampleResult>(object, 'a.b[1]', value);
result = _.set<SampleObject, number, SampleResult>(object, ['a', 'b', 1], value);
}
{
let result: _.LoDashImplicitObjectWrapper<TResult>;
let result: _.LoDashImplicitObjectWrapper<SampleResult>;
result = _(object).set('', any);
result = _(object).set(['a', 'b', 1], any);
result = _(object).set<SampleResult>('a.b[1]', value);
result = _(object).set<SampleResult>(['a', 'b', 1], value);
result = _(object).set<SampleValue>('', value);
result = _(object).set<SampleValue>(['a', 'b', 1], value);
result = _(object).set<number, SampleResult>('a.b[1]', value);
result = _(object).set<number, SampleResult>(['a', 'b', 1], value);
}
{
let result: _.LoDashExplicitObjectWrapper<TResult>;
let result: _.LoDashExplicitObjectWrapper<SampleResult>;
result = _(object).chain().set('', any);
result = _(object).chain().set(['a', 'b', 1], any);
result = _(object).chain().set<SampleResult>('a.b[1]', value);
result = _(object).chain().set<SampleResult>(['a', 'b', 1], value);
result = _(object).chain().set<SampleValue>('', value);
result = _(object).chain().set<SampleValue>(['a', 'b', 1], value);
result = _(object).chain().set<number, SampleResult>('a.b[1]', value);
result = _(object).chain().set<number, SampleResult>(['a', 'b', 1], value);
}
}
+586 -133
View File
@@ -257,6 +257,193 @@ module TestDifference {
}
}
// _.differenceBy
module TestDifferenceBy {
let array: TResult[];
let list: _.List<TResult>;
let iteratee: (value: TResult) => any;
{
let result: TResult[];
result = _.differenceBy<TResult>(array, array);
result = _.differenceBy<TResult>(array, list, array);
result = _.differenceBy<TResult>(array, array, list, array);
result = _.differenceBy<TResult>(array, list, array, list, array);
result = _.differenceBy<TResult>(array, array, list, array, list, array);
result = _.differenceBy<TResult>(array, list, array, list, array, list, array);
result = _.differenceBy<TResult>(array, array, iteratee);
result = _.differenceBy<TResult>(array, list, array, iteratee);
result = _.differenceBy<TResult>(array, array, list, array, iteratee);
result = _.differenceBy<TResult>(array, list, array, list, array, iteratee);
result = _.differenceBy<TResult>(array, array, list, array, list, array, iteratee);
result = _.differenceBy<TResult>(array, list, array, list, array, list, array, iteratee);
result = _.differenceBy<TResult>(array, array, 'a');
result = _.differenceBy<TResult>(array, list, array, 'a');
result = _.differenceBy<TResult>(array, array, list, array, 'a');
result = _.differenceBy<TResult>(array, list, array, list, array, 'a');
result = _.differenceBy<TResult>(array, array, list, array, list, array, 'a');
result = _.differenceBy<TResult>(array, list, array, list, array, list, array, 'a');
result = _.differenceBy<TResult, {a: number}>(array, array, {a: 1});
result = _.differenceBy<TResult, {a: number}>(array, list, array, {a: 1});
result = _.differenceBy<TResult, {a: number}>(array, array, list, array, {a: 1});
result = _.differenceBy<TResult, {a: number}>(array, list, array, list, array, {a: 1});
result = _.differenceBy<TResult, {a: number}>(array, array, list, array, list, array, {a: 1});
result = _.differenceBy<TResult>(array, list, array, list, array, list, array, {a: 1});
result = _.differenceBy<TResult>(list, list);
result = _.differenceBy<TResult>(list, array, list);
result = _.differenceBy<TResult>(list, list, array, list);
result = _.differenceBy<TResult>(list, array, list, array, list);
result = _.differenceBy<TResult>(list, list, array, list, array, list);
result = _.differenceBy<TResult>(list, array, list, array, list, array, list);
result = _.differenceBy<TResult>(list, list, iteratee);
result = _.differenceBy<TResult>(list, array, list, iteratee);
result = _.differenceBy<TResult>(list, list, array, list, iteratee);
result = _.differenceBy<TResult>(list, array, list, array, list, iteratee);
result = _.differenceBy<TResult>(list, list, array, list, array, list, iteratee);
result = _.differenceBy<TResult>(list, array, list, array, list, array, list, iteratee);
result = _.differenceBy<TResult>(list, list, 'a');
result = _.differenceBy<TResult>(list, array, list, 'a');
result = _.differenceBy<TResult>(list, list, array, list, 'a');
result = _.differenceBy<TResult>(list, array, list, array, list, 'a');
result = _.differenceBy<TResult>(list, list, array, list, array, list, 'a');
result = _.differenceBy<TResult>(list, array, list, array, list, array, list, 'a');
result = _.differenceBy<TResult, {a: number}>(list, list, {a: 1});
result = _.differenceBy<TResult, {a: number}>(list, array, list, {a: 1});
result = _.differenceBy<TResult, {a: number}>(list, list, array, list, {a: 1});
result = _.differenceBy<TResult, {a: number}>(list, array, list, array, list, {a: 1});
result = _.differenceBy<TResult, {a: number}>(list, list, array, list, array, list, {a: 1});
result = _.differenceBy<TResult>(list, array, list, array, list, array, list, {a: 1});
}
{
let result: _.LoDashImplicitArrayWrapper<TResult>;
result = _(array).differenceBy<TResult>(array);
result = _(array).differenceBy<TResult>(list, array);
result = _(array).differenceBy<TResult>(array, list, array);
result = _(array).differenceBy<TResult>(list, array, list, array);
result = _(array).differenceBy<TResult>(array, list, array, list, array);
result = _(array).differenceBy<TResult>(list, array, list, array, list, array);
result = _(array).differenceBy<TResult>(array, iteratee);
result = _(array).differenceBy<TResult>(list, array, iteratee);
result = _(array).differenceBy<TResult>(array, list, array, iteratee);
result = _(array).differenceBy<TResult>(list, array, list, array, iteratee);
result = _(array).differenceBy<TResult>(array, list, array, list, array, iteratee);
result = _(array).differenceBy<TResult>(list, array, list, array, list, array, iteratee);
result = _(array).differenceBy<TResult>(array, 'a');
result = _(array).differenceBy<TResult>(list, array, 'a');
result = _(array).differenceBy<TResult>(array, list, array, 'a');
result = _(array).differenceBy<TResult>(list, array, list, array, 'a');
result = _(array).differenceBy<TResult>(array, list, array, list, array, 'a');
result = _(array).differenceBy<TResult>(list, array, list, array, list, array, 'a');
result = _(array).differenceBy<TResult, {a: number}>(array, {a: 1});
result = _(array).differenceBy<TResult, {a: number}>(list, array, {a: 1});
result = _(array).differenceBy<TResult, {a: number}>(array, list, array, {a: 1});
result = _(array).differenceBy<TResult, {a: number}>(list, array, list, array, {a: 1});
result = _(array).differenceBy<TResult, {a: number}>(array, list, array, list, array, {a: 1});
result = _(array).differenceBy<TResult>(list, array, list, array, list, array, {a: 1});
result = _(list).differenceBy<TResult>(list);
result = _(list).differenceBy<TResult>(array, list);
result = _(list).differenceBy<TResult>(list, array, list);
result = _(list).differenceBy<TResult>(array, list, array, list);
result = _(list).differenceBy<TResult>(list, array, list, array, list);
result = _(list).differenceBy<TResult>(array, list, array, list, array, list);
result = _(list).differenceBy<TResult>(list, iteratee);
result = _(list).differenceBy<TResult>(array, list, iteratee);
result = _(list).differenceBy<TResult>(list, array, list, iteratee);
result = _(list).differenceBy<TResult>(array, list, array, list, iteratee);
result = _(list).differenceBy<TResult>(list, array, list, array, list, iteratee);
result = _(list).differenceBy<TResult>(array, list, array, list, array, list, iteratee);
result = _(list).differenceBy<TResult>(list, 'a');
result = _(list).differenceBy<TResult>(array, list, 'a');
result = _(list).differenceBy<TResult>(list, array, list, 'a');
result = _(list).differenceBy<TResult>(array, list, array, list, 'a');
result = _(list).differenceBy<TResult>(list, array, list, array, list, 'a');
result = _(list).differenceBy<TResult>(array, list, array, list, array, list, 'a');
result = _(list).differenceBy<TResult, {a: number}>(list, {a: 1});
result = _(list).differenceBy<TResult, {a: number}>(array, list, {a: 1});
result = _(list).differenceBy<TResult, {a: number}>(list, array, list, {a: 1});
result = _(list).differenceBy<TResult, {a: number}>(array, list, array, list, {a: 1});
result = _(list).differenceBy<TResult, {a: number}>(list, array, list, array, list, {a: 1});
result = _(list).differenceBy<TResult>(array, list, array, list, array, list, {a: 1});
}
{
let result: _.LoDashExplicitArrayWrapper<TResult>;
result = _(array).chain().differenceBy<TResult>(array);
result = _(array).chain().differenceBy<TResult>(list, array);
result = _(array).chain().differenceBy<TResult>(array, list, array);
result = _(array).chain().differenceBy<TResult>(list, array, list, array);
result = _(array).chain().differenceBy<TResult>(array, list, array, list, array);
result = _(array).chain().differenceBy<TResult>(list, array, list, array, list, array);
result = _(array).chain().differenceBy<TResult>(array, iteratee);
result = _(array).chain().differenceBy<TResult>(list, array, iteratee);
result = _(array).chain().differenceBy<TResult>(array, list, array, iteratee);
result = _(array).chain().differenceBy<TResult>(list, array, list, array, iteratee);
result = _(array).chain().differenceBy<TResult>(array, list, array, list, array, iteratee);
result = _(array).chain().differenceBy<TResult>(list, array, list, array, list, array, iteratee);
result = _(array).chain().differenceBy<TResult>(array, 'a');
result = _(array).chain().differenceBy<TResult>(list, array, 'a');
result = _(array).chain().differenceBy<TResult>(array, list, array, 'a');
result = _(array).chain().differenceBy<TResult>(list, array, list, array, 'a');
result = _(array).chain().differenceBy<TResult>(array, list, array, list, array, 'a');
result = _(array).chain().differenceBy<TResult>(list, array, list, array, list, array, 'a');
result = _(array).chain().differenceBy<TResult, {a: number}>(array, {a: 1});
result = _(array).chain().differenceBy<TResult, {a: number}>(list, array, {a: 1});
result = _(array).chain().differenceBy<TResult, {a: number}>(array, list, array, {a: 1});
result = _(array).chain().differenceBy<TResult, {a: number}>(list, array, list, array, {a: 1});
result = _(array).chain().differenceBy<TResult, {a: number}>(array, list, array, list, array, {a: 1});
result = _(array).chain().differenceBy<TResult>(list, array, list, array, list, array, {a: 1});
result = _(list).chain().differenceBy<TResult>(list);
result = _(list).chain().differenceBy<TResult>(array, list);
result = _(list).chain().differenceBy<TResult>(list, array, list);
result = _(list).chain().differenceBy<TResult>(array, list, array, list);
result = _(list).chain().differenceBy<TResult>(list, array, list, array, list);
result = _(list).chain().differenceBy<TResult>(array, list, array, list, array, list);
result = _(list).chain().differenceBy<TResult>(list, iteratee);
result = _(list).chain().differenceBy<TResult>(array, list, iteratee);
result = _(list).chain().differenceBy<TResult>(list, array, list, iteratee);
result = _(list).chain().differenceBy<TResult>(array, list, array, list, iteratee);
result = _(list).chain().differenceBy<TResult>(list, array, list, array, list, iteratee);
result = _(list).chain().differenceBy<TResult>(array, list, array, list, array, list, iteratee);
result = _(list).chain().differenceBy<TResult>(list, 'a');
result = _(list).chain().differenceBy<TResult>(array, list, 'a');
result = _(list).chain().differenceBy<TResult>(list, array, list, 'a');
result = _(list).chain().differenceBy<TResult>(array, list, array, list, 'a');
result = _(list).chain().differenceBy<TResult>(list, array, list, array, list, 'a');
result = _(list).chain().differenceBy<TResult>(array, list, array, list, array, list, 'a');
result = _(list).chain().differenceBy<TResult, {a: number}>(list, {a: 1});
result = _(list).chain().differenceBy<TResult, {a: number}>(array, list, {a: 1});
result = _(list).chain().differenceBy<TResult, {a: number}>(list, array, list, {a: 1});
result = _(list).chain().differenceBy<TResult, {a: number}>(array, list, array, list, {a: 1});
result = _(list).chain().differenceBy<TResult, {a: number}>(list, array, list, array, list, {a: 1});
result = _(list).chain().differenceBy<TResult>(array, list, array, list, array, list, {a: 1});
}
}
// _.drop
{
let array: TResult[];
@@ -3979,8 +4166,53 @@ module TestKeyBy {
}
}
result = <number[][]>_.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
result = <string[][]>_.invokeMap([123, 456], String.prototype.split, '');
//_.invokeMap
module TestInvokeMap {
let numArray = [4, 2, 1, 3]
let numDict: _.Dictionary<number> = {
a: 1,
b: 2,
c: 3,
d: 4
}
let result: string[];
result = _.invokeMap<number, string>(numArray, 'toString');
result = _.invokeMap<number, string>(numArray, 'toString', 2);
result = _.invokeMap<string>(numArray, 'toString');
result = _.invokeMap<string>(numArray, 'toString', 2);
result = _(numArray).invokeMap<string>('toString').value();
result = _(numArray).invokeMap<string>('toString', 2).value();
result = _(numArray).chain().invokeMap<string>('toString').value();
result = _(numArray).chain().invokeMap<string>('toString', 2).value();
result = _.invokeMap<number, string>(numArray, Number.prototype.toString);
result = _.invokeMap<number, string>(numArray, Number.prototype.toString, 2);
result = _.invokeMap<string>(numArray, Number.prototype.toString);
result = _.invokeMap<string>(numArray, Number.prototype.toString, 2);
result = _(numArray).invokeMap<string>(Number.prototype.toString).value();
result = _(numArray).invokeMap<string>(Number.prototype.toString, 2).value();
result = _(numArray).chain().invokeMap<string>(Number.prototype.toString).value();
result = _(numArray).chain().invokeMap<string>(Number.prototype.toString, 2).value();
result = _.invokeMap<number, string>(numDict, 'toString');
result = _.invokeMap<number, string>(numDict, 'toString', 2);
result = _.invokeMap<string>(numDict, 'toString');
result = _.invokeMap<string>(numDict, 'toString', 2);
result = _(numDict).invokeMap<string>('toString').value();
result = _(numDict).invokeMap<string>('toString', 2).value();
result = _(numDict).chain().invokeMap<string>('toString').value();
result = _(numDict).chain().invokeMap<string>('toString', 2).value();
result = _.invokeMap<number, string>(numDict, Number.prototype.toString);
result = _.invokeMap<number, string>(numDict, Number.prototype.toString, 2);
result = _.invokeMap<string>(numDict, Number.prototype.toString);
result = _.invokeMap<string>(numDict, Number.prototype.toString, 2);
result = _(numDict).invokeMap<string>(Number.prototype.toString).value();
result = _(numDict).invokeMap<string>(Number.prototype.toString, 2).value();
result = _(numDict).chain().invokeMap<string>(Number.prototype.toString).value();
result = _(numDict).chain().invokeMap<string>(Number.prototype.toString, 2).value();
}
// _.map
module TestMap {
@@ -5201,17 +5433,28 @@ module TestFlowRight {
}
// _.memoize
var testMemoizedFunction: _.MemoizedFunction;
result = <_.MapCache>testMemoizedFunction.cache;
interface TestMemoizedResultFn extends _.MemoizedFunction {
(...args: any[]): any;
namespace TestMemoize {
var testMemoizedFunction: _.MemoizedFunction;
var cache = <_.MapCache>testMemoizedFunction.cache;
interface TestMemoizedResultFn extends _.MemoizedFunction {
(a1: string, a2: number): boolean;
}
var testMemoizeFn = (a1: string, a2: number) => a1.length > a2;
var testMemoizeResolverFn = (a1: string, a2: number) => a1 + a2;
var result: TestMemoizedResultFn;
result = _.memoize(testMemoizeFn);
result = _.memoize(testMemoizeFn, testMemoizeResolverFn);
result = _(testMemoizeFn).memoize().value();
result = _(testMemoizeFn).memoize(testMemoizeResolverFn).value();
result('foo', 1);
result.cache.get('foo1');
_.memoize.Cache = {
delete: key => false,
get: key => undefined,
has: key => false,
set(key, value) { return this; }
};
}
var testMemoizeFn: (...args: any[]) => any;
var testMemoizeResolverFn: (...args: any[]) => any;
result = <TestMemoizedResultFn>_.memoize<TestMemoizedResultFn>(testMemoizeFn);
result = <TestMemoizedResultFn>_.memoize<TestMemoizedResultFn>(testMemoizeFn, testMemoizeResolverFn);
result = <TestMemoizedResultFn>(_(testMemoizeFn).memoize<TestMemoizedResultFn>().value());
result = <TestMemoizedResultFn>(_(testMemoizeFn).memoize<TestMemoizedResultFn>(testMemoizeResolverFn).value());
// _.overArgs
module TestOverArgs {
@@ -8745,39 +8988,100 @@ module TestPickBy {
// _.set
module TestSet {
type SampleValue = {a: number; b: string; c: boolean;};
type SampleObject = {a: {}};
type SampleResult = {a: {b: number[]}};
let object: TResult;
let value = {a: 1, b: '', c: true};
let object: SampleObject;
let value: number;
{
let result: TResult;
let result: SampleResult;
result = _.set(object, '', any);
result = _.set(object, ['a', 'b', 1], any);
result = _.set<SampleResult>(object, 'a.b[1]', value);
result = _.set<SampleResult>(object, ['a', 'b', 1], value);
result = _.set<SampleValue>(object, '', value);
result = _.set<SampleValue>(object, ['a', 'b', 1], value);
result = _.set<number, SampleResult>(object, 'a.b[1]', value);
result = _.set<number, SampleResult>(object, ['a', 'b', 1], value);
result = _.set<SampleObject, number, SampleResult>(object, 'a.b[1]', value);
result = _.set<SampleObject, number, SampleResult>(object, ['a', 'b', 1], value);
}
{
let result: _.LoDashImplicitObjectWrapper<TResult>;
let result: _.LoDashImplicitObjectWrapper<SampleResult>;
result = _(object).set('', any);
result = _(object).set(['a', 'b', 1], any);
result = _(object).set<SampleResult>('a.b[1]', value);
result = _(object).set<SampleResult>(['a', 'b', 1], value);
result = _(object).set<SampleValue>('', value);
result = _(object).set<SampleValue>(['a', 'b', 1], value);
result = _(object).set<number, SampleResult>('a.b[1]', value);
result = _(object).set<number, SampleResult>(['a', 'b', 1], value);
}
{
let result: _.LoDashExplicitObjectWrapper<TResult>;
let result: _.LoDashExplicitObjectWrapper<SampleResult>;
result = _(object).chain().set('', any);
result = _(object).chain().set(['a', 'b', 1], any);
result = _(object).chain().set<SampleResult>('a.b[1]', value);
result = _(object).chain().set<SampleResult>(['a', 'b', 1], value);
result = _(object).chain().set<SampleValue>('', value);
result = _(object).chain().set<SampleValue>(['a', 'b', 1], value);
result = _(object).chain().set<number, SampleResult>('a.b[1]', value);
result = _(object).chain().set<number, SampleResult>(['a', 'b', 1], value);
}
}
// _.setWith
module TestSetWith {
type SampleObject = {a: {}};
type SampleResult = {a: {b: number[]}};
let object: SampleObject;
let value: number;
let customizer: (value: any, key: string, object: SampleObject) => number;
{
let result: SampleResult;
result = _.setWith<SampleResult>(object, 'a.b[1]', value);
result = _.setWith<SampleResult>(object, 'a.b[1]', value, customizer);
result = _.setWith<SampleResult>(object, ['a', 'b', 1], value);
result = _.setWith<SampleResult>(object, ['a', 'b', 1], value, customizer);
result = _.setWith<number, SampleResult>(object, 'a.b[1]', value);
result = _.setWith<number, SampleResult>(object, 'a.b[1]', value, customizer);
result = _.setWith<number, SampleResult>(object, ['a', 'b', 1], value);
result = _.setWith<number, SampleResult>(object, ['a', 'b', 1], value, customizer);
result = _.setWith<SampleObject, number, SampleResult>(object, 'a.b[1]', value);
result = _.setWith<SampleObject, number, SampleResult>(object, 'a.b[1]', value, customizer);
result = _.setWith<SampleObject, number, SampleResult>(object, ['a', 'b', 1], value);
result = _.setWith<SampleObject, number, SampleResult>(object, ['a', 'b', 1], value, customizer);
}
{
let result: _.LoDashImplicitObjectWrapper<SampleResult>;
result = _(object).setWith<SampleResult>('a.b[1]', value);
result = _(object).setWith<SampleResult>('a.b[1]', value, customizer);
result = _(object).setWith<SampleResult>(['a', 'b', 1], value);
result = _(object).setWith<SampleResult>(['a', 'b', 1], value, customizer);
result = _(object).setWith<number, SampleResult>('a.b[1]', value);
result = _(object).setWith<number, SampleResult>('a.b[1]', value, customizer);
result = _(object).setWith<number, SampleResult>(['a', 'b', 1], value);
result = _(object).setWith<number, SampleResult>(['a', 'b', 1], value, customizer);
}
{
let result: _.LoDashExplicitObjectWrapper<SampleResult>;
result = _(object).chain().setWith<SampleResult>('a.b[1]', value);
result = _(object).chain().setWith<SampleResult>('a.b[1]', value, customizer);
result = _(object).chain().setWith<SampleResult>(['a', 'b', 1], value);
result = _(object).chain().setWith<SampleResult>(['a', 'b', 1], value, customizer);
result = _(object).chain().setWith<number, SampleResult>('a.b[1]', value);
result = _(object).chain().setWith<number, SampleResult>('a.b[1]', value, customizer);
result = _(object).chain().setWith<number, SampleResult>(['a', 'b', 1], value);
result = _(object).chain().setWith<number, SampleResult>(['a', 'b', 1], value, customizer);
}
}
@@ -8898,7 +9202,7 @@ module TestValuesIn {
**********/
// _.camelCase
module TestCamelCase {
namespace TestCamelCase {
{
let result: string;
@@ -8914,7 +9218,7 @@ module TestCamelCase {
}
// _.capitalize
module TestCapitalize {
namespace TestCapitalize {
{
let result: string;
@@ -8930,7 +9234,7 @@ module TestCapitalize {
}
// _.deburr
module TestDeburr {
namespace TestDeburr {
{
let result: string;
@@ -8946,7 +9250,7 @@ module TestDeburr {
}
// _.endsWith
module TestEndsWith {
namespace TestEndsWith {
{
let result: boolean;
@@ -8966,7 +9270,7 @@ module TestEndsWith {
}
// _.escape
module TestEscape {
namespace TestEscape {
{
let result: string;
@@ -8982,7 +9286,7 @@ module TestEscape {
}
// _.escapeRegExp
module TestEscapeRegExp {
namespace TestEscapeRegExp {
{
let result: string;
@@ -8998,7 +9302,7 @@ module TestEscapeRegExp {
}
// _.kebabCase
module TestKebabCase {
namespace TestKebabCase {
{
let result: string;
@@ -9014,7 +9318,7 @@ module TestKebabCase {
}
// _.lowerCase
module TestLowerCase {
namespace TestLowerCase {
{
let result: string;
@@ -9030,7 +9334,7 @@ module TestLowerCase {
}
// _.lowerFirst
module TestLowerFirst {
namespace TestLowerFirst {
{
let result: string;
@@ -9046,11 +9350,11 @@ module TestLowerFirst {
}
// _.pad
module TestPad {
namespace TestPad {
{
let result: string;
result = _.pad('abd');
result = _.pad('abc');
result = _.pad('abc', 8);
result = _.pad('abc', 8, '_-');
@@ -9068,31 +9372,8 @@ module TestPad {
}
}
// _.padStart
module TestPadStart {
{
let result: string;
result = _.padStart('abc');
result = _.padStart('abc', 6);
result = _.padStart('abc', 6, '_-');
result = _('abc').padStart();
result = _('abc').padStart(6);
result = _('abc').padStart(6, '_-');
}
{
let result: _.LoDashExplicitWrapper<string>;
result = _('abc').chain().padStart();
result = _('abc').chain().padStart(6);
result = _('abc').chain().padStart(6, '_-');
}
}
// _.padEnd
module TestPadEnd {
namespace TestPadEnd {
{
let result: string;
@@ -9114,9 +9395,31 @@ module TestPadEnd {
}
}
// _.padStart
namespace TestPadStart {
{
let result: string;
result = _.padStart('abc');
result = _.padStart('abc', 6);
result = _.padStart('abc', 6, '_-');
result = _('abc').padStart();
result = _('abc').padStart(6);
result = _('abc').padStart(6, '_-');
}
{
let result: _.LoDashExplicitWrapper<string>;
result = _('abc').chain().padStart();
result = _('abc').chain().padStart(6);
result = _('abc').chain().padStart(6, '_-');
}
}
// _.parseInt
module TestParseInt {
namespace TestParseInt {
{
let result: number;
@@ -9136,7 +9439,7 @@ module TestParseInt {
}
// _.repeat
module TestRepeat {
namespace TestRepeat {
{
let result: string;
result = _.repeat('*');
@@ -9154,8 +9457,63 @@ module TestRepeat {
}
}
// _.replace
namespace TestReplace {
let replacer = (match: string, offset: number, string: string) => 'Barney';
{
let result: string;
result = _.replace('Hi Fred', 'Fred', 'Barney');
result = _.replace('Hi Fred', 'Fred', replacer);
result = _.replace('Hi Fred', /fred/i, 'Barney');
result = _.replace('Hi Fred', /fred/i, replacer);
result = _.replace('Fred');
result = _.replace('Fred', 'Barney');
result = _.replace('Fred', replacer);
result = _.replace(/fred/i);
result = _.replace(/fred/i, 'Barney');
result = _.replace(/fred/i, replacer);
result = _('Hi Fred').replace('Fred', 'Barney');
result = _('Hi Fred').replace('Fred', replacer);
result = _('Hi Fred').replace(/fred/i, 'Barney');
result = _('Hi Fred').replace(/fred/i, replacer);
result = _('Fred').replace();
result = _('Fred').replace('Barney');
result = _('Fred').replace(replacer);
result = _(/fred/i).replace();
result = _(/fred/i).replace('Barney');
result = _(/fred/i).replace(replacer);
}
{
let result: _.LoDashExplicitWrapper<string>;
result = _('Hi Fred').chain().replace('Fred', 'Barney');
result = _('Hi Fred').chain().replace('Fred', replacer);
result = _('Hi Fred').chain().replace(/fred/i, 'Barney');
result = _('Hi Fred').chain().replace(/fred/i, replacer);
result = _('Fred').chain().replace();
result = _('Fred').chain().replace('Barney');
result = _('Fred').chain().replace(replacer);
result = _(/fred/i).chain().replace();
result = _(/fred/i).chain().replace('Barney');
result = _(/fred/i).chain().replace(replacer);
}
}
// _.snakeCase
module TestSnakeCase {
namespace TestSnakeCase {
{
let result: string;
@@ -9170,8 +9528,35 @@ module TestSnakeCase {
}
}
// _.split
namespace TestSplit {
{
let result: string[];
result = _.split('a-b-c');
result = _.split('a-b-c', '-');
result = _.split('a-b-c', '-', 2);
}
{
let result: _.LoDashImplicitArrayWrapper<string>;
result = _('a-b-c').split();
result = _('a-b-c').split('-');
result = _('a-b-c').split('-', 2);
}
{
let result: _.LoDashExplicitArrayWrapper<string>;
result = _('a-b-c').chain().split();
result = _('a-b-c').chain().split('-');
result = _('a-b-c').chain().split('-', 2);
}
}
// _.startCase
module TestStartCase {
namespace TestStartCase {
{
let result: string;
@@ -9187,7 +9572,7 @@ module TestStartCase {
}
// _.startsWith
module TestStartsWith {
namespace TestStartsWith {
{
let result: boolean;
@@ -9207,7 +9592,7 @@ module TestStartsWith {
}
// _.template
module TestTemplate {
namespace TestTemplate {
interface TemplateExecutor {
(obj?: Object): string;
source: string;
@@ -9241,7 +9626,7 @@ module TestTemplate {
}
// _.toLower
module TestToLower {
namespace TestToLower {
{
let result: string;
@@ -9257,7 +9642,7 @@ module TestToLower {
}
// _.toUpper
module TestToUpper {
namespace TestToUpper {
{
let result: string;
@@ -9273,7 +9658,7 @@ module TestToUpper {
}
// _.trim
module TestTrim {
namespace TestTrim {
{
let result: string;
@@ -9293,29 +9678,8 @@ module TestTrim {
}
}
// _.trimStart
module TestTrimStart {
{
let result: string;
result = _.trimStart();
result = _.trimStart(' abc ');
result = _.trimStart('-_-abc-_-', '_-');
result = _('-_-abc-_-').trimStart();
result = _('-_-abc-_-').trimStart('_-');
}
{
let result: _.LoDashExplicitWrapper<string>;
result = _('-_-abc-_-').chain().trimStart();
result = _('-_-abc-_-').chain().trimStart('_-');
}
}
// _.trimEnd
module TestTrimEnd {
namespace TestTrimEnd {
{
let result: string;
@@ -9335,19 +9699,38 @@ module TestTrimEnd {
}
}
// _.trimStart
namespace TestTrimStart {
{
let result: string;
result = _.trimStart();
result = _.trimStart(' abc ');
result = _.trimStart('-_-abc-_-', '_-');
result = _('-_-abc-_-').trimStart();
result = _('-_-abc-_-').trimStart('_-');
}
{
let result: _.LoDashExplicitWrapper<string>;
result = _('-_-abc-_-').chain().trimStart();
result = _('-_-abc-_-').chain().trimStart('_-');
}
}
// _.truncate
module Testtruncate {
namespace TestTruncate {
{
let result: string;
result = _.truncate('hi-diddly-ho there, neighborino');
result = _.truncate('hi-diddly-ho there, neighborino', 24);
result = _.truncate('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': ' ' });
result = _.truncate('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': /,? +/ });
result = _.truncate('hi-diddly-ho there, neighborino', { 'omission': ' […]' });
result = _('hi-diddly-ho there, neighborino').truncate();
result = _('hi-diddly-ho there, neighborino').truncate(24);
result = _('hi-diddly-ho there, neighborino').truncate({ 'length': 24, 'separator': ' ' });
result = _('hi-diddly-ho there, neighborino').truncate({ 'length': 24, 'separator': /,? +/ });
result = _('hi-diddly-ho there, neighborino').truncate({ 'omission': ' […]' });
@@ -9357,15 +9740,31 @@ module Testtruncate {
let result: _.LoDashExplicitWrapper<string>;
result = _('hi-diddly-ho there, neighborino').chain().truncate();
result = _('hi-diddly-ho there, neighborino').chain().truncate(24);
result = _('hi-diddly-ho there, neighborino').chain().truncate({ 'length': 24, 'separator': ' ' });
result = _('hi-diddly-ho there, neighborino').chain().truncate({ 'length': 24, 'separator': /,? +/ });
result = _('hi-diddly-ho there, neighborino').chain().truncate({ 'omission': ' […]' });
}
}
// _.unescape
namespace TestUnescape {
{
let result: string;
result = _.unescape('fred, barney, &amp; pebbles');
result = _('fred, barney, &amp; pebbles').unescape();
}
{
let result: _.LoDashExplicitWrapper<string>;
result = _('fred, barney, &amp; pebbles').chain().unescape();
}
}
// _.upperCase
module TestUpperCase {
namespace TestUpperCase {
{
let result: string;
@@ -9381,7 +9780,7 @@ module TestUpperCase {
}
// _.upperFirst
module TestUpperFirst {
namespace TestUpperFirst {
{
let result: string;
@@ -9396,24 +9795,8 @@ module TestUpperFirst {
}
}
// _.unescape
module TestUnescape {
{
let result: string;
result = _.unescape('fred, barney, &amp; pebbles');
result = _('fred, barney, &amp; pebbles').unescape();
}
{
let result: _.LoDashExplicitWrapper<string>;
result = _('fred, barney, &amp; pebbles').chain().unescape();
}
}
// _.words
module TestWords {
namespace TestWords {
{
let result: string[];
@@ -9881,6 +10264,29 @@ module TestNoop {
}
}
namespace TestNthArg {
type SampleFunc = (...args: any[]) => any;
{
let result: SampleFunc;
result = _.nthArg<SampleFunc>();
result = _.nthArg<SampleFunc>(1);
}
{
let result: _.LoDashImplicitObjectWrapper<SampleFunc>;
result = _(1).nthArg<SampleFunc>();
}
{
let result: _.LoDashExplicitObjectWrapper<SampleFunc>;
result = _(1).chain().nthArg<SampleFunc>();
}
}
// _.over
namespace TestOver {
{
@@ -9911,6 +10317,66 @@ namespace TestOver {
}
}
// _.overEvery
namespace TestOverEvery {
{
let result: (...args: any[]) => boolean;
result = _.overEvery(() => true);
result = _.overEvery(() => true, () => true);
result = _.overEvery([() => true]);
result = _.overEvery([() => true], [() => true]);
}
{
let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => boolean>;
result = _(Math.max).overEvery();
result = _(Math.max).overEvery(() => true);
result = _([Math.max]).overEvery();
result = _([Math.max]).overEvery([() => true]);
}
{
let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => boolean>;
result = _(Math.max).chain().overEvery();
result = _(Math.max).chain().overEvery(() => true);
result = _([Math.max]).chain().overEvery();
result = _([Math.max]).chain().overEvery([() => true]);
}
}
// _.overSome
namespace TestOverSome {
{
let result: (...args: any[]) => boolean;
result = _.overSome(() => true);
result = _.overSome(() => true, () => true);
result = _.overSome([() => true]);
result = _.overSome([() => true], [() => true]);
}
{
let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => boolean>;
result = _(Math.max).overSome();
result = _(Math.max).overSome(() => true);
result = _([Math.max]).overSome();
result = _([Math.max]).overSome([() => true]);
}
{
let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => boolean>;
result = _(Math.max).chain().overSome();
result = _(Math.max).chain().overSome(() => true);
result = _([Math.max]).chain().overSome();
result = _([Math.max]).chain().overSome([() => true]);
}
}
// _.property
module TestProperty {
interface SampleObject {
@@ -10041,26 +10507,14 @@ module TestTimes {
let result: number[];
result = _.times(42);
result = _(42).times();
}
{
let result: TResult[];
result = _.times(42, iteratee);
result = _.times(42, iteratee, any);
}
{
let result: _.LoDashImplicitArrayWrapper<number>;
result = _(42).times();
}
{
let result: _.LoDashImplicitArrayWrapper<TResult>;
result = _(42).times(iteratee);
result = _(42).times(iteratee, any);
}
{
@@ -10073,7 +10527,6 @@ module TestTimes {
let result: _.LoDashExplicitArrayWrapper<TResult>;
result = _(42).chain().times(iteratee);
result = _(42).chain().times(iteratee, any);
}
}
+1159 -265
View File
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,60 @@
/// <reference path="meteor-publish-composite.d.ts" />
/// <reference path="../meteor/meteor.d.ts" />
import User = Meteor.User;
interface IPost { _id : string, authorId : string };
interface IComment { authorId : string };
var Posts : Mongo.Collection<IPost> = new Mongo.Collection<IPost>('Posts');
var Comments : Mongo.Collection<IComment> = new Mongo.Collection<IComment>('Comments');
// Server
Meteor.publishComposite('topTenPosts', {
find: function() : Mongo.Cursor<IPost> {
// Find top ten highest scoring posts
return Posts.find({}, { sort: { score: -1 }, limit: 10 });
},
children: [
{
find: function(post) {
// Find post author. Even though we only want to return
// one record here, we use "find" instead of "findOne"
// since this function should return a cursor.
return Meteor.users.find(
{ _id: post.authorId },
{ limit: 1, fields: { profile: 1 } });
}
},
{
find: function(post) {
// Find top two comments on post
return Comments.find(
{ postId: post._id },
{ sort: { score: -1 }, limit: 2 });
},
children: [
{
find: function(comment, post) {
// Find user that authored comment.
return Meteor.users.find(
{ _id: comment.authorId },
{ limit: 1, fields: { profile: 1 } });
}
}
]
}
]
});
// Server
Meteor.publishComposite('postsByUser', function(userId, limit) {
return {
find: function() {
// Find posts made by user. Note arguments for callback function
// being used in query.
return Posts.find({ authorId: userId }, { limit: limit });
},
children: [
// This section will be similar to that of the previous example.
]
}
});
+65
View File
@@ -0,0 +1,65 @@
// Type definitions for meteor-publish-composite
// Project: https://github.com/englue/meteor-publish-composite
// Definitions by: Robert Van Gorkom <https://github.com/vangorra>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../meteor/meteor.d.ts" />
declare interface PublishCompositeConfigN {
children? : PublishCompositeConfigN[];
find(
...args : any[]
) : Mongo.Cursor<any>;
}
declare interface PublishCompositeConfig4<InLevel1, InLevel2, InLevel3, InLevel4, OutLevel> {
children? : PublishCompositeConfigN[];
find(
arg4 : InLevel4,
arg3 : InLevel3,
arg2 : InLevel2,
arg1 : InLevel1
) : Mongo.Cursor<OutLevel>;
}
declare interface PublishCompositeConfig3<InLevel1, InLevel2, InLevel3, OutLevel> {
children? : PublishCompositeConfig4<InLevel1, InLevel2, InLevel3, OutLevel, any>[];
find(
arg3 : InLevel3,
arg2 : InLevel2,
arg1 : InLevel1
) : Mongo.Cursor<OutLevel>;
}
declare interface PublishCompositeConfig2<InLevel1, InLevel2, OutLevel> {
children? : PublishCompositeConfig3<InLevel1, InLevel2, OutLevel, any>[];
find(
arg2 : InLevel2,
arg1 : InLevel1
) : Mongo.Cursor<OutLevel>;
}
declare interface PublishCompositeConfig1<InLevel1, OutLevel> {
children? : PublishCompositeConfig2<InLevel1, OutLevel, any>[];
find(
arg1 : InLevel1
) : Mongo.Cursor<OutLevel>;
}
declare interface PublishCompositeConfig<OutLevel> {
children? : PublishCompositeConfig1<OutLevel, any>[];
find() : Mongo.Cursor<OutLevel>;
}
declare module Meteor {
function publishComposite(
name : string,
config : PublishCompositeConfig<any>|PublishCompositeConfig<any>[]
) : void;
function publishComposite(
name : string,
configFunc : (...args : any[]) =>
PublishCompositeConfig<any>|PublishCompositeConfig<any>[]
) : void;
}
+54
View File
@@ -0,0 +1,54 @@
/// <reference path="./micromatch.d.ts" />
import mm = require('micromatch');
var strArrResult: string[];
var boolResult: boolean;
var strMatchFuncResult: mm.MatchFunction<string>;
var anyMatchFuncResult: mm.MatchFunction<any>;
var globDataResult: mm.GlobData;
var regExpResult: RegExp;
// Usage.
strArrResult = mm(['a.js', 'b.md', 'c.txt'], '*.{js,txt}');
// Multiple patterns.
strArrResult = mm(['a.md', 'b.js', 'c.txt', 'd.json'], ['*.md', '*.txt']);
// "isMatch" method.
boolResult = mm.isMatch('.verb.md', '*.md');
boolResult = mm.isMatch('.verb.md', '*.md', {dot: true});
boolResult = mm.isMatch('*.md', {dot: true})('.verb.md');
// "contains" method.
boolResult = mm.contains('a/b/c', 'a/b');
boolResult = mm.contains('a/b/c', 'a/b', {dot: true});
// "matcher" method.
strMatchFuncResult = mm.matcher('*.md');
strMatchFuncResult = mm.matcher(/\.md$/);
strMatchFuncResult = mm.matcher((filePath: string) => true);
// "filter" method.
anyMatchFuncResult = mm.filter('*.md');
anyMatchFuncResult = mm.filter(/\.md$/);
anyMatchFuncResult = mm.filter((filePath: string) => true);
anyMatchFuncResult = mm.filter('*.md', {dot: true});
['a.js', 'b.txt', 'c.md'].filter(anyMatchFuncResult);
var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
anyMatchFuncResult = mm.filter(['{1..10}', '![7-9]', '!{3..4}']);
arr.filter(anyMatchFuncResult);
// "any" method.
boolResult = mm.any('abc', ['!*z']);
boolResult = mm.any('abc', 'a*');
boolResult = mm.any('abc', 'a*', {dot: true});
// "expand" method.
globDataResult = mm.expand('*.js');
globDataResult = mm.expand('*.js', {dot: true});
// "makeRe" method.
regExpResult = mm.makeRe('*.js');
regExpResult = mm.makeRe('*.js', {dot: true});
+174
View File
@@ -0,0 +1,174 @@
// Type definitions for micromatch 2.3.7
// Project: https://github.com/jonschlinkert/micromatch
// Definitions by: glen-84 <https://github.com/glen-84>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../parse-glob/parse-glob.d.ts" />
declare module 'micromatch' {
import parseGlob = require('parse-glob');
namespace micromatch {
type MatchFunction<T> = ((value: T) => boolean);
type Pattern = (string | RegExp | MatchFunction<string>);
interface Options {
/**
* Normalize slashes in file paths and glob patterns to forward slashes.
*/
unixify?: boolean;
/**
* Match dotfiles. Same behavior as minimatch.
*/
dot?: boolean;
/**
* Unescape slashes in glob patterns. Use cautiously, especially on windows.
*/
unescape?: boolean;
/**
* Remove duplicate elements from the result array.
*/
nodupes?: boolean;
/**
* Allow glob patterns without slashes to match a file path based on its basename. Same behavior as
* minimatch.
*/
matchBase?: boolean;
/**
* Don't expand braces in glob patterns. Same behavior as minimatch nobrace.
*/
nobraces?: boolean;
/**
* Don't expand POSIX bracket expressions.
*/
nobrackets?: boolean;
/**
* Don't expand extended globs.
*/
noextglob?: boolean;
/**
* Use a case-insensitive regex for matching files. Same behavior as minimatch.
*/
nocase?: boolean;
/**
* If true, when no matches are found the actual (array-ified) glob pattern is returned instead of an empty
* array. Same behavior as minimatch.
*/
nonull?: boolean;
/**
* Cache the platform (e.g. win32) to prevent this from being looked up for every file path.
*/
cache?: boolean;
}
interface Glob {
options: micromatch.Options;
pattern: string;
history: {msg: any, pattern: string}[];
tokens: parseGlob.Result;
orig: string;
negated: boolean;
/**
* Initialize defaults.
*/
init(pattern: string): void;
/**
* Push a change into `glob.history`. Useful for debugging.
*/
track(msg: any): void;
/**
* Return true if `glob.pattern` was negated with `!`, also remove the `!` from the pattern.
*/
isNegated(): boolean;
/**
* Expand braces in the given glob pattern.
*/
braces(): void;
/**
* Expand bracket expressions in `glob.pattern`.
*/
brackets(): void;
/**
* Expand extended globs in `glob.pattern`.
*/
extglob(): void;
/**
* Parse the given pattern.
*/
parse(pattern: string): parseGlob.Result;
/**
* Escape special characters in the given string.
*/
escape(pattern: string): string;
/**
* Unescape special characters in the given string.
*/
unescape(pattern: string): string;
}
interface GlobData {
pattern: string;
tokens: parseGlob.Result;
options: micromatch.Options;
}
}
interface Micromatch {
(files: string | string[], patterns: micromatch.Pattern | micromatch.Pattern[]): string[];
isMatch: {
/**
* Returns true if a file path matches the given pattern.
*/
(filePath: string, pattern: micromatch.Pattern, opts?: micromatch.Options): boolean;
/**
* Returns a function for matching.
*/
(filePath: string, opts?: micromatch.Options): micromatch.MatchFunction<string>;
};
/**
* Returns true if any part of a file path matches the given pattern. Think of this as "has path" versus
* "is path".
*/
contains(filePath: string, pattern: micromatch.Pattern, opts?: micromatch.Options): boolean;
/**
* Returns a function for matching using the supplied pattern. e.g. create your own "matcher". The advantage of
* this method is that the pattern can be compiled outside of a loop.
*/
matcher(pattern: micromatch.Pattern): micromatch.MatchFunction<string>;
/**
* Returns a function that can be passed to Array#filter().
*/
filter(patterns: micromatch.Pattern | micromatch.Pattern[], opts?: micromatch.Options): micromatch.MatchFunction<any>;
/**
* Returns true if a file path matches any of the given patterns.
*/
any(filePath: string, patterns: micromatch.Pattern | micromatch.Pattern[], opts?: micromatch.Options): boolean;
/**
* Returns an object with a regex-compatible string and tokens.
*/
expand(pattern: string, opts?: micromatch.Options): micromatch.Glob | micromatch.GlobData;
/**
* Create a regular expression for matching file paths based on the given pattern.
*/
makeRe(pattern: string, opts?: micromatch.Options): RegExp;
}
const micromatch: Micromatch;
export = micromatch;
}
+7
View File
@@ -77,3 +77,10 @@ var mockedFS = mock.fs({
if (mockedFS.readFileSync('/file', { encoding: 'utf8' }) === 'blah') {
console.log('woo');
}
mock({
'path/to/file.txt': 'file content here'
}, {
createTmp: true,
createCwd: false
});
+10 -4
View File
@@ -1,6 +1,6 @@
// Type definitions for mock-fs 2.5.0
// Type definitions for mock-fs 3.6.0
// Project: https://github.com/tschaub/mock-fs
// Definitions by: Wim Looman <https://github.com/Nemo157>
// Definitions by: Wim Looman <https://github.com/Nemo157>, Qubo <https://github.com/tkqubo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
@@ -8,7 +8,7 @@
declare module "mock-fs" {
import fs = require("fs");
function mock(config?: mock.Config): void;
function mock(config?: mock.Config, options?: mock.Options): void;
module mock {
function file(config: FileConfig): File;
@@ -17,12 +17,17 @@ declare module "mock-fs" {
function restore(): void;
function fs(config?: Config): typeof fs;
function fs(config?: Config, options?: Options): typeof fs;
interface Config {
[path: string]: string | Buffer | File | Directory | Symlink | Config;
}
interface Options {
createCwd?: boolean;
createTmp?: boolean;
}
interface CommonConfig {
mode?: number;
uid?: number;
@@ -30,6 +35,7 @@ declare module "mock-fs" {
atime?: Date;
ctime?: Date;
mtime?: Date;
birthtime?: Date;
}
interface FileConfig extends CommonConfig {
+8 -7
View File
@@ -18,7 +18,7 @@ declare module moment {
seconds?: number;
milliseconds?: number;
}
interface MomentInput {
/** Year */
years?: number;
@@ -125,11 +125,11 @@ declare module moment {
}
interface MomentCreationData {
input?: string,
format?: string,
locale: MomentLocale,
isUTC: boolean,
strict?: boolean
input?: string;
format?: string;
locale: MomentLocale;
isUTC: boolean;
strict?: boolean;
}
interface Moment {
@@ -313,6 +313,7 @@ declare module moment {
* @since 2.10.7+
*/
isSameOrBefore(b: MomentComparable, granularity?: string): boolean;
isSameOrAfter(b: MomentComparable, granularity?: string): boolean;
/**
* @deprecated since version 2.8.0
@@ -344,7 +345,7 @@ declare module moment {
get(unit: string): number;
set(unit: string, value: number): Moment;
set(objectLiteral: MomentInput): Moment;
/**
* This returns an object containing year, month, day-of-month, hour, minute, seconds, milliseconds.
* @since 2.10.5+
@@ -0,0 +1,15 @@
/// <reference path="node-sass-middleware.d.ts" />
import * as express from "express";
import * as sassMiddleware from "node-sass-middleware";
import * as path from "path";
var app = express();
app.use(sassMiddleware({
/* Options */
src: __dirname,
dest: path.join(__dirname, 'public'),
debug: true,
outputStyle: 'compressed',
prefix: '/prefix' // Where prefix is at <link rel="stylesheets" href="prefix/style.css"/>
}));
app.use(express.static(path.join(__dirname, 'public')));
+69
View File
@@ -0,0 +1,69 @@
// Type definitions for node-sass-middleware
// Project: https://github.com/sass/node-sass-middleware
// Definitions by: Pascal Garber <http://www.jumplink.eu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
/// <reference path="../node-sass/node-sass.d.ts" />
declare module "node-sass-middleware" {
import * as sass from "node-sass";
import * as express from "express";
interface Options extends sass.Options {
/**
*
*/
src: string;
/**
*
*/
dest?: string;
/**
*
*/
root?: string;
/**
*
*/
prefix?: string;
/**
*
*/
force?: boolean;
/**
*
*/
debug?: boolean;
/**
*
*/
indentedSyntax?: boolean;
/**
*
*/
response?: boolean;
/**
*
*/
error?: () => void;
}
/**
*
*
*/
function nodeSassMiddleware(options: Options): express.RequestHandler;
/**
*
*/
namespace nodeSassMiddleware { }
/**
*
*/
export = nodeSassMiddleware;
}
+43 -37
View File
@@ -13,9 +13,9 @@
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz"
},
"bluebird": {
"version": "2.10.2",
"from": "bluebird@>=2.10.1 <3.0.0",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.10.2.tgz"
"version": "3.1.5",
"from": "bluebird@>=3.1.2 <4.0.0",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.1.5.tgz"
},
"brace-expansion": {
"version": "1.1.2",
@@ -33,19 +33,25 @@
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz"
},
"definition-header": {
"version": "0.1.0",
"from": "definition-header@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/definition-header/-/definition-header-0.1.0.tgz"
"version": "0.3.0",
"from": "definition-header@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/definition-header/-/definition-header-0.3.0.tgz"
},
"definition-tester": {
"version": "0.3.0",
"from": "definition-tester@0.3.0",
"resolved": "https://registry.npmjs.org/definition-tester/-/definition-tester-0.3.0.tgz"
"version": "0.4.0",
"from": "definition-tester@0.4.0"
},
"findup-sync": {
"version": "0.3.0",
"from": "findup-sync@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz"
"resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz",
"dependencies": {
"glob": {
"version": "5.0.15",
"from": "glob@>=5.0.0 <5.1.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz"
}
}
},
"git-wrapper": {
"version": "0.1.1",
@@ -53,14 +59,14 @@
"resolved": "https://registry.npmjs.org/git-wrapper/-/git-wrapper-0.1.1.tgz"
},
"glob": {
"version": "5.0.15",
"from": "glob@>=5.0.14 <6.0.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz"
"version": "6.0.4",
"from": "glob@>=6.0.4 <7.0.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz"
},
"hoek": {
"version": "2.16.3",
"from": "hoek@>=2.2.0 <3.0.0",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz"
"version": "3.0.4",
"from": "hoek@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-3.0.4.tgz"
},
"inflight": {
"version": "1.0.4",
@@ -78,18 +84,18 @@
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"isemail": {
"version": "1.2.0",
"from": "isemail@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/isemail/-/isemail-1.2.0.tgz"
"version": "2.1.0",
"from": "isemail@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/isemail/-/isemail-2.1.0.tgz"
},
"joi": {
"version": "4.9.0",
"from": "joi@>=4.0.0 <5.0.0",
"resolved": "https://registry.npmjs.org/joi/-/joi-4.9.0.tgz"
"version": "7.2.2",
"from": "joi@>=7.2.2 <8.0.0",
"resolved": "https://registry.npmjs.org/joi/-/joi-7.2.2.tgz"
},
"joi-assert": {
"version": "0.0.3",
"from": "joi-assert@0.0.3",
"from": "joi-assert@>=0.0.3 <0.0.4",
"resolved": "https://registry.npmjs.org/joi-assert/-/joi-assert-0.0.3.tgz"
},
"jsonparse": {
@@ -130,9 +136,9 @@
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz"
},
"moment": {
"version": "2.10.6",
"version": "2.11.1",
"from": "moment@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.10.6.tgz"
"resolved": "https://registry.npmjs.org/moment/-/moment-2.11.1.tgz"
},
"once": {
"version": "1.3.3",
@@ -145,9 +151,9 @@
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz"
},
"parsimmon": {
"version": "0.5.1",
"from": "parsimmon@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-0.5.1.tgz"
"version": "0.7.0",
"from": "parsimmon@>=0.7.0 <0.8.0",
"resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-0.7.0.tgz"
},
"path-is-absolute": {
"version": "1.0.0",
@@ -180,9 +186,9 @@
"resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz"
},
"topo": {
"version": "1.1.0",
"from": "topo@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/topo/-/topo-1.1.0.tgz"
"version": "2.0.0",
"from": "topo@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/topo/-/topo-2.0.0.tgz"
},
"type-detect": {
"version": "0.1.2",
@@ -190,9 +196,9 @@
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.2.tgz"
},
"typescript": {
"version": "1.7.3",
"from": "typescript@1.7.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-1.7.3.tgz"
"version": "1.7.5",
"from": "typescript@1.7.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-1.7.5.tgz"
},
"wordwrap": {
"version": "0.0.3",
@@ -205,9 +211,9 @@
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
},
"xregexp": {
"version": "2.0.0",
"from": "xregexp@>=2.0.0 <2.1.0",
"resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz"
"version": "3.0.0",
"from": "xregexp@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/xregexp/-/xregexp-3.0.0.tgz"
},
"xtend": {
"version": "3.0.0",
+13
View File
@@ -0,0 +1,13 @@
/// <reference path="once.d.ts" />
import once from "once";
once(() => 3);
once(() => 3)();
let s = once(() => ({foo: 1}))();
s.foo;
once.proto();
once(() => 3).called && true;
once(() => ({foo: 1})).value.foo;
+23
View File
@@ -0,0 +1,23 @@
// Type definitions for once v1.3.3
// Project: https://github.com/isaacs/once
// Definitions by: Denis Sokolov <https://github.com/denis-sokolov>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface SimpleFunction<Result> {
(...args: any[]): Result;
}
interface OnceFunction<Result> extends SimpleFunction<Result> {
called: boolean;
value: Result;
}
interface Once {
<Result>(f: SimpleFunction<Result>): OnceFunction<Result>;
proto: Function;
}
declare module "once" {
var once: Once;
export default once;
}
+2 -2
View File
@@ -35,7 +35,7 @@
"dependencies": {
},
"devDependencies": {
"definition-tester": "0.3.0",
"typescript": "1.7.3"
"definition-tester": "0.4.0",
"typescript": "1.7.5"
}
}
+24
View File
@@ -0,0 +1,24 @@
/// <reference path="./parse-glob.d.ts" />
import parseGlob = require('parse-glob');
var result: parseGlob.Result = parseGlob('a/b/c/**/*.{yml,json}');
var stringValue: string;
var boolValue: boolean;
stringValue = result.base;
stringValue = result.glob;
boolValue = result.is.braces;
boolValue = result.is.brackets;
boolValue = result.is.dotdir;
boolValue = result.is.dotfile;
boolValue = result.is.extglob;
boolValue = result.is.glob;
boolValue = result.is.globstar;
boolValue = result.is.negated;
stringValue = result.orig;
stringValue = result.path.basename;
stringValue = result.path.dirname;
stringValue = result.path.ext;
stringValue = result.path.extname;
stringValue = result.path.filename;
+92
View File
@@ -0,0 +1,92 @@
// Type definitions for parse-glob 3.0.4
// Project: https://github.com/jonschlinkert/parse-glob
// Definitions by: glen-84 <https://github.com/glen-84>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'parse-glob' {
namespace parseGlob {
interface Result {
/**
* A copy of the original, unmodified glob pattern.
*/
orig: string;
/**
* An object with boolean information about the glob.
*/
is: {
/**
* True if the pattern actually is a glob pattern.
*/
glob: boolean;
/**
* True if it's a negation pattern (!/foo.js).
*/
negated: boolean;
/**
* True if it has extglobs (@(foo|bar)).
*/
extglob: boolean;
/**
* True if it has braces ({1..2} or .{txt,md}).
*/
braces: boolean;
/**
* True if it has POSIX brackets ([[:alpha:]]).
*/
brackets: boolean;
/**
* True if the pattern has a globstar (double star, **).
*/
globstar: boolean;
/**
* True if the pattern should match dotfiles.
*/
dotfile: boolean;
/**
* True if the pattern should match dot-directories (like .git).
*/
dotdir: boolean;
};
/**
* The glob pattern part of the string, if any.
*/
glob: string;
/**
* The non-glob part of the string, if any.
*/
base: string;
/**
* File path segments.
*/
path: {
/**
* Directory.
*/
dirname: string;
/**
* File name with extension.
*/
basename: string;
/**
* File name without extension.
*/
filename: string;
/**
* File extension with dot.
*/
extname: string;
/**
* File extension without dot.
*/
ext: string;
};
}
}
interface ParseGlob {
(glob: string): parseGlob.Result;
}
const parseGlob: ParseGlob;
export = parseGlob;
}
+97
View File
@@ -0,0 +1,97 @@
/// <reference path="parse-torrent.d.ts" />
import parseTorrent = require('parse-torrent');
import * as fs from 'fs';
// info hash (as a hex string)
parseTorrent('d2474e86c95b19b8bcfdb92bc12c9d44667cfa36')
// { infoHash: 'd2474e86c95b19b8bcfdb92bc12c9d44667cfa36' }
// info hash (as a Buffer)
parseTorrent(new Buffer('d2474e86c95b19b8bcfdb92bc12c9d44667cfa36', 'hex'))
// { infoHash: 'd2474e86c95b19b8bcfdb92bc12c9d44667cfa36' }
// magnet uri (as a utf8 string)
parseTorrent('magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36')
// { xt: 'urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36',
// infoHash: 'd2474e86c95b19b8bcfdb92bc12c9d44667cfa36' }
// magnet uri with torrent name
parseTorrent('magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36&dn=Leaves%20of%20Grass%20by%20Walt%20Whitman.epub')
// { xt: 'urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36',
// dn: 'Leaves of Grass by Walt Whitman.epub',
// infoHash: 'd2474e86c95b19b8bcfdb92bc12c9d44667cfa36',
// name: 'Leaves of Grass by Walt Whitman.epub' }
// magnet uri with trackers
parseTorrent('magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36&tr=http%3A%2F%2Ftracker.example.com%2Fannounce')
// { xt: 'urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36',
// tr: 'http://tracker.example.com/announce',
// infoHash: 'd2474e86c95b19b8bcfdb92bc12c9d44667cfa36',
// announce: [ 'http://tracker.example.com/announce' ] }
// .torrent file (as a Buffer)
parseTorrent(fs.readFileSync(__dirname + '/torrents/leaves.torrent'))
// { info:
// { length: 362017,
// name: <Buffer 4c 65 61 76 65 73 20 6f 66 20 47 72 61 73 73 20 62 79 20 57 61 6c 74 20 57 68 69 74 6d 61 6e 2e 65 70 75 62>,
// 'piece length': 16384,
// pieces: <Buffer 1f 9c 3f 59 be ec 07 97 15 ec 53 32 4b de 85 69 e4 a0 b4 eb ec 42 30 7d 4c e5 55 7b 5d 39 64 c5 ef 55 d3 54 cf 4a 6e cc 7b f1 bc af 79 d1 1f a5 e0 be 06 ...> },
// infoBuffer: <Buffer 64 36 3a 6c 65 6e 67 74 68 69 33 36 32 30 31 37 65 34 3a 6e 61 6d 65 33 36 3a 4c 65 61 76 65 73 20 6f 66 20 47 72 61 73 73 20 62 79 20 57 61 6c 74 20 57 ...>,
// infoHash: 'd2474e86c95b19b8bcfdb92bc12c9d44667cfa36',
// name: 'Leaves of Grass by Walt Whitman.epub',
// private: false,
// created: Thu Aug 01 2013 06:27:46 GMT-0700 (PDT),
// comment: 'Downloaded from http://TheTorrent.org',
// announce:
// [ 'http://tracker.example.com/announce' ],
// urlList: [],
// files:
// [ { path: 'Leaves of Grass by Walt Whitman.epub',
// name: 'Leaves of Grass by Walt Whitman.epub',
// length: 362017,
// offset: 0 } ],
// length: 362017,
// pieceLength: 16384,
// lastPieceLength: 1569,
// pieces:
// [ '1f9c3f59beec079715ec53324bde8569e4a0b4eb',
// 'ec42307d4ce5557b5d3964c5ef55d354cf4a6ecc',
// '7bf1bcaf79d11fa5e0be06593c8faafc0c2ba2cf',
// '76d71c5b01526b23007f9e9929beafc5151e6511',
// '0931a1b44c21bf1e68b9138f90495e690dbc55f5',
// '72e4c2944cbacf26e6b3ae8a7229d88aafa05f61',
// 'eaae6abf3f07cb6db9677cc6aded4dd3985e4586',
// '27567fa7639f065f71b18954304aca6366729e0b',
// '4773d77ae80caa96a524804dfe4b9bd3deaef999',
// 'c9dd51027467519d5eb2561ae2cc01467de5f643',
// '0a60bcba24797692efa8770d23df0a830d91cb35',
// 'b3407a88baa0590dc8c9aa6a120f274367dcd867',
// 'e88e8338c572a06e3c801b29f519df532b3e76f6',
// '70cf6aee53107f3d39378483f69cf80fa568b1ea',
// 'c53b506159e988d8bc16922d125d77d803d652c3',
// 'ca3070c16eed9172ab506d20e522ea3f1ab674b3',
// 'f923d76fe8f44ff32e372c3b376564c6fb5f0dbe',
// '52164f03629fd1322636babb2c014b7dae582da4',
// '1363965261e6ce12b43701f0a8c9ed1520a70eba',
// '004400a267765f6d3dd5c7beb5bd3c75f3df2a54',
// '560a61801147fa4ec7cf568e703acb04e5610a4d',
// '56dcc242d03293e9446cf5e457d8eb3d9588fd90',
// 'c698de9b0dad92980906c026d8c1408fa08fe4ec' ] }
var uri = parseTorrent.toMagnetURI({
infoHash: 'd2474e86c95b19b8bcfdb92bc12c9d44667cfa36'
})
var buf = parseTorrent.toTorrentFile({
info: {
infoHash: 'd2474e86c95b19b8bcfdb92bc12c9d44667cfa36'
/* ... */
}
})
parseTorrent.remote('d2474e86c95b19b8bcfdb92bc12c9d44667cfa36', function (err, parsedTorrent) {
// if (err) throw err
// console.log(parsedTorrent)
})
+42
View File
@@ -0,0 +1,42 @@
// Type definitions for parse-torrent
// Project: https://github.com/feross/parse-torrent
// Definitions by: Bazyli Brzóska <https://invent.life>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path='../node/node.d.ts' />
declare module ParseTorrent {
export interface ParsedTorrent {
infoHash:string;
xt?:string;
info?: { length:number, name:Buffer, 'piece length':number, pieces:Buffer };
infoBuffer?:Buffer;
name?:string;
private?:boolean;
created?:Date;
comment?:string;
announce?:Array<string>;
urlList?:Array<string>;
files?:Array<{path:string, name:string, length: number, offset:number}>;
length?:number;
pieceLength?:number;
lastPieceLength?:number;
pieces?:Array<string>;
}
interface StaticInstance {
(magnetUriOrInfoHash:string):ParsedTorrent;
(torrentFileOrInfoHash:Buffer):{ info:ParsedTorrent };
toMagnetURI(parsedTorrent:ParsedTorrent):string;
toTorrentFile(parsedTorrent:{ info:ParsedTorrent }):Buffer;
remote(remoteURLorLocalTorrentPath:string, onTorrentCallback?:(err:Error, parsedTorrent:ParsedTorrent)=>void):void;
remote(torrentBlob:Blob, onTorrentCallback?:(err:Error, parsedTorrent:ParsedTorrent)=>void):void;
}
}
declare module "parse-torrent" {
const parseTorrentStatic:ParseTorrent.StaticInstance;
export = parseTorrentStatic;
}
@@ -0,0 +1,60 @@
/// <reference path="./passport-http-bearer.d.ts"/>
/**
* Created by Isman Usoh <https://github.com/isman-usoh>.
*/
import express = require("express");
import passport = require("passport");
import httpBearer = require("passport-http-bearer");
//#region Test Models
interface IUser {
token: string;
}
class User implements IUser {
public token: string;
static findOne(user: IUser, callback: (err: Error, user: User) => void): void {
callback(null, new User());
}
}
//#endregion
passport.use(new httpBearer.Strategy((token: string, done: any) => {
User.findOne({ token: token }, function(err, user) {
if (err) {
return done(err);
}
if (!user) {
return done(null, false);
}
return done(null, user);
});
}));
passport.use(new httpBearer.Strategy({
scope: ["read", "write"],
realm: "User",
passReqToCallback: true
}, function(req: express.Request, token: string, done: any) {
User.findOne({ token: token }, function(err, user) {
if (err) {
return done(err, null, { message: "Access Denied" });
}
if (!user) {
return done(null, false, "Access Denied");
}
return done(null, user);
});
}));
let app = express();
app.post("/login", passport.authenticate("bearer", { failureRedirect: "/login" }), function(req, res) {
res.redirect("/");
});
+40
View File
@@ -0,0 +1,40 @@
// Type definitions for passport-http-bearer 1.0.1
// Project: https://github.com/jaredhanson/passport-http-bearer
// Definitions by: Isman Usoh <https://github.com/isman-usoh>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../passport/passport.d.ts"/>
/// <reference path="../express/express.d.ts"/>
declare module "passport-http-bearer" {
import passport = require("passport");
import express = require("express");
interface IStrategyOptions {
scope: string | Array<string>;
realm: string;
passReqToCallback: boolean;
}
interface IVerifyOptions {
message: string;
scope: string | Array<string>;
}
interface VerifyFunction {
(token: string, done: (error: any, user?: any, options?: IVerifyOptions | string) => void): void;
}
interface VerifyFunctionWithRequest {
(req: express.Request, token: string, done: (error: any, user?: any, options?: IVerifyOptions | string) => void): void;
}
class Strategy implements passport.Strategy {
constructor(verify: VerifyFunction);
constructor(options: IStrategyOptions, verify: VerifyFunction);
constructor(options: IStrategyOptions, verify: VerifyFunctionWithRequest);
name: string;
authenticate: (req: express.Request, options?: Object) => void;
}
}
+29
View File
@@ -0,0 +1,29 @@
/// <reference path="pi-spi" />
import * as piSPI from 'pi-spi';
var spi:piSPI.SPI = piSPI.initialize("test");
var b:Buffer = new Buffer("Hello, World!");
var cb = function(error:Error, data:Buffer):void { };
spi.bitOrder(piSPI.order.LSB_FIRST);
spi.bitOrder(piSPI.order.MSB_FIRST);
console.log(spi.bitOrder());
spi.dataMode(piSPI.mode.CPHA);
spi.dataMode(piSPI.mode.CPOL);
console.log(spi.dataMode());
spi.clockSpeed(4e6);
console.log(spi.clockSpeed());
spi.write(b, cb);
spi.read(13, cb);
spi.transfer(b, cb);
spi.transfer(b, 13, cb);
spi.close();
+46
View File
@@ -0,0 +1,46 @@
// Type definitions for pi-spi
// Project: https://github.com/natevw/pi-spi
// Definitions by: Marcel Ernst <https://github.com/marcel-ernst>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare namespace __PI_SPI {
enum mode {
CPHA = 0x01,
CPOL = 0x02
}
enum order {
MSB_FIRST = 0,
LSB_FIRST = 1
}
function initialize(device:string):__PI_SPI.SPI;
class SPI {
clockSpeed():number;
clockSpeed(speed:number):void;
dataMode():number;
dataMode(mode:mode):void;
bitOrder():number;
bitOrder(order:order):void;
write(writebuf:Buffer, cb:(error:Error,data:Buffer) => void):void;
read(readcount:number, cb:(error:Error,data:Buffer) => void):void;
transfer(writebuf:Buffer, cb:(error:Error,data:Buffer) => void ):void;
transfer(writebuf:Buffer, readcount:number, cb:(error:Error,data:Buffer) => void ):void;
close():void;
}
}
declare module "pi-spi" {
export = __PI_SPI;
}
+3 -1
View File
@@ -2,6 +2,8 @@
/// <reference path="../moment/moment.d.ts" />
/// <reference path="pikaday.d.ts" />
import * as Pikaday from "pikaday";
new Pikaday({field: document.getElementById('datepicker')});
new Pikaday({field: $('#datepicker')[0]});
@@ -46,7 +48,7 @@ new Pikaday({field: $('#datepicker')[0]});
})();
(() => {
var i18n:PikadayI18nConfig = {
var i18n: Pikaday.PikadayI18nConfig = {
previousMonth: 'Previous Month',
nextMonth: 'Next Month',
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
+46 -39
View File
@@ -5,48 +5,10 @@
/// <reference path="../moment/moment.d.ts" />
interface PikadayI18nConfig {
previousMonth: string;
nextMonth: string;
months: string[];
weekdays: string[];
weekdaysShort: string[];
}
interface PikadayOptions {
field?: HTMLElement;
format?: string;
trigger?: HTMLElement;
bound?: boolean;
position?: string;
reposition?: boolean;
container?: HTMLElement;
defaultDate?: Date;
setDefaultDate?: boolean;
firstDay?: number;
minDate?: Date;
maxDate?: Date;
disableWeekends?: boolean;
disableDayFn?: (date:Date) => boolean;
yearRange?: number[];
showWeekNumber?: boolean;
isRTL?: boolean;
i18n?: PikadayI18nConfig;
yearSuffix?: string;
showMonthAfterYear?: boolean;
numberOfMonths?: number;
mainCalendar?: string;
theme?: string;
onSelect?: (date:Date) => void;
onOpen?: () => void;
onClose?: () => void;
onDraw?: () => void;
}
declare class Pikaday {
el:HTMLElement;
constructor(options:PikadayOptions);
constructor(options: Pikaday.PikadayOptions);
toString():string;
toString(format:string):string;
@@ -87,3 +49,48 @@ declare class Pikaday {
destroy():void;
}
// merge the Pikaday class declaration with a module
declare module Pikaday {
interface PikadayI18nConfig {
previousMonth: string;
nextMonth: string;
months: string[];
weekdays: string[];
weekdaysShort: string[];
}
interface PikadayOptions {
field?: HTMLElement;
format?: string;
trigger?: HTMLElement;
bound?: boolean;
position?: string;
reposition?: boolean;
container?: HTMLElement;
defaultDate?: Date;
setDefaultDate?: boolean;
firstDay?: number;
minDate?: Date;
maxDate?: Date;
disableWeekends?: boolean;
disableDayFn?: (date:Date) => boolean;
yearRange?: number[];
showWeekNumber?: boolean;
isRTL?: boolean;
i18n?: PikadayI18nConfig;
yearSuffix?: string;
showMonthAfterYear?: boolean;
numberOfMonths?: number;
mainCalendar?: string;
theme?: string;
onSelect?: (date:Date) => void;
onOpen?: () => void;
onClose?: () => void;
onDraw?: () => void;
}
}
declare module "pikaday" {
export = Pikaday;
}
+15 -14
View File
@@ -1,4 +1,4 @@
// Type definitions for Pixi.js 3.0.9 dev
// Type definitions for Pixi.js 3.0.9 dev
// Project: https://github.com/GoodBoyDigital/pixi.js/
// Definitions by: clark-stevenson <https://github.com/pixijs/pixi-typescript>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -87,10 +87,10 @@ declare module PIXI {
emit(event: string, ...args: any[]): boolean;
on(event: string, fn: Function, context?: any): EventEmitter;
once(event: string, fn: Function, context?: any): EventEmitter;
removeListener(event: string, fn: Function, once?: boolean): EventEmitter;
removeListener(event: string, fn: Function, context?: any, once?: boolean): EventEmitter;
removeAllListeners(event: string): EventEmitter;
off(event: string, fn: Function, once?: boolean): EventEmitter;
off(event: string, fn: Function, context?: any, once?: boolean): EventEmitter;
addListener(event: string, fn: Function, context?: any): EventEmitter;
}
@@ -502,7 +502,7 @@ declare module PIXI {
export interface RendererOptions {
view?: HTMLCanvasElement;
transparent?: boolean
transparent?: boolean;
antialias?: boolean;
resolution?: number;
clearBeforeRendering?: boolean;
@@ -611,7 +611,7 @@ declare module PIXI {
premultipliedAlpha: boolean;
stencil: boolean;
preseveDrawingBuffer: boolean;
}
};
protected _renderTargetStack: RenderTarget[];
protected _initContext(): void;
@@ -689,7 +689,7 @@ declare module PIXI {
popFilter(): AbstractFilter;
getRenderTarget(clear?: boolean): RenderTarget;
protected returnRenderTarget(renderTarget: RenderTarget): void;
applyFilter(shader: Shader, inputTarget: RenderTarget, outputTarget: RenderTarget, clear?: boolean): void;
applyFilter(shader: Shader | AbstractFilter, inputTarget: RenderTarget, outputTarget: RenderTarget, clear?: boolean): void;
calculateMappedMatrix(filterArea: Rectangle, sprite: Sprite, outputMatrix?: Matrix): Matrix;
capFilterArea(filterArea: Rectangle): void;
resize(width: number, height: number): void;
@@ -771,8 +771,8 @@ declare module PIXI {
fragmentSrc: string;
init(): void;
cachUniformLocations(keys: string): void;
cacheAttributeLocations(keys: string): void;
cacheUniformLocations(keys: string[]): void;
cacheAttributeLocations(keys: string[]): void;
compile(): WebGLProgram;
syncUniform(uniform: any): void;
syncUniforms(): void;
@@ -871,7 +871,7 @@ declare module PIXI {
anchor: Point;
tint: number;
blendMode: number;
shader: Shader;
shader: Shader | AbstractFilter;
texture: Texture;
width: number;
@@ -896,7 +896,7 @@ declare module PIXI {
indices: number[];
currentBatchSize: number;
sprites: Sprite[];
shader: Shader;
shader: Shader | AbstractFilter;
render(sprite: Sprite): void;
flush(): void;
@@ -1144,7 +1144,7 @@ declare module PIXI {
align: string;
name: string;
size: number;
}
};
protected _text: string;
protected updateText(): void;
@@ -1164,7 +1164,7 @@ declare module PIXI {
align: string;
name: string;
size: number;
}
};
text: string;
}
@@ -1609,6 +1609,7 @@ declare module PIXI {
name: string;
texture: Texture;
textures: Texture[];
url: string;
data: any;
crossOrigin: string;
@@ -1634,7 +1635,7 @@ declare module PIXI {
static DRAW_MODES: {
TRIANGLE_MESH: number;
TRIANGLES: number;
}
};
constructor(texture: Texture, vertices?: number[], uvs?: number[], indices?: number[], drawMode?: number);
@@ -1646,7 +1647,7 @@ declare module PIXI {
blendMode: number;
canvasPadding: number;
drawMode: number;
shader: Shader;
shader: Shader | AbstractFilter;
getBounds(matrix?: Matrix): Rectangle;
containsPoint(point: Point): boolean;
+1
View File
@@ -1,4 +1,5 @@
/// <reference path="prettyjson.d.ts" />
import prettyjson = require("prettyjson");
var options: prettyjson.RendererOptions,
input: string,
+1 -1
View File
@@ -4,7 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module prettyjson {
declare module "prettyjson" {
/**
* Defines prettyjson version
+2 -2
View File
@@ -1,8 +1,8 @@
/// <reference path="../redis/redis.d.ts" />
/// <reference path="./ratelimiter.d.ts" />
import redis = require('redis');
import Limiter = require('ratelimiter');
import * as redis from 'redis';
import * as Limiter from 'ratelimiter';
let id: string;
let db: redis.RedisClient;
+2
View File
@@ -55,5 +55,7 @@ declare module "ratelimiter" {
get(fn: (err: any, info: LimiterInfo) => void): void;
}
namespace Limiter {}
export = Limiter;
}
@@ -20,3 +20,17 @@ function MyComponent() {
}
DayPicker2.DateUtils.clone(new Date());
DayPicker2.DateUtils.isDayInRange(new Date(), { from: new Date() });
// test interface for captionElement prop
interface MyCaptionProps extends ReactDayPicker.CaptionElementProps { }
class Caption extends React.Component<MyCaptionProps, {}> {
render() {
const { date, locale, localeUtils, onClick } = this.props;
return (
<div className="DayPicker-Caption" onClick={ onClick }>
{ localeUtils.formatMonthTitle(date, locale) }
</div>
);
}
}
<DayPicker captionElement={<Caption/>}/>
+21 -9
View File
@@ -1,4 +1,4 @@
// Type definitions for react-day-picker v1.1.4
// Type definitions for react-day-picker v1.2.0
// Project: https://github.com/gpbl/react-day-picker
// Definitions by: Giampaolo Bellavite <https://github.com/gpbl>, Jason Killian <https://github.com/jkillian>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -13,18 +13,28 @@ declare module "react-day-picker" {
declare var DayPicker: typeof ReactDayPicker.DayPicker;
declare namespace ReactDayPicker {
import React = __React;
interface LocaleUtils {
formatMonthTitle: (month: Date, locale: string) => string;
formatWeekdayShort: (weekday: number, locale: string) => string;
formatWeekdayLong: (weekday: number, locale: string) => string;
getFirstDayOfWeek: (locale: string) => number;
getMonths: (locale: string) => string[];
}
interface Modifiers {
[name: string]: (date: Date) => boolean;
}
interface Props extends __React.Props<DayPicker>{
interface CaptionElementProps extends React.Props<any> {
date?: Date;
localeUtils?: LocaleUtils;
locale?: string;
onClick?: React.MouseEventHandler;
}
interface Props extends React.Props<DayPicker>{
modifiers?: Modifiers;
initialMonth?: Date;
numberOfMonths?: number;
@@ -35,18 +45,19 @@ declare namespace ReactDayPicker {
toMonth?: Date;
localeUtils?: LocaleUtils;
locale?: string;
onDayClick?: (e: __React.SyntheticEvent, day: Date, modifiers: string[]) => any;
onDayTouchTap?: (e: __React.SyntheticEvent, day: Date, modifiers: string[]) => any;
onDayMouseEnter?: (e: __React.SyntheticEvent, day: Date, modifiers: string[]) => any;
onDayMouseLeave?: (e: __React.SyntheticEvent, day: Date, modifiers: string[]) => any;
captionElement?: React.ReactElement<CaptionElementProps>;
onDayClick?: (e: React.SyntheticEvent, day: Date, modifiers: string[]) => any;
onDayTouchTap?: (e: React.SyntheticEvent, day: Date, modifiers: string[]) => any;
onDayMouseEnter?: (e: React.SyntheticEvent, day: Date, modifiers: string[]) => any;
onDayMouseLeave?: (e: React.SyntheticEvent, day: Date, modifiers: string[]) => any;
onMonthChange?: (month: Date) => any;
onCaptionClick?: (e: __React.SyntheticEvent, month: Date) => any;
onCaptionClick?: (e: React.SyntheticEvent, month: Date) => any;
className?: string;
style?: __React.CSSProperties;
style?: React.CSSProperties;
tabIndex?: number;
}
class DayPicker extends __React.Component<Props, {}> {
class DayPicker extends React.Component<Props, {}> {
showMonth(month: Date): void;
showPreviousMonth(): void;
showNextMonth(): void;
@@ -55,6 +66,7 @@ declare namespace ReactDayPicker {
namespace DayPicker {
var LocaleUtils: LocaleUtils;
namespace DateUtils {
function addMonths(d: Date, n: number): Date;
function clone(d: Date): Date;
function isSameDay(d1?: Date, d2?: Date): boolean;
function isPastDay(d: Date): boolean;
+1 -1
View File
@@ -2712,7 +2712,7 @@ declare namespace __React {
* Fires at most once per frame during scrolling.
* The frequency of the events can be contolled using the scrollEventThrottle prop.
*/
onScroll?: () => void
onScroll?: (event?: { nativeEvent: NativeScrollEvent }) => void
/**
* Experimental: When true offscreen child views (whose `overflow` value is
@@ -0,0 +1,20 @@
/// <reference path="./react-router-redux.d.ts" />
/// <reference path="../redux/redux.d.ts" />
/// <reference path="../react-router/react-router.d.ts" />
import { createStore, combineReducers, applyMiddleware } from 'redux';
import { browserHistory } from 'react-router';
import { syncHistory, routeReducer } from 'react-router-redux';
const reducer = combineReducers({ routing: routeReducer });
// Sync dispatched route actions to the history
const reduxRouterMiddleware = syncHistory(browserHistory);
const createStoreWithMiddleware = applyMiddleware(reduxRouterMiddleware)(createStore);
const store = createStoreWithMiddleware(reducer);
// Required for replaying actions from devtools to
reduxRouterMiddleware.listenForReplays(store);
+48
View File
@@ -0,0 +1,48 @@
// Type definitions for react-router-redux v2.1.0
// Project: https://github.com/rackt/react-router-redux
// Definitions by: Isman Usoh <http://github.com/isman-usoh>, Noah Shipley <https://github.com/noah79>, Dimitri Rosenberg <https://github.com/rosendi>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../redux/redux.d.ts" />
/// <reference path="../react-router/react-router.d.ts"/>
declare namespace ReactRouterRedux {
import R = Redux;
import H = HistoryModule;
const TRANSITION: string;
const UPDATE_LOCATION: string;
const push: PushAction;
const replace: ReplaceAction;
const go: GoAction;
const goBack: GoForwardAction;
const goForward: GoBackAction;
const routeActions: RouteActions;
type LocationDescriptor = H.Location | H.Path;
type PushAction = (nextLocation: LocationDescriptor) => void;
type ReplaceAction = (nextLocation: LocationDescriptor) => void;
type GoAction = (n: number) => void;
type GoForwardAction = () => void;
type GoBackAction = () => void;
interface RouteActions {
push: PushAction;
replace: ReplaceAction;
go: GoAction;
goForward: GoForwardAction;
goBack: GoBackAction;
}
interface HistoryMiddleware extends R.Middleware {
listenForReplays(store: R.Store, selectLocationState?: Function): void;
unsubscribe(): void;
}
function routeReducer(state?: any, options?: any): R.Reducer;
function syncHistory(history: H.History): HistoryMiddleware;
}
declare module "react-router-redux" {
export = ReactRouterRedux;
}
+15 -10
View File
@@ -1,4 +1,4 @@
// Type definitions for react-router v1.0.0
// Type definitions for react-router v2.0.0-rc5
// 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: https://github.com/borisyankov/DefinitelyTyped
@@ -110,17 +110,22 @@ declare namespace ReactRouter {
const IndexLink: Link
interface RoutingContextProps extends React.Props<RoutingContext> {
history: H.History
interface RouterContextProps extends React.Props<RouterContext> {
history?: H.History
router: Router
createElement: (component: RouteComponent, props: Object) => any
location: H.Location
routes: RouteConfig
params: Params
components?: RouteComponent[]
}
interface RoutingContext extends React.ComponentClass<RoutingContextProps> {}
interface RoutingContextElement extends React.ReactElement<RoutingContextProps> {}
const RoutingContext: RoutingContext
interface RouterContext extends React.ComponentClass<RouterContextProps> {}
interface RouterContextElement extends React.ReactElement<RouterContextProps> {
history?: H.History
location: H.Location
router?: Router
}
const RouterContext: RouterContext
/* components (configuration) */
@@ -335,9 +340,9 @@ declare module "react-router/lib/RouteUtils" {
}
declare module "react-router/lib/RoutingContext" {
declare module "react-router/lib/RouterContext" {
export default ReactRouter.RoutingContext
export default ReactRouter.RouterContext
}
@@ -418,7 +423,7 @@ declare module "react-router" {
import { formatPattern } from "react-router/lib/PatternUtils"
import RoutingContext from "react-router/lib/RoutingContext"
import RouterContext from "react-router/lib/RouterContext"
import PropTypes from "react-router/lib/PropTypes"
@@ -459,7 +464,7 @@ declare module "react-router" {
useRoutes,
createRoutes,
formatPattern,
RoutingContext,
RouterContext,
PropTypes,
match
}
+8 -3
View File
@@ -146,9 +146,10 @@ var StatelessComponent = (props: SCProps) => {
return React.DOM.div(null, props.foo);
};
// Must explicitly type-annotate to add defaultProps/contextTypes
// Must explicitly type-annotate to add displayName/defaultProps/contextTypes
var StatelessComponent2: React.StatelessComponent<SCProps> =
(props: SCProps) => React.DOM.div(null, props.foo);
StatelessComponent2.displayName = "StatelessComponent2";
StatelessComponent2.defaultProps = {
foo: 42
};
@@ -405,7 +406,8 @@ var mappedChildrenArray: number[] =
React.Children.map<number>(children, (child) => { return 42; });
React.Children.forEach(children, (child) => {});
var nChildren: number = React.Children.count(children);
var onlyChild = React.Children.only([null, [[["Hallo"], true]], false]);
var onlyChild: React.ReactElement<any> = React.Children.only(React.DOM.div()); // ok
onlyChild = React.Children.only([null, [[["Hallo"], true]], false]); // error
var childrenToArray: React.ReactChild[] = React.Children.toArray(children);
//
@@ -521,7 +523,10 @@ React.createClass({
//
// TestUtils addon
// --------------------------------------------------------------------------
var node: Element;
var inst: ModernComponent = TestUtils.renderIntoDocument<ModernComponent>(element);
var node: Element = TestUtils.renderIntoDocument(React.DOM.div());
TestUtils.Simulate.click(node);
TestUtils.Simulate.change(node);
TestUtils.Simulate.keyDown(node, { key: "Enter" });
+4 -1
View File
@@ -149,6 +149,7 @@ declare namespace __React {
propTypes?: ValidationMap<P>;
contextTypes?: ValidationMap<any>;
defaultProps?: P;
displayName?: string;
}
interface ComponentClass<P> {
@@ -514,6 +515,8 @@ declare namespace __React {
*/
backgroundBlendMode?: any;
backgroundColor?: any;
backgroundComposite?: any;
/**
@@ -2077,7 +2080,7 @@ declare namespace __React {
map<T>(children: ReactNode, fn: (child: ReactChild, index: number) => T): T[];
forEach(children: ReactNode, fn: (child: ReactChild, index: number) => any): void;
count(children: ReactNode): number;
only(children: ReactNode): ReactChild;
only(children: ReactNode): ReactElement<any>;
toArray(children: ReactNode): ReactChild[];
}
+3
View File
@@ -359,6 +359,9 @@ declare module "redis" {
eval(...args:any[]): boolean;
evalsha(args:any[], callback?:ResCallbackT<any>): boolean;
evalsha(...args:any[]): boolean;
script(args:any[], callback?:ResCallbackT<any>): boolean;
script(...args: any[]): boolean;
script(key: string, callback?: ResCallbackT<any>): boolean;
quit(args:any[], callback?:ResCallbackT<any>): boolean;
quit(...args:any[]): boolean;
}
+2
View File
@@ -0,0 +1,2 @@
///<reference path="redux-router.d.ts" />
import { reduxReactRouter, routerStateReducer, ReduxRouter } from 'redux-router';
+109
View File
@@ -0,0 +1,109 @@
// Type definitions for redux-router v1.0.0
// Project: https://github.com/rackt/redux-router
// Definitions by: Stepan Mikhaylyuk <http://github.com/stepancar>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../react/react.d.ts" />
/// <reference path="../react-router/react-router.d.ts" />
/// <reference path="../redux/redux.d.ts" />
declare namespace __ReduxRouter {
import React = __React;
import H = HistoryModule;
/**
* A component that renders a React Router app using router state from a Redux store.
*/
export class ReduxRouter extends React.Component<any, any> { }
/**
* A component that renders a React Router app using router state from a Redux store.
*/
export class ReactRouter { }
/**
* A Redux store enhancer that adds router state to the store.
*/
export var reduxReactRouter: any;
export function isActive(pathname: H.Pathname, query?: H.Query, indexOnly?: boolean): boolean;
/**
* A reducer that keeps track of Router state.
*/
export function routerStateReducer(state: any, action: any): any;
export interface ReduxRouterAction {
type: string,
payload: any
}
export function routerDidChange(state: any): ReduxRouterAction;
export function initRoutes(routes: any): ReduxRouterAction;
export function replaceRoutes(routes: any): ReduxRouterAction;
export function historyAPI(method: any): ReduxRouterAction;
}
declare module "redux-router/lib/routerStateReducer" {
export default __ReduxRouter.routerStateReducer;
}
declare module "redux-router/lib/ReduxRouter" {
export default __ReduxRouter.ReactRouter;
}
declare module "redux-router/lib/client" {
export default __ReduxRouter.reduxReactRouter;
}
declare module "redux-router/lib/isActive" {
export default __ReduxRouter.isActive;
}
declare module "redux-router/lib/actionCreators" {
export const routerDidChange: typeof __ReduxRouter.routerDidChange;
export const initRoutes: typeof __ReduxRouter.initRoutes;
export const replaceRoutes: typeof __ReduxRouter.replaceRoutes;
export const historyAPI: typeof __ReduxRouter.historyAPI;
export const pushState: __ReduxRouter.ReduxRouterAction;
export const push: __ReduxRouter.ReduxRouterAction;
export const replaceState: __ReduxRouter.ReduxRouterAction;
export const replace: __ReduxRouter.ReduxRouterAction;
export const setState: __ReduxRouter.ReduxRouterAction;
export const go: __ReduxRouter.ReduxRouterAction;
export const goBack: __ReduxRouter.ReduxRouterAction;
export const goForward: __ReduxRouter.ReduxRouterAction;
}
declare module "redux-router" {
import routerStateReducer from "redux-router/lib/routerStateReducer";
import ReduxRouter from "redux-router/lib/ReduxRouter";
import reduxReactRouter from "redux-router/lib/client";
import isActive from "redux-router/lib/isActive";
import {
historyAPI,
pushState,
push,
replaceState,
replace,
setState,
go,
goBack,
goForward
} from "redux-router/lib/actionCreators";
export {
routerStateReducer,
ReduxRouter,
reduxReactRouter,
isActive,
historyAPI,
pushState,
push,
replaceState,
replace,
setState,
go,
goBack,
goForward
}
}
+12
View File
@@ -640,3 +640,15 @@ request({url: 'http://www.google.com', jar: j}, function () {
var cookies = j.getCookies(url);
// [{key: 'key1', value: 'value1', domain: "www.google.com", ...}, ...]
});
request(
{ method: 'GET'
, uri: 'http://www.google.com'
, gzip: true
}
)
.on('request', function(req: http.ClientRequest) { })
.on('response', function(resp: http.IncomingMessage) { })
.on('data', function(data: Buffer | string) { })
.on('error', function(e: Error) { })
.on('complete', function(resp: http.IncomingMessage, body?: string | Buffer) { });
+6 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for request
// Project: https://github.com/mikeal/request
// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>, bonnici <https://github.com/bonnici>, Bart van der Schoor <https://github.com/Bartvds>, Joe Skeen <http://github.com/joeskeen>
// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>, bonnici <https://github.com/bonnici>, Bart van der Schoor <https://github.com/Bartvds>, Joe Skeen <http://github.com/joeskeen>, Christopher Currens <https://github.com/ccurrens>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Imported from: https://github.com/soywiz/typescript-node-definitions/d.ts
@@ -180,6 +180,11 @@ declare module 'request' {
jar(jar: CookieJar): Request;
on(event: string, listener: Function): Request;
on(event: 'request', listener: (req: http.ClientRequest) => void): Request;
on(event: 'response', listener: (resp: http.IncomingMessage) => void): Request;
on(event: 'data', listener: (data: Buffer | string) => void): Request;
on(event: 'error', listener: (e: Error) => void): Request;
on(event: 'complete', listener: (resp: http.IncomingMessage, body?: string | Buffer) => void): Request;
write(buffer: Buffer, cb?: Function): boolean;
write(str: string, cb?: Function): boolean;
+42
View File
@@ -0,0 +1,42 @@
/// <reference path="reselect.d.ts" />
import {createSelector, defaultMemoize} from "reselect";
type Item1 = {
prop1: number;
}
type Item2 = {
prop2: number;
}
type State = {
item1: Item1,
item2: Item2
}
function getItem1(state: State, props: any): Item1 {
return state.item1;
}
function getItem2(state: State, props: any): Item2 {
return state.item2;
}
const selector = createSelector(
getItem1,
getItem2,
(item1: Item1, item2: Item2) => {
return item1.prop1 + item2.prop2;
}
);
const state = {
item1: { prop1: 10 },
item2: { prop2: 20 }
}
const props = { multiplier: 10 };
const total: number = selector(state, props);
const getItem2Memoized = defaultMemoize(getItem2);
const memItem: Item2 = getItem2Memoized(state, {});
+36
View File
@@ -0,0 +1,36 @@
// Type definitions for reselect v2.0.2
// Project: https://github.com/rackt/reselect
// Definitions by: Frank Wallis <https://github.com/frankwallis>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module Reselect {
type Selector<TInput, TOutput> = (state: TInput, props?: any) => TOutput;
function createSelector<TInput, TOutput, T1>(selector1: Selector<TInput, T1>, combiner: (arg1: T1) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, combiner: (arg1: T1, arg2: T2) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, combiner: (arg1: T1, arg2: T2, arg3: T3) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6, T7>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, selector7: Selector<TInput, T7>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6, T7, T8>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, selector7: Selector<TInput, T7>, selector8: Selector<TInput, T8>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6, T7, T8, T9>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, selector7: Selector<TInput, T7>, selector8: Selector<TInput, T8>, selector9: Selector<TInput, T9>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, selector7: Selector<TInput, T7>, selector8: Selector<TInput, T8>, selector9: Selector<TInput, T9>, selector10: Selector<TInput, T10>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, selector7: Selector<TInput, T7>, selector8: Selector<TInput, T8>, selector9: Selector<TInput, T9>, selector10: Selector<TInput, T10>, selector11: Selector<TInput, T11>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, selector7: Selector<TInput, T7>, selector8: Selector<TInput, T8>, selector9: Selector<TInput, T9>, selector10: Selector<TInput, T10>, selector11: Selector<TInput, T11>, selector12: Selector<TInput, T12>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11, arg12: T12) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, selector7: Selector<TInput, T7>, selector8: Selector<TInput, T8>, selector9: Selector<TInput, T9>, selector10: Selector<TInput, T10>, selector11: Selector<TInput, T11>, selector12: Selector<TInput, T12>, selector13: Selector<TInput, T13>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11, arg12: T12, arg13: T13) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, selector7: Selector<TInput, T7>, selector8: Selector<TInput, T8>, selector9: Selector<TInput, T9>, selector10: Selector<TInput, T10>, selector11: Selector<TInput, T11>, selector12: Selector<TInput, T12>, selector13: Selector<TInput, T13>, selector14: Selector<TInput, T14>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11, arg12: T12, arg13: T13, arg14: T14) => TOutput): Selector<TInput, TOutput>;
function createStructuredSelector(inputSelectors: any, selectorCreator?: any): any;
type EqualityChecker = <T>(arg1: T, arg2: T) => boolean;
type Memoizer = <TFunc extends Function>(func: TFunc, equalityCheck?: EqualityChecker) => TFunc;
const defaultMemoize: Memoizer;
function createSelectorCreator(memoize: Memoizer, ...memoizeOptions: any[]): any;
}
declare module "reselect" {
export = Reselect
}
+6
View File
@@ -0,0 +1,6 @@
/// <reference path="./riot-api-nodejs.d.ts"/>
import * as Api from "riot-api-nodejs";
let ClassicApi = new Api.ClassicAPI([""], Api.region_e.EUW);
let TournamentApi = new Api.TournamentAPI("");
+413
View File
@@ -0,0 +1,413 @@
// Type definitions for Riot Games API
// Project: https://developer.riotgames.com/
// Definitions by: Luca Laissue <https://github.com/zafixlrp/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../request/request.d.ts" />
/// <reference path="../es6-promise/es6-promise.d.ts" />
/// <reference path="../riot-games-api/riot-games-api.d.ts" />
declare module "riot-api-nodejs"{
export enum region_e {
BR = 0,
EUNE = 1,
EUW = 2,
KR = 3,
LAN = 4,
LAS = 5,
NA = 6,
OCE = 7,
TR = 8,
RU = 9,
PBE = 10,
}
/**
* Tournament API
*/
export class TournamentAPI {
private ApiKeys;
private ApiKey;
/**
* TournamentAPI Constructor
*/
constructor(...ApiKeys: string[]);
/**
* Change the Api Key for the next requests
*/
private switchApiKey();
/**
* Send a request to the Riot Games Api and return a formatted json via a callback
* @param {string} url request url
* @param {string} method method(post / put / get)
* @param {[type]} data body parameters
* @param {(JSON} callback callback function with formatted JSON
*/
private getJSON(url, method, data, callback);
/**
* get tournament Codes for a given tournament
* @param {number} tournamentId the ID of the tournament
* @param {number} count Number of codes you want
* @param {RiotGamesAPI.TournamentProvider.TournamentCodeParameters} params Tournament Code parameters
* @param {number[]} callback Tournaments Codes [description]
*/
getTournamentCodes(tournamentId: number, count: number, params: RiotGamesAPI.TournamentProvider.TournamentCodeParameters, callback: (tournamentCodes: number[]) => void): any;
/**
* get tournament infos for a given tournament code
* @param {string} tournamentCode Tournament Code
* @param {RiotGamesAPI.TournamentProvider.TournamentCodeDto} callback Tournament Infos
*/
getTournamentByCode(tournamentCode: string, callback: (tournament: RiotGamesAPI.TournamentProvider.TournamentCodeDto) => void): any;
/**
* edit the tournament Code parameters for a given tournament Code
* @param {string} tournamentCode Tournament Code to update
* @param {RiotGamesAPI.TournamentProvider.TournamentCodeUpdateParameters} params parameters to edit
* @param {(} callback callback if succes
*/
editTournamentByCode(tournamentCode: string, params: RiotGamesAPI.TournamentProvider.TournamentCodeUpdateParameters, callback: () => void): any;
/**
* get the lobby envents for a given tournament Code
* @param {string} tournamentCode the tournament code to get the lobby events
* @param {RiotGamesAPI.TournamentProvider.LobbyEventDto} callback lobby events
*/
getLobbyEventByCode(tournamentCode: string, callback: (lobbyEventDto: RiotGamesAPI.TournamentProvider.LobbyEventDto) => void): any;
/**
* Register a new tournament provider
* @param {region_e} region region where you want to register the provider
* @param {string} url url of callback for the POST notifications
* @param {number} callback returns the tounament provider ID
*/
registerProvider(region: region_e, url: string, callback: (providerId: number) => void): any;
/**
* Register a new tournament
* @param {string} name Name of tournament
* @param {number} providerId Provider ID
* @param {number} callback returns the tournament ID
*/
registerTournament(name: string, providerId: number, callback: (tournamentId: number) => void): any;
}
export class ClassicAPI {
private ApiKeys;
private ApiKey;
private region;
/**
* ClassicAPI Constructor
* @param {string[]} ApiKeys API Keys for the requests
* @param {region_e} region region where you want to send requests
*/
constructor(ApiKeys: string[], region: region_e);
/**
* change the API Key for the next requests
*/
private switchApiKey();
/**
* get the JSON response code for a given URL
* @param {string} url Request url
* @param {Function} callback JSON formatted data
*/
private getJSON(url, callback);
/**
* Edit the consts for a valid url for the riot games api
* @param {string} unparsedURL the URL to parse
* @return {string} the Parsed URL
*/
private parseURL(unparsedURL);
/**
* get the API Key that is used for the requests
* @return {string} the current API Key
*/
getCurrentApiKey(): string;
/**
* get the region where send send request
* @return {region_e} the current region
*/
getRegion(): region_e;
/**
* set the API Keys
* @param {string[]} ApiKeys the API Keys
*/
setApikeys(ApiKeys: string[]): void;
/**
* set the region where you want to send requests
* @param {region_e} region the region
*/
setRegion(region: region_e): void;
/**
* get all champions of league of legends
* @param {RiotGamesAPI.Champion.ChampionListDto} callback data callback
*/
getChampions(callback: (championListDto: RiotGamesAPI.Champion.ChampionListDto) => void): any;
/**
* get the champion for a given id
* @param {number} id the champion id
* @param {RiotGamesAPI.Champion.ChampionDto} callback data callback
*/
getChampionById(id: number, callback: (ChampionDto: RiotGamesAPI.Champion.ChampionDto) => void): any;
/**
* get the free to play champions
* @param {RiotGamesAPI.Champion.ChampionListDto} callback data callback
*/
getFreeToPlayChampions(callback: (championsListDto: RiotGamesAPI.Champion.ChampionListDto) => void): any;
/**
* get Champion mastery of a player for a given champion ID
* @param {number} summonerId summoner ID
* @param {number} championId Champion ID
* @param {RiotGamesAPI.ChampionMastery.ChampionMasteryDto} callback data callback
*/
getChampionMastery(summonerId: number, championId: number, callback: (championMastery: RiotGamesAPI.ChampionMastery.ChampionMasteryDto) => void): any;
/**
* get all champion masteries for a given summoner
* @param {number} summonerId Summoner ID
* @param {[RiotGamesAPI.ChampionMastery.ChampionMasteryDto]} callback data callback
*/
getChampionMasteryBySummoner(summonerId: number, callback: (championsMastery: [RiotGamesAPI.ChampionMastery.ChampionMasteryDto]) => void): any;
/**
* get the mastery score of a summoner
* @param {number} summonerId Summoner ID
* @param {number} callback Mastery Score
*/
getChampionMasteryScore(summonerId: number, callback: (score: number) => void): any;
/**
* get The 3 best champion masteries
* @param {[type]} summonerId Summoner ID
* @param {[RiotGamesAPI.ChampionMastery.ChampionMasteryDto]} callback data callback
*/
getTopChampionMastery(summonerId: any, callback: (championsMastery: [RiotGamesAPI.ChampionMastery.ChampionMasteryDto]) => void): any;
/**
* get the current game infos for a given summoner ID
* @param {number} summonerId Summoner ID
* @param {RiotGamesAPI.CurrentGame.CurrentGameInfo} callback data callback
*/
getCurrentGame(summonerId: number, callback: (gameInfoDto: RiotGamesAPI.CurrentGame.CurrentGameInfo) => void): any;
/**
* get the featured games
* @param {RiotGamesAPI.FeaturedGames.FeaturedGames} callback data callback
*/
getFeaturedGame(callback: (featuredGamesInfos: RiotGamesAPI.FeaturedGames.FeaturedGames) => void): any;
/**
* get the recents games for a given Summoner ID
* @param {number} summonerId Summoner ID
* @param {RiotGamesAPI.Game.RecentGamesDto} callback data callback
*/
getRecentGames(summonerId: number, callback: (RecentGamesDto: RiotGamesAPI.Game.RecentGamesDto) => void): any;
/**
* Get League infos of a summoner
* @param {number} summonerId Summoner ID
* @param {RiotGamesAPI.League.LeagueDto[]} callback data callback
*/
getLeagueBySummonerId(summonerId: number, callback: (LeagueDto: RiotGamesAPI.League.LeagueDto[]) => void): any;
/**
* get League infos of a summoner
* @param {number} summonerId Summoner ID
* @param {RiotGamesAPI.League.LeagueDto[]} callback data callback
*/
getLeagueBySummonerIdEntry(summonerId: number, callback: (LeagueDto: RiotGamesAPI.League.LeagueDto[]) => void): any;
/**
* get league infos by team
* @param {string} teamId Team ID
* @param {RiotGamesAPI.League.LeagueDto[]} callback data callback
*/
getLeagueByTeamId(teamId: string, callback: (LeagueDto: RiotGamesAPI.League.LeagueDto[]) => void): any;
/**
* get league infos by team
* @param {string} teamId Team ID
* @param {RiotGamesAPI.League.LeagueDto[]} callback data callback
*/
getLeagueByTeamIdEntry(teamId: string, callback: (LeagueDto: RiotGamesAPI.League.LeagueDto[]) => void): any;
/**
* get Challengers in SOLO Queue
* @param {RiotGamesAPI.League.LeagueDto} callback data callback
*/
getChallengers_SOLO(callback: (League: RiotGamesAPI.League.LeagueDto) => void): any;
/**
* get Challengers Teams in 3x3
* @param {RiotGamesAPI.League.LeagueDto} callback data callback
*/
getChallengers_3x3(callback: (League: RiotGamesAPI.League.LeagueDto) => void): any;
/**
* get Challengers Teams in 5x5
* @param {RiotGamesAPI.League.LeagueDto} callback data callback
*/
getChallengers_5x5(callback: (League: RiotGamesAPI.League.LeagueDto) => void): any;
/**
* get Masters in Solo Queue
* @param {RiotGamesAPI.League.LeagueDto} callback data callback
*/
getMasters_SOLO(callback: (League: RiotGamesAPI.League.LeagueDto) => void): any;
/**
* get Master Teams in 3x3
* @param {RiotGamesAPI.League.LeagueDto} callback data callback
*/
getMasters_3x3(callback: (League: RiotGamesAPI.League.LeagueDto) => void): any;
/**
* get Master Teams in 5x5
* @param {RiotGamesAPI.League.LeagueDto} callback data callback
*/
getMasters_5x5(callback: (League: RiotGamesAPI.League.LeagueDto) => void): any;
/**
* get Champions (static data)
* @param {RiotGamesAPI.LolStaticData.ChampionListDto} callback data callback
*/
staticDataChampions(callback: (championListDto: RiotGamesAPI.LolStaticData.ChampionListDto) => void): any;
/**
* get data by champion ID
* @param {number} championsId Champion ID
* @param {RiotGamesAPI.LolStaticData.ChampionDto} callback data callback
*/
staticDataChampionById(championsId: number, callback: (championDto: RiotGamesAPI.LolStaticData.ChampionDto) => void): any;
/**
* get League of Legends Items
* @param {RiotGamesAPI.LolStaticData.ItemListDto} callback data callback
*/
staticDataItems(callback: (itemsDto: RiotGamesAPI.LolStaticData.ItemListDto) => void): any;
/**
* Get item infos by ID
* @param {number} itemId item ID
* @param {RiotGamesAPI.LolStaticData.ItemDto} callback data callback
*/
staticDataItemById(itemId: number, callback: (itemDto: RiotGamesAPI.LolStaticData.ItemDto) => void): any;
/**
* get league of legends languages
* @param {RiotGamesAPI.LolStaticData.LanguageStringsDto} callback data callback
*/
staticDataLanguagesStrings(callback: (languageStringsDto: RiotGamesAPI.LolStaticData.LanguageStringsDto) => void): any;
/**
* get league of legends languages
* @param {string[]} callback data callback
*/
staticDataLanguages(callback: (languages: string[]) => void): any;
/**
* get Map data
* @param {RiotGamesAPI.LolStaticData.MapDataDto} callback data callback
*/
staticDataMap(callback: (mapDataDto: RiotGamesAPI.LolStaticData.MapDataDto) => void): any;
/**
* get all masteries
* @param {RiotGamesAPI.LolStaticData.MasteryListDto} callback data callback
*/
staticDataMastery(callback: (masteryListDto: RiotGamesAPI.LolStaticData.MasteryListDto) => void): any;
/**
* get data by mastery ID
* @param {number} masteryId Mastery ID
* @param {RiotGamesAPI.LolStaticData.MasteryDto} callback data callback
*/
staticDataMasteryById(masteryId: number, callback: (masteryDto: RiotGamesAPI.LolStaticData.MasteryDto) => void): any;
staticDataRealm(callback: (realmDto: RiotGamesAPI.LolStaticData.RealmDto) => void): any;
/**
* get all runes
* @param {RiotGamesAPI.LolStaticData.RuneListDto} callback data callback
*/
staticDataRunes(callback: (runeListDto: RiotGamesAPI.LolStaticData.RuneListDto) => void): any;
/**
* get rune by Rune ID
* @param {number} runeId Rune ID
* @param {RiotGamesAPI.LolStaticData.RuneDto} callback data callback
*/
staticDataRuneById(runeId: number, callback: (runeDto: RiotGamesAPI.LolStaticData.RuneDto) => void): any;
/**
* get all summoner spells
* @param {RiotGamesAPI.LolStaticData.SummonerSpellListDto} callback data callback
*/
staticDataSummonerSpells(callback: (summonerSpellListDto: RiotGamesAPI.LolStaticData.SummonerSpellListDto) => void): any;
/**
* get summoner spell by summoner spell ID
* @param {number} summonerSpellId Summoner spell ID
* @param {RiotGamesAPI.LolStaticData.SummonerSpellDto} callback data callback
*/
staticDataSummonSpellById(summonerSpellId: number, callback: (runeDto: RiotGamesAPI.LolStaticData.SummonerSpellDto) => void): any;
/**
* get league of legends versions
* @param {string[]} callback data callback
*/
staticDataVersion(callback: (versions: string[]) => void): any;
/**
* get league of legends status
* @param {RiotGamesAPI.LolStatus.Shard[]} callback data callback
*/
getSatus(callback: (shardList: RiotGamesAPI.LolStatus.Shard[]) => void): any;
/**
* get status for a given region
* @param {region_e} region region
* @param {RiotGamesAPI.LolStatus.Shard} callback data callback
*/
getSatusByRegion(region: region_e, callback: (shard: RiotGamesAPI.LolStatus.Shard) => void): any;
/**
* get match infos for a given match ID
* @param {number} matchId Match ID
* @param {RiotGamesAPI.Match.MatchDetail} callback data callback
*/
getMatch(matchId: number, callback: (matchDetails: RiotGamesAPI.Match.MatchDetail) => void): any;
/**
* get all matches for a given tournament code
* @param {string} tournamentCode Tournament Code
* @param {number[]} callback data callback
*/
getMatchIdsByTournamentCode(tournamentCode: string, callback: (matchIds: number[]) => void): any;
/**
* get match by ID in a tournament
* @param {number} matchId Match ID
* @param {RiotGamesAPI.Match.MatchDetail} callback data callback
*/
getMatchForTournament(matchId: number, callback: (matchDetails: RiotGamesAPI.Match.MatchDetail) => void): any;
/**
* get match list of a summoner
* @param {number} summonerId Summoner ID
* @param {RiotGamesAPI.MatchList.MatchList} callback data callback
*/
getMatchList(summonerId: number, callback: (matchList: RiotGamesAPI.MatchList.MatchList) => void): any;
/**
* get ranked stats of summoner
* @param {number} summonerId Summoner ID
* @param {RiotGamesAPI.Stats.RankedStatsDto} callback data callback
*/
getStatsRanked(summonerId: number, callback: (rankedStatsDto: RiotGamesAPI.Stats.RankedStatsDto) => void): any;
/**
* get summary ranked stats of summoner
* @param {number} summonerId Summoner ID
* @param {RiotGamesAPI.Stats.PlayerStatsSummaryListDto} callback data callback
*/
getStatsSummary(summonerId: number, callback: (playerStatsSummaryListDto: RiotGamesAPI.Stats.PlayerStatsSummaryListDto) => void): any;
/**
* get summoner infos by Summoner Name
* @param {string} summonerName Summoner Name
* @param {RiotGamesAPI.Summoner.SummonerDto} callback data callback
*/
getSummonerByName(summonerName: string, callback: (summonerDto: RiotGamesAPI.Summoner.SummonerDto) => void): any;
/**
* get summoner infos by summoner ID
* @param {number} summonerId Summoner ID
* @param {RiotGamesAPI.Summoner.SummonerDto} callback data callback
*/
getSummonerById(summonerId: number, callback: (summonerDto: RiotGamesAPI.Summoner.SummonerDto) => void): any;
/**
* get masteries of a summoner
* @param {number} summonerId Summoner ID
* @param {RiotGamesAPI.Summoner.MasteryPagesDto} callback data callback
*/
getSummonerMasteries(summonerId: number, callback: (masteryPagesDto: RiotGamesAPI.Summoner.MasteryPagesDto) => void): any;
/**
* get the Summoner Name of a summoner ID
* @param {number} summonerId Summoner ID
* @param {string} callback data callback
*/
getSummonerName(summonerId: number, callback: (summonerName: string) => void): any;
/**
* get the runes of a summoner
* @param {number} summonerId Summoner ID
* @param {RiotGamesAPI.Summoner.RunePagesDto} callback data callback
*/
getSummonerRunes(summonerId: number, callback: (runePagesDto: RiotGamesAPI.Summoner.RunePagesDto) => void): any;
/**
* get teams of a summoner
* @param {number} summonerId Summoner ID
* @param {RiotGamesAPI.Team.TeamDto[]} callback data callback
*/
getTeamsBySummoner(summonerId: number, callback: (teamsList: RiotGamesAPI.Team.TeamDto[]) => void): any;
/**
* get Team infos by Team ID
* @param {string} teamId Team ID
* @param {RiotGamesAPI.Team.TeamDto} callback data callback
*/
getTeamById(teamId: string, callback: (teamDto: RiotGamesAPI.Team.TeamDto) => void): any;
}
}
+81
View File
@@ -0,0 +1,81 @@
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="ss-utils.d.ts" />
declare var EventSource : sse.IEventSourceStatic;
declare module sse {
interface IEventSourceStatic extends EventTarget {
new (url: string, eventSourceInitDict?: IEventSourceInit):IEventSourceStatic;
url: string;
}
interface IEventSourceInit {
withCredentials?: boolean;
}
}
function test_ssutils() {
$.ss.eventReceivers = { "document": document };
var source = new EventSource("/event-stream?channels=home,work");
$(source).handleServerEvents({
handlers: {
onConnect: function(connect:ssutils.SSEConnect) {},
onHeartbeat: function(msg:ssutils.SSEHeartbeat, e:MessageEvent){},
onJoin: function(msg:ssutils.SSEJoin) {},
onLeave: function(msg:ssutils.SSELeave) {}
},
receivers: {
tv: {
watch: function(){}
}
}
});
$(document).bindHandlers({
announce: function (msg:string) {}
})
.on('customEvent', function (e, msg, msgEvent) { });
$.ss.handlers["changeChannel"]("home");
}
function test_jQuery_functions(){
$("document").setFieldError("name","message");
var map = $("form").serializeMap();
$("form").applyErrors({errorCode:"",message:"",stackTrace:"",errors:[]});
$("form").clearErrors();
$("form").bindForm({
overrideMessages: true,
messages: {"NotFound": "Not Found"},
errorFilter: function(errorMsg, errorCode, type){}
});
$("form").applyValues({
"Key": "Value"
});
$("form").bindHandlers({
"test": function() {}
});
}
function test_ssutils_Static(){
$.ss.handlers["key"] = () => 0;
$.ss.onSubmitDisable = "class";
$.ss.validation.messages["Code"] = "Message";
$.ss.clearAdjacentError();
var date:Date = $.ss.todate("2001-01-01");
var dateFmt:String = $.ss.todfmt("2001-01-01");
dateFmt = $.ss.dfmt(new Date(2001,1,1));
dateFmt = $.ss.dfmthm(new Date(2001,1,1));
dateFmt = $.ss.tfmt12(new Date(2001,1,1));
var parts:string[] = $.ss.splitOnFirst("A,B,C");
parts = $.ss.splitOnLast("A,B,C");
var selectedText = $.ss.getSelection();
var qs:{ [index: string]: string } = $.ss.queryString("http://google.com?a=b&c=d");
var relativePath = $.ss.createUrl("/path/to/{File}", {File:"file.js"});
var readableText = $.ss.humanize("TheVariableName");
$.ss.listenOn = "click onmousedown";
$.ss.eventReceivers = { "document": document };
$.ss.handlers["changeChannel"]("home");
}
+122
View File
@@ -0,0 +1,122 @@
// Type definitions for ServiceStack Utils v0.0.1
// Project: https://servicestack.net/
// Definitions by: Demis Bellot <https://github.com/mythz/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
declare namespace ssutils {
interface Static {
handlers: { [index: string]: Function };
onSubmitDisable: string;
validation: Validation;
clearAdjacentError: () => void;
todate: (s: string) => Date;
todfmt: (s: string) => string;
dfmt: (d: Date) => string;
dfmthm: (d: Date) => string;
tfmt12: (d: Date) => string;
splitOnFirst: (s: string) => string[];
splitOnLast: (s: string) => string[];
getSelection: () => string;
queryString: (url: string) => { [index: string]: string };
createUrl: (route: string, args?: any) => string;
humanize: (s: string) => string;
listenOn: string;
eventReceivers: any;
reconnectServerEvents: (opt: ReconnectServerEventsOptions) => any;
}
interface Validation {
overrideMessages: boolean;
messages: { [index: string]: string };
errorFilter: (errorMsg: string, errorCode: string, type: string) => void;
}
interface ValidationOptional {
overrideMessages?: boolean;
messages?: { [index: string]: string };
errorFilter?: (errorMsg: string, errorCode: string, type: string) => void;
}
interface ApplyErrorsOptions extends ValidationOptional {
}
interface BindFormOptions {
validation?: ValidationOptional;
validate?: (form: HTMLFormElement) => boolean;
onSubmitDisable?: string;
complete?: (...args: any[]) => void;
error?: (...args: any[]) => void;
}
interface HandleServerEventsOptions {
handlers?: { [index: string]: Function };
validate?: (op?: string, target?: string, msg?: string, json?: string) => boolean;
heartbeatUrl?: string;
heartbeatIntervalMs?: number;
unRegisterUrl?: string;
receivers?: { [index: string]: any };
success?: (selector: string, msg: string, e: any) => void;
}
interface ResponseStatus {
errorCode: string;
message: string;
stackTrace: string;
errors: ResponseError[];
}
interface ResponseError {
errorCode: string;
fieldName: string;
message: string;
}
interface SSECommand {
userId: string;
displayName: string;
channels: string;
profileUrl: string;
}
interface SSEHeartbeat extends SSECommand { }
interface SSEJoin extends SSECommand { }
interface SSELeave extends SSECommand { }
interface SSEConnect extends SSECommand {
id: string;
unRegisterUrl: string;
heartbeatUrl: string;
heartbeatIntervalMs: number;
idleTimeoutMs: number;
}
interface ReconnectServerEventsOptions {
url?: string;
onerror?: (...args: any[]) => void;
onmessage?: (...args: any[]) => void;
errorArgs: any[];
}
}
interface JQuery {
setFieldError: (name: string, msg: string) => void;
serializeMap: () => { [index: string]: any };
applyErrors: (status: ssutils.ResponseStatus, opt?: ssutils.ApplyErrorsOptions) => JQuery;
clearErrors: () => JQuery;
bindForm: (opt?: ssutils.ApplyErrorsOptions) => JQuery;
applyValues: (values: { [index: string]: string }) => JQuery;
bindHandlers: (handlers: { [index: string]: Function }) => JQuery;
setActiveLinks: () => JQuery;
handleServerEvents: (opt?: ssutils.HandleServerEventsOptions) => void;
}
interface JQueryStatic {
ss: ssutils.Static;
}
declare module "ss-utils" {
export = ssutils;
}
+7 -7
View File
@@ -51,37 +51,37 @@ declare module "tabtab" {
* Holds interesting values to drive the output of the completion.
*/
interface Data {
/**
* full command being completed
*/
line: string;
/**
* number of words
*/
words: number;
/**
* cursor position
*/
point: number;
/**
* tabing in the middle of a word: foo bar baz bar foobarrrrrrr
*/
partial: string;
/**
* last word of the line
*/
last: string;
/**
* last partial of the line
*/
lastPartial: string;
/**
* the previous word
*/
+73 -73
View File
@@ -15,13 +15,13 @@ declare module 'tedious' {
*/
name: string;
}
export interface ColumnMetaData {
/**
* The column's name
*/
colName: string;
/**
* The column type.
*/
@@ -31,18 +31,18 @@ declare module 'tedious' {
* The precision. Only applicable to numeric and decimal.
*/
precision?: number;
/**
* The scale. Only applicable to numeric, decimal, time, datetime2 and datetimeoffset.
*/
scale?: number;
/**
* The length, for char, varchar, nvarchar and varbinary.
* The length, for char, varchar, nvarchar and varbinary.
*/
dataLength?: number;
}
export interface DebugOptions {
/**
* A boolean, controlling whether debug events will be emitted with text describing packet details (default: false).
@@ -58,13 +58,13 @@ declare module 'tedious' {
* A boolean, controlling whether debug events will be emitted with text describing packet payload details (default: false).
*/
payload?: boolean;
/**
* A boolean, controlling whether debug events will be emitted with text describing token stream tokens (default: false).
*/
token?: boolean;
}
export enum ISOLATION_LEVEL {
NO_CHANGE = 0x00,
READ_UNCOMMITTED = 0x01,
@@ -73,7 +73,7 @@ declare module 'tedious' {
SERIALIZABLE = 0x04,
SNAPSHOT = 0x05
}
/**
* Unfortunately these aren't valid JavaScript identifiers
* so I cannot list the values here as enum values
@@ -89,7 +89,7 @@ declare module 'tedious' {
type: string;
name: string;
}
export interface TediousTypes {
BigInt: TediousType;
Binary: TediousType;
@@ -130,82 +130,82 @@ declare module 'tedious' {
VarChar: TediousType;
Xml: TediousType;
}
export var TYPES: TediousTypes;
export interface ConnectionOptions {
/**
* Port to connect to (default: 1433). Mutually exclusive with options.instanceName.
*/
port?: number;
/**
* The instance name to connect to. The SQL Server Browser service must be running on the database server,
* and UDP port 1444 on the database server must be reachable. (no default) Mutually exclusive with options.port.
*/
instanceName?: string;
/**
* Database to connect to (default: dependent on server configuration).
*/
database?: string;
/**
* By default, if the database requestion by options.database cannot be accessed,
* the connection will fail with an error. However, if options.fallbackToDefaultDb is set to true,
* By default, if the database requestion by options.database cannot be accessed,
* the connection will fail with an error. However, if options.fallbackToDefaultDb is set to true,
* then the user's default database will be * used instead (Default: false).
*/
fallbackToDefaultDb?: boolean;
/**
* The number of milliseconds before the attempt to connect is considered failed (default: 15000).
*/
connectTimeout?: number;
/**
* The number of milliseconds before a request is considered failed, or 0 for no timeout (default: 15000).
*/
requestTimeout?: number;
/**
* The number of milliseconds before the cancel (abort) of a request is considered failed (default: 5000).
*/
cancelTimeout?: number;
/**
* The size of TDS packets (subject to negotiation with the server). Should be a power of 2. (default: 4096).
*/
packetSize?: number;
/**
* A boolean determining whether to pass time values in UTC or local time. (default: true).
*/
useUTC?: boolean;
/**
* A boolean determining whether to rollback a transaction automatically if any error is encountered
* during the given transaction's execution. This sets the value for SET XACT_ABORT during the initial
* during the given transaction's execution. This sets the value for SET XACT_ABORT during the initial
* SQL phase of a connection (documentation).
*/
abortTransactionOnError?: boolean;
/**
* A string indicating which network interface (ip addres) to use when connecting to SQL Server.
*/
localAddress?: string;
/**
* A boolean determining whether to return rows as arrays or key-value collections. (default: false).
*/
useColumnNames?: boolean;
/**
* A boolean, controlling whether the column names returned will have the first letter converted
* to lower case (true) or not. This value is ignored if you provide a columnNameReplacer. (default: false).
*/
camelCaseColumns?: boolean;
/**
* A function with parameters (columnName, index, columnMetaData) and returning a string. If provided,
* this will be called once per column per result-set. The returned value will be used instead of the
@@ -213,56 +213,56 @@ declare module 'tedious' {
* naming conventions. (default: null).
*/
columnNameReplacer?: (columnName: string, index: number, columnMetaData: ColumnMetaData) => string;
/**
* Debug options
*/
debug?: DebugOptions;
/**
* The default isolation level that transactions will be run with. (default: READ_COMMITED).
*/
isolationLevel?: ISOLATION_LEVEL;
/**
* The default isolation level for new connections. All out-of-transaction queries are executed with this setting. (default: READ_COMMITED)
*/
connectionIsolationLevel?: ISOLATION_LEVEL;
/**
* A boolean, determining whether the connection will request read only access from a SQL Server Availability Group. For more information, see here. (default: false).
*/
readOnlyIntent?: boolean;
/**
* A boolean determining whether or not the connection will be encrypted. Set to true if you're on Windows Azure. (default: false).
*/
encrypt?: boolean;
/**
* When encryption is used, an object may be supplied that will be used for the first argument when calling tls.createSecurePair (default: {}).
*/
cryptoCredentialsDetails?: Object;
/**
* A boolean, that when true will expose received rows in Requests' done* events. See done, doneInProc and doneProc. (default: false)
* Caution: If many row are received, enabling this option could result in excessive memory usage.
*/
rowCollectionOnDone?: boolean;
/**
* A boolean, that when true will expose received rows in Requests' completion callback. See new Request. (default: false)
* Caution: If many row are received, enabling this option could result in excessive memory usage.
*/
rowCollectionOnRequestCompletion?: boolean;
/**
* The version of TDS to use. If server doesn't support specified version, negotiated version is used instead. (default: 7_4).
* Take this from tedious.TDS_VERSION.7_4 .
*/
tdsVersion?: number;
}
export interface ConnectionConfig {
/**
* User name to use for authentication.
@@ -283,13 +283,13 @@ declare module 'tedious' {
* Once you set domain, driver will connect to SQL Server using domain login.
*/
domain?: string;
/**
* Further options
*/
options?: ConnectionOptions;
}
export interface ParameterOptions {
// for VarChar, NVarChar, VarBinary
length?: number;
@@ -298,7 +298,7 @@ declare module 'tedious' {
// scale for Numeric, Decimal, Time, DateTime2, DateTimeOffset
scale?: number;
}
/**
* Type of each column in the Request#row event
*/
@@ -306,7 +306,7 @@ declare module 'tedious' {
metadata: ColumnMetaData;
value: any;
}
/**
* A Request instance represents a request that can be executed on a connection
* @event 'columnMetadata' This event, describing result set columns, will be emitted before row events are emitted. This event may be emited multiple times when more than one recordset is produced by the statement.
@@ -317,7 +317,7 @@ declare module 'tedious' {
* @event 'returnValue' A value for an output parameter (that was added to the request with addOutputParameter(...)). See also Using Parameters.
*/
export class Request extends events.EventEmitter {
/**
* Constructor
* @param sql The SQL statement to be executed (or a procedure name, if the request is to be used with connection.callProcedure).
@@ -327,7 +327,7 @@ declare module 'tedious' {
* rows: Rows as a result of executing the SQL statement. Will only be avaiable if Connection's config.options.rowCollectionOnRequestCompletion is true.
*/
constructor(sql: string, callback: (error: Error, rowCount: number, rows: any[]) => void);
/**
* Add an input parameter to the request.
* @param name The parameter name. This should correspond to a parameter in the SQL, or a parameter that a called procedure expects. The name should not start '@'.
@@ -336,26 +336,26 @@ declare module 'tedious' {
* @param options Additional type options. Optional.
*/
addParameter(name: string, type: TediousType, value: any, options?: ParameterOptions): void;
/**
* Add an output parameter to the request. The parameter's value will be provide by an emitted returnValue event.
* Add an output parameter to the request. The parameter's value will be provide by an emitted returnValue event.
* @param name The parameter name. This should correspond to a parameter in the SQL, or a parameter that a called procedure expects.
* @param type One of the supported data types.
* @param value The value that the parameter is to be given. The Javascript type of the argument should match that documented for data types. Optional.
* @param options Additional type options. Optional.
* @param options Additional type options. Optional.
*/
addOutputParameter(name: string, type: TediousType, value?: any, options?: ParameterOptions): void;
}
export interface BulkLoadColumnOpts extends ParameterOptions {
// indicates whether the column accepts NULL values.
nullable: boolean;
nullable: boolean;
// If the name of the column is different from the name of the property found on rowObj arguments passed to , then you can use this option to specify the property name.
objName?: string;
}
export interface BulkLoad {
/**
* Adds a column to the bulk load. The column definitions should match the table you are trying to insert into. Attempting to call addColumn after the first row has been added will throw an exception.
* @param name The name of the column.
@@ -363,7 +363,7 @@ declare module 'tedious' {
* @param options Additional column type information. At a minimum, nullable must be set to true or false.
*/
addColumn(name: string, type: TediousType, options: BulkLoadColumnOpts): void;
/**
* Adds a row to the bulk insert. This method accepts arguments in three different formats:
* @param rowObj An object of key/value pairs representing column name (or objName) and value.
@@ -392,30 +392,30 @@ declare module 'tedious' {
export interface InfoObject {
/**
* Error number
*/
*/
number: number;
/**
* The error state, used as a modifier to the error number.
*/
*/
state: any;
/**
* The class (severity) of the error. A class of less than 10 indicates an informational message.
*/
*/
class: number;
/**
* The message text.
*/
*/
message: string;
/**
* The stored procedure name (if a stored procedure generated the message).
*/
*/
procName: string;
/**
* The line number in the SQL batch or stored procedure that caused the error. Line numbers begin at 1; therefore, if the line number is not applicable to the message, the value of LineNumber will be 0.
*/
*/
lineNumber: number;
}
/**
* Connection
* @event 'connect' The attempt to connect and validate has completed.
@@ -430,26 +430,26 @@ declare module 'tedious' {
* @event 'secure' A secure connection has been established.
*/
export class Connection extends events.EventEmitter {
constructor(config: ConnectionConfig);
/**
* Start a transaction. As only one request at a time may be executed on
* Start a transaction. As only one request at a time may be executed on
* a connection, another request should not be initiated until this callback is called.
* @param callback The callback is called when the request to start the transaction has completed, either successfully or with an error. If an error occured then err will describe the error.
* @param name A string representing a name to associate with the transaction. Optional, and defaults to an empty string. Required when isolationLevel is present.
* @param isolationLevel The isolation level that the transaction is to be run with.
*/
beginTransaction(callback: (error?: Error) => void, name?: string, isolationLevel?: ISOLATION_LEVEL): void;
/**
* Commit a transaction.
* Commit a transaction.
* There should be an active transaction. That is, beginTransaction should have been previously called.
* @param callback The callback is called when the request to commit the transaction has completed, either successfully or with an error. If an error occured then err will describe the error.
* As only one request at a time may be executed on a connection, another request should not be initiated until this callback is called.
*/
commitTransaction(callback: (error: Error) => void): void;
/**
* Rollback a transaction. There should be an active transaction. That is, beginTransaction should have been previously called.
* @param callback The callback is called when the request to rollback the transaction has completed, either successfully or with an error. If an error occured then err will describe the error.
@@ -462,7 +462,7 @@ declare module 'tedious' {
* @param request A Request object representing the request. Parameters only require a name and type. Parameter values are ignored.
*/
prepare(request: Request): void;
/**
* Release the SQL Server resources associated with a previously prepared request.
*/
@@ -472,20 +472,20 @@ declare module 'tedious' {
* Call a stored procedure represented by request.
*/
callProcedure(request: Request): void;
/**
* Execute the SQL represented by request.
* As sp_executesql is used to execute the SQL, if the same SQL is executed multiples times using this function, the SQL Server query optimizer is likely to reuse the execution plan it generates for the first execution.
* Beware of the way that scoping rules apply, and how they may affect local temp tables. If you're running in to scoping issues, then execSqlBatch may be a better choice. See also issue #24.
*/
execSql(request: Request): void;
/**
* Execute the SQL batch represented by request. There is no param support, and unlike execSql, it is not likely that SQL Server will reuse the execution plan it generates for the SQL.
* In almost all cases, execSql will be a better choice.
*/
execSqlBatch(request: Request): void;
/**
* Execute previously prepared SQL, using the supplied parameters.
* @param request A previously prepared Request.
@@ -499,7 +499,7 @@ declare module 'tedious' {
* @param callback A function which will be called after the BulkLoad finishes executing. rowCount will equal the number of rows inserted.
*/
newBulkLoad(tableName: string, callback: (error: Error, rowCount: number) => void): BulkLoad;
/**
* Executes a BulkLoad.
*/
@@ -508,19 +508,19 @@ declare module 'tedious' {
/**
* Reset the connection to its initial state. Can be useful for connection pool implementations.
* @param callback The callback is called when the connection reset has completed, either successfully or with an error. If an error occured then err will describe the error.
* As only one request at a time may be executed on a connection, another request should not be initiated until this callback is called.
* As only one request at a time may be executed on a connection, another request should not be initiated until this callback is called.
*/
reset(callback: (error: Error) => void): void;
/**
* Cancel currently executed request.
*/
cancel(): void;
/**
* Closes the connection to the database. The end will be emmited once the connection has been closed.
*/
close(): void;
}
}
+1 -1
View File
@@ -316,7 +316,7 @@ declare module Tee {
calc(value: number): number;
fromPos(position: number): number;
fromSize(size: number): number;
hasAnySeries(): boolean;
scroll(delta: number): void;
setMinMax(minimum: number, maximum: number): void;
+14 -17
View File
@@ -1,14 +1,22 @@
// Type definitions for Tether v0.6
// Type definitions for Tether v1.1
// Project: http://github.hubspot.com/tether/
// Definitions by: Adi Dahiya <https://github.com/adidahiya>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module tether {
// global Tether constructor
declare class Tether {
constructor(options: Tether.ITetherOptions);
interface TetherStatic {
new(options: ITetherOptions): Tether;
}
public setOptions(options: Tether.ITetherOptions): void;
public disable(): void;
public enable(): void;
public destroy(): void;
public position(): void;
public static position(): void;
}
declare namespace Tether {
interface ITetherOptions {
attachment?: string;
classes?: {[className: string]: boolean};
@@ -31,20 +39,9 @@ declare module tether {
pinnedClass?: string;
to?: string | HTMLElement | number[];
}
interface Tether {
setOptions(options: ITetherOptions): void;
disable(): void;
enable(): void;
destroy(): void;
position(): void;
}
}
declare module "tether" {
export = tether;
export = Tether;
}
declare var Tether: tether.TetherStatic;
+1 -1
View File
@@ -8,7 +8,7 @@ interface DetectorStatic {
webgl: boolean;
workers: boolean;
fileapi: boolean;
getWebGLErrorMessage(): HTMLElement;
addGetWebGLMessage(parameters?: {id?: string; parent?: HTMLElement}): void;
}
+1 -1
View File
@@ -17,7 +17,7 @@ declare module THREE {
readBuffer: WebGLRenderTarget;
passes: any[];
copyPass: ShaderPass;
swapBuffers(): void;
addPass(pass: any): void;
insertPass(pass: any, index: number): void;
+1 -1
View File
@@ -18,7 +18,7 @@ declare module THREE {
render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, delta: number): void;
}
export class ClearMaskPass {
constructor();
+2 -2
View File
@@ -51,11 +51,11 @@ declare module THREE {
reset(): void;
getPolarAngle(): number;
getAzimuthalAngle(): number;
// EventDispatcher mixins
addEventListener(type: string, listener: (event: any) => void): void;
hasEventListener(type: string, listener: (event: any) => void): void;
removeEventListener(type: string, listener: (event: any) => void): void;
dispatchEvent(event: { type: string; target: any; }): void;
}
}
}
+4 -4
View File
@@ -72,7 +72,7 @@ declare module THREE {
*/
export class Projector {
constructor();
// deprecated.
projectVector(vector: Vector3, camera: Camera): Vector3;
@@ -88,10 +88,10 @@ declare module THREE {
* @param sort select whether to sort elements using the Painter's algorithm.
*/
projectScene(scene: Scene, camera: Camera, sortObjects: boolean, sortElements?: boolean): {
objects: Object3D[]; // Mesh, Line or other object
sprites: Object3D[]; // Sprite or Particle
objects: Object3D[]; // Mesh, Line or other object
sprites: Object3D[]; // Sprite or Particle
lights: Light[];
elements: Face3[]; // Line, Particle, Face3 or Face4
};
}
}
}
+2 -2
View File
@@ -4618,7 +4618,7 @@ declare module THREE {
getMaxAnisotropy(): number;
getPixelRatio(): number;
setPixelRatio(value: number): void;
getSize(): { width: number; height: number; };
/**
@@ -4960,7 +4960,7 @@ declare module THREE {
export class WebGLProgram{
constructor(renderer: WebGLRenderer, code: string, material: ShaderMaterial, parameters: WebGLRendererParameters);
getUniforms(): any;
getAttributes(): any;

Some files were not shown because too many files have changed in this diff Show More