CustomScrollbarOptions with all the options from current documentation

This commit is contained in:
Radu Woinaroski
2016-06-04 17:14:34 +02:00
91 changed files with 35853 additions and 6626 deletions

View File

@@ -56,6 +56,15 @@ declare namespace angular.local.storage {
* @param val
*/
set(key:string, val:string):boolean;
/**
* Directly adds a value to cookies with an expiration.
* Note: Typically used as a fallback if local storage is not supported.
* Returns: Boolean
* @param key
* @param val
* @param daysToExpiry
*/
set(key:string, val:string, daysToExpiry:number):boolean;
/**
* Directly get a value from a cookie.
* Returns: value from local storage

View File

@@ -4,6 +4,12 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module 'angular-material' {
   var _: string;
  export = _;
}
declare namespace angular.material {
interface IBottomSheetOptions {

View File

@@ -387,6 +387,12 @@ declare namespace angular.ui.bootstrap {
* @default 'model-open'
*/
openedClass?: string;
/**
* CSS class(es) to be added to the top modal window.
*/
windowTopClass?: string;
}
interface IModalStackService {

View File

@@ -428,4 +428,55 @@ declare namespace angular {
interface OnReuse {
$routerOnReuse(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): any;
}
/**
* Runtime representation a type that a Component or other object is instances of.
*
* An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by
* the `MyCustomComponent` constructor function.
*/
interface Type extends Function {
}
/**
* `RouteDefinition` defines a route within a {@link RouteConfig} decorator.
*
* Supported keys:
* - `path` or `aux` (requires exactly one of these)
* - `component`, `loader`, `redirectTo` (requires exactly one of these)
* - `name` or `as` (optional) (requires exactly one of these)
* - `data` (optional)
*
* See also {@link Route}, {@link AsyncRoute}, {@link AuxRoute}, and {@link Redirect}.
*/
interface RouteDefinition {
path?: string;
aux?: string;
component?: Type | ComponentDefinition | string;
loader?: Function;
redirectTo?: any[];
as?: string;
name?: string;
data?: any;
useAsDefault?: boolean;
}
/**
* Represents either a component type (`type` is `component`) or a loader function
* (`type` is `loader`).
*
* See also {@link RouteDefinition}.
*/
interface ComponentDefinition {
type: string;
loader?: Function;
component?: Type;
}
// Supplement IComponentOptions from angular.d.ts with router-specific
// fields.
interface IComponentOptions {
$canActivate?: () => boolean;
$routeConfig?: RouteDefinition[];
}
}

View File

@@ -95,7 +95,7 @@ declare namespace angular.resource {
(params: Object, data: Object, success?: Function, error?: Function): IResourceArray<T>;
}
// Baseclass for everyresource with default actions.
// Baseclass for every resource with default actions.
// If you define your new actions for the resource, you will need
// to extend this interface and typecast the ResourceClass to it.
//

View File

@@ -883,6 +883,24 @@ declare namespace angular {
unwrapPromises(): boolean;
unwrapPromises(value: boolean): IParseProvider;
/**
* Configure $parse service to add literal values that will be present as literal at expressions.
*
* @param literalName Token for the literal value. The literal name value must be a valid literal name.
* @param literalValue Value for this literal. All literal values must be primitives or `undefined`.
**/
addLiteral(literalName: string, literalValue: any): void;
/**
* Allows defining the set of characters that are allowed in Angular expressions. The function identifierStart will get called to know if a given character is a valid character to be the first character for an identifier. The function identifierContinue will get called to know if a given character is a valid character to be a follow-up identifier character. The functions identifierStart and identifierContinue will receive as arguments the single character to be identifier and the character code point. These arguments will be string and numeric. Keep in mind that the string parameter can be two characters long depending on the character representation. It is expected for the function to return true or false, whether that character is allowed or not.
* Since this function will be called extensivelly, keep the implementation of these functions fast, as the performance of these functions have a direct impact on the expressions parsing speed.
*
* @param identifierStart The function that will decide whether the given character is a valid identifier start character.
* @param identifierContinue The function that will decide whether the given character is a valid identifier continue character.
**/
setIdentifierFns(identifierStart?: (character: string, codePoint: number) => boolean,
identifierContinue?: (character: string, codePoint: number) => boolean): void;
}
interface ICompiledExpression {
@@ -1656,50 +1674,6 @@ declare namespace angular {
// see http://angularjs.blogspot.com.br/2015/11/angularjs-15-beta2-and-14-releases.html
// and http://toddmotto.com/exploring-the-angular-1-5-component-method/
///////////////////////////////////////////////////////////////////////////
/**
* Runtime representation a type that a Component or other object is instances of.
*
* An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by
* the `MyCustomComponent` constructor function.
*/
interface Type extends Function {
}
/**
* `RouteDefinition` defines a route within a {@link RouteConfig} decorator.
*
* Supported keys:
* - `path` or `aux` (requires exactly one of these)
* - `component`, `loader`, `redirectTo` (requires exactly one of these)
* - `name` or `as` (optional) (requires exactly one of these)
* - `data` (optional)
*
* See also {@link Route}, {@link AsyncRoute}, {@link AuxRoute}, and {@link Redirect}.
*/
interface RouteDefinition {
path?: string;
aux?: string;
component?: Type | ComponentDefinition | string;
loader?: Function;
redirectTo?: any[];
as?: string;
name?: string;
data?: any;
useAsDefault?: boolean;
}
/**
* Represents either a component type (`type` is `component`) or a loader function
* (`type` is `loader`).
*
* See also {@link RouteDefinition}.
*/
interface ComponentDefinition {
type: string;
loader?: Function;
component?: Type;
}
/**
* Component definition object (a simplified directive definition object)
*/

View File

@@ -378,6 +378,7 @@ async.auto({
async.retry(3, function (callback, results) { }, function (err, result) { });
async.retry({ times: 3, interval: 200 }, function (callback, results) { }, function (err, result) { });
async.retry({ times: 3, interval: (retryCount) => { return 200 * retryCount; } }, function (callback, results) { }, function (err, result) { });
async.parallel([

4
async/async.d.ts vendored
View File

@@ -12,7 +12,7 @@ interface AsyncResultObjectCallback<T> { (err: Error, results: Dictionary<T>): v
interface AsyncFunction<T> { (callback: (err?: Error, result?: T) => void): void; }
interface AsyncIterator<T> { (item: T, callback: ErrorCallback): void; }
interface AsyncForEachOfIterator<T> { (item: T, key: number, callback: ErrorCallback): void; }
interface AsyncForEachOfIterator<T> { (item: T, key: number|string, callback: ErrorCallback): void; }
interface AsyncResultIterator<T, R> { (item: T, callback: AsyncResultCallback<R>): void; }
interface AsyncMemoIterator<T, R> { (memo: R, item: T, callback: AsyncResultCallback<R>): void; }
interface AsyncBooleanIterator<T> { (item: T, callback: (err: string, truthValue: boolean) => void): void; }
@@ -136,7 +136,7 @@ interface Async {
cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo;
auto(tasks: any, callback?: (error: Error, results: any) => void): void;
retry<T>(opts: number, task: (callback : AsyncResultCallback<T>, results: any) => void, callback: (error: Error, results: any) => void): void;
retry<T>(opts: { times: number, interval: number }, task: (callback: AsyncResultCallback<T>, results : any) => void, callback: (error: Error, results: any) => void): void;
retry<T>(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback<T>, results : any) => void, callback: (error: Error, results: any) => void): void;
iterator(tasks: Function[]): Function;
apply(fn: Function, ...arguments: any[]): AsyncFunction<any>;
nextTick(callback: Function): void;

View File

@@ -31,7 +31,7 @@ function test() {
bezier.get(1);
bezier.getLUT()[0].x;
bezier.hull(0);
bezier.inflections().values;
bezier.extrema();
bezier.intersects(bezier);
bezier.length();
bezier.lineIntersects(line);
@@ -48,7 +48,8 @@ function test() {
bezier.scale(4);
bezier.selfintersects();
bezier.simple();
bezier.split(0, 1);
bezier.split(0, 1).clockwise;
bezier.split(0.5).left;
bezier.toSVG();
bezier.update();

View File

@@ -117,7 +117,8 @@ declare module BezierJs {
private __normal3(t);
private __normal(t);
hull(t: number): Point[];
split(t1: number, t2?: number): Bezier | Split;
split(t1: number): Split;
split(t1: number, t2: number): Bezier;
extrema(): Inflection;
bbox(): BBox;
overlaps(curve: Bezier): boolean;

View File

@@ -301,7 +301,7 @@ declare namespace Microsoft.Maps {
getShowPointer(): boolean;
getTitle(): string;
getTitleAction(): any;
getTitleClickHandler(): () => void;
getTitleClickHandler(): (mouseEvent?: MouseEvent) => void;
getVisible(): boolean;
getWidth(): number;
getZIndex(): number;
@@ -329,8 +329,8 @@ declare namespace Microsoft.Maps {
showPointer?: boolean;
pushpin?: Pushpin;
title?: string;
titleAction?: { label?: string; eventHandler: () => void; };
titleClickHandler?: () => void;
titleAction?: { label?: string; eventHandler: (mouseEvent?: MouseEvent) => void; };
titleClickHandler?: (mouseEvent?: MouseEvent) => void;
typeName?: InfoboxType;
visible?: boolean;
width?: number;

View File

@@ -91,7 +91,7 @@ declare class ByteBuffer
/**
* Data view to manipulate the backing buffer. Becomes null if the backing buffer has a capacity of 0.
*/
view: DataView;
view: DataView;
/**
* Allocates a new ByteBuffer backed by a buffer of the specified capacity.
@@ -424,7 +424,7 @@ declare class ByteBuffer
/**
* Resizes this ByteBuffer to be backed by a buffer of at least the given capacity. Will do nothing if already that large or larger.
*/
*/
resize( capacity: number ): ByteBuffer;
/**
@@ -611,6 +611,5 @@ declare class ByteBuffer
}
declare module 'bytebuffer' {
namespace ByteBuffer {}
export = ByteBuffer;
}

View File

@@ -0,0 +1,33 @@
///<reference path="combokeys.d.ts" />
import Combokeys = require("combokeys");
const combokeys1: Combokeys.Combokeys = new Combokeys(document.createElement('div'));
const combokeys2: Combokeys.Combokeys = new Combokeys(document.createElement('div'));
combokeys1.bind('ctrl+a', () => {});
combokeys1.bind('ctrl+z', () => {}, 'keydown');
combokeys1.bind(['ctrl+a', 'ctrl+shift+a'], () => {});
combokeys1.bind(['ctrl+a', 'ctrl+shift+a'], () => {}, 'keyup');
combokeys1.bindMultiple(['ctrl+a', 'ctrl+shift+a'], () => {});
combokeys1.bindMultiple(['ctrl+a', 'ctrl+shift+a'], () => {}, 'keyup');
const result: boolean = combokeys1.stopCallback(new Event(null), document.createElement('div'));
combokeys1.unbind('ctrl+a');
combokeys1.unbind('ctrl+a', 'keydown');
combokeys1.unbind(['ctrl+a', 'ctrl+shift+a']);
combokeys1.unbind(['ctrl+a', 'ctrl+shift+a'], 'keydown');
combokeys1.trigger('ctrl+a');
combokeys1.trigger('ctrl+a', 'keypress');
combokeys1.reset();
combokeys1.detach();
Combokeys.reset();
Combokeys.instances.forEach((combokeys: Combokeys.Combokeys) => combokeys.reset() );

107
combokeys/combokeys.d.ts vendored Normal file
View File

@@ -0,0 +1,107 @@
// Type definitions for Combokeys v2.4.6
// Project: https://github.com/PolicyStat/combokeys
// Definitions by: Ian Clanton-Thuon <https://github.com/iclanton>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace Combokeys {
interface CombokeysStatic {
new (element: Element): Combokeys;
/**
* all instances of Combokeys
*/
instances: Combokeys[];
/**
* reset all instances
*/
reset(): void;
}
interface Combokeys {
element: Element;
/**
* binds an event to Combokeys
*
* can be a single key, a combination of keys separated with +,
* an array of keys, or a sequence of keys separated by spaces
*
* be sure to list the modifier keys first to make sure that the
* correct key ends up getting bound (the last key in the pattern)
*
* @param {keys} key combination or combinations
* @param {callback} callback function
* @param {handler} optional - one of "keypress", "keydown", or "keyup"
* @returns void
*/
bind(keys: string | string[], callback: () => void, action?: string): void;
/**
* binds multiple combinations to the same callback
*
* @param {keys} key combinations
* @param {callback} callback function
* @param {handler} optional - one of "keypress", "keydown", or "keyup"
* @returns void
*/
bindMultiple(keys: string[], callback: () => void, action?: string): void;
/**
* unbinds an event to Combokeys
*
* the unbinding sets the callback function of the specified key combo
* to an empty function and deletes the corresponding key in the
* directMap dict.
*
* the keycombo+action has to be exactly the same as
* it was defined in the bind method
*
* @param {keys} key combination or combinations
* @param {action} optional - one of "keypress", "keydown", or "keyup"
* @returns void
*/
unbind(keys: string | string[], action?: string): void;
/**
* triggers an event that has already been bound
*
* @param {keys} key combination
* @param {action} optional - one of "keypress", "keydown", or "keyup"
* @returns void
*/
trigger(keys: string, action?: string): void;
/**
* resets the library back to its initial state. This is useful
* if you want to clear out the current keyboard shortcuts and bind
* new ones - for example if you switch to another page
*
* @returns void
*/
reset(): void;
/**
* should we stop this event before firing off callbacks
*
* @param {e} event
* @param {element} bound element
* @return {boolean}
*/
stopCallback(e: Event, element: Element): boolean;
/**
* detach all listners from the bound element
*
* @return {void}
*/
detach(): void;
}
}
declare var combokeys: Combokeys.CombokeysStatic;
declare module "combokeys" {
export = combokeys;
}

13
core-js/core-js.d.ts vendored
View File

@@ -790,8 +790,17 @@ interface PromiseConstructor {
* @param values An array of Promises.
* @returns A new Promise.
*/
all<T>(values: Iterable<T | PromiseLike<T>>): Promise<T[]>;
all<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>, T9 | PromiseLike<T9>, T10 | PromiseLike<T10>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>;
all<T1, T2, T3, T4, T5, T6, T7, T8, T9>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>, T9 | PromiseLike<T9>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;
all<T1, T2, T3, T4, T5, T6, T7, T8>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>;
all<T1, T2, T3, T4, T5, T6, T7>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>]): Promise<[T1, T2, T3, T4, T5, T6, T7]>;
all<T1, T2, T3, T4, T5, T6>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>]): Promise<[T1, T2, T3, T4, T5, T6]>;
all<T1, T2, T3, T4, T5>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>]): Promise<[T1, T2, T3, T4, T5]>;
all<T1, T2, T3, T4>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>]): Promise<[T1, T2, T3, T4]>;
all<T1, T2, T3>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>]): Promise<[T1, T2, T3]>;
all<T1, T2>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]): Promise<[T1, T2]>;
all<TAll>(values: Iterable<TAll | PromiseLike<TAll>>): Promise<TAll[]>;
/**
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
* or rejected.

View File

@@ -0,0 +1,64 @@
/// <reference path="csv-parse.d.ts" />
import parse = require('csv-parse');
function callbackAPITest() {
var input = '#Welcome\n"1","2","3","4"\n"a","b","c","d"';
parse(input, {comment: '#'}, function(err, output){
output.should.eql([ [ '1', '2', '3', '4' ], [ 'a', 'b', 'c', 'd' ] ]);
});
}
function streamAPITest() {
var output:any = [];
// Create the parser
var parser = parse({delimiter: ':'});
var record: any;
// Use the writable stream api
parser.on('readable', function(){
while(record = parser.read()){
output.push(record);
}
});
// Catch any error
parser.on('error', function(err: any){
console.log(err.message);
});
// When we are done, test that the parsed output matched what expected
parser.on('finish', function(){
output.should.eql([
[ 'root','x','0','0','root','/root','/bin/bash' ],
[ 'someone','x','1022','1022','a funny cat','/home/someone','/bin/bash' ]
]);
});
// Now that setup is done, write data to the stream
parser.write("root:x:0:0:root:/root:/bin/bash\n");
parser.write("someone:x:1022:1022:a funny cat:/home/someone:/bin/bash\n");
// Close the readable stream
parser.end();
}
import fs = require('fs');
function pipeFunctionTest() {
var transform = require('stream-transform');
var output:any = [];
var parser = parse({delimiter: ':'})
var input = fs.createReadStream('/etc/passwd');
var transformer = transform(function(record: any[], callback: any){
setTimeout(function(){
callback(null, record.join(' ')+'\n');
}, 500);
}, {parallel: 10});
input.pipe(parser).pipe(transformer).pipe(process.stdout);
}
import parseSync = require('csv-parse/lib/sync');
function syncApiTest() {
var input = '"key_1","key_2"\n"value 1","value 2"';
var records = parseSync(input, {columns: true});
records.should.eql([{ key_1: 'value 1', key_2: 'value 2' }]);
}

132
csv-parse/csv-parse.d.ts vendored Normal file
View File

@@ -0,0 +1,132 @@
// Type definitions for csv-parse 1.1.0
// Project: https://github.com/wdavidw/node-csv-parse
// Definitions by: David Muller <https://github.com/davidm77>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "csv-parse/types" {
interface callbackFn {
(err: any, output: any): void
}
interface nameCallback {
(line1: any[]): boolean | string[]
}
interface options {
/***
* Set the field delimiter. One character only, defaults to comma.
*/
delimiter?: string;
/***
* String used to delimit record rows or a special value; special constants are 'auto', 'unix', 'mac', 'windows', 'unicode'; defaults to 'auto' (discovered in source or 'unix' if no source is specified).
*/
rowDelimiter?: string;
/***
* Optional character surrounding a field, one character only, defaults to double quotes.
*/
quote?: string
/***
* Set the escape character, one character only, defaults to double quotes.
*/
escape?: string
/***
* List of fields as an array, a user defined callback accepting the first line and returning the column names or true if autodiscovered in the first CSV line, default to null, affect the result data set in the sense that records will be objects instead of arrays.
*/
columns?: any[]|boolean|nameCallback;
/***
* Treat all the characters after this one as a comment, default to '' (disabled).
*/
comment?: string
/***
* Name of header-record title to name objects by.
*/
objname?: string
/***
* Preserve quotes inside unquoted field.
*/
relax?: boolean
/***
* Discard inconsistent columns count, default to false.
*/
relax_column_count?: boolean
/***
* Dont generate empty values for empty lines.
*/
skip_empty_lines?: boolean
/***
* Maximum numer of characters to be contained in the field and line buffers before an exception is raised, used to guard against a wrong delimiter or rowDelimiter, default to 128000 characters.
*/
max_limit_on_data_read?: number
/***
* If true, ignore whitespace immediately around the delimiter, defaults to false. Does not remove whitespace in a quoted field.
*/
trim?: boolean
/***
* If true, ignore whitespace immediately following the delimiter (i.e. left-trim all fields), defaults to false. Does not remove whitespace in a quoted field.
*/
ltrim?: boolean
/***
* If true, ignore whitespace immediately preceding the delimiter (i.e. right-trim all fields), defaults to false. Does not remove whitespace in a quoted field.
*/
rtrim?: boolean
/***
* If true, the parser will attempt to convert read data types to native types.
*/
auto_parse?: boolean
/***
* If true, the parser will attempt to convert read data types to dates. It requires the "auto_parse" option.
*/
auto_parse_date?: boolean
}
import * as stream from "stream";
interface Parser extends stream.Transform {
__push(line: any): any ;
__write(chars: any, end: any, callback: any): any;
}
interface ParserConstructor {
new (options: options): Parser;
}
interface parse {
(input: string, options?: options, callback?: callbackFn): any;
(options: options, callback: callbackFn): any;
(callback: callbackFn): any;
(options?: options): NodeJS.ReadWriteStream;
Parser: ParserConstructor;
}
}
declare module "csv-parse" {
import { parse as parseIntf } from "csv-parse/types";
let parse: parseIntf;
export = parse;
}
declare module "csv-parse/lib/sync" {
import { options } from "csv-parse/types";
function parse (input: string, options?: options): any;
export = parse;
}

View File

@@ -14,6 +14,6 @@ namespace DagreD3Tests {
const render = new dagreD3.render();
const svg = d3.select("svg");
render.arrows()["arrowType"] = (parent: JQuery, id: string, edge: Dagre.Edge, type: string) => {};
render.arrows()["arrowType"] = (parent: d3.Selection<any>, id: string, edge: Dagre.Edge, type: string) => {};
render(svg, graph);
}

View File

@@ -5,7 +5,6 @@
/// <reference path="../d3/d3.d.ts"/>
/// <reference path="../dagre/dagre.d.ts"/>
/// <reference path="../jquery/jquery.d.ts" />
declare namespace Dagre {
@@ -25,7 +24,7 @@ declare namespace Dagre {
interface Render {
// see http://cpettitt.github.io/project/dagre-d3/latest/demo/user-defined.html for example usage
arrows (): { [arrowStyleName: string]: (parent: JQuery, id: string, edge: Dagre.Edge, type: string) => void };
arrows (): { [arrowStyleName: string]: (parent: d3.Selection<any>, id: string, edge: Dagre.Edge, type: string) => void };
new (): Render;
(selection: d3.Selection<any>, g: Dagre.Graph): void;
}

7443
devextreme/devextreme-15.2.9.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -582,6 +582,7 @@ interface Set<T> {
entries(): IterableIteratorShim<[T, T]>;
keys(): IterableIteratorShim<T>;
values(): IterableIteratorShim<T>;
'_es6-shim iterator_'(): IterableIteratorShim<T>;
}
interface SetConstructor {

View File

@@ -408,7 +408,7 @@ declare module "express-serve-static-core" {
interface Send {
(status: number, body?: any): Response;
(body: any): Response;
(body?: any): Response;
}
interface Response extends http.ServerResponse, Express.Response {

View File

@@ -0,0 +1,46 @@
/// <reference path="fontfaceobserver.d.ts" />
function test1() {
var font = new FontFaceObserver('My Family', {
weight: 400
});
font.load().then(function () {
console.log('Font is available');
}, function () {
console.log('Font is not available');
});
}
function test2() {
var font = new FontFaceObserver('My Family');
font.load('中国').then(function () {
console.log('Font is available');
}, function () {
console.log('Font is not available');
});
}
function test3() {
var font = new FontFaceObserver('My Family');
font.load(null, 5000).then(function () {
console.log('Font is available');
}, function () {
console.log('Font is not available after waiting 5 seconds');
});
}
function test4() {
var fontA = new FontFaceObserver('Family A');
var fontB = new FontFaceObserver('Family B');
fontA.load().then(function () {
console.log('Family A is available');
});
fontB.load().then(function () {
console.log('Family B is available');
});
}

View File

@@ -0,0 +1 @@
--target ES6

33
fontfaceobserver/fontfaceobserver.d.ts vendored Normal file
View File

@@ -0,0 +1,33 @@
// Type definitions for fontfaceobserver
// Project: https://github.com/bramstein/fontfaceobserver
// Definitions by: Rand Scullard <https://github.com/RandScullard>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace FontFaceObserver {
interface FontVariant {
weight?: number | string;
style?: string;
stretch?: string;
}
}
declare class FontFaceObserver {
/**
* Creates a new FontFaceObserver.
* @param fontFamilyName Name of the font family to observe.
* @param variant Description of the font variant to observe. If a property is not present it will default to normal.
*/
constructor(fontFamilyName: string, variant?: FontFaceObserver.FontVariant);
/**
* Starts observing the loading of the specified font. Immediately returns a new Promise that resolves when the font is available and rejected when the font is not available.
* @param testString If your font doesn't contain latin characters you can pass a custom test string.
* @param timeout The default timeout for giving up on font loading is 3 seconds. You can increase or decrease this by passing a number of milliseconds.
*/
load(testString?: string, timeout?: number): Promise<void>;
}
declare module "fontfaceobserver" {
export = FontFaceObserver;
}

View File

@@ -0,0 +1,64 @@
/// <reference path="fullpage.js.d.ts" />
function test_public_methods() {
$(() => {
$('#fullpage').fullpage({
// Navigation
menu: '#menu',
lockAnchors: false,
anchors:['firstPage', 'secondPage'],
navigation: false,
navigationPosition: 'right',
navigationTooltips: ['firstSlide', 'secondSlide'],
showActiveTooltip: false,
slidesNavigation: true,
slidesNavPosition: 'bottom',
// Scrolling
css3: true,
scrollingSpeed: 700,
autoScrolling: true,
fitToSection: true,
fitToSectionDelay: 1000,
scrollBar: false,
easing: 'easeInOutCubic',
easingcss3: 'ease',
loopBottom: false,
loopTop: false,
loopHorizontal: true,
continuousVertical: false,
normalScrollElements: '#element1, .element2',
scrollOverflow: false,
scrollOverflowOptions: null,
touchSensitivity: 15,
normalScrollElementTouchThreshold: 5,
// Accessibility
keyboardScrolling: true,
animateAnchor: true,
recordHistory: true,
// Design
controlArrows: true,
verticalCentered: true,
sectionsColor : ['#ccc', '#fff'],
paddingTop: '3em',
paddingBottom: '10px',
fixedElements: '#header, .footer',
responsiveWidth: 0,
responsiveHeight: 0,
// Custom selectors
sectionSelector: '.section',
slideSelector: '.slide',
// Events
onLeave: (index, nextIndex, direction) => {},
afterLoad: (anchorLink, index) => {},
afterRender: () => {},
afterResize: () => {},
afterSlideLoad: (anchorLink, index, slideAnchor, slideIndex) => {},
onSlideLeave: (anchorLink, index, slideIndex, direction, nextSlideIndex) => {}
});
});
}

267
fullpage.js/fullpage.js.d.ts vendored Normal file
View File

@@ -0,0 +1,267 @@
// Type definitions for fullpage.js v2.8.0
// Project: http://alvarotrigo.com/fullPage/
// Definitions by: Andrew Roberts <http://www.atroberts.org>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
interface FullPageJsOptions {
/**
* (default false) A selector can be used to specify the menu to link with the sections. This way the scrolling of the sections will activate the corresponding element in the menu using the class active. This won't generate a menu but will just add the active class to the element in the given menu with the corresponding anchor links. In order to link the elements of the menu with the sections, an HTML 5 data-tag (data-menuanchor) will be needed to use with the same anchor links as used within the sections.
*/
menu?: string;
/**
* (default false). Determines whether anchors in the URL will have any effect at all in the plugin. You can still using anchors internally for your own functions and callbacks, but they won't have any effect in the scrolling of the site. Useful if you want to combine fullPage.js with other plugins using anchor in the URL.
*/
lockAnchors?: boolean;
/**
* (default []) Defines the anchor links (#example) to be shown on the URL for each section. Anchors value should be unique. The position of the anchors in the array will define to which sections the anchor is applied. (second position for second section and so on). Using anchors forward and backward navigation will also be possible through the browser. This option also allows users to bookmark a specific section or slide. Be careful! anchors can not have the same value as any ID element on the site (or NAME element for IE). Now anchors can be defined directly in the HTML structure by using the attribute data-anchor as explained here.
*/
anchors?: string[];
/**
* (default false) If set to true, it will show a navigation bar made up of small circles.
*/
navigation?: boolean;
/**
* (default none) It can be set to left or right and defines which position the navigation bar will be shown (if using one).
*/
navigationPosition?: string;
/**
* (default []) Defines the tooltips to show for the navigation circles in case they are being used. Example: navigationTooltips: ['firstSlide', 'secondSlide'].
*/
navigationTooltips?: string[];
/**
* (default false) Shows a persistent tooltip for the actively viewed section in the vertical navigation.
*/
showActiveTooltip?: boolean;
/**
* (default false) If set to true it will show a navigation bar made up of small circles for each landscape slider on the site.
*/
slidesNavigation?: boolean;
/**
* (default bottom) Defines the position for the landscape navigation bar for sliders. Admits top and bottom as values. You may want to modify the CSS styles to determine the distance from the top or bottom as well as any other style such as color.
*/
slidesNavPosition?: string;
// Scrolling
/**
* (default true). Defines whether to use JavaScript or CSS3 transforms to scroll within sections and slides. Useful to speed up the movement in tablet and mobile devices with browsers supporting CSS3. If this option is set to true and the browser doesn't support CSS3, a jQuery fallback will be used instead.
*/
css3?: boolean;
/**
* (default 700) Speed in milliseconds for the scrolling transitions.
*/
scrollingSpeed?: number;
/**
* (default true) Defines whether to use the "automatic" scrolling or the "normal" one. It also has affects the way the sections fit in the browser/device window in tablets and mobile phones.
*/
autoScrolling?: boolean;
/**
* (default true). Determines whether or not to fit sections to the viewport or not. When set to true the current active section will always fill the whole viewport. Otherwise the user will be free to stop in the middle of a section (when )
*/
fitToSection?: boolean;
/**
* (default 1000). If fitToSection is set to true, this delays the fitting by the configured milliseconds.
*/
fitToSectionDelay?: number;
/**
* (default false). Determines whether to use scrollbar for the site or not. In case of using scroll bar, the autoScrolling functionality will still working as expected. The user will also be free to scroll the site with the scroll bar and fullPage.js will fit the section in the screen when scrolling finishes.
*/
scrollBar?: boolean;
/**
* (default easeInOutCubic) Defines the transition effect to use for the vertical and horizontal scrolling. It requires the file vendors/jquery.easings.min.js or jQuery UI for using some of its transitions. Other libraries could be used instead.
*/
easing?: string;
/**
* (default ease) Defines the transition effect to use in case of using css3:true. You can use the pre-defined ones (such as linear, ease-out...) or create your own ones using the cubic-bezier function. You might want to use Matthew Lein CSS Easing Animation Tool for it.
*/
easingcss3?: string;
/**
* (default false) Defines whether scrolling down in the last section should scroll to the first one or not.
*/
loopBottom?: boolean;
/**
* (default false) Defines whether scrolling up in the first section should scroll to the last one or not.
*/
loopTop?: boolean;
/**
* (default true) Defines whether horizontal sliders will loop after reaching the last or previous slide or not.
*/
loopHorizontal?: boolean;
/**
* (default false) Defines whether scrolling down in the last section should scroll down to the first one or not, and if scrolling up in the first section should scroll up to the last one or not. Not compatible with loopTop or loopBottom.
*/
continuousVertical?: boolean;
/**
* (default null) If you want to avoid the auto scroll when scrolling over some elements, this is the option you need to use. (useful for maps, scrolling divs etc.) It requires a string with the jQuery selectors for those elements. (For example: normalScrollElements: '#element1, .element2')
*/
normalScrollElements?: string;
/**
* (default false) defines whether or not to create a scroll for the section/slide in case its content is bigger than the height of it. When set to true, your content will be wrapped by the plugin. Consider using delegation or load your other scripts in the afterRender callback. In case of setting it to true, it requires the vendor library scrolloverflow.min.js and it should be loaded before the fullPage.js plugin.
*/
scrollOverflow?: boolean;
/**
* when using scrollOverflow:true fullpage.js will make use of a forked and modified version of iScroll.js libary. You can customize the scrolling behaviour by providing fullpage.js with the iScroll.js options you want to use. Check its documentation for more info.
*/
scrollOverflowOptions?: any;
/**
* (default 5) Defines a percentage of the browsers window width/height, and how far a swipe must measure for navigating to the next section / slide
*/
touchSensitivity?: number;
/**
* (default 5) Defines the threshold for the number of hops up the html node tree Fullpage will test to see if normalScrollElements is a match to allow scrolling functionality on divs on a touch device. (For example: normalScrollElementTouchThreshold: 3)
*/
normalScrollElementTouchThreshold?: number;
// Accessibility
/**
* (default true) Defines if the content can be navigated using the keyboard
*/
keyboardScrolling?: boolean;
/**
* (default true) Defines whether the load of the site when given an anchor (#) will scroll with animation to its destination or will directly load on the given section.
*/
animateAnchor?: boolean;
/**
* (default true) Defines whether to push the state of the site to the browser's history. When set to true each section/slide of the site will act as a new page and the back and forward buttons of the browser will scroll the sections/slides to reach the previous or next state of the site. When set to false, the URL will keep changing but will have no effect ont he browser's history. This option is automatically turned off when using autoScrolling:false.
*/
recordHistory?: boolean;
// Design
/**
* (default: true) Determines whether to use control arrows for the slides to move right or left.
*/
controlArrows?: boolean;
/**
* (default true) Vertically centering of the content within sections. When set to true, your content will be wrapped by the plugin. Consider using delegation or load your other scripts in the afterRender callback.
*/
verticalCentered?: boolean;
resize ?: boolean;
/**
* (default none) Define the CSS background-color property for each section
*/
sectionsColor ?: string[];
/**
* (default 0) Defines the top padding for each section with a numerical value and its measure (paddingTop: '10px', paddingTop: '10em'...) Useful in case of using a fixed header.
*/
paddingTop?: string;
/**
* (default 0) Defines the bottom padding for each section with a numerical value and its measure (paddingBottom: '10px', paddingBottom: '10em'...). Useful in case of using a fixed footer.
*/
paddingBottom?: string;
/**
* (default null) Defines which elements will be taken off the scrolling structure of the plugin which is necessary when using the css3 option to keep them fixed. It requires a string with the jQuery selectors for those elements. (For example: fixedElements: '#element1, .element2')
*/
fixedElements?: string;
/**
* (default 0) A normal scroll (autoScrolling:false) will be used under the defined width in pixels. A class fp-responsive is added to the body tag in case the user wants to use it for his own responsive CSS. For example, if set to 900, whenever the browser's width is less than 900 the plugin will scroll like a normal site.
*/
responsiveWidth?: number;
/**
* (default 0) A normal scroll (autoScrolling:false) will be used under the defined height in pixels. A class fp-responsive is added to the body tag in case the user wants to use it for his own responsive CSS. For example, if set to 900, whenever the browser's height is less than 900 the plugin will scroll like a normal site.
*/
responsiveHeight?: number;
// Custom selectors
/**
* (default .section) Defines the jQuery selector used for the plugin sections. It might need to be changed sometimes to avoid problem with other plugins using the same selectors as fullpage.js.
*/
sectionSelector?: string;
/**
* (default .slide) Defines the jQuery selector used for the plugin slides. It might need to be changed sometimes to avoid problem with other plugins using the same selectors as fullpage.js.
*/
slideSelector?: string;
// Events
/**
* This callback is fired once the user leaves a section, in the transition to the new section. Returning false will cancel the move before it takes place.
* @param index index of the leaving section. Starting from 1.
* @param nextIndex index of the destination section. Starting from 1.
* @param direction it will take the values up or down depending on the scrolling direction.
*/
onLeave?: (index: number, nextIndex: number, direction: string) => void;
/**
* Callback fired once the sections have been loaded, after the scrolling has ended.
* @param anchorLink anchorLink corresponding to the section.
* @param index index of the section. Starting from 1.
*/
afterLoad?: (anchorLink: string, index: number) => void;
/**
* This callback is fired just after the structure of the page is generated. This is the callback you want to use to initialize other plugins or fire any code which requires the document to be ready (as this plugin modifies the DOM to create the resulting structure).
*/
afterRender?: () => void;
/**
* This callback is fired after resizing the browser's window. Just after the sections are resized.
*/
afterResize?: () => void;
/**
* Callback fired once the slide of a section have been loaded, after the scrolling has ended.
*
* In case of not having anchorLinks defined for the slide or slides the slideIndex parameter would be the only one to use.
*
* Parameters:
*
* @param anchorLink anchorLink corresponding to the section.
* @param index index of the section. Starting from 1.
* @param slideAnchor anchor corresponding to the slide (in case there is)
* @param slideIndex index of the slide. Starting from 1. (the default slide doesn't count as slide, but as a section)
*/
afterSlideLoad?: (anchorLink: string, index: number, slideAnchor: string, slideIndex: number) => void;
/**
* This callback is fired once the user leaves an slide to go to another, in the transition to the new slide. Returning false will cancel the move before it takes place.
* @param anchorLink: anchorLink corresponding to the section.
* @param index index of the section. Starting from 1.
* @param slideIndex index of the slide. Starting from 0.
* @param direction takes the values right or left depending on the scrolling direction.
* @param nextSlideIndex index of the destination slide. Starting from 0.
*/
onSlideLeave?: (anchorLink: string, index: number, slideIndex: number, direction: string, nextSlideIndex: number) => void;
}
interface JQuery {
fullpage(options?: FullPageJsOptions): JQuery;
}

View File

@@ -64,7 +64,7 @@ declare namespace gapi.auth2 {
fetch_basic_profile?: boolean;
prompt?: boolean;
scope?: string;
}, onsuccess: () => any, onfailure: (reason: string) => any): any;
}, onsuccess: (googleUser: GoogleUser) => any, onfailure: (reason: string) => any): any;
}
export interface IsSignedIn{

View File

@@ -79,19 +79,9 @@ app.on('ready', () => {
mainWindow = null;
});
mainWindow.print({silent: true, printBackground: false});
mainWindow.webContents.print({silent: true, printBackground: false});
mainWindow.print();
mainWindow.webContents.print();
mainWindow.printToPDF({
marginsType: 1,
pageSize: 'A3',
printBackground: true,
printSelectionOnly: true,
landscape: true,
}, (error: Error, data: Buffer) => {});
mainWindow.webContents.printToPDF({
marginsType: 1,
pageSize: 'A3',
@@ -100,7 +90,6 @@ app.on('ready', () => {
landscape: true,
}, (error: Error, data: Buffer) => {});
mainWindow.printToPDF({}, (err, data) => {});
mainWindow.webContents.printToPDF({}, (err, data) => {});
mainWindow.webContents.executeJavaScript('return true;');
@@ -146,6 +135,29 @@ app.on('ready', () => {
mainWindow.webContents.debugger.sendCommand("Network.enable");
});
app.commandLine.appendSwitch('enable-web-bluetooth');
app.on('ready', () => {
mainWindow.webContents.on('select-bluetooth-device', (event, deviceList, callback) => {
event.preventDefault();
let result = (() => {
for (let device of deviceList) {
if (device.deviceName === 'test') {
return device;
}
}
return null;
})();
if (!result) {
callback('');
} else {
callback(result.deviceId);
}
});
});
// Locale
app.getLocale();
@@ -287,10 +299,6 @@ if (browserOptions.transparent) {
win.loadURL('file://' + __dirname + '/fallback.html');
}
app.on('platform-theme-changed', () => {
console.log(systemPreferences.isDarkMode());
});
// app
// https://github.com/atom/electron/blob/master/docs/api/app.md
@@ -857,6 +865,13 @@ session.defaultSession.setPermissionRequestHandler(function(webContents, permiss
callback(true);
});
// consider any url ending with `example.com`, `foobar.com`, `baz`
// for integrated authentication.
session.defaultSession.allowNTLMCredentialsForDomains('*example.com, *foobar.com, *baz')
// consider all urls for integrated authentication.
session.defaultSession.allowNTLMCredentialsForDomains('*')
// Modify the user agent for all requests to the following urls.
var filter = {
urls: ["https://*.github.com/*", "*://electron.github.io"]

View File

@@ -75,6 +75,9 @@ webFrame.executeJavaScript('JSON.stringify({})', false, (result) => {
console.log(result);
});
console.log(webFrame.getResourceUsage());
webFrame.clearCache();
// clipboard
// https://github.com/atom/electron/blob/master/docs/api/clipboard.md
@@ -232,7 +235,7 @@ webview.addEventListener('found-in-page', function(e) {
}
});
var rquestId = webview.findInPage("test");
var requestId = webview.findInPage("test");
webview.addEventListener('new-window', function(e) {
require('electron').shell.openExternal(e.url);

View File

@@ -1,4 +1,4 @@
// Type definitions for Electron v1.0.2
// Type definitions for Electron v1.2.1
// Project: http://electron.atom.io/
// Definitions by: jedmao <https://github.com/jedmao/>, rhysd <https://rhysd.github.io>, Milan Burda <https://github.com/miniak/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -49,7 +49,9 @@ declare namespace Electron {
/**
* Emitted when all windows have been closed.
*
* This event is only emitted when the application is not going to quit.
* If you do not subscribe to this event and all windows are closed,
* the default behavior is to quit the app; however, if you subscribe,
* you control whether the app quits or not.
* If the user pressed Cmd + Q, or the developer called app.quit(),
* Electron will first try to close all the windows and then emit the will-quit event,
* and in this case the window-all-closed event would not be emitted.
@@ -271,30 +273,29 @@ declare namespace Electron {
* Note: This API is only available on Windows.
*/
setUserTasks(tasks: Task[]): void;
/**
* Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate authentication.
* Normally, Electron will only send NTLM/Kerberos credentials for URLs that fall under
* "Local Intranet" sites (i.e. are in the same domain as you).
* However, this detection often fails when corporate networks are badly configured,
* so this lets you co-opt this behavior and enable it for all URLs.
*/
allowNTLMCredentialsForAllDomains(allow: boolean): void;
/**
* This method makes your application a Single Instance Application instead of allowing
* multiple instances of your app to run, this will ensure that only a single instance
* of your app is running, and other instances signal this instance and exit.
*/
makeSingleInstance(callback: (args: string[], workingDirectory: string) => void): boolean;
/**
* Releases all locks that were created by makeSingleInstance. This will allow
* multiple instances of the application to once again run side by side.
*/
releaseSingleInstance(): void;
/**
* Creates an NSUserActivity and sets it as the current activity.
* The activity is eligible for Handoff to another device afterward.
*
* @param type Uniquely identifies the activity. Maps to NSUserActivity.activityType.
* @param userInfo App-specific state to store for use by another device.
* @param webpageURL The webpage to load in a browser if no suitable app is
* installed on the resuming device. The scheme must be http or https.
*
* Note: This API is only available on Mac.
*/
setUserActivity(type: string, userInfo: Object): void;
setUserActivity(type: string, userInfo: Object, webpageURL?: string): void;
/**
* @returns The type of the currently running activity.
*
@@ -851,7 +852,7 @@ declare namespace Electron {
* Changes the attachment point for sheets on Mac OS X.
* Note: This API is available only on OS X.
*/
setSheetOffset(offset: number): void;
setSheetOffset(offsetY: number, offsetX?: number): void;
/**
* Starts or stops flashing the window to attract user's attention.
*/
@@ -925,19 +926,11 @@ declare namespace Electron {
capturePage(rect: Rectangle, callback: (image: NativeImage) => void): void;
capturePage(callback: (image: NativeImage) => void): void;
/**
* Same with webContents.print([options])
*/
print(options?: PrintOptions): void;
/**
* Same with webContents.printToPDF([options])
*/
printToPDF(options: PrintToPDFOptions, callback: (error: Error, data: Buffer) => void): void;
/**
* Same with webContents.loadURL(url).
* Same as webContents.loadURL(url).
*/
loadURL(url: string, options?: LoadURLOptions): void;
/**
* Same with webContents.reload.
* Same as webContents.reload.
*/
reload(): void;
/**
@@ -984,6 +977,11 @@ declare namespace Electron {
* Note: This API is available only on OS X.
*/
showDefinitionForSelection(): void;
/**
* Changes window icon.
* Note: This API is not available on OS X.
*/
setIcon(icon: NativeImage): void;
/**
* Sets whether the window menu bar should hide itself automatically. Once set
* the menu bar will only show when users press the single Alt key.
@@ -1275,7 +1273,8 @@ declare namespace Electron {
*/
fullscreen?: boolean;
/**
* Whether the maximize/zoom button on OS X should toggle full screen mode or maximize window.
* Whether the window can be put into fullscreen mode.
* On OS X, also whether the maximize/zoom button should toggle full screen mode or maximize window.
* Default: true.
*/
fullscreenable?: boolean;
@@ -1392,11 +1391,11 @@ declare namespace Electron {
/**
* @returns The contents of the clipboard as markup.
*/
readHtml(type?: ClipboardType): string;
readHTML(type?: ClipboardType): string;
/**
* Writes markup to the clipboard.
*/
writeHtml(markup: string, type?: ClipboardType): void;
writeHTML(markup: string, type?: ClipboardType): void;
/**
* @returns The contents of the clipboard as a NativeImage.
*/
@@ -1408,11 +1407,11 @@ declare namespace Electron {
/**
* @returns The contents of the clipboard as RTF.
*/
readRtf(type?: ClipboardType): string;
readRTF(type?: ClipboardType): string;
/**
* Writes the text into the clipboard in RTF.
*/
writeRtf(text: string, type?: ClipboardType): void;
writeRTF(text: string, type?: ClipboardType): void;
/**
* Clears everything in clipboard.
*/
@@ -1718,6 +1717,10 @@ declare namespace Electron {
interface OpenDialogOptions {
title?: string;
defaultPath?: string;
/**
* Custom label for the confirmation button, when left empty the default label will be used.
*/
buttonLabel?: string;
/**
* File types that can be displayed or selected.
*/
@@ -1738,6 +1741,10 @@ declare namespace Electron {
interface SaveDialogOptions {
title?: string;
defaultPath?: string;
/**
* Custom label for the confirmation button, when left empty the default label will be used.
*/
buttonLabel?: string;
/**
* File types that can be displayed, see dialog.showOpenDialog for an example.
*/
@@ -2590,6 +2597,11 @@ declare namespace Electron {
* Clears the host resolver cache.
*/
clearHostResolverCache(callback: Function): void;
/**
* Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate authentication.
* @param domains Comma-seperated list of servers for which integrated authentication is enabled.
*/
allowNTLMCredentialsForDomains(domains: string): void;
/**
* The webRequest API set allows to intercept and modify contents of a request at various stages of its lifetime.
*/
@@ -2993,7 +3005,7 @@ declare namespace Electron {
*
* Note: This is only implemented on OS X.
*/
subscribeNotification(event: string, callback: Function): number;
subscribeNotification(event: string, callback: (event: Event, userInfo: Object) => void): number;
/**
* Removes the subscriber with id.
*
@@ -3320,6 +3332,14 @@ declare namespace Electron {
* Emitted when there is a new context menu that needs to be handled.
*/
on(event: 'context-menu', listener: (event: Event, params: ContextMenuParams) => void): this;
/**
* Emitted when bluetooth device needs to be selected on call to navigator.bluetooth.requestDevice.
* To use navigator.bluetooth api webBluetooth should be enabled.
* If event.preventDefault is not called, first available device will be selected.
* callback should be called with deviceId to be selected,
* passing empty string to callback will cancel the request.
*/
on(event: 'select-bluetooth-device', listener: (event: Event, deviceList: BluetoothDevice[], callback: (deviceId: string) => void) => void): this;
on(event: string, listener: Function): this;
/**
* Loads the url in the window.
@@ -3590,6 +3610,10 @@ declare namespace Electron {
* @returns If the process of saving page has been initiated successfully.
*/
savePage(fullPath: string, saveType: 'HTMLOnly' | 'HTMLComplete' | 'MHTML', callback?: (eror: Error) => void): boolean;
/**
* @returns The unique ID of this WebContents.
*/
id: number;
/**
* @returns The session object used by this webContents.
*/
@@ -3748,6 +3772,11 @@ declare namespace Electron {
menuSourceType: 'none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu';
}
interface BluetoothDevice {
deviceName: string;
deviceId: string;
}
interface Headers {
[key: string]: string;
}
@@ -3756,8 +3785,8 @@ declare namespace Electron {
/**
* Specifies the action to take place when ending webContents.findInPage request.
* 'clearSelection' - Translate the selection into a normal selection.
* 'keepSelection' - Clear the selection.
* 'clearSelection' - Clear the selection.
* 'keepSelection' - Translate the selection into a normal selection.
* 'activateSelection' - Focus and click the selection node.
*/
type StopFindInPageAtion = 'clearSelection' | 'keepSelection' | 'activateSelection';
@@ -3805,7 +3834,7 @@ declare namespace Electron {
* Specify page size of the generated PDF.
* Default: A4.
*/
pageSize?: 'A3' | 'A4' | 'A5' | 'Legal' | 'Letter' | 'Tabloid';
pageSize?: 'A3' | 'A4' | 'A5' | 'Legal' | 'Letter' | 'Tabloid' | Dimension;
/**
* Whether to print CSS backgrounds.
* Default: false.
@@ -4063,6 +4092,32 @@ declare namespace Electron {
* this limitation.
*/
executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): void;
/**
* @returns Object describing usage information of Blinks internal memory caches.
*/
getResourceUsage(): ResourceUsages;
/**
* Attempts to free memory that is no longer being used (like images from a previous navigation).
*/
clearCache(): void;
}
interface ResourceUsages {
fonts: ResourceUsage;
images: ResourceUsage;
cssStyleSheets: ResourceUsage;
xslStyleSheets: ResourceUsage;
scripts: ResourceUsage;
other: ResourceUsage;
}
interface ResourceUsage {
count: number;
decodedSize: number;
liveSize: number;
purgeableSize: number;
purgedSize: number;
size: number;
}
// https://github.com/electron/electron/blob/master/docs/api/web-view-tag.md
@@ -4602,6 +4657,10 @@ declare namespace Electron {
* properties and a single method.
*/
postMessage(message: string, targetOrigin: string): void;
/**
* Invokes the print dialog on the child window.
*/
print(): void;
}
// https://github.com/electron/electron/blob/master/docs/api/synopsis.md
@@ -4669,6 +4728,10 @@ interface File {
declare namespace NodeJS {
interface Process {
/**
* Setting this to true can disable the support for asar archives in Node's built-in modules.
*/
noAsar?: boolean;
/**
* Process's type
*/
@@ -4696,10 +4759,6 @@ declare namespace NodeJS {
*/
on(event: 'loaded', listener: Function): this;
on(event: string, listener: Function): this;
/**
* Setting this to true can disable the support for asar archives in Node's built-in modules.
*/
noAsar?: boolean;
/**
* Causes the main thread of the current process crash;
*/
@@ -4715,6 +4774,54 @@ declare namespace NodeJS {
* Note: This API is only available on Mac and Linux.
*/
setFdLimit(maxDescriptors: number): void;
/**
* @returns Object giving memory usage statistics about the current process.
* Note: All statistics are reported in Kilobytes.
*/
getProcessMemoryInfo(): ProcessMemoryInfo;
/**
* @returns Object giving memory usage statistics about the entire system.
* Note: All statistics are reported in Kilobytes.
*/
getSystemMemoryInfo(): SystemMemoryInfo;
}
interface ProcessMemoryInfo {
/**
* The amount of memory currently pinned to actual physical RAM.
*/
workingSetSize: number;
/**
* The maximum amount of memory that has ever been pinned to actual physical RAM.
*/
peakWorkingSetSize: number;
/**
* The amount of memory not shared by other processes, such as JS heap or HTML content.
*/
privateBytes: number;
/**
* The amount of memory shared between processes, typically memory consumed by the Electron code itself.
*/
sharedBytes: number;
}
interface SystemMemoryInfo {
/**
* The total amount of physical memory available to the system.
*/
total: number;
/**
* The total amount of memory not being used by applications or disk cache.
*/
free: number;
/**
* The total amount of swap memory available to the system.
*/
swapTotal: number;
/**
* The free amount of swap memory available to the system.
*/
swapFree: number;
}
}

View File

@@ -773,6 +773,7 @@ declare namespace grunt {
* The taskList argument must be an array of tasks.
*/
registerTask(taskName: string, taskList: string[]): void
registerTask(taskName: string, description: string, taskList: string[]): void
/**
* If a description and taskFunction are passed, the specified function will be executed
@@ -784,6 +785,7 @@ declare namespace grunt {
*
* @note taskFunction.apply(scope: grunt.task.ITask, args: any[])
*/
registerTask(taskName: string, taskFunction: Function): void
registerTask(taskName: string, description: string, taskFunction: Function): void
/**

2
hapi/hapi.d.ts vendored
View File

@@ -875,7 +875,7 @@ declare module "hapi" {
/** - an optional domain string or an array of domain strings for limiting the route to only requests with a matching host header field.Matching is done against the hostname part of the header only (excluding the port).Defaults to all hosts.*/
vhost?: string;
/** - (required) the function called to generate the response after successful authentication and validation.The handler function is described in Route handler.If set to a string, the value is parsed the same way a prerequisite server method string shortcut is processed.Alternatively, handler can be assigned an object with a single key using the name of a registered handler type and value with the options passed to the registered handler.*/
handler: ISessionHandler | string | IRouteHandlerConfig;
handler?: ISessionHandler | string | IRouteHandlerConfig;
/** - additional route options.*/
config?: IRouteAdditionalConfigurationOptions;
}

View File

@@ -0,0 +1,329 @@
/// <reference path="immutable.d.ts" />
import immutable = require('immutable')
// List tests
let list: immutable.List<number> = immutable.List<number>([0, 1, 2, 3, 4, 5]);
let list1: immutable.List<number> = immutable.List<number>(list);
list = immutable.List.of<number>(0, 1, 2, 3, 4);
let bool: boolean = immutable.List.isList(list);
list = list.set(0, 1);
list = list.delete(0);
list = list.remove(0);
list = list.insert(0, 1);
list = list.clear();
list = list.push(0, 1, 2, 3, 4, 5);
list = list.pop();
list = list.unshift(1, 2, 3);
list = list.shift();
list = list.update((value: immutable.List<number>) => value);
list = list.update(1, (value: number) => value);
list = list.update(1, 1, (value: number) => value);
list = list.merge(list1, list);
list = list.merge([0, 1, 2], [3, 4, 5]);
list = list.mergeWith((prev: number, next: number, key: number) => prev, list, list1);
list = list.mergeWith((prev: number, next: number, key: number) => prev, [0, 1, 2], [3, 4, 5]);
list = list.mergeDeep(list1, list);
list = list.mergeDeep([0, 1, 2], [3, 4, 5]);
list = list.mergeDeepWith((prev: number, next: number, key: number) => prev, list, list1);
list = list.mergeDeepWith((prev: number, next: number, key: number) => prev, [0, 1, 2], [3, 4, 5]);
list = list.setSize(5);
list = list.setIn([0, 1, 2], 5);
list = list.deleteIn([0, 1, 2]);
list = list.removeIn([0, 1, 2]);
list = list.updateIn([0, 1, 2], value => value);
list = list.updateIn([0, 1, 2], 1, value => value);
list = list.mergeIn([0, 1, 2], list, list1);
list = list.mergeIn([0, 1, 2], [0, 1, 2], [3, 4, 5]);
list = list.mergeDeepIn([0, 1, 2], list, list1);
list = list.mergeDeepIn([0, 1, 2], [0, 1, 2], [3, 4, 5]);
list = list.withMutations((mutable: immutable.List<number>) => mutable);
list = list.asMutable();
list = list.asImmutable();
// Collection.Indexed
let indexedSeq: immutable.Seq.Indexed<number> = list.toSeq();
// Iterable tests
let value: number = list.get(0);
value = list.get(0, 1);
list = list.interpose(0);
list = list.interleave(list, list1);
list = list.splice(0, 2, 4, 5, 6);
list = list.zip(list1);
let indexedIterable: immutable.Iterable.Indexed<number> = list.zipWith<number, number>(
(value: number, other: number) => value + other,
list1
);
let indexedIterable1: immutable.Iterable.Indexed<number> = list.zipWith<number, number, number>(
(value: number, other: number, third: number) => value + other + third,
list1,
indexedIterable
);
indexedIterable = list.zipWith<number>(
(value: number, other: number, third: number) => value + other + third,
list1,
indexedIterable1
);
value = list.indexOf(1);
value = list.lastIndexOf(1);
value = list.findIndex((value: number, index: number, iter: immutable.List<number>) => true);
value = list.findLastIndex((value: number, index: number, iter: immutable.List<number>) => true);
value = list.size;
bool = list.equals(list1);
value = list.hashCode();
bool = list.has(1);
bool = list.includes(1);
bool = list.contains(1);
value = list.first();
value = list.last();
let toArr: number[] = list.toArray();
let toMap: immutable.Map<number, number> = list.toMap();
let toOrderedMap: immutable.OrderedMap<number, number> = list.toOrderedMap();
let toSet: immutable.Set<number> = list.toSet();
let toOrderedSet: immutable.OrderedSet<number> = list.toOrderedSet();
list = list.toList();
let toStack: immutable.Stack<number> = list.toStack();
let toKeyedSeq: immutable.Seq.Keyed<number, number> = list.toKeyedSeq();
indexedSeq = list.toIndexedSeq();
let toSetSeq: immutable.Seq.Set<number> = list.toSetSeq();
let iter: immutable.Iterator<number> = list.keys();
iter = list.values();
let iter1: immutable.Iterator<[number, number]> = list.entries();
indexedSeq = list.keySeq();
indexedSeq = list.valueSeq();
let indexedSeq1: immutable.Seq.Indexed<[number, number]> = list.entrySeq();
let iter2: immutable.Iterable<number, string> = list.map<string>(
(value: number, key: number, iter: immutable.List<number>) => "foo"
)
list = list.filterNot((value: number, key: number, iter: immutable.List<number>) => true);
list = list.reverse();
list = list.sort((valA: number, valB: number) => 0);
list = list.sortBy<string>(
(value: number, key: number, iter: immutable.List<number>) => "foo",
(valueA: string, valueB: string) => 0
);
let keyedSeq2: immutable.Seq.Keyed<string, immutable.List<number>> = list.groupBy<string>(
(value: number, key: number, iter: immutable.List<number>) => ""
);
value = list.forEach((value: number, key: number, iter: immutable.List<number>) => true);
list = list.slice(0, 1);
list = list.rest();
list = list.butLast();
list = list.skip(0);
list = list.skipLast(0);
list = list.skipWhile(
(value: number, key: number, iter: immutable.List<number>) => true
);
list = list.take(2);
list = list.takeLast(2);
list = list.takeWhile(
(value: number, key: number, iter: immutable.List<number>) => true
);
list = list.takeUntil(
(value: number, key: number, iter: immutable.List<number>) => true
);
list = list.concat(list1, 2, 3);
list = list.flatten(1);
list = list.flatten(true);
let str: string = list.reduce<string>(
(red: string, value: number, key: number, iter: immutable.List<number>) => red + "bar",
"foo"
);
str = list.reduceRight<string>(
(red: string, value: number, key: number, iter: immutable.List<number>) => red + "bar",
"foo"
);
bool = list.every(
(value: number, key: number, iter: immutable.List<number>) => true
);
bool = list.some(
(value: number, key: number, iter: immutable.List<number>) => true
);
str = list.join(",");
bool = list.isEmpty();
value = list.count();
value = list.count(
(value: number, key: number, iter: immutable.List<number>) => true
);
let keyedSeq3: immutable.Seq.Keyed<string, number> = list.countBy<string>(
(value: number, key: number, iter: immutable.List<number>) => "foo"
);
value = list.find(
(value: number, key: number, iter: immutable.List<number>) => true,
null,
0
);
value = list.findLast(
(value: number, key: number, iter: immutable.List<number>) => true,
null,
0
);
let tuple: [number, number] = list.findEntry(
(value: number, key: number, iter: immutable.List<number>) => true,
null,
0
);
tuple = list.findLastEntry(
(value: number, key: number, iter: immutable.List<number>) => true,
null,
0
);
value = list.findKey(
(value: number, key: number, iter: immutable.List<number>) => true,
null
);
value = list.findLastKey(
(value: number, key: number, iter: immutable.List<number>) => true,
null
);
value = list.keyOf(0);
value = list.lastKeyOf(0);
value = list.max((valA: number, valB: number) => 0);
value = list.maxBy<string>(
(value: number, key: number, iter: immutable.List<number>) => "foo",
(valueA: string, valueB: string) => 0
);
value = list.min((valA: number, valB: number) => 0);
value = list.minBy<string>(
(value: number, key: number, iter: immutable.List<number>) => "foo",
(valueA: string, valueB: string) => 0
);
bool = list.isSubset(list1);
bool = list.isSubset([0, 1, 2]);
bool = list.isSuperset(list1);
bool = list.isSuperset([0, 1, 2]);
// Map tests
let map: immutable.Map<string, number> = immutable.Map<string, number>();
map = immutable.Map<string, number>([["foo", 1], ["bar", 2]]);
let map1: immutable.Map<string, number> = immutable.Map<string, number>(map);
map = map.set("baz", 3);
map.delete("foo");
map.remove("foo");
map = map.clear();
map = map.update((value: immutable.Map<string, number>) => value);
map = map.update("foo", (value: number) => value);
map = map.update("bar", 1, (value: number) => value);
map = map.merge(map1, map);
map = map.merge({ "foo": 0, "bar": 1}, {"baz": 2});
map = map.mergeWith((prev: number, next: number, key: string) => prev, map, map1);
map = map.mergeWith((prev: number, next: number, key: string) => prev,{ "foo": 0, "bar": 1}, {"baz": 2});
map = map.mergeDeep(map1, map);
map = map.mergeDeep({ "foo": 0, "bar": 1}, {"baz": 2});
map = map.mergeDeepWith((prev: number, next: number, key: string) => prev, map, map1);
map = map.mergeDeepWith((prev: number, next: number, key: string) => prev, { "foo": 0, "bar": 1}, {"baz": 2});
map = map.setIn([0, 1, 2], 5);
map = map.deleteIn([0, 1, 2]);
map = map.removeIn([0, 1, 2]);
map = map.updateIn([0, 1, 2], value => value);
map = map.updateIn([0, 1, 2], 1, value => value);
map = map.mergeIn([0, 1, 2], map, map1);
map = map.mergeIn([0, 1, 2], { "foo": 0, "bar": 1}, {"baz": 2});
map = map.mergeDeepIn([0, 1, 2], map, map1);
map = map.mergeDeepIn([0, 1, 2], { "foo": 0, "bar": 1}, {"baz": 2});
map = map.withMutations((mutable: immutable.Map<string, number>) => mutable);
map = map.asMutable();
map = map.asImmutable();
bool = immutable.Map.isMap(map);
map = immutable.Map.of<string, number>("foo", 0, "bar", 1);
// OrderedMap tests
bool = immutable.OrderedMap.isOrderedMap(toOrderedMap);
toOrderedMap = immutable.OrderedMap(toOrderedMap);
// Set tests
let set: immutable.Set<number> = immutable.Set.of<number>(0, 1, 2, 3);
bool = immutable.Set.isSet(set);
set = immutable.Set.fromKeys<number>(toMap);
let set1: immutable.Set<string> = immutable.Set.fromKeys({ "foo": 1, "bar": 2});
set = immutable.Set<number>();
set = immutable.Set<number>(set);
set = set.add(3);
set.delete(1);
set.remove(2);
set = set.clear();
set = set.union(map, list);
set = set.union([1, 2, 3], [4, 5, 6]);
set = set.merge(map1, list);
set = set.merge([1, 2, 3], [4, 5, 6]);
set = set.intersect(map1, list);
set = set.intersect([1, 2, 3], [4, 5, 6]);
set = set.subtract(map1, list);
set = set.subtract([1, 2, 3], [4, 5, 6]);
set = set.withMutations((mutable: immutable.Set<number>) => mutable);
set = set.asMutable();
set = set.asImmutable();
// OrderedSet tests
bool = immutable.OrderedSet.isOrderedSet(set);
let orderedSet1: immutable.OrderedSet<number> = immutable.OrderedSet.of<number>(0, 1, 2, 3);
orderedSet1 = immutable.OrderedSet.fromKeys<number>(toMap);
let orderedSet2: immutable.Set<string> = immutable.Set.fromKeys({ "foo": 1, "bar": 2});
// Stack tests
let stack: immutable.Stack<number> = immutable.Stack<number>();
bool = immutable.Stack.isStack(stack);
stack = immutable.Stack.of<number>(0, 1, 2, 3, 4, 5);
stack = immutable.Stack<number>(list);
value = stack.peek();
stack = stack.clear();
stack = stack.unshift(0, 1, 2);
stack = stack.unshiftAll(list);
stack = stack.unshiftAll([1, 2, 3]);
stack = stack.shift();
stack = stack.push(1, 2, 3);
stack = stack.pushAll(list);
stack = stack.pushAll([1, 2, 3]);
stack = stack.pop();
stack = stack.withMutations((mutable: immutable.Stack<number>) => mutable);
stack = stack.asMutable();
stack = stack.asImmutable();
// Range and Repeat function tests
let funcSeqIndexed: immutable.Seq.Indexed<number> = immutable.Range(0, 3, 1);
funcSeqIndexed = immutable.Repeat<number>(2, 10);
// Seq tests
let seq: immutable.Seq<string, number> = immutable.Seq<string, number>();
bool = immutable.Seq.isSeq(seq);
funcSeqIndexed = immutable.Seq.of<number>(0, 1, 2, 3);
seq = immutable.Seq<string, number>(map);
value = seq.size;
seq = seq.cacheResult();
// keyed
let seqKeyed: immutable.Seq.Keyed<string, number> = immutable.Seq.Keyed<string, number>();
seqKeyed = immutable.Seq.Keyed<string, number>(map);
seqKeyed = seqKeyed.toSeq();
// indexed
let seqIndexed: immutable.Seq.Indexed<number> = immutable.Seq.Indexed<number>();
seqIndexed = immutable.Seq.Indexed.of<number>(0, 1, 2, 3);
seqIndexed = immutable.Seq.Indexed<number>(list);
seqIndexed = seqIndexed.toSeq();
// indexed
let seqSet: immutable.Seq.Set<number> = immutable.Seq.Set<number>();
seqSet = immutable.Seq.Set.of<number>(0, 1, 2, 3);
seqSet = immutable.Seq.Set<number>(list);
seqSet = seqSet.toSeq();

2546
immutable/immutable.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
/// <reference path="javascript-obfuscator" />
import { JavaScriptObfuscator } from 'javascript-obfuscator';
let sourceCode1: string = JavaScriptObfuscator.obfuscate('var foo = 1;');
let sourceCode2: string = JavaScriptObfuscator.obfuscate('var foo = 1;', {
compact: true,
debugProtection: false,
debugProtectionInterval: false,
disableConsoleOutput: true,
encodeUnicodeLiterals: true,
rotateUnicodeArray: true,
unicodeArray: true,
wrapUnicodeArrayCalls: true
});

View File

@@ -0,0 +1,22 @@
// Type definitions for javascript-obfuscator
// Project: https://github.com/sanex3339/javascript-obfuscator
// Definitions by: sanex3339 <https://github.com/sanex3339>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'javascript-obfuscator' {
export interface IOptions {
compact?: boolean;
debugProtection?: boolean;
debugProtectionInterval?: boolean;
disableConsoleOutput?: boolean;
encodeUnicodeLiterals?: boolean;
rotateUnicodeArray?: boolean;
unicodeArray?: boolean;
wrapUnicodeArrayCalls?: boolean;
[id: string]: any;
}
export class JavaScriptObfuscator {
public static obfuscate (sourceCode: string, customOptions?: IOptions): string;
}
}

2
joi/joi.d.ts vendored
View File

@@ -844,7 +844,7 @@ declare module 'joi' {
* @param schema - the schema object.
* @param message - optional message string prefix added in front of the error message. may also be an Error object.
*/
export function attempt(value: any, schema: Schema, message?: string | Error): void;
export function attempt<T>(value: T, schema: Schema, message?: string | Error): T;
/**

View File

@@ -18,7 +18,8 @@ interface PNotifyStack {
spacing2?: number;
firstpos1?: number;
firstpos2?: number;
context?: JQuery
context?: JQuery;
modal?: boolean;
}
interface PNotifyLabel {
@@ -228,7 +229,7 @@ interface PNotifyOptions {
}
/**
* After a delay, remove the notice.
* After a delay, remove the notice, set to false for sticky note.
*/
hide?: boolean;
/**

180
jstree/jstree.d.ts vendored
View File

@@ -1,8 +1,8 @@
// Type definitions for jsTree v3.0.9
// Type definitions for jsTree v3.3.1
// Project: http://www.jstree.com/
// Definitions by: Adam Pluciński <https://github.com/adaskothebeast>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// 45 commit df38535 2015-03-02 13:23 +2:00
// 1 commit 3b8f55d3797cd299eb36695b62d75c2313a3e3b3 2016-05-10
///<reference path="../jquery/jquery.d.ts" />
@@ -65,10 +65,12 @@ interface JSTreeStatic {
/**
* stores all loaded jstree plugins (used internally)
* @name $.jstree.plugins
*/
plugins: any[];
path: string;
idregex: any;
root: string;
/**
* creates a jstree instance
@@ -77,7 +79,7 @@ interface JSTreeStatic {
* @param {Object} options options for this instance (extends `$.jstree.defaults`)
* @return {jsTree} the new instance
*/
create(el: any, options?: JSTreeStaticDefaults): JSTree;
create(el: HTMLElement|JQuery|string, options?: JSTreeStaticDefaults): JSTree;
/**
* remove all traces of jstree from the DOM and destroy all instances
@@ -98,41 +100,22 @@ interface JSTreeStatic {
*
* __Examples__
*
* $.jstree.reference('tree');
* $.jstree.reference('#tree');
* $.jstree.reference('branch');
* $.jstree.reference('#branch');
*
* @param {String} selector
* @returns {JSTree|null} the instance or `null` if not found
*/
reference(selector: string): JSTree;
/**
* get a reference to an existing instance
*
* __Examples__
*
* $.jstree.reference(document.getElementByID('tree'));
* $.jstree.reference(document.getElementByID('branch'));
*
* @param {HTMLElement} element
* @returns {JSTree|null} the instance or `null` if not found
*/
reference(element: HTMLElement): JSTree;
/**
* get a reference to an existing instance
*
* __Examples__
*
* $.jstree.reference($('#tree'));
* $.jstree.reference($('#branch'));
*
* @param {JQuery} object
* @returns {JSTree|null} the instance or `null` if not found
*/
reference(object: JQuery): JSTree;
* // provided a container with an ID of "tree", and a nested node with an ID of "branch"
* // all of there will return the same instance
* $.jstree.reference('tree');
* $.jstree.reference('#tree');
* $.jstree.reference($('#tree'));
* $.jstree.reference(document.getElementByID('tree'));
* $.jstree.reference('branch');
* $.jstree.reference('#branch');
* $.jstree.reference($('#branch'));
* $.jstree.reference(document.getElementByID('branch'));
*
* @name $.jstree.reference(needle)
* @param {DOMElement|jQuery|String} needle
* @return {jsTree|null} the instance or `null` if not found
*/
reference(needle: HTMLElement|JQuery|string): JSTree;
}
interface JSTreeStaticDefaults {
@@ -475,18 +458,19 @@ interface JSTreeStaticDefaultsContextMenu {
/**
* an object of actions, or a function that accepts a node and a callback function and calls the callback function with an object of actions available for that node (you can also return the items too).
*
* Each action consists of a key (a unique name) and a value which is an object with the following properties (only label and action are required):
*
*
* Each action consists of a key (a unique name) and a value which is an object with the following properties (only label and action are required). Once a menu item is activated the `action` function will be invoked with an object containing the following keys: item - the contextmenu item definition as seen below, reference - the DOM node that was used (the tree node), element - the contextmenu DOM element, position - an object with x/y properties indicating the position of the menu.
*
* * `separator_before` - a boolean indicating if there should be a separator before this item
* * `separator_after` - a boolean indicating if there should be a separator after this item
* * `_disabled` - a boolean indicating if this action should be disabled
* * `label` - a string - the name of the action (could be a function returning a string)
* * `action` - a function to be executed if this item is chosen
* * `action` - a function to be executed if this item is chosen, the function will receive
* * `icon` - a string, can be a path to an icon or a className, if using an image that is in the current directory use a `./` prefix, otherwise it will be detected as a class
* * `shortcut` - keyCode which will trigger the action if the menu is open (for example `113` for rename, which equals F2)
* * `shortcut_label` - shortcut label (like for example `F2` for rename)
*
* * `submenu` - an object with the same structure as $.jstree.defaults.contextmenu.items which can be used to create a submenu - each key will be rendered as a separate option in a submenu that will appear once the current item is hovered
*
* @name $.jstree.defaults.contextmenu.items
* @plugin contextmenu
*/
@@ -563,6 +547,14 @@ interface JSTreeStaticDefaultsDragNDrop {
* @plugin dnd
*/
large_drag_target: boolean;
/**
* controls whether use HTML5 dnd api instead of classical. That will allow better integration of dnd events with other HTML5 controls.
* @reference http://caniuse.com/#feat=dragndrop
* @name $.jstree.defaults.dnd.use_html5
* @plugin dnd
*/
use_html5: boolean;
}
interface JSTreeStaticDefaultsMassload {
@@ -627,6 +619,14 @@ interface JSTreeStaticDefaultsSearch {
* @plugin search
*/
show_only_matches: boolean;
/**
* Indicates if the children of matched element are shown (when show_only_matches is true)
* This setting can be changed at runtime when calling the search method. Default is `false`.
* @name $.jstree.defaults.search.show_only_matches_children
* @plugin search
*/
show_only_matches_children: boolean;
/**
* Indicates if all nodes opened to reveal the search result,
@@ -720,7 +720,7 @@ interface JSTree extends JQuery {
* @param {Object} options options for this instance
* @trigger init.jstree, loading.jstree, loaded.jstree, ready.jstree, changed.jstree
*/
init: (el:any, options:any) => void;
init: (el: HTMLElement|JQuery|string, options:any) => void;
/**
* destroy an instance
@@ -932,8 +932,9 @@ interface JSTree extends JQuery {
* @param {array} nodes
* @param {function} callback a function to be executed once loading is complete, the function is executed in the instance's scope and receives one argument - the array passed to _load_nodes
* @param {Boolean} is_callback - if false reloads node (AP - original comment missing in source code)
* @param {Boolean} force_reload - if true force reloads node (AP - original comment missing in source code)
*/
_load_nodes: (nodes: any[], callback?: (nodes: any[]) => void, is_callback?: boolean) => void;
_load_nodes: (nodes: any[], callback?: (nodes: any[]) => void, is_callback?: boolean, force_reload?: boolean) => void;
/**
* loads all unloaded nodes
@@ -1130,6 +1131,45 @@ interface JSTree extends JQuery {
* @trigger disable_node.jstree
*/
disable_node: (obj: any) => boolean;
/**
* determines if a node is hidden
* @name is_hidden(obj)
* @param {mixed} obj the node
*/
is_hidden: (obj: any) => boolean;
/**
* hides a node - it is still in the structure but will not be visible
* @name hide_node(obj)
* @param {mixed} obj the node to hide
* @param {Boolean} skip_redraw internal parameter controlling if redraw is called
* @trigger hide_node.jstree
*/
hide_node: (obj: any, skip_redraw: boolean) => boolean;
/**
* shows a node
* @name show_node(obj)
* @param {mixed} obj the node to show
* @param {Boolean} skip_redraw internal parameter controlling if redraw is called
* @trigger show_node.jstree
*/
show_node: (obj: any, skip_redraw: boolean) => boolean;
/**
* hides all nodes
* @name hide_all()
* @trigger hide_all.jstree
*/
hide_all: (skip_redraw: boolean) => boolean;
/**
* shows all nodes
* @name show_all()
* @trigger show_all.jstree
*/
show_all: (skip_redraw: boolean) => boolean;
/**
* called when a node is selected by the user. Used internally.
@@ -1432,11 +1472,12 @@ interface JSTree extends JQuery {
/**
* put a node in edit mode (input field to rename the node)
* @name edit(obj [, default_text])
* @name edit(obj [, default_text, callback])
* @param {mixed} obj
* @param {String} default_text the text to populate the input with (if omitted the node text value is used)
*/
edit: (obj: any, default_text?: string) => void;
* @param {String} default_text the text to populate the input with (if omitted or set to a non-string value the node's text value is used)
* @param {Function} callback a function to be called once the text box is blurred, it is called in the instance's scope and receives the node, a status parameter (true if the rename is successful, false otherwise) and a boolean indicating if the user cancelled the edit. You can access the node's title using .text
*/
edit: (obj: any, default_text?: string, callback?: (node: any, status: boolean, canceled: boolean) => void) => void;
/**
* changes the theme
@@ -1553,6 +1594,10 @@ interface JSTree extends JQuery {
* @param {mixed} obj
*/
show_icon: (obj: any) => void;
/**
* checkbox plugin
*/
/**
* set the undetermined state where and if necessary. Used internally.
@@ -1590,6 +1635,24 @@ interface JSTree extends JQuery {
* @return {Boolean}
*/
is_undetermined: (obj: any) => boolean;
/**
* disable a node's checkbox
* @name disable_checkbox(obj)
* @param {mixed} obj an array can be used too
* @trigger disable_checkbox.jstree
* @plugin checkbox
*/
disable_checkbox: (obj: any) => boolean;
/**
* enable a node's checkbox
* @name disable_checkbox(obj)
* @param {mixed} obj an array can be used too
* @trigger enable_checkbox.jstree
* @plugin checkbox
*/
enable_checkbox: (obj: any) => boolean;
/**
* check a node (only if tie_selection in checkbox settings is false, otherwise select_node will be called internally)
@@ -1689,6 +1752,10 @@ interface JSTree extends JQuery {
* @private
*/
_show_contextmenu: (obj: any, x: number, y: number, i: number) => void;
/**
* search plugin
*/
/**
* used to search the tree nodes for a given string
@@ -1698,10 +1765,11 @@ interface JSTree extends JQuery {
* @param {Boolean} show_only_matches if set to true only matching nodes will be shown (keep in mind this can be very slow on large trees or old browsers)
* @param {mixed} inside an optional node to whose children to limit the search
* @param {Boolean} append if set to true the results of this search are appended to the previous search
* @param {Boolean} show_only_matches_children show only matched children
* @plugin search
* @trigger search.jstree
*/
search: (str: string, skip_async?: boolean, show_only_matches?: boolean, inside?: any, append?: boolean) => void;
search: (str: string, skip_async?: boolean, show_only_matches?: boolean, inside?: any, append?: boolean, show_only_matches_children?: boolean) => void;
/**
* used to clear the last search (removes classes and shows all nodes if filtering is on)
@@ -1719,6 +1787,10 @@ interface JSTree extends JQuery {
* @plugin search
*/
_search_open: (d: string[]) => void;
/**
* sort plugin
*/
/**
* used to sort a node's children
@@ -1730,6 +1802,10 @@ interface JSTree extends JQuery {
* @trigger search.jstree
*/
sort: (obj: any, deep?: boolean) => void;
/**
* state plugin
*/
/**
* save the state
@@ -1751,6 +1827,10 @@ interface JSTree extends JQuery {
* @plugin state
*/
clear_state: () => void;
/**
* types plugin
*/
/**
* used to retrieve the type settings object for a node

View File

@@ -6,10 +6,10 @@
/// <reference path="../knockout/knockout.d.ts" />
interface KnockoutStatic {
track(obj: any, propertyNames?: Array<string>): any;
untrack(obj: any, propertyNames?: Array<string>): any;
defineProperty(obj: any, propertyName: string, evaluator: Function): any;
defineProperty(obj: any, propertyName: string, options: KnockoutDefinePropertyOptions): any;
track<T>(obj: T, propertyNames?: Array<string>): T;
untrack(obj: any, propertyNames?: Array<string>): void;
defineProperty<T>(obj: T, propertyName: string, evaluator: Function): T;
defineProperty<T>(obj: T, propertyName: string, options: KnockoutDefinePropertyOptions): T;
getObservable(obj: any, propertyName: string): KnockoutObservable<any>;
valueHasMutated(obj: any, propertyName: string): void;
}

View File

@@ -1,196 +0,0 @@
// Type definitions for linq.js v3.0.3-Beta4
// Project: http://linqjs.codeplex.com/
// Definitions by: neuecc <http://www.codeplex.com/site/users/view/neuecc>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace linqjs {
interface IEnumerator {
current(): any;
moveNext(): boolean;
dispose(): void;
}
interface EnumerableStatic {
Utils: {
createLambda(expression: any): (...params: any[]) => any;
createEnumerable(getEnumerator: () => IEnumerator): Enumerable;
createEnumerator(initialize: () => void , tryGetNext: () => boolean, dispose: () => void ): IEnumerator;
extendTo(type: any): void;
};
choice(...params: any[]): Enumerable;
cycle(...params: any[]): Enumerable;
empty(): Enumerable;
from(): Enumerable;
from(obj: Enumerable): Enumerable;
from(obj: string): Enumerable;
from(obj: number): Enumerable;
from(obj: { length: number;[x: number]: any; }): Enumerable;
from(obj: any): Enumerable;
make(element: any): Enumerable;
matches(input: string, pattern: RegExp): Enumerable;
matches(input: string, pattern: string, flags?: string): Enumerable;
range(start: number, count: number, step?: number): Enumerable;
rangeDown(start: number, count: number, step?: number): Enumerable;
rangeTo(start: number, to: number, step?: number): Enumerable;
repeat(element: any, count?: number): Enumerable;
repeatWithFinalize(initializer: () => any, finalizer: (element: any) => void ): Enumerable;
generate(func: () => any, count?: number): Enumerable;
toInfinity(start?: number, step?: number): Enumerable;
toNegativeInfinity(start?: number, step?: number): Enumerable;
unfold(seed: any, func: (value: any) => any): Enumerable;
defer(enumerableFactory: () => Enumerable): Enumerable;
}
interface Enumerable {
constructor(getEnumerator: () => IEnumerator): Enumerable;
getEnumerator(): IEnumerator;
// Extension Methods
traverseBreadthFirst(func: (element: any) => Enumerable, resultSelector?: (element: any, nestLevel: number) => any): Enumerable;
traverseDepthFirst(func: (element: any) => Enumerable, resultSelector?: (element: any, nestLevel: number) => any): Enumerable;
flatten(): Enumerable;
pairwise(selector: (prev: any, current: any) => any): Enumerable;
scan(func: (prev: any, current: any) => any): Enumerable;
scan(seed: any, func: (prev: any, current: any) => any): Enumerable;
select(selector: (element: any, index: number) => any): Enumerable;
selectMany(collectionSelector: (element: any, index: number) => any[], resultSelector?: (outer: any, inner: any) => any): Enumerable;
selectMany(collectionSelector: (element: any, index: number) => Enumerable, resultSelector?: (outer: any, inner: any) => any): Enumerable;
selectMany(collectionSelector: (element: any, index: number) => { length: number;[x: number]: any; }, resultSelector?: (outer: any, inner: any) => any): Enumerable;
where(predicate: (element: any, index: number) => boolean): Enumerable;
choose(selector: (element: any, index: number) => any): Enumerable;
ofType(type: any): Enumerable;
zip(second: any[], resultSelector: (first: any, second: any, index: number) => any): Enumerable;
zip(second: Enumerable, resultSelector: (first: any, second: any, index: number) => any): Enumerable;
zip(second: { length: number;[x: number]: any; }, resultSelector: (first: any, second: any, index: number) => any): Enumerable;
zip(...params: any[]): Enumerable; // last one is selector
merge(second: any[], resultSelector: (first: any, second: any, index: number) => any): Enumerable;
merge(second: Enumerable, resultSelector: (first: any, second: any, index: number) => any): Enumerable;
merge(second: { length: number;[x: number]: any; }, resultSelector: (first: any, second: any, index: number) => any): Enumerable;
merge(...params: any[]): Enumerable; // last one is selector
join(inner: Enumerable, outerKeySelector: (outer: any) =>any, innerKeySelector: (inner: any) =>any, resultSelector: (outer: any, inner: any) => any, compareSelector?: (obj: any) => any): Enumerable;
groupJoin(inner: Enumerable, outerKeySelector: (outer: any) =>any, innerKeySelector: (inner: any) =>any, resultSelector: (outer: any, inner: any) => any, compareSelector?: (obj: any) => any): Enumerable;
all(predicate: (element: any) => boolean): boolean;
any(predicate?: (element: any) => boolean): boolean;
isEmpty(): boolean;
concat(...sequences: any[]): Enumerable;
insert(index: number, second: any[]): Enumerable;
insert(index: number, second: Enumerable): Enumerable;
insert(index: number, second: { length: number;[x: number]: any; }): Enumerable;
alternate(alternateValue: any): Enumerable;
alternate(alternateSequence: any[]): Enumerable;
alternate(alternateSequence: Enumerable): Enumerable;
contains(value: any, compareSelector: (element: any) => any): Enumerable;
contains(value: any): Enumerable;
defaultIfEmpty(defaultValue?: any): Enumerable;
distinct(compareSelector?: (element: any) => any): Enumerable;
distinctUntilChanged(compareSelector: (element: any) => any): Enumerable;
except(second: any[], compareSelector?: (element: any) => any): Enumerable;
except(second: { length: number;[x: number]: any; }, compareSelector?: (element: any) => any): Enumerable;
except(second: Enumerable, compareSelector?: (element: any) => any): Enumerable;
intersect(second: any[], compareSelector?: (element: any) => any): Enumerable;
intersect(second: { length: number;[x: number]: any; }, compareSelector?: (element: any) => any): Enumerable;
intersect(second: Enumerable, compareSelector?: (element: any) => any): Enumerable;
sequenceEqual(second: any[], compareSelector?: (element: any) => any): Enumerable;
sequenceEqual(second: { length: number;[x: number]: any; }, compareSelector?: (element: any) => any): Enumerable;
sequenceEqual(second: Enumerable, compareSelector?: (element: any) => any): Enumerable;
union(second: any[], compareSelector?: (element: any) => any): Enumerable;
union(second: { length: number;[x: number]: any; }, compareSelector?: (element: any) => any): Enumerable;
union(second: Enumerable, compareSelector?: (element: any) => any): Enumerable;
orderBy(keySelector: (element: any) => any): OrderedEnumerable;
orderByDescending(keySelector: (element: any) => any): OrderedEnumerable;
reverse(): Enumerable;
shuffle(): Enumerable;
weightedSample(weightSelector: (element: any) => any): Enumerable;
groupBy(keySelector: (element: any) => any, elementSelector?: (element: any) => any, resultSelector?: (key: any, element: any) => any, compareSelector?: (element: any) => any): Enumerable;
partitionBy(keySelector: (element: any) => any, elementSelector?: (element: any) => any, resultSelector?: (key: any, element: any) => any, compareSelector?: (element: any) => any): Enumerable;
buffer(count: number): Enumerable;
aggregate(func: (prev: any, current: any) => any): any;
aggregate(seed: any, func: (prev: any, current: any) => any, resultSelector?: (last: any) => any): any;
average(selector?: (element: any) => any): number;
count(predicate?: (element: any, index: number) => boolean): number;
max(selector?: (element: any) => any): number;
min(selector?: (element: any) => any): number;
maxBy(keySelector: (element: any) => any): any;
minBy(keySelector: (element: any) => any): any;
sum(selector?: (element: any) => any): number;
elementAt(index: number): any;
elementAtOrDefault(index: number, defaultValue?: any): any;
first(predicate?: (element: any, index: number) => boolean): any;
firstOrDefault(predicate?: (element: any, index: number) => boolean, defaultValue?: any): any;
last(predicate?: (element: any, index: number) => boolean): any;
lastOrDefault(predicate?: (element: any, index: number) => boolean, defaultValue?: any): any;
single(predicate?: (element: any, index: number) => boolean): any;
singleOrDefault(predicate?: (element: any, index: number) => boolean, defaultValue?: any): any;
skip(count: number): Enumerable;
skipWhile(predicate: (element: any, index: number) => boolean): Enumerable;
take(count: number): Enumerable;
takeWhile(predicate: (element: any, index: number) => boolean): Enumerable;
takeExceptLast(count?: number): Enumerable;
takeFromLast(count: number): Enumerable;
indexOf(item: any): number;
indexOf(predicate: (element: any, index: number) => boolean): number;
lastIndexOf(item: any): number;
lastIndexOf(predicate: (element: any, index: number) => boolean): number;
asEnumerable(): Enumerable;
toArray(): any[];
toLookup(keySelector: (element: any) => any, elementSelector?: (element: any) => any, compareSelector?: (element: any) => any): Lookup;
toObject(keySelector: (element: any) => any, elementSelector?: (element: any) => any): Object;
toDictionary(keySelector: (element: any) => any, elementSelector?: (element: any) => any, compareSelector?: (element: any) => any): Dictionary;
toJSONString(replacer: (key: string, value: any) => any): string;
toJSONString(replacer: any[]): string;
toJSONString(replacer: (key: string, value: any) => any, space: any): string;
toJSONString(replacer: any[], space: any): string;
toJoinedString(separator?: string, selector?: (element: any, index: number) => any): string;
doAction(action: (element: any, index: number) => void ): Enumerable;
doAction(action: (element: any, index: number) => boolean): Enumerable;
forEach(action: (element: any, index: number) => void ): void;
forEach(action: (element: any, index: number) => boolean): void;
write(separator?: string, selector?: (element: any) => any): void;
writeLine(selector?: (element: any) => any): void;
force(): void;
letBind(func: (source: Enumerable) => any[]): Enumerable;
letBind(func: (source: Enumerable) => { length: number;[x: number]: any; }): Enumerable;
letBind(func: (source: Enumerable) => Enumerable): Enumerable;
share(): DisposableEnumerable;
memoize(): DisposableEnumerable;
catchError(handler: (exception: any) => void ): Enumerable;
finallyAction(finallyAction: () => void ): Enumerable;
log(selector?: (element: any) => void ): Enumerable;
trace(message?: string, selector?: (element: any) => void ): Enumerable;
}
interface OrderedEnumerable extends Enumerable {
createOrderedEnumerable(keySelector: (element: any) => any, descending: boolean): OrderedEnumerable;
thenBy(keySelector: (element: any) => any): OrderedEnumerable;
thenByDescending(keySelector: (element: any) => any): OrderedEnumerable;
}
interface DisposableEnumerable extends Enumerable {
dispose(): void;
}
interface Dictionary {
add(key: any, value: any): void;
get(key: any): any;
set(key: any, value: any): boolean;
contains(key: any): boolean;
clear(): void;
remove(key: any): void;
count(): number;
toEnumerable(): Enumerable; // Enumerable<KeyValuePair>
}
interface Lookup {
count(): number;
get(key: any): Enumerable;
contains(key: any): boolean;
toEnumerable(): Enumerable; // Enumerable<Groping>
}
interface Grouping extends Enumerable {
key(): any;
}
}
// export definition
declare var Enumerable: linqjs.EnumerableStatic;

276
linq/linq.3.0.4-Beta5.d.ts vendored Normal file
View File

@@ -0,0 +1,276 @@
// Type definitions for linq.js v3.0.4-Beta5
// Project: https://linqjs.codeplex.com/
// Definitions by: neuecc <https://www.codeplex.com/site/users/view/neuecc>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module linqjs {
interface IEnumerator<T> {
current(): T;
moveNext(): boolean;
dispose(): void;
}
interface IEqualityComparer<T> {
equals(x: T, y: T): boolean;
getHashCode(obj: any): string;
}
interface ITuple<T1, T2, T3, T4, T5, T6, T7, T8> {
equals(other: ITuple<T1, T2, T3, T4, T5, T6, T7, T8>): boolean;
getHashCode(): string;
}
interface ITupleArray {
equals(other: ITupleArray): boolean;
getHashCode(): string;
}
interface Enumerable {
Utils: {
createLambda(expression: any): (...params: any[]) => any;
createEnumerable<T>(getEnumerator: () => IEnumerator<T>): IEnumerable<T>;
createEnumerator<T>(initialize: () => void, tryGetNext: () => boolean, dispose: () => void): IEnumerator<T>;
getDefaultEqualityComparer<T>(): IEqualityComparer<T>;
createEqualityComparer<T>(equals: (x: T, y: T) => boolean, getHashCode: (obj: any) => string): IEqualityComparer<T>;
createKeyedEqualityComparer<TKey, TValue>(keySelector: (element: TValue) => TKey): IEqualityComparer<TValue>;
createDictionary<TKey, TValue>(compareSelector: (element: TValue) => TKey): IDictionary<TKey, TValue>;
createDictionary<TKey, TValue>(equalityComparer: IEqualityComparer<TValue>): IDictionary<TKey, TValue>;
createList<T>(): IList<T>;
createTuple<T1, T2, T3, T4, T5, T6, T7, T8>(item1: T1, item2: T2, item3?: T3, item4?: T4, item5?: T5, item6?: T6, item7?: T7, item8?: T8): ITuple<T1, T2, T3, T4, T5, T6, T7, T8>;
extendTo(type: any, forceAppend?: boolean): void;
};
choice<T>(...params: T[]): IEnumerable<T>;
cycle<T>(...params: T[]): IEnumerable<T>;
empty<T>(): IEnumerable<T>;
// from<T>, obj as JScript's IEnumerable or WinMD IIterable<T> is IEnumerable<T> but it can't define.
from(): IEnumerable<any>; // empty
from<T>(obj: IEnumerable<T>): IEnumerable<T>;
from(obj: number): IEnumerable<number>;
from(obj: boolean): IEnumerable<boolean>;
from(obj: string): IEnumerable<string>;
from<T>(obj: T[]): IEnumerable<T>;
from<T>(obj: { length: number; [x: number]: T; }): IEnumerable<T>;
from(obj: any): IEnumerable<{ key: string; value: any }>;
make<T>(element: T): IEnumerable<T>;
matches<T>(input: string, pattern: RegExp): IEnumerable<T>;
matches<T>(input: string, pattern: string, flags?: string): IEnumerable<T>;
range(start: number, count: number, step?: number): IEnumerable<number>;
rangeDown(start: number, count: number, step?: number): IEnumerable<number>;
rangeTo(start: number, to: number, step?: number): IEnumerable<number>;
repeat<T>(element: T, count?: number): IEnumerable<T>;
repeatWithFinalize<T>(initializer: () => T, finalizer: (element: T) => void): IEnumerable<T>;
generate<T>(func: () => T, count?: number): IEnumerable<T>;
toInfinity(start?: number, step?: number): IEnumerable<number>;
toNegativeInfinity(start?: number, step?: number): IEnumerable<number>;
unfold<T>(seed: T, func: (value: T) => T): IEnumerable<T>;
defer<T>(enumerableFactory: () => IEnumerable<T>): IEnumerable<T>;
}
interface IEnumerable<T> {
constructor(getEnumerator: () => IEnumerator<T>): IEnumerable<T>;
getEnumerator(): IEnumerator<T>;
// Extension Methods
traverseBreadthFirst(func: (element: T) => IEnumerable<T>): IEnumerable<T>;
traverseBreadthFirst<TResult>(func: (element: T) => IEnumerable<T>, resultSelector: (element: T, nestLevel: number) => TResult): IEnumerable<TResult>;
traverseDepthFirst<TResult>(func: (element: T) => Enumerable): IEnumerable<T>;
traverseDepthFirst<TResult>(func: (element: T) => Enumerable, resultSelector?: (element: T, nestLevel: number) => TResult): IEnumerable<TResult>;
flatten(): IEnumerable<any>;
pairwise<TResult>(selector: (prev: T, current: T) => TResult): IEnumerable<TResult>;
scan(func: (prev: T, current: T) => T): IEnumerable<T>;
scan<TAccumulate>(seed: TAccumulate, func: (prev: TAccumulate, current: T) => TAccumulate): IEnumerable<TAccumulate>;
select<TResult>(selector: (element: T, index: number) => TResult): IEnumerable<TResult>;
selectMany<TOther>(collectionSelector: (element: T, index: number) => IEnumerable<TOther>): IEnumerable<TOther>;
selectMany<TCollection, TResult>(collectionSelector: (element: T, index: number) => IEnumerable<TCollection>, resultSelector: (outer: T, inner: TCollection) => TResult): IEnumerable<TResult>;
selectMany<TOther>(collectionSelector: (element: T, index: number) => TOther[]): IEnumerable<TOther>;
selectMany<TCollection, TResult>(collectionSelector: (element: T, index: number) => TCollection[], resultSelector: (outer: T, inner: TCollection) => TResult): IEnumerable<TResult>;
selectMany<TOther>(collectionSelector: (element: T, index: number) => { length: number; [x: number]: TOther; }): IEnumerable<TOther>;
selectMany<TCollection, TResult>(collectionSelector: (element: T, index: number) => { length: number; [x: number]: TCollection; }, resultSelector: (outer: T, inner: TCollection) => TResult): IEnumerable<TResult>;
where(predicate: (element: T, index: number) => boolean): IEnumerable<T>;
choose(selector: (element: T, index: number) => T): IEnumerable<T>;
ofType<TResult>(type: any): IEnumerable<TResult>;
zip<TResult>(second: IEnumerable<T>, resultSelector: (first: T, second: T, index: number) => TResult): IEnumerable<TResult>;
zip<TResult>(second: { length: number; [x: number]: T; }, resultSelector: (first: T, second: T, index: number) => TResult): IEnumerable<TResult>;
zip<TResult>(second: T[], resultSelector: (first: T, second: T, index: number) => TResult): IEnumerable<TResult>;
zip<TResult>(...params: any[]): IEnumerable<TResult>; // last one is selector
merge<TResult>(...params: IEnumerable<T>[]): IEnumerable<T>;
merge<TResult>(...params: { length: number; [x: number]: T; }[]): IEnumerable<T>;
merge<TResult>(...params: T[][]): IEnumerable<T>;
join<TInner, TKey, TResult>(inner: IEnumerable<TInner>, outerKeySelector: (outer: T) => TKey, innerKeySelector: (inner: TInner) => TKey, resultSelector: (outer: T, inner: TKey) => TResult, compareSelector?: (obj: T) => TKey): IEnumerable<TResult>;
join<TInner, TKey, TResult>(inner: { length: number; [x: number]: TInner; }, outerKeySelector: (outer: T) => TKey, innerKeySelector: (inner: TInner) => TKey, resultSelector: (outer: T, inner: TKey) => TResult, compareSelector?: (obj: T) => TKey): IEnumerable<TResult>;
join<TInner, TKey, TResult>(inner: TInner[], outerKeySelector: (outer: T) => TKey, innerKeySelector: (inner: TInner) => TKey, resultSelector: (outer: T, inner: TKey) => TResult, compareSelector?: (obj: T) => TKey): IEnumerable<TResult>;
groupJoin<TInner, TKey, TResult>(inner: IEnumerable<TInner>, outerKeySelector: (outer: T) => TKey, innerKeySelector: (inner: TInner) => TKey, resultSelector: (outer: T, inner: TKey) => TResult, compareSelector?: (obj: T) => TKey): IEnumerable<TResult>;
groupJoin<TInner, TKey, TResult>(inner: { length: number; [x: number]: TInner; }, outerKeySelector: (outer: T) => TKey, innerKeySelector: (inner: TInner) => TKey, resultSelector: (outer: T, inner: TKey) => TResult, compareSelector?: (obj: T) => TKey): IEnumerable<TResult>;
groupJoin<TInner, TKey, TResult>(inner: TInner[], outerKeySelector: (outer: T) => TKey, innerKeySelector: (inner: TInner) => TKey, resultSelector: (outer: T, inner: TKey) => TResult, compareSelector?: (obj: T) => TKey): IEnumerable<TResult>;
all(predicate: (element: T) => boolean): boolean;
any(predicate?: (element: T) => boolean): boolean;
isEmpty(): boolean;
concat(...sequences: IEnumerable<T>[]): IEnumerable<T>;
concat(...sequences: { length: number; [x: number]: T; }[]): IEnumerable<T>;
concat(...sequences: T[]): IEnumerable<T>;
insert(index: number, second: IEnumerable<T>): IEnumerable<T>;
insert(index: number, second: { length: number; [x: number]: T; }): IEnumerable<T>;
alternate(alternateValue: T): IEnumerable<T>;
alternate(alternateSequence: { length: number; [x: number]: T; }): IEnumerable<T>;
alternate(alternateSequence: IEnumerable<T>): IEnumerable<T>;
alternate(alternateSequence: T[]): IEnumerable<T>;
contains(value: T): boolean;
contains<TCompare>(value: T, compareSelector?: (element: T) => TCompare): boolean;
contains(value: T, equalityComparer?: IEqualityComparer<T>): boolean;
defaultIfEmpty(defaultValue?: T): IEnumerable<T>;
distinct(): IEnumerable<T>;
distinct<TCompare>(compareSelector: (element: T) => TCompare): IEnumerable<T>;
distinctUntilChanged(): IEnumerable<T>;
distinctUntilChanged<TCompare>(compareSelector: (element: T) => TCompare): IEnumerable<T>;
except(second: { length: number; [x: number]: T; }): IEnumerable<T>;
except<TCompare>(second: { length: number; [x: number]: T; }, compareSelector: (element: T) => TCompare): IEnumerable<T>;
except(second: IEnumerable<T>): IEnumerable<T>;
except<TCompare>(second: IEnumerable<T>, compareSelector: (element: T) => TCompare): IEnumerable<T>;
except(second: T[]): IEnumerable<T>;
except<TCompare>(second: T[], compareSelector: (element: T) => TCompare): IEnumerable<T>;
intersect(second: { length: number; [x: number]: T; }): IEnumerable<T>;
intersect<TCompare>(second: { length: number; [x: number]: T; }, compareSelector: (element: T) => TCompare): IEnumerable<T>;
intersect(second: IEnumerable<T>): IEnumerable<T>;
intersect<TCompare>(second: IEnumerable<T>, compareSelector: (element: T) => TCompare): IEnumerable<T>;
intersect(second: T[]): IEnumerable<T>;
intersect<TCompare>(second: T[], compareSelector: (element: T) => TCompare): IEnumerable<T>;
union(second: { length: number; [x: number]: T; }): IEnumerable<T>;
union<TCompare>(second: { length: number; [x: number]: T; }, compareSelector: (element: T) => TCompare): IEnumerable<T>;
union(second: IEnumerable<T>): IEnumerable<T>;
union<TCompare>(second: IEnumerable<T>, compareSelector: (element: T) => TCompare): IEnumerable<T>;
union(second: T[]): IEnumerable<T>;
union<TCompare>(second: T[], compareSelector: (element: T) => TCompare): IEnumerable<T>;
sequenceEqual(second: { length: number; [x: number]: T; }): boolean;
sequenceEqual<TCompare>(second: { length: number; [x: number]: T; }, compareSelector: (element: T) => TCompare): boolean;
sequenceEqual(second: IEnumerable<T>): boolean;
sequenceEqual<TCompare>(second: IEnumerable<T>, compareSelector: (element: T) => TCompare): boolean;
sequenceEqual(second: T[]): boolean;
sequenceEqual<TCompare>(second: T[], compareSelector: (element: T) => TCompare): boolean;
orderBy<TKey>(keySelector: (element: T) => TKey): IOrderedEnumerable<T>;
orderBy<TKey>(keySelector: (element: T) => TKey, comparison: (x: TKey, y: TKey) => number): IOrderedEnumerable<T>;
orderByDescending<TKey>(keySelector: (element: T) => TKey): IOrderedEnumerable<T>;
orderByDescending<TKey>(keySelector: (element: T) => TKey, comparison: (x: TKey, y: TKey) => number): IOrderedEnumerable<T>;
reverse(): IEnumerable<T>;
shuffle(): IEnumerable<T>;
weightedSample(weightSelector: (element: T) => number): IEnumerable<T>;
// truly, return type is IEnumerable<IGrouping<TKey, T>> but Visual Studio + TypeScript Compiler can't compile.
groupBy<TKey>(keySelector: (element: T) => TKey): IEnumerable<IGrouping<TKey, any>>;
groupBy<TKey, TElement>(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement): IEnumerable<IGrouping<TKey, TElement>>;
groupBy<TKey, TElement, TResult>(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement, resultSelector: (key: TKey, element: IEnumerable<TElement>) => TResult): IEnumerable<TResult>;
groupBy<TKey, TElement, TResult, TCompare>(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement, resultSelector: (key: TKey, element: IEnumerable<TElement>) => TResult, compareSelector: (element: T) => TCompare): IEnumerable<TResult>;
// :IEnumerable<IGrouping<TKey, T>>
partitionBy<TKey>(keySelector: (element: T) => TKey): IEnumerable<IGrouping<TKey, any>>;
// :IEnumerable<IGrouping<TKey, TElement>>
partitionBy<TKey, TElement>(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement): IEnumerable<IGrouping<TKey, TElement>>;
partitionBy<TKey, TElement, TResult>(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement, resultSelector: (key: TKey, element: IEnumerable<TElement>) => TResult): IEnumerable<TResult>;
partitionBy<TKey, TElement, TResult, TCompare>(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement, resultSelector: (key: TKey, element: IEnumerable<TElement>) => TResult, compareSelector: (element: T) => TCompare): IEnumerable<TResult>;
buffer(count: number): IEnumerable<T>;
aggregate(func: (prev: T, current: T) => T): T;
aggregate<TAccumulate>(seed: TAccumulate, func: (prev: TAccumulate, current: T) => TAccumulate): TAccumulate;
aggregate<TAccumulate, TResult>(seed: TAccumulate, func: (prev: TAccumulate, current: T) => TAccumulate, resultSelector: (last: TAccumulate) => TResult): TResult;
average(selector?: (element: T) => number): number;
count(predicate?: (element: T, index: number) => boolean): number;
max(selector?: (element: T) => number): number;
min(selector?: (element: T) => number): number;
maxBy<TKey>(keySelector: (element: T) => TKey): T;
minBy<TKey>(keySelector: (element: T) => TKey): T;
sum(selector?: (element: T) => number): number;
elementAt(index: number): T;
elementAtOrDefault(index: number, defaultValue?: T): T;
first(predicate?: (element: T, index: number) => boolean): T;
firstOrDefault(predicate?: (element: T, index: number) => boolean, defaultValue?: T): T;
last(predicate?: (element: T, index: number) => boolean): T;
lastOrDefault(predicate?: (element: T, index: number) => boolean, defaultValue?: T): T;
single(predicate?: (element: T, index: number) => boolean): T;
singleOrDefault(predicate?: (element: T, index: number) => boolean, defaultValue?: T): T;
skip(count: number): IEnumerable<T>;
skipWhile(predicate: (element: T, index: number) => boolean): IEnumerable<T>;
take(count: number): IEnumerable<T>;
takeWhile(predicate: (element: T, index: number) => boolean): IEnumerable<T>;
takeExceptLast(count?: number): IEnumerable<T>;
takeFromLast(count: number): IEnumerable<T>;
indexOf(item: T): number;
indexOf(predicate: (element: T, index: number) => boolean): number;
lastIndexOf(item: T): number;
lastIndexOf(predicate: (element: T, index: number) => boolean): number;
asEnumerable(): IEnumerable<T>;
cast<TResult>(): IEnumerable<TResult>;
toArray(): T[];
toList(): IList<T>;
// truly, return type is ILookup<TKey, T> but Visual Studio + TypeScript Compiler can't compile.
toLookup<TKey>(keySelector: (element: T) => TKey): ILookup<TKey, any>;
toLookup<TKey, TElement>(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement): ILookup<TKey, TElement>;
toLookup<TKey, TElement, TCompare>(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement, compareSelector: (key: TKey) => TCompare): ILookup<TKey, TElement>;
toObject(keySelector: (element: T) => any, elementSelector?: (element: T) => any): Object;
// :IDictionary<TKey, T>
toDictionary<TKey>(keySelector: (element: T) => TKey): IDictionary<TKey, any>;
toDictionary<TKey, TValue>(keySelector: (element: T) => TKey, elementSelector: (element: T) => TValue): IDictionary<TKey, TValue>;
toDictionary<TKey, TValue, TCompare>(keySelector: (element: T) => TKey, elementSelector: (element: T) => TValue, compareSelector: (key: TKey) => TCompare): IDictionary<TKey, TValue>;
toJSONString(replacer: (key: string, value: any) => any): string;
toJSONString(replacer: any[]): string;
toJSONString(replacer: (key: string, value: any) => any, space: any): string;
toJSONString(replacer: any[], space: any): string;
toJoinedString(separator?: string): string;
toJoinedString<TResult>(separator: string, selector: (element: T, index: number) => TResult): string;
doAction(action: (element: T, index: number) => void): IEnumerable<T>;
doAction(action: (element: T, index: number) => boolean): IEnumerable<T>;
forEach(action: (element: T, index: number) => void): void;
forEach(action: (element: T, index: number) => boolean): void;
write(separator?: string): void;
write<TResult>(separator: string, selector: (element: T) => TResult): void;
writeLine(): void;
writeLine<TResult>(selector: (element: T) => TResult): void;
force(): void;
letBind<TResult>(func: (source: IEnumerable<T>) => { length: number; [x: number]: TResult; }): IEnumerable<TResult>;
letBind<TResult>(func: (source: IEnumerable<T>) => TResult[]): IEnumerable<TResult>;
letBind<TResult>(func: (source: IEnumerable<T>) => IEnumerable<TResult>): IEnumerable<TResult>;
share(): IDisposableEnumerable<T>;
memoize(): IDisposableEnumerable<T>;
catchError(handler: (exception: any) => void): IEnumerable<T>;
finallyAction(finallyAction: () => void): IEnumerable<T>;
log(): IEnumerable<T>;
log<TValue>(selector: (element: T) => TValue): IEnumerable<T>;
trace(message?: string): IEnumerable<T>;
trace<TValue>(message: string, selector: (element: T) => TValue): IEnumerable<T>;
}
interface IOrderedEnumerable<T> extends IEnumerable<T> {
createOrderedEnumerable<TKey>(keySelector: (element: T) => TKey, comparison: (x: TKey, y: TKey) => number, descending: boolean): IOrderedEnumerable<T>;
thenBy<TKey>(keySelector: (element: T) => TKey) : IOrderedEnumerable<T>;
thenBy<TKey>(keySelector: (element: T) => TKey, comparison: (x: TKey, y: TKey) => number) : IOrderedEnumerable<T>;
thenByDescending<TKey>(keySelector: (element: T) => TKey): IOrderedEnumerable<T>;
thenByDescending<TKey>(keySelector: (element: T) => TKey, comparison: (x: TKey, y: TKey) => number): IOrderedEnumerable<T>;
}
interface IDisposableEnumerable<T> extends IEnumerable<T> {
dispose(): void;
}
interface IDictionary<TKey, TValue> {
add(key: TKey, value: TValue): void;
get(key: TKey): TValue;
set(key: TKey, value: TValue): boolean;
contains(key: TKey): boolean;
clear(): void;
remove(key: TKey): void;
count(): number;
toEnumerable(): IEnumerable<{ key: TKey; value: TValue }>;
}
interface ILookup<TKey, TElement> {
count(): number;
get(key: TKey): IEnumerable<TElement>;
contains(key: TKey): boolean;
toEnumerable(): IEnumerable<IGrouping<TKey, TElement>>;
}
interface IGrouping<TKey, TElement> extends IEnumerable<TElement> {
key(): TKey;
}
interface IList<T> extends Array<T> {
}
}
// export definition
declare var Enumerable: linqjs.Enumerable;

116
linq/linq.d.ts vendored
View File

@@ -30,43 +30,43 @@ declare namespace linq {
Generate(func: string, count?: number): Enumerable<any>;
ToInfinity(start?: number, step?: number): Enumerable<number>;
ToNegativeInfinity(start?: number, step?: number): Enumerable<number>;
Unfold<T>(seed, func: ($) => T): Enumerable<T>;
Unfold(seed, func: string): Enumerable<any>;
Unfold<T>(seed: T, func: ($: T) => T): Enumerable<T>;
Unfold(seed: any, func: string): Enumerable<any>;
}
interface Enumerable<T> {
//Projection and Filtering Methods
CascadeBreadthFirst(func: ($) => any[], resultSelector: (v, i: number) => any): Enumerable<any>;
CascadeBreadthFirst(func: ($: T) => any[], resultSelector: (v: any, i: number) => any): Enumerable<any>;
CascadeBreadthFirst(func: string, resultSelector: string): Enumerable<any>;
CascadeDepthFirst(func: ($) => any[], resultSelector: (v, i: number) => any): Enumerable<any>;
CascadeDepthFirst(func: ($: T) => any[], resultSelector: (v: any, i: number) => any): Enumerable<any>;
CascadeDepthFirst(func: string, resultSelector: string): Enumerable<any>;
Flatten(...items: any[]): Enumerable<any>;
Pairwise(selector: (prev, next) => any): Enumerable<any>;
Pairwise(selector: (prev: any, next: any) => any): Enumerable<any>;
Pairwise(selector: string): Enumerable<any>;
Scan(func: (a, b) => any): Enumerable<any>;
Scan(func: (a: any, b: any) => any): Enumerable<any>;
Scan(func: string): Enumerable<any>;
Scan(seed, func: (a, b) => any, resultSelector?: ($) => any): Enumerable<any>;
Scan(seed, func: string, resultSelector?: string): Enumerable<any>;
Scan(seed: any, func: (a: any, b: any) => any, resultSelector?: ($: T) => any): Enumerable<any>;
Scan(seed: any, func: string, resultSelector?: string): Enumerable<any>;
Select<TResult>(selector: ($: T, i: number) => TResult): Enumerable<TResult>;
Select(selector: string): Enumerable<any>;
SelectMany(collectionSelector: ($, i: number) => any[], resultSelector?: ($, item) => any): Enumerable<any>;
SelectMany(collectionSelector: ($, i: number) => Enumerable<any>, resultSelector?: ($, item) => any): Enumerable<any>;
SelectMany(collectionSelector: ($: any, i: number) => any[], resultSelector?: ($: any, item: any) => any): Enumerable<any>;
SelectMany(collectionSelector: ($: any, i: number) => Enumerable<any>, resultSelector?: ($: any, item: any) => any): Enumerable<any>;
SelectMany(collectionSelector: string, resultSelector?: string): Enumerable<any>;
Where(predicate: ($ : T, i: number) => boolean): Enumerable<T>;
Where(predicate: string): Enumerable<any>;
OfType(type: Function): Enumerable<any>;
Zip(second: any[], selector: (v1, v2, i: number) => any): Enumerable<any>;
Zip(second: any[], selector: (v1: any, v2: any, i: number) => any): Enumerable<any>;
Zip(second: any[], selector: string): Enumerable<any>;
Zip(second: Enumerable<any>, selector: (v1, v2, i: number) => any): Enumerable<any>;
Zip(second: Enumerable<any>, selector: (v1: any, v2: any, i: number) => any): Enumerable<any>;
Zip(second: Enumerable<any>, selector: string): Enumerable<any>;
//Join Methods
Join(inner: any[], outerKeySelector: (v1) => any, innerKeySelector: (v1) => any, resultSelector: (v1, v2) => any, compareSelector?: (v) => any): Enumerable<any>;
Join(inner: any[], outerKeySelector: (v1: any) => any, innerKeySelector: (v1: any) => any, resultSelector: (v1: any, v2: any) => any, compareSelector?: (v: any) => any): Enumerable<any>;
Join(inner: any[], outerKeySelector: string, innerKeySelector: string, resultSelector: string, compareSelector?: string): Enumerable<any>;
Join(inner: Enumerable<any>, outerKeySelector: (v1) => any, innerKeySelector: (v1) => any, resultSelector: (v1, v2) => any, compareSelector?: (v) => any): Enumerable<any>;
Join(inner: Enumerable<any>, outerKeySelector: (v1: any) => any, innerKeySelector: (v1: any) => any, resultSelector: (v1: any, v2: any) => any, compareSelector?: (v: any) => any): Enumerable<any>;
Join(inner: Enumerable<any>, outerKeySelector: string, innerKeySelector: string, resultSelector: string, compareSelector?: string): Enumerable<any>;
GroupJoin(inner: any[], outerKeySelector: (v1) => any, innerKeySelector: (v1) => any, resultSelector: (v1, v2: Enumerable<any>) => any, compareSelector?: (v) => any): Enumerable<any>;
GroupJoin(inner: any[], outerKeySelector: (v1: any) => any, innerKeySelector: (v1: any) => any, resultSelector: (v1: any, v2: Enumerable<any>) => any, compareSelector?: (v: any) => any): Enumerable<any>;
GroupJoin(inner: any[], outerKeySelector: string, innerKeySelector: string, resultSelector: string, compareSelector?: string): Enumerable<any>;
GroupJoin(inner: Enumerable<any>, outerKeySelector: (v1) => any, innerKeySelector: (v1) => any, resultSelector: (v1, v2: Enumerable<any>) => any, compareSelector?: (v) => any): Enumerable<any>;
GroupJoin(inner: Enumerable<any>, outerKeySelector: (v1: any) => any, innerKeySelector: (v1: any) => any, resultSelector: (v1: any, v2: Enumerable<any>) => any, compareSelector?: (v: any) => any): Enumerable<any>;
GroupJoin(inner: Enumerable<any>, outerKeySelector: string, innerKeySelector: string, resultSelector: string, compareSelector?: string): Enumerable<any>;
//Set Methods
All(predicate: ($ : T) => boolean): boolean;
@@ -77,49 +77,49 @@ declare namespace linq {
Concat(second: Enumerable<any>): Enumerable<any>;
Insert(index: number, second: any[]): Enumerable<any>;
Insert(index: number, second: Enumerable<any>): Enumerable<any>;
Alternate(value): Enumerable<any>;
Contains(value, compareSelector?: ($) => any): boolean;
Contains(value, compareSelector?: string): boolean;
DefaultIfEmpty(defaultValue): Enumerable<any>;
Distinct(compareSelector?: ($) => any): Enumerable<any>;
Alternate(value: any): Enumerable<any>;
Contains(value: any, compareSelector?: ($: T) => any): boolean;
Contains(value: any, compareSelector?: string): boolean;
DefaultIfEmpty(defaultValue: any): Enumerable<any>;
Distinct(compareSelector?: ($: T) => any): Enumerable<any>;
Distinct(compareSelector?: string): Enumerable<any>;
Except(second: any[], compareSelector?: ($) => any): Enumerable<any>;
Except(second: any[], compareSelector?: ($: T) => any): Enumerable<any>;
Except(second: any[], compareSelector?: string): Enumerable<any>;
Except(second: Enumerable<any>, compareSelector?: ($) => any): Enumerable<any>;
Except(second: Enumerable<any>, compareSelector?: ($: T) => any): Enumerable<any>;
Except(second: Enumerable<any>, compareSelector?: string): Enumerable<any>;
Intersect(second: any[], compareSelector?: ($) => any): Enumerable<any>;
Intersect(second: any[], compareSelector?: ($: T) => any): Enumerable<any>;
Intersect(second: any[], compareSelector?: string): Enumerable<any>;
Intersect(second: Enumerable<any>, compareSelector?: ($) => any): Enumerable<any>;
Intersect(second: Enumerable<any>, compareSelector?: ($: T) => any): Enumerable<any>;
Intersect(second: Enumerable<any>, compareSelector?: string): Enumerable<any>;
SequenceEqual(second: any[], compareSelector?: ($) => any): boolean;
SequenceEqual(second: any[], compareSelector?: ($: T) => any): boolean;
SequenceEqual(second: any[], compareSelector?: string): boolean;
SequenceEqual(second: Enumerable<any>, compareSelector?: ($) => any): boolean;
SequenceEqual(second: Enumerable<any>, compareSelector?: ($: T) => any): boolean;
SequenceEqual(second: Enumerable<any>, compareSelector?: string): boolean;
Union(second: any[], compareSelector?: ($) => any): Enumerable<any>;
Union(second: any[], compareSelector?: ($: T) => any): Enumerable<any>;
Union(second: any[], compareSelector?: string): Enumerable<any>;
Union(second: Enumerable<any>, compareSelector?: ($) => any): Enumerable<any>;
Union(second: Enumerable<any>, compareSelector?: ($: T) => any): Enumerable<any>;
Union(second: Enumerable<any>, compareSelector?: string): Enumerable<any>;
//Ordering Methods
OrderBy(keySelector?: ($: T) => any): OrderedEnumerable<T>;
OrderBy(keySelector?: string): OrderedEnumerable<T>;
OrderByDescending(keySelector?: ($) => any): OrderedEnumerable<T>;
OrderByDescending(keySelector?: ($: T) => any): OrderedEnumerable<T>;
OrderByDescending(keySelector?: string): OrderedEnumerable<T>;
Reverse(): Enumerable<T>;
Shuffle(): Enumerable<T>;
//Grouping Methods
GroupBy(keySelector: ($) => any, elementSelector?: ($) => any, resultSelector?: (key, e) => any, compareSelector?: ($) =>any): Enumerable<any>;
GroupBy(keySelector: ($: T) => any, elementSelector?: ($: T) => any, resultSelector?: (key: any, e: any) => any, compareSelector?: ($: T) =>any): Enumerable<any>;
GroupBy(keySelector: string, elementSelector?: string, resultSelector?: string, compareSelector?: string): Enumerable<any>;
PartitionBy(keySelector: ($) => any, elementSelector?: ($) => any, resultSelector?: (key, e) => any, compareSelector?: ($) =>any): Enumerable<any>;
PartitionBy(keySelector: ($: T) => any, elementSelector?: ($: T) => any, resultSelector?: (key: any, e: any) => any, compareSelector?: ($: T) =>any): Enumerable<any>;
PartitionBy(keySelector: string, elementSelector?: string, resultSelector?: string, compareSelector?: string): Enumerable<any>;
BufferWithCount(count: number): Enumerable<any>;
// Aggregate Methods
Aggregate(func: (a, b) => any);
Aggregate(seed, func: (a, b) => any, resultSelector?: ($) => any);
Aggregate(func: string);
Aggregate(seed, func: string, resultSelector?: string);
Average(selector?: ($) => number): number;
Aggregate(func: (a: any, b: any) => any): any;
Aggregate(seed: any, func: (a: any, b: any) => any, resultSelector?: ($: T) => any): any;
Aggregate(func: string): any;
Aggregate(seed: any, func: string, resultSelector?: string): any;
Average(selector?: ($: T) => number): number;
Average(selector?: string): number;
Count(predicate?: ($) => boolean): number;
Count(predicate?: ($: T) => boolean): number;
Count(predicate?: string): number;
Max(selector?: ($: T) => any): any;
Max(selector?: ($: T) => Date): Date;
@@ -141,7 +141,7 @@ declare namespace linq {
MinBy(selector: ($: T) => string): string;
MinBy(selector: ($: T) => any): any;
MinBy(selector: string): any;
Sum(selector?: ($) => number): number;
Sum(selector?: ($: T) => number): number;
Sum(selector?: string): number;
//Paging Methods
ElementAt(index: number): T;
@@ -166,29 +166,29 @@ declare namespace linq {
TakeWhile(predicate: string): Enumerable<T>;
TakeExceptLast(count?: number): Enumerable<T>;
TakeFromLast(count: number): Enumerable<T>;
IndexOf(item): number;
LastIndexOf(item): number;
IndexOf(item: T): number;
LastIndexOf(item: T): number;
// Convert Methods
ToArray(): T[];
ToLookup(keySelector: ($) => any, elementSelector?: ($) => any, compareSelector?: (key) => any): Lookup<T>;
ToLookup(keySelector: ($: T) => any, elementSelector?: ($: T) => any, compareSelector?: (key: any) => any): Lookup<T>;
ToLookup(keySelector: string, elementSelector?: string, compareSelector?: string): Lookup<T>;
ToObject(keySelector: ($) => string, elementSelector: ($) => any): any;
ToObject(keySelector: ($: T) => string, elementSelector: ($: T) => any): any;
ToObject(keySelector: string, elementSelector: string): any;
ToDictionary(keySelector: ($) => any, elementSelector: ($) => any, compareSelector?: (key) => any): Dictionary<T>;
ToDictionary(keySelector: ($: T) => any, elementSelector: ($: T) => any, compareSelector?: (key: T) => any): Dictionary<T>;
ToDictionary(keySelector: string, elementSelector: string, compareSelector?: string): Dictionary<T>;
ToJSON(replacer?: (key, value) => any, space?: number): string;
ToJSON(replacer?: (key: any, value: any) => any, space?: number): string;
ToJSON(replacer?: string, space?: number): string;
ToString(separator?: string, selector?: ($) =>any): string;
ToString(separator?: string, selector?: ($: T) =>any): string;
ToString(separator?: string, selector?: string): string;
//Action Methods
Do(action: ($, i: number) => void ): Enumerable<any>;
Do(action: ($: T, i: number) => void ): Enumerable<any>;
Do(action: string): Enumerable<any>;
ForEach(action: ($: T, i: number) => void ): void;
ForEach(func: ($: T, i: number) => boolean): void;
ForEach(action_func: string): void;
Write(separator?: string, selector?: ($) =>any): void;
Write(separator?: string, selector?: ($: T) =>any): void;
Write(separator?: string, selector?: string): void;
WriteLine(selector?: ($) =>any): void;
WriteLine(selector?: ($: T) =>any): void;
Force(): void;
//Functional Methods
Let(func: (e: Enumerable<any>) => Enumerable<any>): Enumerable<any>;
@@ -200,7 +200,7 @@ declare namespace linq {
Finally(finallyAction: () => void ): Enumerable<any>;
Finally(finallyAction: string): Enumerable<any>;
//For Debug Methods
Trace(message?: string, selector?: ($) =>any): Enumerable<any>;
Trace(message?: string, selector?: ($: T) =>any): Enumerable<any>;
Trace(message?: string, selector?: string): Enumerable<any>;
}
@@ -212,23 +212,23 @@ declare namespace linq {
}
interface Grouping<T> extends Enumerable<T> {
Key();
Key(): any;
}
interface Lookup<TValue> {
Count(): number;
Get(key): Enumerable<TValue>;
Contains(key): boolean;
Get(key: any): Enumerable<TValue>;
Contains(key: any): boolean;
ToEnumerable(): Enumerable<TValue>;
}
interface Dictionary<TValue> {
Add(key, value): void;
Get(key): any;
Set(key, value): boolean;
Contains(key): boolean;
Add(key: any, value: TValue): void;
Get(key: any): any;
Set(key: any, value: TValue): boolean;
Contains(key: any): boolean;
Clear(): void;
Remove(key): void;
Remove(key: any): void;
Count(): number;
ToEnumerable(): Enumerable<TValue>;
}

18
linq/linq.jquery.3.0.4-Beta5.d.ts vendored Normal file
View File

@@ -0,0 +1,18 @@
// Type definitions for linq.jquery (from linq.js)
// Project: https://linqjs.codeplex.com/
// Definitions by: neuecc <https://www.codeplex.com/site/users/view/neuecc>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
/// <reference path="linq.d.ts"/>
declare module linqjs {
interface IEnumerable<T> {
tojQuery(): JQuery;
tojQueryAsArray(): JQuery;
}
}
interface JQuery {
toEnumerable(): linqjs.IEnumerable<JQuery>;
}

View File

@@ -2,7 +2,14 @@
function aSimpleLoggingMessageString() {
var log = log4javascript.getDefaultLogger();
log.info("Hello World");
log.info("Hello World");
}
function compareLogLevelsAndLog() {
var log = log4javascript.getDefaultLogger();
if (log4javascript.Level.INFO.isGreaterOrEqual(log.getLevel())) {
log.log(log4javascript.Level.INFO, ["Info"]);
}
}
function loggingAnErrorWithAMessage() {

View File

@@ -89,7 +89,22 @@ declare namespace log4javascript {
/**
* Levels are available as static properties of the log4javascript.Level object.
*/
export enum Level { ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF }
export class Level {
static ALL: Level;
static TRACE: Level;
static DEBUG: Level;
static INFO: Level;
static WARN: Level;
static ERROR: Level;
static FATAL: Level;
static OFF: Level;
constructor(level: number, name: string);
toString(): string;
equals(level: Level): boolean;
isGreaterOrEqual(level: Level): boolean;
}
// #endregion

1
long/long.d.ts vendored
View File

@@ -348,6 +348,5 @@ declare class Long
}
declare module 'long' {
namespace Long {}
export = Long;
}

View File

@@ -130,6 +130,10 @@ declare namespace MCustomScrollbar {
scrollType?: "stepless"|"stepped";
}
=======
disableOver?: string[]
}
>>>>>>> upstream/master
/**
* Mouse wheel scrolling pixels amount, value in pixels (integer) or "auto" (script calculates and sets pixels amount according to content length)
*/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
--experimentalDecorators

8246
material-ui/legacy/material-ui-0.14.4.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -697,6 +697,13 @@ declare module "mongodb" {
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#reIndex
reIndex(): Promise<any>;
reIndex(callback: MongoCallback<any>): void;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#remove
/** @deprecated Use use deleteOne, deleteMany or bulkWrite */
remove(selector: Object, callback: MongoCallback<WriteOpResult>): void;
/** @deprecated Use use deleteOne, deleteMany or bulkWrite */
remove(selector: Object, options?: CollectionOptions & { single?: boolean }): Promise<WriteOpResult>;
/** @deprecated Use use deleteOne, deleteMany or bulkWrite */
remove(selector: Object, options?: CollectionOptions & { single?: boolean }, callback?: MongoCallback<WriteOpResult>): void;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#rename
rename(newName: string, callback: MongoCallback<Collection>): void;
rename(newName: string, options?: { dropTarget?: boolean }): Promise<Collection>;
@@ -708,7 +715,9 @@ declare module "mongodb" {
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#save
/** @deprecated Use insertOne, insertMany, updateOne or updateMany */
save(doc: Object, callback: MongoCallback<WriteOpResult>): void;
/** @deprecated Use insertOne, insertMany, updateOne or updateMany */
save(doc: Object, options?: CollectionOptions): Promise<WriteOpResult>;
/** @deprecated Use insertOne, insertMany, updateOne or updateMany */
save(doc: Object, options: CollectionOptions, callback: MongoCallback<WriteOpResult>): void;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#stats
stats(callback: MongoCallback<CollStats>): void;

View File

@@ -138,6 +138,22 @@ fs.mkdtemp('/tmp/foo-', (err, folder) => {
var tempDir: string;
tempDir = fs.mkdtempSync('/tmp/foo-');
fs.watch('/tmp/foo-', (event, filename) => {
console.log(event, filename);
});
fs.watch('/tmp/foo-', 'utf8', (event, filename) => {
console.log(event, filename);
});
fs.watch('/tmp/foo-', {
recursive: true,
persistent: true,
encoding: 'utf8'
}, (event, filename) => {
console.log(event, filename);
});
///////////////////////////////////////////////////////
/// Buffer tests : https://nodejs.org/api/buffer.html
///////////////////////////////////////////////////////

26
node/node.d.ts vendored
View File

@@ -197,6 +197,29 @@ declare var Buffer: {
* The same as buf1.compare(buf2).
*/
compare(buf1: Buffer, buf2: Buffer): number;
/**
* Allocates a new buffer of {size} octets.
*
* @param size count of octets to allocate.
* @param fill if specified, buffer will be initialized by calling buf.fill(fill).
* If parameter is omitted, buffer will be filled with zeros.
* @param encoding encoding used for call to buf.fill while initalizing
*/
alloc(size: number, fill?: string|Buffer|number, encoding?: string): Buffer;
/**
* Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
* of the newly created Buffer are unknown and may contain sensitive data.
*
* @param size count of octets to allocate
*/
allocUnsafe(size: number): Buffer;
/**
* Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
* of the newly created Buffer are unknown and may contain sensitive data.
*
* @param size count of octets to allocate
*/
allocUnsafeSlow(size: number): Buffer;
};
/************************************************
@@ -1599,7 +1622,8 @@ declare module "fs" {
export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void;
export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void;
export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher;
export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher;
export function watch(filename: string, encoding: string, listener?: (event: string, filename: string) => any): FSWatcher;
export function watch(filename: string, options: { persistent?: boolean; recursive?: boolean; encoding?: string }, listener?: (event: string, filename: string) => any): FSWatcher;
export function exists(path: string | Buffer, callback?: (exists: boolean) => void): void;
export function existsSync(path: string | Buffer): boolean;
/** Constant for fs.access(). File is visible to the calling process. */

View File

@@ -62,6 +62,7 @@ declare namespace nunjucks {
autoescape: boolean;
};
constructor();
constructor(loader: ILoader, opts?: ConfigureOptions);
constructor(loaders: ILoader[], opts?: ConfigureOptions);
@@ -122,6 +123,11 @@ declare namespace nunjucks {
getSource(name: string): LoaderSource;
}
export class WebLoader implements ILoader {
constructor(baseUrl: string, opts?: any);
getSource(name: string): LoaderSource;
}
export class PrecompiledLoader extends Loader implements ILoader {
init(searchPaths: string[], opts: any): void;
getSource(name: string): LoaderSource;

2
parse5/parse5.d.ts vendored
View File

@@ -181,7 +181,7 @@ declare module 'parse5' {
getFirstChild(node: ASTNode): ASTNode;
getChildNodes(node: ASTNode): ASTNode[];
getParentNode(node: ASTNode): ASTNode;
getAttrList(node: ASTNode): Attribute[];
getAttrList(node: ASTNode): ASTAttribute[];
getTagName(element: ASTNode): string;
getNamespaceURI(element: ASTNode): string;
getTextNodeContent(textNode: ASTNode): string;

View File

@@ -13,7 +13,7 @@ Path.history.listen(() =>{
var initial = Path.history.initial;
//Core
var route = Path.core.route("/test/:id");
var route = new Path.core.route("/test/:id");
function test1() {
@@ -30,4 +30,4 @@ var funs = new Array<Function>();
funs.push(test1);
funs.push(test2);
route.enter(funs);
route.enter(funs);

6
pathjs/pathjs.d.ts vendored
View File

@@ -27,7 +27,11 @@ interface IPathRoutes{
}
interface IPathCore{
route(path: string): IPathRoute;
route: IPathRouteConstructor;
}
interface IPathRouteConstructor {
new (path: string): IPathRoute;
}
interface IPath {

View File

@@ -20,14 +20,14 @@ declare namespace createjs {
static BINARY: string;
canceled: boolean;
static CSS: string;
GET: string;
static GET: string;
static IMAGE: string;
static JAVASCRIPT: string;
static JSON: string;
static JSONP: string;
loaded: boolean;
static MANIFEST: string;
POST: string;
static POST: string;
progress: number;
resultFormatter: () => any;
static SOUND: string;

View File

@@ -19,3 +19,9 @@ var prom3 = Promise.all([prom, prom2]);
prom3.then((resolve: Array<any>) => {
});
function withCallback(arg: any, cb: (e: Error, result: any) => void): void {
cb(null, arg);
}
var prom4 = Promise.denodeify(withCallback);
prom4('test').then(result => result);

View File

@@ -18,7 +18,7 @@ declare namespace Promise {
resolve: <T>(value: T) => IThenable<T>;
reject: <T>(value: T) => IThenable<T>;
all: (array: Array<IThenable<any>>) => IThenable<Array<any>>;
denodeify: (fn: Function) => IThenable<any>;
denodeify: (fn: Function) => (...args: any[]) => IThenable<any>;
nodeify: (fn: Function) => Function;
}

View File

@@ -1,115 +1,595 @@
// Type definitions for react-bootstrap-table v1.4.6
// Type definitions for react-bootstrap-table v2.3.0
// Project: https://github.com/AllenFang/react-bootstrap-table
// Definitions by: Frank Laub <https://github.com/flaub>
// Definitions by: Frank Laub <https://github.com/flaub>, Michael Scharf <https://github.com/scharf>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../react/react.d.ts" />
/// <reference path="../node/node.d.ts" />
// documentation taken from http://allenfang.github.io/react-bootstrap-table/docs.html
declare module "react-bootstrap-table" {
import { ComponentClass, Props, ReactElement } from 'react';
import { EventEmitter } from 'events';
interface SelectRow {
mode?: string;
bgColor?: string;
selected?: any[];
onSelect?: Function;
onSelectAll?: Function;
export interface BootstrapTableProps extends Props<BootstrapTable> {
/**
Use data to specify the data that you want to display on table.
*/
data: any[];
/**
If set, data is remote (use also fetchInfo)
*/
remote?: boolean,
/**
Use keyField to tell table which column is unique. This is same as isKey in <TableHeaderColumn>
Tips: You need choose one configuration to set key field: keyField or isKey in <TableHeaderColumn>
*/
keyField?: string;
/**
Use height to set the height of table, default is 100%.
*/
height?: string;
/**
Set the max column width (pixels)
*/
maxHeight?: string;
/**
Enable striped by setting striped to true. Same as Bootstrap table class .table-striped, default is false.
*/
striped?: boolean;
/**
Enable hover by setting hover to true. Same as Bootstrap table class .table-hover, default is false.
*/
hover?: boolean;
/**
Enable condensed by setting condensed to true. Same as Bootstrap table class .table-condensed, default is false.
*/
condensed?: boolean;
/**
Become a borderless table by setting bordered to false, default is true.
*/
bordered?: boolean;
/**
Enable pagination by setting pagination to true, default is false.
*/
pagination?: boolean;
/**
Assign the class name of row(tr). This attribute accept a string or function and function is a better way to do more customization.
If a string given, means the value will be presented as the row class.
If a function given, will pass rowData and rowIndex as params and should return string for presenting class. for examples:
@example
function trClassFormat(rowData,rowIndex){
return rowIndex%2==0?"tr-odd":"tr-even"; //return a class name.
}
*/
trClassName?: string | ((rowData:any, rowIndex:number)=>string);
/**
Enable row insertion by setting insertRow to true, default is false.
If you enable row insertion, there's a button on the upper left side of table.
*/
insertRow?: boolean;
/**
Enable row deletion by setting deleteRow to true, default is false.
If you enable row deletion, there's a button on the upper left side of table.
*/
deleteRow?: boolean;
/**
Enable column filter by setting columnFilter to true, default is false.
If enabled, there're input text field per column under the table, user can input your filter condition by each column.
*/
columnFilter?: boolean;
/**
Enable search by setting search to true, default is false.
If enabled, there is a on the upper left side of the table. The default place holder is Search
*/
search?: boolean;
/**
Set searchPlaceholder to change the placeholder in search field, default is Search.
*/
searchPlaceholder?: string;
/**
Enable multi search by multiColumnSearch, default is false.
If you want to use multi search, you must enable search at first.
Tips: Use space to delimited search text. EX: 3 4, which means match all 3 or 4 datas in table.
*/
multiColumnSearch?: boolean;
/**
Enable export csv function, default is false.
If you enable, there's a button on the upper left side of table.
*/
exportCSV?: boolean;
/**
Set CSV filename (e.g. items.csv). Default is spreadsheet.csv
*/
csvFileName?: string;
/**
Enable row selection on table. selectRow accept an object which have the following properties
*/
selectRow?: SelectRow;
/**
Enable cell editing on table. cellEdit accept an object which have the following properties
*/
cellEdit?: CellEdit;
/**
For some options setting on this component, you can set the options attribute and give an object which contain following properties
*/
options?:Options;
fetchInfo?:FetchInfo;
tableStyle?: any;
containerStyle?: any;
headerStyle?: any;
bodyStyle?: any;
}
export type SelectRowMode = 'none' | 'radio' | 'checkbox';
export interface SelectRow {
/**
For specifing the selection is single(radio) or multiple(checkbox).
*/
mode: SelectRowMode;
/**
Click the row will trigger selection on that row if enable clickToSelect, default is false.
*/
clickToSelect?: boolean;
hideSelectColumn?: boolean;
/**
If true, click the row will trigger selection on that row and also trigger cell editing if you enabled cell edit. Default is false.
*/
clickToSelectAndEditCell?: boolean;
/**
You can assign the background color of row which be selected.
*/
bgColor?: string;
/**
You can assign the class name of row which be selected.
*/
className?: string;
/**
Give an array data to perform which rows you want to be selected when table loading.
The content of array should be the rowkey which you want to be selected.
*/
selected?: string[];
/**
if true, the radio/checkbox column will be hide.
You can enable this attribute if you enable clickToSelect and you don't want to show the selection column.
*/
hideSelectColumn?: boolean;
/**
Default is false, if enabled, there will be a button on top of table for toggling selected rows only.
*/
showOnlySelected?: boolean;
/**
Accept a custom callback function, if a row be selected or unselected, this function will be called.
This callback function taking three arguments row, isSelected and event:
`row`: is the row data which you wanted to select or unselect.
`isSelected`: it's a boolean value means "whether or not that row will be selected?".
`event`: The event target object.
If return value of this function is false, the select or deselect action will not be applied.
*/
onSelect?: (row:any, isSelected:Boolean, event:any)=>boolean;
/**
Accept a custom callback function, if click select all checkbox, this function will be called.
This callback function taking two arguments isSelected and currentSelectedAndDisplayData:
`isSelected`: it's a boolean value means "whether or not that row will be selected?".
`currentSelectedAndDisplayData`: If pagination enabled, this result is the data which in a page. In contrast, this is all data in table.
If return value of this function is false, the select all or deselect all action will not be applied.
*/
onSelectAll?: (isSelected:boolean, currentSelectedAndDisplayData:any)=>boolean;
}
interface CellEdit {
mode?: string;
export type CellEditClickMode = 'none' | 'click' | 'dbclick';
export interface CellEdit {
/**
To spectify which condition will trigger cell editing.(click or dbclick)
*/
mode: CellEditClickMode;
/**
Enable blurToSave will trigger a saving event on cell when mouse blur on the input field. Default is false.
In the default condition, you need to press ENTER to save the cell.
*/
blurToSave?: boolean;
afterSaveCell?: Function;
/**
Accept a custom callback function, before cell saving, this function will be called.
This callback function taking three arguments:row, cellName and cellValue
It's necessary to return a bool value which whether apply this cell editing.
*/
beforeSaveCell?: (row:any, cellName:string, cellValue:any)=>boolean;
/**
Accept a custom callback function, after cell saving, this function will be called.
This callback function taking three arguments:row, cellName and cellValue
*/
afterSaveCell?: (row:any, cellName:string, cellValue:any)=>void;
}
export type SortOrder ='asc' | 'desc';
export interface Options {
/**
Manage sort field by yourself
*/
sortName?: string;
/**
Manage sort order by yourself
*/
sortOrder?: SortOrder;
/**
Assign a default sort field.
*/
defaultSortName?: string;
/**
Assign a default sort ordering.
*/
defaultSortOrder?: SortOrder;
/**
False to disable sort indicator on header column, default is true.
*/
sortIndicator?: boolean;
/**
Change the displaying text on table if data is empty.
*/
noDataText?: string | ReactElement<any>;
/**
A delay for trigger search after a keyup (millisecond)
*/
searchDelayTime?: number;
/**
A custom text on export csv button
*/
exportCSVText?: string;
/**
Default is false, if true means you want to ignore any editable configuration when row insert.
*/
ignoreEditable?: boolean;
/**
Only work on enable search. If true, there will be a button beside search input field for clear search field text.
*/
clearSearch?: boolean;
/**
Assign a callback function which will be called after table update.
*/
afterTableComplete?: Function;
/**
Assign a callback function which will be called after row delete.
This function taking one argument: rowKeys, which means the row key you dropped.
*/
afterDeleteRow?: (rowKeys:string[])=>void;
/**
Assign a callback function which will be called after row insert.
This function taking one argument: row, which means the whole row data you added.
*/
afterInsertRow?: (row:any)=>void;
/**
Customize the text of previouse page button
*/
prePage?: string;
/**
Customize the text of next page button
*/
nextPage?: string;
/**
Customize the text of first page button
*/
firstPage?: string;
/**
Customize the text of last page button
*/
lastPage?: string;
/**
Accept a number, which means the page you want to show as default.
*/
page?: number;
/**
You can change the dropdown list for size per page if you enable pagination.
*/
sizePerPageList?: number[];
/**
Means the size per page you want to locate as default.
*/
sizePerPage?: number;
/**
To define the pagination bar length, default is 5.
*/
paginationSize?: number;
/**
Assign a callback function which will be called after page changed.
This function taking two argument: page and sizePerPage.
`page`: Current page.
`sizePerPage`: The data size which in one page.
*/
onPageChange?: (page:number, sizePerPage:number)=>void;
/**
Assign a callback function which will be called after size per page dropdown changed.
This function taking one argument: sizePerPage.
`sizePerPage`: The data size which in one page.
*/
onSizePerPageList?: (sizePerPage:number)=>void;
/**
Assign a callback function which will be called after trigger sorting.
This function taking two argument: `sortName` and `sortOrde`r.
`sortName`: The sort column name
`sortOrder`: The sort ordering.
*/
onSortChange?: (sortName:string, sortOrder:SortOrder)=>void;
/**
Assign a callback function which will be called after trigger searching.
This function taking two argument: search and result.
`search`: The search text which user input.
`result`: The results after searching.
*/
afterSearch?: (search:string, result:any)=>void;
/**
Assign a callback function which will be called after trigger column filtering.
This function taking two argument: filterConds and result.
`filterConds`: It's an array object which contain all column filter conditions.
`result`: The results after filtering.
*/
afterColumnFilter?: (filterConds:any[], result:any)=>void;
/**
Assign a callback function which will be called after a row click.
This function taking one argument: row which is the row data which you click on.
*/
onRowClick?: (row:any)=>void;
/**
Assign a callback function which will be called when mouse enter into the table.
*/
onMouseEnter?: Function;
/**
Assign a callback function which will be called when mouse leave from the table.
*/
onMouseLeave?: Function;
/**
Assign a callback function which will be called when mouse over a row in table.
This function taking one argument: row which is the row data which mouse over.
*/
onRowMouseOver?: Function;
/**
Assign a callback function which will be called when mouse leave from a row in table.
This function taking one argument: row which is the row data which mouse out.
*/
onRowMouseOut?: Function;
/**
Assign a callback function which will be called when row dropping.
It give you a chance to customize your confirmation for row deletion.
This function taking two argument: next and rowKeys:
`next`: If you confirm to drop row, call next() to continue the process
`rowKeys` is the row keys which been deleted, you can call next function to apply this deletion.
*/
handleConfirmDeleteRow?: (next:Function, rowKeys:any[])=>void;
paginationShowsTotal?: boolean;
onSearchChange?: Function;
onAddRow?: Function;
onExportToCSV?: Function;
insertText?: string;
deleteText?: string;
saveText?: string;
closeText?: string;
}
interface Options {
sortName?: string;
sortOrder?: string;
afterTableComplete?: Function;
afterDeleteRow?: Function;
afterInsertRow?: Function;
afterSearch?: Function;
afterColumnFilter?: Function;
onRowClick?: Function;
page?: number;
sizePerPageList?: number[];
sizePerPage?: number;
paginationSize?: number;
onSortChange?: Function;
onPageChange?: Function;
onSizePerPageList?: Function;
noDataText?: string;
handleConfirmDeleteRow?: Function;
}
interface FetchInfo {
dataTotalSize?: number;
}
interface BootstrapTableProps extends Props<BootstrapTable> {
keyField?: string;
height?: string;
maxHeight?: string;
data?: any;
remote?: boolean;
striped?: boolean;
bordered?: boolean;
hover?: boolean;
condensed?: boolean;
pagination?: boolean;
searchPlaceholder?: string;
selectRow?: SelectRow;
cellEdit?: CellEdit;
insertRow?: boolean;
deleteRow?: boolean;
search?: boolean;
columnFilter?: boolean;
trClassName?: any;
options?: Options;
fetchInfo?: FetchInfo;
exportCSV?: boolean;
csvFileName?: string;
export interface BootstrapTable extends ComponentClass<BootstrapTableProps> {
/**
* Call this function to insert an new row to table.
*/
handleAddRow(row:any): void;
/**
* Call this function to insert an new row as first row on table.
*/
handleAddRowAtBegin(row:any): void;
/**
* Call this function to drop rows in table.
*/
handleDropRow(rowKeys:any[]): void;
/**
* Call this function to do column filtering on table.
*/
handleFilterData(filter:any): void;
/**
* Call this function with search text for fully searching.
*/
handleSearch(search:string): void;
/**
* Call this function to sort table.
*/
handleSort(order: SortOrder, field: string): void;
/**
* Call this function to get the page by a rowkey
*/
getPageByRowKey(rowKey: string): any;
/**
* Call this function to export table as csv.
*/
handleExportCSV(): void;
/**
* Clean all the selection state on table.
*/
cleanSelected(): void;
}
export const BootstrapTable: BootstrapTable;
interface BootstrapTable extends ComponentClass<BootstrapTableProps> { }
const BootstrapTable: BootstrapTable;
export type DataAlignType = 'left' | 'center' | 'right' | 'start' | 'end';
interface TableHeaderColumnProps extends Props<TableHeaderColumn> {
dataField?: string;
dataAlign?: string;
dataSort?: boolean;
onSort?: Function;
dataFormat?: Function;
export interface TableHeaderColumnProps extends Props<TableHeaderColumn> {
/**
The field of data you want to show on column.
*/
dataField: string;
/**
Use isKey to tell table which column is unique. This is same as keyField in <BootstrapTable>
Tips: You need choose one configuration to set key field: isKey or keyField in <BootstrapTable>
*/
isKey?: boolean;
editable?: any;
hidden?: boolean;
className?: string;
/**
Set the column width. ex: 150, it's means 150px
*/
width?: string;
sortFunc?: Function;
columnClassName?: any;
/**
Set align in column, value is left, center, right, start and end.
*/
dataAlign?: DataAlignType;
/**
True to enable table sorting. Default is disabled.
*/
dataSort?: boolean;
/**
Allow user to render a custom sort caret. You should give a function and should return a JSX.
This function taking one arguments: order which present the sort order currently.
*/
caretRender?: Function;
/**
To customize the column. This callback function should return a String or a React Component.
In addition, this function taking two argument: cell and row.
*/
dataFormat?: (cell:any, row:any) => string | ReactElement<any>;
/**
To to enable search or filter data on formatting. Default is false
*/
filterFormatted?: boolean;
sort?: string;
/**
True to hide column.
*/
hidden?: boolean;
/**
False to disable search functionality on column, default is true.
*/
searchable?: boolean;
/**
Give a customize function for data sorting.
This function taking four arguments: a, b, order, sortField, extraData
*/
sortFunc?: (a:any, b:any, order:SortOrder, sortField:any, extraData:any) => number;
/**
It's a extra data for custom sort function, if defined, this data will be pass as fifth argument in sortFunc.
*/
sortFuncExtraData?: any;
/**
Add custom css class on table header column, this attribute only accept String or Function.
If Function, it taking four arguments: cell, row, rowIndex, columnIndex.
In addition, this function should return a String which is the class name you want to add on.
*/
className?: string | ((cell:any, row:any, rowIndex:number, columnIndex:number) => string);
/**
Add custom css class on table body column, this attribute only accept String or Function.
If Function, it taking four arguments: cell, row, rowIndex, columnIndex.
In addition, this function should return a String which is the class name you want to add on.
*/
columnClassName?: String | ((cell:any, row:any, rowIndex:number, columnIndex:number) => string);
/**
Add True to set column editable, false is non-editable. If give Object,
you can do more customization when editing cell. This object have following properties:
@example
{
type: //edit type, avaiable value is textarea, select, checkbox
validator: //give function for validation and taking only one "cell value" as argument. This function should return Bool.
options:{
values: //values means data in select or checkbox.If checkbox, use ':'(colon) to separate value, ex: Y:N
}
}
*/
editable?: boolean | Editable;
/**
It only work when you enable insertRow and be assign on rowKey column.
If true, the row key will be generated automatically after a row insertion.
*/
autoValue?: boolean;
/**
To Enable a column filter within header column.
This feature support a lots of filter type and condition. Please check example
Following is the format for filter
*/
filter?: Filter;
onSort?: Function;
csvFormat?: Function;
columnTitle?: boolean;
sort?: SortOrder;
formatExtraData?: any;
}
export interface Editable {
type?: string;//edit type, avaiable value is textarea, select, checkbox
/**
function for validation and taking only one "cell value" as argument. This function should return Bool.
*/
validator?: (cell: any) => boolean;
/**
{
values: //values means data in select or checkbox.If checkbox, use ':'(colon) to separate value, ex: Y:N
}
*/
options?: any;
}
export type FilterType = 'TextFilter' | 'RegexFilter' | 'SelectFilter' | 'NumberFilter' | 'DateFilter' | 'CustomFilter';
export interface Filter {
/**
"TextFilter"||"SelectFilter"||"NumberFilter"||"DateFilter"||"RegexFilter"||"YOUR_CUSTOM_FILTER"
*/
type?: FilterType;
/**
* Default value on filter. If type is NumberFilter or DateFilter, this value will like { number||date: xxx, comparator: '>' }
*/
defaultValue?: any;
/**
* Assign a millisecond for delay when trigger filtering, default is 500.
*/
delay?: number;
/**
* Only work on TextFilter. Assign the placeholder text on text and regex filter
*/
placeholder?: string| RegExp;
/**
* Only work on NumberFilter. Accept an array which conatin the filter condition, like: ['<','>','=']
*/
numberComparators: string[];
}
interface TableHeaderColumn extends ComponentClass<TableHeaderColumnProps> { }
const TableHeaderColumn: TableHeaderColumn;
export interface TableHeaderColumn extends ComponentClass<TableHeaderColumnProps> { }
export const TableHeaderColumn: TableHeaderColumn;
class TableDataSet extends EventEmitter {
export class TableDataSet extends EventEmitter {
constructor(data: any);
setData(data: any): void;
clear(): void;
getData(): any;
}
export {
BootstrapTable,
TableHeaderColumn,
TableDataSet
}
}

View File

@@ -0,0 +1,49 @@
/// <reference path="../react/react.d.ts" />
/// <reference path="./react-modal.d.ts"/>
import * as React from "react";
import ReactModal from 'react-modal';
class ExampleOfUsingReactModal extends React.Component<{}, {}> {
render() {
var onAfterOpenFn = () => { }
var onRequestCloseFn = () => { }
var customStyle = {
overlay: {
position: 'fixed',
top: 0,
left: 0,
right: 0,
bottom: 0,
backgroundColor: 'rgba(255, 255, 255, 0.75)'
},
content: {
position: 'absolute',
top: '40px',
left: '40px',
right: '40px',
bottom: '40px',
border: '1px solid #ccc',
background: '#fff',
overflow: 'auto',
WebkitOverflowScrolling: 'touch',
borderRadius: '4px',
outline: 'none',
padding: '20px'
}
}
return (
<ReactModal
isOpen={true}
onAfterOpen={onAfterOpenFn}
onRequestClose={onRequestCloseFn}
closeTimeoutMS={1000}
style={customStyle}
>
<h1>Modal Content</h1>
<p>Etc.</p>
</ReactModal>
);
}
};

28
react-modal/react-modal.d.ts vendored Normal file
View File

@@ -0,0 +1,28 @@
// Type definitions for react-modal v1.3.0
// Project: https://github.com/reactjs/react-modal
// Definitions by: Rajab Shakirov <https://github.com/radziksh>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../react/react.d.ts"/>
declare module "react-modal" {
interface ReactModal {
isOpen: boolean;
style?: {
content: {
[key: string]: any;
},
overlay: {
[key: string]: any;
}
},
appElement?: HTMLElement | {},
onAfterOpen?: Function,
onRequestClose?: Function,
closeTimeoutMS?: number,
ariaHideApp?: boolean,
shouldCloseOnOverlayClick?: boolean
}
let ReactModal: __React.ClassicComponentClass<ReactModal>;
export default ReactModal;
}

View File

@@ -90,7 +90,7 @@ declare namespace HistoryModule {
type Pathname = string
type Query = Object
type Query = { [key: string]: any; }
type QueryString = string

View File

@@ -8,6 +8,59 @@ import * as ReactDOM from "react-dom";
import { Option, MenuRendererProps } from "react-select-props";
import Select = require("react-select");
const CustomOption = React.createClass({
propTypes: {
children: React.PropTypes.node,
className: React.PropTypes.string,
isDisabled: React.PropTypes.bool,
isFocused: React.PropTypes.bool,
isSelected: React.PropTypes.bool,
onFocus: React.PropTypes.func,
onSelect: React.PropTypes.func,
option: React.PropTypes.object.isRequired,
},
handleMouseDown (event: Event) {
event.preventDefault();
event.stopPropagation();
this.props.onSelect(this.props.option, event);
},
handleMouseEnter (event: Event) {
this.props.onFocus(this.props.option, event);
},
handleMouseMove (event: Event) {
if (this.props.isFocused) return;
this.props.onFocus(this.props.option, event);
},
render () {
return (
<div className="Select-option"
onMouseDown={this.handleMouseDown}
onMouseEnter={this.handleMouseEnter}
onMouseMove={this.handleMouseMove}
title={this.props.option.title}>
{this.props.children}
</div>
);
}
});
const CustomValue = React.createClass({
propTypes: {
children: React.PropTypes.node,
placeholder: React.PropTypes.string,
value: React.PropTypes.object
},
render () {
return (
<div className="Select-value" title={this.props.value.title}>
<span className="Select-value-label">
{this.props.children}
</span>
</div>
);
}
});
class SelectTest extends React.Component<React.Props<{}>, {}> {
render() {
@@ -50,7 +103,7 @@ class SelectTest extends React.Component<React.Props<{}>, {}> {
onOpen={onOpen}
onClose={onClose}
openAfterFocus={false}
optionComponent={<div></div>}
optionComponent={CustomOption}
required={false}
resetValue={"resetValue"}
scrollMenuIntoView={false}
@@ -59,7 +112,7 @@ class SelectTest extends React.Component<React.Props<{}>, {}> {
onChange={onChange}
simpleValue
value={options}
valueComponent={<span></span>}
valueComponent={CustomValue}
/>
</div>;
}

View File

@@ -252,7 +252,7 @@ declare namespace ReactSelect {
/**
* option component to render in dropdown
*/
optionComponent?: __React.ReactElement<any>;
optionComponent?: __React.ComponentClass<any>;
/**
* function which returns a custom way to render the options in the menu
*/
@@ -317,7 +317,7 @@ declare namespace ReactSelect {
/**
* value component to render
*/
valueComponent?: __React.ReactElement<any>;
valueComponent?: __React.ComponentClass<any>;
/**
* optional style to apply to the component wrapper
@@ -407,7 +407,7 @@ declare module "react-select" {
}
declare module "react-select-props" {
interface Option extends ReactSelect.Option {}
interface MenuRendererProps extends ReactSelect.MenuRendererProps {}

View File

@@ -1,5 +1,18 @@
/// <reference path="react-tap-event-plugin.d.ts"/>
import * as injectTapEventPlugin from 'react-tap-event-plugin';
import * as injectTapEventPluginAll from 'react-tap-event-plugin';
injectTapEventPlugin();
// since the export is a function, this is the only actual correct way:
import injectTapEventPluginRequire = require("react-tap-event-plugin");
injectTapEventPluginAll();
injectTapEventPluginAll({
shouldRejectClick: function (lastTouchEventTimestamp, clickEventTimestamp) {
return true;
}
});
injectTapEventPluginRequire();
injectTapEventPluginRequire({});

View File

@@ -4,6 +4,11 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'react-tap-event-plugin'{
var exports:()=>any;
export = exports;
interface StrategyOverrides {
shouldRejectClick?: (lastTouchEventTimestamp: Date, clickEventTimestamp: Date) => boolean;
}
var injectTapEventPlugin: (strategyOverrides?: StrategyOverrides) => void;
export = injectTapEventPlugin;
}

25
react/react.d.ts vendored
View File

@@ -347,13 +347,25 @@ declare namespace __React {
view: AbstractView;
}
interface WheelEvent extends SyntheticEvent {
interface WheelEvent extends MouseEvent {
deltaMode: number;
deltaX: number;
deltaY: number;
deltaZ: number;
}
interface AnimationEvent extends SyntheticEvent {
animationName: string;
pseudoElement: string;
elapsedTime: number;
}
interface TransitionEvent extends SyntheticEvent {
propertyName: string;
pseudoElement: string;
elapsedTime: number;
}
//
// Event Handler Types
// ----------------------------------------------------------------------
@@ -374,6 +386,8 @@ declare namespace __React {
type TouchEventHandler = EventHandler<TouchEvent>;
type UIEventHandler = EventHandler<UIEvent>;
type WheelEventHandler = EventHandler<WheelEvent>;
type AnimationEventHandler = EventHandler<AnimationEvent>;
type TransitionEventHandler = EventHandler<TransitionEvent>;
//
// Props / DOM Attributes
@@ -497,6 +511,14 @@ declare namespace __React {
// Wheel Events
onWheel?: WheelEventHandler;
// Animation Events
onAnimationStart?: AnimationEventHandler;
onAnimationEnd?: AnimationEventHandler;
onAnimationIteration?: AnimationEventHandler;
// Transition Events
onTransitionEnd?: TransitionEventHandler;
}
// This interface is not complete. Only properties accepting
@@ -2455,6 +2477,7 @@ declare namespace JSX {
clipPath: React.SVGProps;
defs: React.SVGProps;
ellipse: React.SVGProps;
foreignObject: React.SVGProps;
g: React.SVGProps;
image: React.SVGProps;
line: React.SVGProps;

View File

@@ -1,6 +1,7 @@
/// <reference path="restify.d.ts" />
import restify = require("restify");
import url = require("url");
var server = restify.createServer({
formatters: {
@@ -40,23 +41,47 @@ server.use((req, res, next)=>{}, (req, res, next)=>{});
function send(req: restify.Request, res: restify.Response, next: restify.Next) {
req.header('key', 'val');
req.header('key') === 'val';
req.accepts('test') === true;
req.is('test') === true;
req.trailer('key', 'val');
req.trailer('key') === 'val';
req.accepts('test') === true;
req.accepts(['test']) === true;
req.acceptsEncoding('test') === true;
req.acceptsEncoding(['test']) === true;
req.is('test') === true;
req.isChunked() === true;
req.isKeepAlive() === true;
req.isSecure() === true;
req.isUpgradeRequest() === true;
req.isUpload() === true;
req.userAgent() === 'test';
req.startHandlerTimer('test');
req.endHandlerTimer('test');
req.absoluteUri('test') === 'test';
req.timers.pop() === { name: 'test', time: [0, 1234] };
req.getLogger('test');
var log = req.log;
log.debug({params: req.params}, 'Hello there %s', 'foo');
req.contentLength === 50;
req.contentType === 'test';
req.getContentLength() === 50;
req.contentLength() === 50;
req.getContentType() === 'test';
req.contentType() === 'test';
req.getHref() === 'test';
req.href() === 'test';
req.id === 'test';
req.getId() === 'test';
req.id() === 'test';
req.getPath() === 'test';
req.path() === 'test';
req.query === 'test';
req.getQuery() === 'test';
req.query() === 'test';
req.secure === true;
req.time === 50;
req.time() === 1463518410080;
req.getUrl() === url.parse('http://test.test.test/test');
req.getVersion() === 'test';
req.version() === 'test';
req.params;
res.header('test');
@@ -253,6 +278,7 @@ server.on('after', (req: restify.Request, res: restify.Response, route: restify.
route.spec.method === 'GET';
route.spec.name === 'routeName';
route.spec.path === '/some/path';
route.spec.path === /\/some\/path\/.*/;
route.spec.versions === ['v1'];
restify.auditLogger({ log: ()=>{} })(req, res, route, err);
});
@@ -316,7 +342,7 @@ client2.get('/str/mcavage', function(err: any, req: any) {
});
});
});
client.basicAuth('test', 'password');
client2.basicAuth('test', 'password');

276
restify/restify.d.ts vendored
View File

@@ -9,6 +9,7 @@
declare module "restify" {
import http = require('http');
import bunyan = require('bunyan');
import url = require('url');
interface addressInterface {
@@ -16,12 +17,12 @@ declare module "restify" {
family: string;
address: string;
}
interface requestFileInterface {
path: string;
type: string;
}
/**
* Comes from authorizationParser plugin
*/
@@ -35,21 +36,247 @@ declare module "restify" {
}
interface Request extends http.ServerRequest {
header: (key: string, defaultValue?: string) => any;
accepts: (type: string) => boolean;
/**
* builds an absolute URI for the request.
* @private
* @function absoluteUri
* @param {String} path a url path
* @returns {String}
*/
absoluteUri: (path: string) => string;
/**
* returns any header off the request. also, 'correct' any
* correctly spelled 'referrer' header to the actual spelling used.
* @public
* @function header
* @param {String} name the name of the header
* @param {String} value default value if header isn't found on the req
* @returns {String}
*/
header: (name: string, value?: string) => string;
/**
* returns any trailer header off the request. also, 'correct' any
* correctly spelled 'referrer' header to the actual spelling used.
* @public
* @function trailer
* @param {String} name the name of the header
* @param {String} value default value if header isn't found on the req
* @returns {String}
*/
trailer: (name: string, value?: string) => string;
/**
* checks if the accept header is present and has the value requested.
* e.g., req.accepts('html');
* @public
* @function accepts
* @param {String | Array} types an array of accept type headers
* @returns {Boolean}
*/
accepts: (types: string | string[]) => boolean;
/**
* checks if the request accepts the encoding types.
* @public
* @function acceptsEncoding
* @param {String | Array} types an array of accept type headers
* @returns {Boolean}
*/
acceptsEncoding: (types: string | string[]) => boolean;
/**
* Check if the incoming request contains the Content-Type header field, and
* if it contains the given mime type.
* @public
* @function is
* @param {String} type a content-type header value
* @returns {Boolean}
*/
is: (type: string) => boolean;
/**
* Check if the incoming request is chunked.
* @public
* @function isChunked
* @returns {Boolean}
*/
isChunked: () => boolean;
/**
* Check if the incoming request is kept alive.
* @public
* @function isKeepAlive
* @returns {Boolean}
*/
isKeepAlive: () => boolean;
/**
* Check if the incoming request has been upgraded.
* @public
* @function isUpgradeRequest
* @returns {Boolean}
*/
isUpgradeRequest: () => boolean;
/**
* Check if the incoming request is an upload verb.
* @public
* @function isUpload
* @returns {Boolean}
*/
isUpload: () => boolean;
/**
* retrieves the user-agent header.
* @public
* @function userAgent
* @returns {String}
*/
userAgent: () => string;
/**
* Start the timer for a request handler function. You must explicitly invoke
* endHandlerTimer() after invoking this function. Otherwise timing information
* will be inaccurate.
* @public
* @function startHandlerTimer
* @param {String} handlerName The name of the handler.
* @returns {undefined}
*/
startHandlerTimer: (handlerName: string) => void;
/**
* Stop the timer for a request handler function.
* @public
* @function endHandlerTimer
* @param {String} handlerName The name of the handler.
* @returns {undefined}
*/
endHandlerTimer: (handlerName: string) => void;
getLogger: (component: string) => any;
contentLength: number;
contentType: string;
/**
* gets the content-length header off the request.
* @public
* @function getContentLength
* @returns {Number}
*/
getContentLength: () => number;
/**
* @see getContentLength
* @function contentLength
*/
contentLength: () => number;
/**
* gets the content-type header.
* @public
* @function getContentType
* @returns {String}
*/
getContentType: () => string;
/**
* @see getContentType
*/
contentType: () => string;
/**
* retrieves the complete URI requested by the client.
* @public
* @function getHref
* @returns {String}
*/
getHref: () => string;
/**
* @see getHref
*/
href: () => string;
log: bunyan.Logger;
id: string;
/**
* retrieves the request uuid. was created when the request was setup.
* @public
* @function getId
* @returns {String}
*/
getId: () => string;
/**
* @see getId
*/
id: () => string;
/**
* retrieves the cleaned up url path.
* e.g., /foo?a=1 => /foo
* @public
* @function getPath
* @returns {String}
*/
getPath: () => string;
/**
* @see getPath
*/
path: () => string;
query: any;
/**
* returns the raw query string
* @public
* @function getQuery
* @returns {String}
*/
getQuery: () => string;
/**
* @see getQuery
*/
query: () => string;
secure: boolean;
time: number;
/**
* returns ms since epoch when request was setup.
* @public
* @function time
* @returns {Number}
*/
time: () => number;
/**
* returns a parsed URL object.
* @public
* @function getUrl
* @returns {Object}
*/
getUrl: () => url.Url;
/**
* returns the accept-version header.
* @public
* @function getVersion
* @returns {String}
*/
getVersion: () => string;
/**
* @see getVersion
*/
version: () => string;
params: any;
files?: { [name: string]: requestFileInterface };
/**
* Check if the incoming request is encrypted.
* @public
* @function isSecure
* @returns {Boolean}
*/
isSecure: () => boolean;
/** available when bodyParser plugin is used */
body?: any;
@@ -57,6 +284,19 @@ declare module "restify" {
username?: string;
/** available when authorizationParser plugin is used */
authorization?: requestAuthorization;
timers: HandlerTiming[];
}
/**
* Timer object used to identify how long a specific handler took to run
*
* @property {String} name The name of the handler.
* @property {Array} time A tuple of [seconds, nanoseconds], how long the handler took.
*/
interface HandlerTiming {
name: string;
time: [number, number];
}
interface Response extends http.ServerResponse {
@@ -72,11 +312,11 @@ declare module "restify" {
headers: Object;
id: string;
}
interface RouteSpec {
method: string;
name: string;
path: string;
path: string | RegExp;
versions: string[];
}
@@ -88,7 +328,7 @@ declare module "restify" {
types: string[];
versions: string[];
}
interface RouteOptions {
name: string;
method: string;
@@ -98,11 +338,11 @@ declare module "restify" {
contentType?: string | string[];
versions?: string | string[];
}
interface RoutePathRegex extends RegExp {
restifyParams: string[];
}
interface Router {
name: string;
mounts: { [routeName: string]: Route };
@@ -119,7 +359,7 @@ declare module "restify" {
};
log?: any;
toString: () => string;
/**
* Takes an object of route params and query params, and 'renders' a URL
* @param {String} routeName the route name
@@ -128,14 +368,14 @@ declare module "restify" {
* @returns {String}
*/
render: (routeName: string, params: Object, query?: Object) => string;
/**
* adds a route.
* @param {Object} options an options object
* @returns {String} returns the route name if creation is successful.
*/
mount: (options: Object) => string;
/**
* unmounts a route.
* @param {String} name the route name
@@ -184,7 +424,7 @@ declare module "restify" {
opts(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[]): Route;
opts(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[][]): Route;
opts(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[][]): Route;
name: string;
version: string;
log: Object;

View File

@@ -0,0 +1,7 @@
/// <reference path="samchon-collection.d.ts" />
declare var global: any;
declare var require: (name: string) => any;
collection = require("samchon-collection");
console.log(collection);

View File

@@ -0,0 +1,23 @@
// Type definitions for Samchon Collection v0.0.2
// Project: https://github.com/samchon/framework
// Definitions by: Jeongho Nam <http://samchon.org>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// ------------------------------------------------------------------------------------
// In Samchon Collection, merging multiple 'ts' files to a module is not possible yet.
// Instead of using "import" instruction, use such trick:
//
// <code>
// declare var global: any;
// declare var require: Function;
//
// collection = require("samchon-collection");
// let cont: collection.ArrayCollection<string> = new collection.ArrayCollection<string>();
// </code>
//
// Those declaration of global and require can be substituted by using "node.d.ts"
// ------------------------------------------------------------------------------------
/// <reference path="../samchon-framework/samchon-framework.d.ts" />
declare var collection: typeof samchon.collection;

View File

@@ -0,0 +1,7 @@
/// <reference path="samchon-framework.d.ts" />
declare var global: any;
declare var require: any;
global["samchon"] = require("samchon-framework");
console.log(samchon);

2710
samchon-framework/samchon-framework.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
/// <reference path="samchon-library.d.ts" />
declare var global: any;
declare var require: (name: string) => any;
library = require("samchon-library");
console.log(library);

23
samchon-library/samchon-library.d.ts vendored Normal file
View File

@@ -0,0 +1,23 @@
// Type definitions for Samchon Library v0.0.2
// Project: https://github.com/samchon/framework
// Definitions by: Jeongho Nam <http://samchon.org>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// ------------------------------------------------------------------------------------
// In Samchon Collection, merging multiple 'ts' files to a module is not possible yet.
// Instead of using "import" instruction, use such trick:
//
// <code>
// declare var global: any;
// declare var require: Function;
//
// library = require("samchon-library");
// let xml: library.XML = new library.XML();
// </code>
//
// Those declaration of global and require can be substituted by using "node.d.ts"
// ------------------------------------------------------------------------------------
/// <reference path="../samchon-framework/samchon-framework.d.ts" />
declare var library: typeof samchon.library;

View File

@@ -841,6 +841,10 @@ User.schema( 'special' ).create( { age : 3 }, { logging : function( ) {} } );
User.getTableName();
User.addScope('lowAccess', { where : { parent_id : 2 } });
User.addScope('lowAccess', function() { } );
User.addScope('lowAccess', { where : { parent_id : 2 } }, { override: true });
User.scope( 'lowAccess' ).count();
User.scope( { where : { parent_id : 2 } } );
@@ -884,6 +888,10 @@ User.findAll( { include : [User], order : [['id', 'ASC NULLS LAST'], [User, 'id'
User.findAll( { include : [{ model : User, where : { title : 'DoDat' }, include : [{ model : User }] }] } );
User.findAll( { attributes: ['username', 'data']});
User.findAll( { attributes: {include: ['username', 'data']} });
User.findAll( { attributes: [['username', 'UNM'], ['email', 'EML']] });
User.findAll( { attributes: [s.fn('count', Sequelize.col('*'))] });
User.findAll( { attributes: [[s.fn('count', Sequelize.col('*')), 'count']] });
User.findAll( { attributes: [[s.fn('count', Sequelize.col('*')), 'count']], group: ['sex'] });
User.findById( 'a string' );

View File

@@ -2948,6 +2948,18 @@ declare module "sequelize" {
}
/**
* AddScope Options for Model.addScope
*/
interface AddScopeOptions {
/**
* If a scope of the same name already exists, should it be overwritten?
*/
override: boolean;
}
/**
* Scope Options for Model.scope
*/
@@ -3121,7 +3133,7 @@ declare module "sequelize" {
* `Sequelize.literal`, `Sequelize.fn` and so on), and the second is the name you want the attribute to
* have in the returned instance
*/
attributes? : Array<string> | { include?: Array<string>, exclude?: Array<string> };
attributes?: Array<string | fn | [string, string] | [fn, string]> | { include?: Array<string>, exclude?: Array<string> };
/**
* If true, only non-deleted records will be returned. If false, both deleted and non-deleted records will
@@ -3182,6 +3194,12 @@ declare module "sequelize" {
*/
having? : WhereOptions;
/**
* Group by. It is not mentioned in sequelize's JSDoc, but mentioned in docs.
* https://github.com/sequelize/sequelize/blob/master/docs/docs/models-usage.md#user-content-manipulating-the-dataset-with-limit-offset-order-and-group
*/
group?: string | string[] | Object;
}
/**
@@ -3640,6 +3658,18 @@ declare module "sequelize" {
*/
getTableName( options? : { logging : Function } ) : string | Object;
/**
* Add a new scope to the model. This is especially useful for adding scopes with includes, when the model you want to include is not available at the time this model is defined.
*
* By default this will throw an error if a scope with that name already exists. Pass `override: true` in the options object to silence this error.
*
* @param {String} name The name of the scope. Use `defaultScope` to override the default scope
* @param {Object|Function} scope
* @param {Object} [options]
* @param {Boolean} [options.override=false]
*/
addScope( name : string, scope : FindOptions | Function, options? : AddScopeOptions ): void;
/**
* Apply a scope created in `define` to the model. First let's look at how to create scopes:
* ```js
@@ -6162,4 +6192,4 @@ declare module "sequelize" {
export = sequelize;
}
}

View File

@@ -0,0 +1,15 @@
// Tests for serialport.d.ts
// Project: https://github.com/EmergingTechnologyAdvisors/node-serialport
// Definitions by: Jeremy Foster <https://github.com/codefoster>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Tests taken from documentation samples.
/// <reference path="serialport.d.ts" />
import * as serialport from 'serialport';
this.port = new serialport.SerialPort("", {
baudrate: 0,
disconnectedCallback: function () { },
parser: serialport.parsers.readline("\n")
});

39
serialport/serialport.d.ts vendored Normal file
View File

@@ -0,0 +1,39 @@
// Type definitions for serialport
// Project: https://github.com/EmergingTechnologyAdvisors/node-serialport
// Definitions by: Jeremy Foster <https://github.com/codefoster>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'serialport' {
module parsers {
function readline(delimiter: string):void;
}
export class SerialPort {
constructor(path: string, options?: Object, openImmediately?: boolean, callback?: () => {})
isOpen: boolean;
on(event: string, callback?: (data?:any) => void):void;
open(callback?: () => void):void;
write(buffer: any, callback?: () => void):void
pause():void;
resume():void;
disconnected(err: Error):void;
close(callback?: () => void):void;
flush(callback?: () => void):void;
set(options: setOptions, callback: () => void):void;
drain(callback?: () => void):void;
update(options: updateOptions, callback?: () => void):void;
list(callback?: () => void):void;
}
interface setOptions {
brk?: boolean;
cts?: boolean;
dsr?: boolean;
dtr?: boolean;
rts?: boolean;
}
interface updateOptions {
baudRate?: number
}
}

View File

@@ -6946,8 +6946,8 @@ declare namespace SP {
set_label(value: string): void;
get_termGuid(): SP.Guid;
set_termGuid(value: SP.Guid): void;
get_wssId(): SP.Guid;
set_wssId(value: SP.Guid): void;
get_wssId(): number;
set_wssId(value: number): void;
}
export class MobileTaxonomyField extends SP.ClientObject {

View File

@@ -14,9 +14,9 @@ declare namespace svgjs {
}
export interface Element {
draggable(): Element
draggable(obj: Object):Element
fixed(): Element
draggable(): this
draggable(obj: Object): this
fixed(): this
beforedrag: (event: MouseEvent) => any
dragstart: (delta: draggable.DragDelta, event: MouseEvent) => any
dragmove: (delta: draggable.DragDelta, event: MouseEvent) => any

2
threejs/three.d.ts vendored
View File

@@ -4165,7 +4165,7 @@ declare namespace THREE {
applyMatrix4(m: Matrix4): Vector3;
applyProjection(m: Matrix4): Vector3;
applyQuaternion(q: Quaternion): Vector3;
project(camrea: Camera): Vector3;
project(camera: Camera): Vector3;
unproject(camera: Camera): Vector3;
transformDirection(m: Matrix4): Vector3;
divide(v: Vector3): Vector3;

File diff suppressed because it is too large Load Diff

2
yamljs/yamljs.d.ts vendored
View File

@@ -6,6 +6,8 @@
declare namespace YAML {
function load(path: string): any;
function load(path: string, callback: (res:any) => void): void
function stringify(nativeObject: any, inline?: number, spaces?: number): string;
function parse(yamlString: string): any;