mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Merge commit 'upstream/master~600' into merge_7_25
This commit is contained in:
commit
5d004be8ba
@ -55,6 +55,18 @@ myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material.
|
||||
$scope['confirmDialog'] = () => {
|
||||
$mdDialog.show($mdDialog.confirm().htmlContent('<span>Confirm!</span>'));
|
||||
};
|
||||
$scope['promptDialog'] = () => {
|
||||
$mdDialog.show($mdDialog.prompt().textContent('Prompt!'));
|
||||
};
|
||||
$scope['promptDialog'] = () => {
|
||||
$mdDialog.show($mdDialog.prompt().htmlContent('<span>Prompt!</span>'));
|
||||
};
|
||||
$scope['promptDialog'] = () => {
|
||||
$mdDialog.show($mdDialog.prompt().cancel('Prompt "Cancel" button text'));
|
||||
};
|
||||
$scope['promptDialog'] = () => {
|
||||
$mdDialog.show($mdDialog.prompt().placeholder('Prompt input placeholder text'));
|
||||
};
|
||||
$scope['hideDialog'] = $mdDialog.hide.bind($mdDialog, 'hide');
|
||||
$scope['cancelDialog'] = $mdDialog.cancel.bind($mdDialog, 'cancel');
|
||||
});
|
||||
|
||||
8
angular-material/index.d.ts
vendored
8
angular-material/index.d.ts
vendored
@ -3,8 +3,6 @@
|
||||
// Definitions by: Matt Traynham <https://github.com/mtraynham>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="angular" />
|
||||
|
||||
import * as angular from 'angular';
|
||||
|
||||
declare module 'angular' {
|
||||
@ -64,6 +62,11 @@ declare module 'angular' {
|
||||
cancel(cancel: string): IConfirmDialog;
|
||||
}
|
||||
|
||||
interface IPromptDialog extends IPresetDialog<IPromptDialog> {
|
||||
cancel(cancel: string): IPromptDialog;
|
||||
placeholder(placeholder: string): IPromptDialog;
|
||||
}
|
||||
|
||||
interface IDialogOptions {
|
||||
templateUrl?: string;
|
||||
template?: string;
|
||||
@ -94,6 +97,7 @@ declare module 'angular' {
|
||||
show(dialog: IDialogOptions | IAlertDialog | IConfirmDialog): angular.IPromise<any>;
|
||||
confirm(): IConfirmDialog;
|
||||
alert(): IAlertDialog;
|
||||
prompt(): IPromptDialog;
|
||||
hide(response?: any): angular.IPromise<any>;
|
||||
cancel(response?: any): void;
|
||||
}
|
||||
|
||||
6
angular-ui-bootstrap/index.d.ts
vendored
6
angular-ui-bootstrap/index.d.ts
vendored
@ -379,6 +379,12 @@ declare module 'angular' {
|
||||
* @default 'model-open'
|
||||
*/
|
||||
openedClass?: string;
|
||||
|
||||
/**
|
||||
* CSS class(es) to be added to the top modal window.
|
||||
*/
|
||||
|
||||
windowTopClass?: string;
|
||||
}
|
||||
|
||||
interface IModalStackService {
|
||||
|
||||
51
angular/angular-component-router.d.ts
vendored
51
angular/angular-component-router.d.ts
vendored
@ -427,4 +427,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[];
|
||||
}
|
||||
}
|
||||
|
||||
44
angular/index.d.ts
vendored
44
angular/index.d.ts
vendored
@ -1658,50 +1658,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)
|
||||
*/
|
||||
|
||||
2
async/index.d.ts
vendored
2
async/index.d.ts
vendored
@ -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; }
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
3
bezier-js/bezier-js.d.ts
vendored
3
bezier-js/bezier-js.d.ts
vendored
@ -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;
|
||||
|
||||
6
bingmaps/index.d.ts
vendored
6
bingmaps/index.d.ts
vendored
@ -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;
|
||||
|
||||
13
core-js/index.d.ts
vendored
13
core-js/index.d.ts
vendored
@ -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.
|
||||
|
||||
@ -13,6 +13,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);
|
||||
}
|
||||
|
||||
2
dagre-d3/index.d.ts
vendored
2
dagre-d3/index.d.ts
vendored
@ -25,7 +25,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;
|
||||
}
|
||||
|
||||
1
es6-shim/index.d.ts
vendored
1
es6-shim/index.d.ts
vendored
@ -582,6 +582,7 @@ interface Set<T> {
|
||||
entries(): IterableIteratorShim<[T, T]>;
|
||||
keys(): IterableIteratorShim<T>;
|
||||
values(): IterableIteratorShim<T>;
|
||||
'_es6-shim iterator_'(): IterableIteratorShim<T>;
|
||||
}
|
||||
|
||||
interface SetConstructor {
|
||||
|
||||
@ -0,0 +1,2 @@
|
||||
/// <reference path="express-domain-middleware.d.ts" />
|
||||
import fn = require('express-domain-middleware');
|
||||
12
express-domain-middleware/express-domain-middleware.d.ts
vendored
Normal file
12
express-domain-middleware/express-domain-middleware.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
// Type definitions for express-domain-middleware
|
||||
// Project: https://www.npmjs.com/package/express-domain-middleware
|
||||
// Definitions by: Hookclaw <https://github.com/hookclaw>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
|
||||
declare module "express-domain-middleware" {
|
||||
import express = require('express');
|
||||
function e(req: express.Request, res: express.Response, next: express.NextFunction): any;
|
||||
export = e;
|
||||
}
|
||||
46
fontfaceobserver/fontfaceobserver-tests.ts
Normal file
46
fontfaceobserver/fontfaceobserver-tests.ts
Normal 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');
|
||||
});
|
||||
}
|
||||
1
fontfaceobserver/fontfaceobserver-tests.ts.tscparams
Normal file
1
fontfaceobserver/fontfaceobserver-tests.ts.tscparams
Normal file
@ -0,0 +1 @@
|
||||
--target ES6
|
||||
33
fontfaceobserver/fontfaceobserver.d.ts
vendored
Normal file
33
fontfaceobserver/fontfaceobserver.d.ts
vendored
Normal 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;
|
||||
}
|
||||
64
fullpage.js/fullpage.js-tests.ts
Normal file
64
fullpage.js/fullpage.js-tests.ts
Normal 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
267
fullpage.js/fullpage.js.d.ts
vendored
Normal 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;
|
||||
}
|
||||
2
gapi.auth2/index.d.ts
vendored
2
gapi.auth2/index.d.ts
vendored
@ -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{
|
||||
|
||||
@ -12,9 +12,9 @@ var options = <IGridstackOptions> {
|
||||
};
|
||||
var gridstack:GridStack = $(document).gridstack(options);
|
||||
|
||||
gridstack.add_widget("test", 1, 2, 3, 4, true);
|
||||
gridstack.batch_update();
|
||||
gridstack.cell_height();;
|
||||
gridstack.cell_height(2);
|
||||
gridstack.cell_width();
|
||||
gridstack.get_cell_from_pixel(<MousePosition>{ left:20, top: 20 });
|
||||
gridstack.addWidget("test", 1, 2, 3, 4, true);
|
||||
gridstack.batchUpdate();
|
||||
gridstack.cellHeight();;
|
||||
gridstack.cellHeight(2);
|
||||
gridstack.cellWidth();
|
||||
gridstack.getCellFromPixel(<MousePosition>{ left:20, top: 20 });
|
||||
|
||||
52
gridstack/index.d.ts
vendored
52
gridstack/index.d.ts
vendored
@ -11,35 +11,35 @@ interface GridStack {
|
||||
/**
|
||||
* Creates new widget and returns it.
|
||||
*
|
||||
* Widget will be always placed even if result height is more than actual grid height. You need to use will_it_fit method before calling add_widget for additional check.
|
||||
* Widget will be always placed even if result height is more than actual grid height. You need to use willItFit method before calling addWidget for additional check.
|
||||
*
|
||||
* @param {string} el widget to add
|
||||
* @param {number} x widget position x
|
||||
* @param {number} y widget position y
|
||||
* @param {number} width widget dimension width
|
||||
* @param {number} height widget dimension height
|
||||
* @param {boolean} auto_position if true then x, y parameters will be ignored and widget will be places on the first available position
|
||||
* @param {boolean} autoPosition if true then x, y parameters will be ignored and widget will be places on the first available position
|
||||
*/
|
||||
add_widget(el: string, x: number, y: number, width: number, height: number, auto_position: boolean): JQuery
|
||||
addWidget(el: string, x: number, y: number, width: number, height: number, autoPosition: boolean): JQuery
|
||||
/**
|
||||
* Initializes batch updates. You will see no changes until commit method is called.
|
||||
*/
|
||||
batch_update():void
|
||||
batchUpdate():void
|
||||
/**
|
||||
* Gets current cell height.
|
||||
*/
|
||||
cell_height():number
|
||||
cellHeight():number
|
||||
/**
|
||||
* Update current cell height. This method rebuilds an internal CSS style sheet. Note: You can expect performance issues if call this method too often.
|
||||
* @param {number} val the cell height
|
||||
*/
|
||||
cell_height(val:number):void
|
||||
cellHeight(val:number):void
|
||||
/**
|
||||
* Gets current cell width.
|
||||
*/
|
||||
cell_width():number
|
||||
cellWidth():number
|
||||
/**
|
||||
* Finishes batch updates. Updates DOM nodes. You must call it after batch_update.
|
||||
* Finishes batch updates. Updates DOM nodes. You must call it after batchUpdate.
|
||||
*/
|
||||
commit():void
|
||||
/**
|
||||
@ -58,7 +58,7 @@ interface GridStack {
|
||||
* Get the position of the cell under a pixel on screen.
|
||||
* @param {MousePosition} position the position of the pixel to resolve in absolute coordinates, as an object with top and leftproperties
|
||||
*/
|
||||
get_cell_from_pixel(position: MousePosition): CellPosition,
|
||||
getCellFromPixel(position: MousePosition): CellPosition,
|
||||
/*
|
||||
* Checks if specified area is empty.
|
||||
* @param {number} x the position x.
|
||||
@ -66,7 +66,7 @@ interface GridStack {
|
||||
* @param {number} width the width of to check
|
||||
* @param {number} height the height of to check
|
||||
*/
|
||||
is_area_empty(x: number, y: number, width: number, height: number): void
|
||||
isAreaEmpty(x: number, y: number, width: number, height: number): void
|
||||
/*
|
||||
* Locks/unlocks widget.
|
||||
* @param {HTMLElement} el widget to modify.
|
||||
@ -78,13 +78,13 @@ interface GridStack {
|
||||
* @param {HTMLElement} el widget to modify.
|
||||
* @param {number} val A numeric value of the number of columns
|
||||
*/
|
||||
min_width(el: HTMLElement, val: number): void
|
||||
minWidth(el: HTMLElement, val: number): void
|
||||
/*
|
||||
* Set the minHeight for a widget.
|
||||
* @param {HTMLElement} el widget to modify.
|
||||
* @param {number} val A numeric value of the number of rows
|
||||
*/
|
||||
min_height(el: HTMLElement, val: number): void
|
||||
minHeight(el: HTMLElement, val: number): void
|
||||
/*
|
||||
* Enables/Disables moving.
|
||||
* @param {HTMLElement} el widget to modify.
|
||||
@ -102,13 +102,13 @@ interface GridStack {
|
||||
/**
|
||||
* Removes widget from the grid.
|
||||
* @param {HTMLElement} el widget to modify
|
||||
* @param {boolean} detach_node if false DOM node won't be removed from the tree (Optional. Default true).
|
||||
* @param {boolean} detachNode if false DOM node won't be removed from the tree (Optional. Default true).
|
||||
*/
|
||||
remove_widget(el: HTMLElement, detach_node?: boolean): void
|
||||
removeWidget(el: HTMLElement, detachNode?: boolean): void
|
||||
/**
|
||||
* Removes all widgets from the grid.
|
||||
*/
|
||||
remove_all(): void
|
||||
removeAll(): void
|
||||
/**
|
||||
* Changes widget size
|
||||
* @param {HTMLElement} el widget to modify
|
||||
@ -124,9 +124,9 @@ interface GridStack {
|
||||
resizable(el: HTMLElement, val: boolean): void
|
||||
/**
|
||||
* Toggle the grid static state. Also toggle the grid-stack-static class.
|
||||
* @param {boolean} static_value if true the grid become static.
|
||||
* @param {boolean} staticValue if true the grid become static.
|
||||
*/
|
||||
set_static(static_value: boolean): void
|
||||
setStatic(staticValue: boolean): void
|
||||
/**
|
||||
* Updates widget position/size.
|
||||
* @param {HTMLElement} el widget to modify
|
||||
@ -142,9 +142,9 @@ interface GridStack {
|
||||
* @param {number} y new position y. If value is null or undefined it will be ignored.
|
||||
* @param {number} width new dimensions width. If value is null or undefined it will be ignored.
|
||||
* @param {number} height new dimensions height. If value is null or undefined it will be ignored.
|
||||
* @param {boolean} auto_position if true then x, y parameters will be ignored and widget will be places on the first available position
|
||||
* @param {boolean} autoPosition if true then x, y parameters will be ignored and widget will be places on the first available position
|
||||
*/
|
||||
will_it_fit(x: number, y: number, width: number, height: number, auto_position:boolean):boolean
|
||||
willItFit(x: number, y: number, width: number, height: number, autoPosition:boolean):boolean
|
||||
|
||||
|
||||
}
|
||||
@ -181,7 +181,7 @@ interface IGridstackOptions {
|
||||
/**
|
||||
* if true the resizing handles are shown even if the user is not hovering over the widget (default: false)
|
||||
*/
|
||||
always_show_resize_handle: boolean;
|
||||
alwaysShowResizeHandle: boolean;
|
||||
/**
|
||||
* turns animation on (default: true)
|
||||
*/
|
||||
@ -193,7 +193,7 @@ interface IGridstackOptions {
|
||||
/**
|
||||
* one cell height (default: 60)
|
||||
*/
|
||||
cell_height: number;
|
||||
cellHeight: number;
|
||||
/**
|
||||
* allows to override jQuery UI draggable options. (default: { handle: '.grid-stack-item-content', scroll: true, appendTo: 'body' })
|
||||
*/
|
||||
@ -213,15 +213,15 @@ interface IGridstackOptions {
|
||||
/**
|
||||
* widget class (default: 'grid-stack-item')
|
||||
*/
|
||||
item_class: string;
|
||||
itemClass: string;
|
||||
/**
|
||||
* minimal width.If window width is less, grid will be shown in one - column mode (default: 768)
|
||||
*/
|
||||
min_width: number;
|
||||
minWidth: number;
|
||||
/**
|
||||
* class for placeholder (default: 'grid-stack-placeholder')
|
||||
*/
|
||||
placeholder_class: string;
|
||||
placeholderClass: string;
|
||||
/**
|
||||
* allows to override jQuery UI resizable options. (default: { autoHide: true, handles: 'se' })
|
||||
*/
|
||||
@ -229,11 +229,11 @@ interface IGridstackOptions {
|
||||
/**
|
||||
* makes grid static (default false).If true widgets are not movable/ resizable.You don't even need jQueryUI draggable/resizable. A CSS class grid-stack-static is also added to the container.
|
||||
*/
|
||||
static_grid: boolean;
|
||||
staticGrid: boolean;
|
||||
/**
|
||||
* vertical gap size (default: 20)
|
||||
*/
|
||||
vertical_margin: number;
|
||||
verticalMargin: number;
|
||||
/**
|
||||
* amount of columns (default: 12)
|
||||
*/
|
||||
|
||||
2
hapi/index.d.ts
vendored
2
hapi/index.d.ts
vendored
@ -874,7 +874,7 @@ export interface IRouteConfiguration {
|
||||
/** - 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;
|
||||
}
|
||||
|
||||
329
immutable/immutable-tests.ts
Normal file
329
immutable/immutable-tests.ts
Normal 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
2546
immutable/immutable.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2
istanbul-middleware/istanbul-middleware-tests.ts
Normal file
2
istanbul-middleware/istanbul-middleware-tests.ts
Normal file
@ -0,0 +1,2 @@
|
||||
/// <reference path="istanbul-middleware.d.ts" />
|
||||
import i = require('istanbul-middleware');
|
||||
33
istanbul-middleware/istanbul-middleware.d.ts
vendored
Normal file
33
istanbul-middleware/istanbul-middleware.d.ts
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
// Type definitions for istanbul-middleware
|
||||
// Project: https://www.npmjs.com/package/istanbul-middleware
|
||||
// Definitions by: Hookclaw <https://github.com/hookclaw>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
|
||||
declare module "istanbul-middleware" {
|
||||
import * as express from "express";
|
||||
|
||||
type Matcher = (file:string)=> boolean;
|
||||
type PostLoadHookFn = (file:any)=> {};
|
||||
type PostLoadHook = (matcherfn:Matcher,transformer:any,verbose:boolean)=>PostLoadHookFn;
|
||||
|
||||
export function hookLoader(matcherOrRoot:Matcher|string, opts?:{
|
||||
postLoadHook?:PostLoadHook,
|
||||
verbose?:boolean
|
||||
//and istanbul.Instrumenter(...opts)
|
||||
}): void;
|
||||
|
||||
export function createHandler(opts?:{
|
||||
resetOnGet?:boolean
|
||||
}): any;
|
||||
|
||||
type ClientMatcher = (req:express.Request)=> boolean;
|
||||
type PathTransformer = (req:express.Request)=> string;
|
||||
|
||||
export function createClientHandler(root:string,opts?:{
|
||||
matcher?:ClientMatcher,
|
||||
pathTransformer?:PathTransformer,
|
||||
verbose?:boolean
|
||||
}): any;
|
||||
}
|
||||
189
joi/index.d.ts
vendored
189
joi/index.d.ts
vendored
@ -492,11 +492,11 @@ export interface ArraySchema extends AnySchema<ArraySchema> {
|
||||
* @param type - a joi schema object to validate against each array item in sequence order. type can be an array of values, or multiple values can be passed as individual arguments.
|
||||
* If a given type is .required() then there must be a matching item with the same index position in the array. Errors will contain the number of items that didn't match. Any unmatched item having a label will be mentioned explicitly.
|
||||
*/
|
||||
ordered(type: Schema, ...types: Schema[]): ArraySchema;
|
||||
ordered(type: Schema, ...types: Schema[]): ArraySchema;
|
||||
|
||||
/**
|
||||
* Specifies the minimum number of items in the array.
|
||||
*/
|
||||
/**
|
||||
* Specifies the minimum number of items in the array.
|
||||
*/
|
||||
min(limit: number): ArraySchema;
|
||||
|
||||
/**
|
||||
@ -692,72 +692,99 @@ export interface DateSchema extends AnySchema<DateSchema> {
|
||||
iso(): DateSchema;
|
||||
|
||||
|
||||
/**
|
||||
* Requires the value to be a timestamp interval from Unix Time.
|
||||
* @param type - the type of timestamp (allowed values are unix or javascript [default])
|
||||
*/
|
||||
timestamp(type?: 'javascript' | 'unix'): DateSchema;
|
||||
/**
|
||||
* Requires the value to be a timestamp interval from Unix Time.
|
||||
* @param type - the type of timestamp (allowed values are unix or javascript [default])
|
||||
*/
|
||||
timestamp(type?: 'javascript' | 'unix'): DateSchema;
|
||||
}
|
||||
|
||||
export interface FunctionSchema extends AnySchema<FunctionSchema> {
|
||||
|
||||
/**
|
||||
* Specifies the arity of the function where:
|
||||
* @param n - the arity expected.
|
||||
*/
|
||||
arity(n: number): FunctionSchema;
|
||||
/**
|
||||
* Specifies the arity of the function where:
|
||||
* @param n - the arity expected.
|
||||
*/
|
||||
arity(n: number): FunctionSchema;
|
||||
|
||||
|
||||
/**
|
||||
* Specifies the minimal arity of the function where:
|
||||
* @param n - the minimal arity expected.
|
||||
*/
|
||||
minArity(n: number): FunctionSchema;
|
||||
/**
|
||||
* Specifies the minimal arity of the function where:
|
||||
* @param n - the minimal arity expected.
|
||||
*/
|
||||
minArity(n: number): FunctionSchema;
|
||||
|
||||
|
||||
/**
|
||||
* Specifies the minimal arity of the function where:
|
||||
* @param n - the minimal arity expected.
|
||||
*/
|
||||
maxArity(n: number): FunctionSchema;
|
||||
/**
|
||||
* Specifies the minimal arity of the function where:
|
||||
* @param n - the minimal arity expected.
|
||||
*/
|
||||
maxArity(n: number): FunctionSchema;
|
||||
|
||||
/**
|
||||
* Requires the function to be a Joi reference.
|
||||
*/
|
||||
ref(): FunctionSchema;
|
||||
/**
|
||||
* Requires the function to be a Joi reference.
|
||||
*/
|
||||
ref(): FunctionSchema;
|
||||
}
|
||||
|
||||
export interface AlternativesSchema extends AnySchema<FunctionSchema> {
|
||||
try(schemas: Schema[]): AlternativesSchema;
|
||||
when<T>(ref: string, options: WhenOptions<T>): AlternativesSchema;
|
||||
when<T>(ref: Reference, options: WhenOptions<T>): AlternativesSchema;
|
||||
}
|
||||
}
|
||||
|
||||
export interface Terms {
|
||||
value: any;
|
||||
state: {
|
||||
key: string,
|
||||
path: string,
|
||||
parent: any
|
||||
};
|
||||
options: ValidationOptions;
|
||||
}
|
||||
export interface Terms {
|
||||
value: any;
|
||||
state: {
|
||||
key: string,
|
||||
path: string,
|
||||
parent: any
|
||||
};
|
||||
options: ValidationOptions;
|
||||
}
|
||||
|
||||
export interface Rules {
|
||||
name: string;
|
||||
params?: ObjectSchema | { [key: string]: Schema };
|
||||
setup?: Function;
|
||||
validate?: Function;
|
||||
description: string | Function;
|
||||
}
|
||||
export interface Rules {
|
||||
name: string;
|
||||
params?: ObjectSchema | { [key: string]: Schema };
|
||||
setup?: Function;
|
||||
validate?: Function;
|
||||
description: string | Function;
|
||||
}
|
||||
|
||||
export interface Extension {
|
||||
name: string;
|
||||
base?: Schema;
|
||||
pre?: Function;
|
||||
language?: {};
|
||||
describe?: Function;
|
||||
rules?: Rules[];
|
||||
export interface Extension {
|
||||
name: string;
|
||||
base?: Schema;
|
||||
pre?: Function;
|
||||
language?: {};
|
||||
describe?: Function;
|
||||
rules?: Rules[];
|
||||
}
|
||||
|
||||
export interface Terms {
|
||||
value: any;
|
||||
state: {
|
||||
key: string,
|
||||
path: string,
|
||||
parent: any
|
||||
};
|
||||
options: ValidationOptions;
|
||||
}
|
||||
|
||||
export interface Rules {
|
||||
name: string;
|
||||
params?: ObjectSchema | { [key: string]: Schema };
|
||||
setup?: Function;
|
||||
validate?: Function;
|
||||
description: string | Function;
|
||||
}
|
||||
|
||||
export interface Extension {
|
||||
name: string;
|
||||
base?: Schema;
|
||||
pre?: Function;
|
||||
language?: {};
|
||||
describe?: Function;
|
||||
rules?: Rules[];
|
||||
}
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
@ -844,29 +871,57 @@ export declare function assert(value: any, schema: Schema, message?: string | Er
|
||||
* @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(value: any, schema: Schema, message?: string | Error): void;
|
||||
|
||||
|
||||
/**
|
||||
* Generates a reference to the value of the named key.
|
||||
/**
|
||||
* Validates a value against a schema, returns valid object, and throws if validation fails where:
|
||||
*
|
||||
* @param value - the value to validate.
|
||||
* @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<T>(value: T, schema: Schema, message?: string | Error): T;
|
||||
|
||||
|
||||
/**
|
||||
* Generates a reference to the value of the named key.
|
||||
*/
|
||||
export declare function ref(key: string, options?: ReferenceOptions): Reference;
|
||||
|
||||
|
||||
/**
|
||||
* Checks whether or not the provided argument is a reference. It's especially useful if you want to post-process error messages.
|
||||
*/
|
||||
export function isRef(ref: any): boolean;
|
||||
/**
|
||||
* Checks whether or not the provided argument is a reference. It's especially useful if you want to post-process error messages.
|
||||
*/
|
||||
export function isRef(ref: any): boolean;
|
||||
|
||||
|
||||
/**
|
||||
* Get a sub-schema of an existing schema based on a path. Path separator is a dot (.).
|
||||
*/
|
||||
export function reach(schema: Schema, path: string): Schema;
|
||||
/**
|
||||
* Get a sub-schema of an existing schema based on a path. Path separator is a dot (.).
|
||||
*/
|
||||
export function reach(schema: Schema, path: string): Schema;
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new Joi instance customized with the extension(s) you provide included.
|
||||
*/
|
||||
export function extend(extention: Extension): any;
|
||||
/**
|
||||
* Creates a new Joi instance customized with the extension(s) you provide included.
|
||||
*/
|
||||
export function extend(extention: Extension): any;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Checks whether or not the provided argument is a reference. It's especially useful if you want to post-process error messages.
|
||||
*/
|
||||
export function isRef(ref: any): boolean;
|
||||
|
||||
|
||||
/**
|
||||
* Get a sub-schema of an existing schema based on a path. Path separator is a dot (.).
|
||||
*/
|
||||
export function reach(schema: Schema, path: string): Schema;
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new Joi instance customized with the extension(s) you provide included.
|
||||
*/
|
||||
export function extend(extention: Extension): any;
|
||||
|
||||
5
jquery.pnotify/index.d.ts
vendored
5
jquery.pnotify/index.d.ts
vendored
@ -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;
|
||||
/**
|
||||
|
||||
6
jsonnet/jsonnet-tests.ts
Normal file
6
jsonnet/jsonnet-tests.ts
Normal file
@ -0,0 +1,6 @@
|
||||
/// <reference path="jsonnet.d.ts" />
|
||||
import Jsonnet = require('jsonnet');
|
||||
var jsonnet = new Jsonnet();
|
||||
var code = '{a:1}';
|
||||
var result = jsonnet.eval(code);
|
||||
console.log(result);
|
||||
13
jsonnet/jsonnet.d.ts
vendored
Normal file
13
jsonnet/jsonnet.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
// Type definitions for jsonnet
|
||||
// Project: https://github.com/yosuke-furukawa/node-jsonnet
|
||||
// Definitions by: Hookclaw <https://github.com/hookclaw>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
declare module "jsonnet" {
|
||||
class Jsonnet {
|
||||
constructor();
|
||||
eval(code: string): any;
|
||||
evalFile(): any;
|
||||
destroy(): void;
|
||||
}
|
||||
export = Jsonnet;
|
||||
}
|
||||
2
knex/index.d.ts
vendored
2
knex/index.d.ts
vendored
@ -10,7 +10,7 @@ import * as events from "events";
|
||||
|
||||
type Callback = Function;
|
||||
type Client = Function;
|
||||
type Value = string | number | boolean | Date;
|
||||
type Value = string | number | boolean | Date | Array<string> | Array<number> | Array<Date> | Array<boolean>;
|
||||
type ColumnName = string | Knex.Raw | Knex.QueryBuilder;
|
||||
|
||||
interface Knex extends Knex.QueryInterface {
|
||||
|
||||
116
linq/index.d.ts
vendored
116
linq/index.d.ts
vendored
@ -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>;
|
||||
}
|
||||
|
||||
196
linq/linq.3.0.3-Beta4.d.ts
vendored
196
linq/linq.3.0.3-Beta4.d.ts
vendored
@ -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
276
linq/linq.3.0.4-Beta5.d.ts
vendored
Normal 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;
|
||||
18
linq/linq.jquery.3.0.4-Beta5.d.ts
vendored
Normal file
18
linq/linq.jquery.3.0.4-Beta5.d.ts
vendored
Normal 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>;
|
||||
}
|
||||
353
locutus/locutus-tests.ts
Normal file
353
locutus/locutus-tests.ts
Normal file
@ -0,0 +1,353 @@
|
||||
/// <reference path="locutus.d.ts" />
|
||||
import locutus_c_math_abs = require('locutus/c/math/abs');
|
||||
import locutus_golang_strings_Contains = require('locutus/golang/strings/Contains');
|
||||
import locutus_golang_strings_Count = require('locutus/golang/strings/Count');
|
||||
import locutus_golang_strings_Index = require('locutus/golang/strings/Index');
|
||||
import locutus_golang_strings_LastIndex = require('locutus/golang/strings/LastIndex');
|
||||
import locutus_php_array_array_change_key_case = require('locutus/php/array/array_change_key_case');
|
||||
import locutus_php_array_array_chunk = require('locutus/php/array/array_chunk');
|
||||
import locutus_php_array_array_combine = require('locutus/php/array/array_combine');
|
||||
import locutus_php_array_array_count_values = require('locutus/php/array/array_count_values');
|
||||
import locutus_php_array_array_diff = require('locutus/php/array/array_diff');
|
||||
import locutus_php_array_array_diff_assoc = require('locutus/php/array/array_diff_assoc');
|
||||
import locutus_php_array_array_diff_key = require('locutus/php/array/array_diff_key');
|
||||
import locutus_php_array_array_diff_uassoc = require('locutus/php/array/array_diff_uassoc');
|
||||
import locutus_php_array_array_diff_ukey = require('locutus/php/array/array_diff_ukey');
|
||||
import locutus_php_array_array_fill = require('locutus/php/array/array_fill');
|
||||
import locutus_php_array_array_fill_keys = require('locutus/php/array/array_fill_keys');
|
||||
import locutus_php_array_array_filter = require('locutus/php/array/array_filter');
|
||||
import locutus_php_array_array_flip = require('locutus/php/array/array_flip');
|
||||
import locutus_php_array_array_intersect = require('locutus/php/array/array_intersect');
|
||||
import locutus_php_array_array_intersect_assoc = require('locutus/php/array/array_intersect_assoc');
|
||||
import locutus_php_array_array_intersect_key = require('locutus/php/array/array_intersect_key');
|
||||
import locutus_php_array_array_intersect_uassoc = require('locutus/php/array/array_intersect_uassoc');
|
||||
import locutus_php_array_array_intersect_ukey = require('locutus/php/array/array_intersect_ukey');
|
||||
import locutus_php_array_array_key_exists = require('locutus/php/array/array_key_exists');
|
||||
import locutus_php_array_array_keys = require('locutus/php/array/array_keys');
|
||||
import locutus_php_array_array_map = require('locutus/php/array/array_map');
|
||||
import locutus_php_array_array_merge = require('locutus/php/array/array_merge');
|
||||
import locutus_php_array_array_merge_recursive = require('locutus/php/array/array_merge_recursive');
|
||||
import locutus_php_array_array_multisort = require('locutus/php/array/array_multisort');
|
||||
import locutus_php_array_array_pad = require('locutus/php/array/array_pad');
|
||||
import locutus_php_array_array_pop = require('locutus/php/array/array_pop');
|
||||
import locutus_php_array_array_product = require('locutus/php/array/array_product');
|
||||
import locutus_php_array_array_push = require('locutus/php/array/array_push');
|
||||
import locutus_php_array_array_rand = require('locutus/php/array/array_rand');
|
||||
import locutus_php_array_array_reduce = require('locutus/php/array/array_reduce');
|
||||
import locutus_php_array_array_replace = require('locutus/php/array/array_replace');
|
||||
import locutus_php_array_array_replace_recursive = require('locutus/php/array/array_replace_recursive');
|
||||
import locutus_php_array_array_reverse = require('locutus/php/array/array_reverse');
|
||||
import locutus_php_array_array_search = require('locutus/php/array/array_search');
|
||||
import locutus_php_array_array_shift = require('locutus/php/array/array_shift');
|
||||
import locutus_php_array_array_slice = require('locutus/php/array/array_slice');
|
||||
import locutus_php_array_array_splice = require('locutus/php/array/array_splice');
|
||||
import locutus_php_array_array_sum = require('locutus/php/array/array_sum');
|
||||
import locutus_php_array_array_udiff = require('locutus/php/array/array_udiff');
|
||||
import locutus_php_array_array_udiff_assoc = require('locutus/php/array/array_udiff_assoc');
|
||||
import locutus_php_array_array_udiff_uassoc = require('locutus/php/array/array_udiff_uassoc');
|
||||
import locutus_php_array_array_uintersect = require('locutus/php/array/array_uintersect');
|
||||
import locutus_php_array_array_uintersect_uassoc = require('locutus/php/array/array_uintersect_uassoc');
|
||||
import locutus_php_array_array_unique = require('locutus/php/array/array_unique');
|
||||
import locutus_php_array_array_unshift = require('locutus/php/array/array_unshift');
|
||||
import locutus_php_array_array_values = require('locutus/php/array/array_values');
|
||||
import locutus_php_array_array_walk = require('locutus/php/array/array_walk');
|
||||
import locutus_php_array_arsort = require('locutus/php/array/arsort');
|
||||
import locutus_php_array_asort = require('locutus/php/array/asort');
|
||||
import locutus_php_array_count = require('locutus/php/array/count');
|
||||
import locutus_php_array_current = require('locutus/php/array/current');
|
||||
import locutus_php_array_each = require('locutus/php/array/each');
|
||||
import locutus_php_array_end = require('locutus/php/array/end');
|
||||
import locutus_php_array_in_array = require('locutus/php/array/in_array');
|
||||
import locutus_php_array_key = require('locutus/php/array/key');
|
||||
import locutus_php_array_krsort = require('locutus/php/array/krsort');
|
||||
import locutus_php_array_ksort = require('locutus/php/array/ksort');
|
||||
import locutus_php_array_natcasesort = require('locutus/php/array/natcasesort');
|
||||
import locutus_php_array_natsort = require('locutus/php/array/natsort');
|
||||
import locutus_php_array_next = require('locutus/php/array/next');
|
||||
import locutus_php_array_pos = require('locutus/php/array/pos');
|
||||
import locutus_php_array_prev = require('locutus/php/array/prev');
|
||||
import locutus_php_array_range = require('locutus/php/array/range');
|
||||
import locutus_php_array_reset = require('locutus/php/array/reset');
|
||||
import locutus_php_array_rsort = require('locutus/php/array/rsort');
|
||||
import locutus_php_array_shuffle = require('locutus/php/array/shuffle');
|
||||
import locutus_php_array_sizeof = require('locutus/php/array/sizeof');
|
||||
import locutus_php_array_sort = require('locutus/php/array/sort');
|
||||
import locutus_php_array_uasort = require('locutus/php/array/uasort');
|
||||
import locutus_php_array_uksort = require('locutus/php/array/uksort');
|
||||
import locutus_php_array_usort = require('locutus/php/array/usort');
|
||||
import locutus_php_bc_bcadd = require('locutus/php/bc/bcadd');
|
||||
import locutus_php_bc_bccomp = require('locutus/php/bc/bccomp');
|
||||
import locutus_php_bc_bcdiv = require('locutus/php/bc/bcdiv');
|
||||
import locutus_php_bc_bcmul = require('locutus/php/bc/bcmul');
|
||||
import locutus_php_bc_bcround = require('locutus/php/bc/bcround');
|
||||
import locutus_php_bc_bcscale = require('locutus/php/bc/bcscale');
|
||||
import locutus_php_bc_bcsub = require('locutus/php/bc/bcsub');
|
||||
import locutus_php_ctype_ctype_alnum = require('locutus/php/ctype/ctype_alnum');
|
||||
import locutus_php_ctype_ctype_alpha = require('locutus/php/ctype/ctype_alpha');
|
||||
import locutus_php_ctype_ctype_cntrl = require('locutus/php/ctype/ctype_cntrl');
|
||||
import locutus_php_ctype_ctype_digit = require('locutus/php/ctype/ctype_digit');
|
||||
import locutus_php_ctype_ctype_graph = require('locutus/php/ctype/ctype_graph');
|
||||
import locutus_php_ctype_ctype_lower = require('locutus/php/ctype/ctype_lower');
|
||||
import locutus_php_ctype_ctype_print = require('locutus/php/ctype/ctype_print');
|
||||
import locutus_php_ctype_ctype_punct = require('locutus/php/ctype/ctype_punct');
|
||||
import locutus_php_ctype_ctype_space = require('locutus/php/ctype/ctype_space');
|
||||
import locutus_php_ctype_ctype_upper = require('locutus/php/ctype/ctype_upper');
|
||||
import locutus_php_ctype_ctype_xdigit = require('locutus/php/ctype/ctype_xdigit');
|
||||
import locutus_php_datetime_checkdate = require('locutus/php/datetime/checkdate');
|
||||
import locutus_php_datetime_date = require('locutus/php/datetime/date');
|
||||
import locutus_php_datetime_date_parse = require('locutus/php/datetime/date_parse');
|
||||
import locutus_php_datetime_getdate = require('locutus/php/datetime/getdate');
|
||||
import locutus_php_datetime_gettimeofday = require('locutus/php/datetime/gettimeofday');
|
||||
import locutus_php_datetime_gmdate = require('locutus/php/datetime/gmdate');
|
||||
import locutus_php_datetime_gmmktime = require('locutus/php/datetime/gmmktime');
|
||||
import locutus_php_datetime_gmstrftime = require('locutus/php/datetime/gmstrftime');
|
||||
import locutus_php_datetime_idate = require('locutus/php/datetime/idate');
|
||||
import locutus_php_datetime_microtime = require('locutus/php/datetime/microtime');
|
||||
import locutus_php_datetime_mktime = require('locutus/php/datetime/mktime');
|
||||
import locutus_php_datetime_strftime = require('locutus/php/datetime/strftime');
|
||||
import locutus_php_datetime_strptime = require('locutus/php/datetime/strptime');
|
||||
import locutus_php_datetime_strtotime = require('locutus/php/datetime/strtotime');
|
||||
import locutus_php_datetime_time = require('locutus/php/datetime/time');
|
||||
import locutus_php_exec_escapeshellarg = require('locutus/php/exec/escapeshellarg');
|
||||
import locutus_php_filesystem_basename = require('locutus/php/filesystem/basename');
|
||||
import locutus_php_filesystem_dirname = require('locutus/php/filesystem/dirname');
|
||||
import locutus_php_filesystem_file_get_contents = require('locutus/php/filesystem/file_get_contents');
|
||||
import locutus_php_filesystem_pathinfo = require('locutus/php/filesystem/pathinfo');
|
||||
import locutus_php_filesystem_realpath = require('locutus/php/filesystem/realpath');
|
||||
import locutus_php_funchand_call_user_func = require('locutus/php/funchand/call_user_func');
|
||||
import locutus_php_funchand_call_user_func_array = require('locutus/php/funchand/call_user_func_array');
|
||||
import locutus_php_funchand_create_function = require('locutus/php/funchand/create_function');
|
||||
import locutus_php_funchand_function_exists = require('locutus/php/funchand/function_exists');
|
||||
import locutus_php_funchand_get_defined_functions = require('locutus/php/funchand/get_defined_functions');
|
||||
import locutus_php_i18n_i18n_loc_get_default = require('locutus/php/i18n/i18n_loc_get_default');
|
||||
import locutus_php_i18n_i18n_loc_set_default = require('locutus/php/i18n/i18n_loc_set_default');
|
||||
import locutus_php_info_assert_options = require('locutus/php/info/assert_options');
|
||||
import locutus_php_info_getenv = require('locutus/php/info/getenv');
|
||||
import locutus_php_info_ini_get = require('locutus/php/info/ini_get');
|
||||
import locutus_php_info_ini_set = require('locutus/php/info/ini_set');
|
||||
import locutus_php_info_set_time_limit = require('locutus/php/info/set_time_limit');
|
||||
import locutus_php_info_version_compare = require('locutus/php/info/version_compare');
|
||||
import locutus_php_json_json_decode = require('locutus/php/json/json_decode');
|
||||
import locutus_php_json_json_encode = require('locutus/php/json/json_encode');
|
||||
import locutus_php_json_json_last_error = require('locutus/php/json/json_last_error');
|
||||
import locutus_php_math_abs = require('locutus/php/math/abs');
|
||||
import locutus_php_math_acos = require('locutus/php/math/acos');
|
||||
import locutus_php_math_acosh = require('locutus/php/math/acosh');
|
||||
import locutus_php_math_asin = require('locutus/php/math/asin');
|
||||
import locutus_php_math_asinh = require('locutus/php/math/asinh');
|
||||
import locutus_php_math_atan = require('locutus/php/math/atan');
|
||||
import locutus_php_math_atan2 = require('locutus/php/math/atan2');
|
||||
import locutus_php_math_atanh = require('locutus/php/math/atanh');
|
||||
import locutus_php_math_base_convert = require('locutus/php/math/base_convert');
|
||||
import locutus_php_math_bindec = require('locutus/php/math/bindec');
|
||||
import locutus_php_math_ceil = require('locutus/php/math/ceil');
|
||||
import locutus_php_math_cos = require('locutus/php/math/cos');
|
||||
import locutus_php_math_cosh = require('locutus/php/math/cosh');
|
||||
import locutus_php_math_decbin = require('locutus/php/math/decbin');
|
||||
import locutus_php_math_dechex = require('locutus/php/math/dechex');
|
||||
import locutus_php_math_decoct = require('locutus/php/math/decoct');
|
||||
import locutus_php_math_deg2rad = require('locutus/php/math/deg2rad');
|
||||
import locutus_php_math_exp = require('locutus/php/math/exp');
|
||||
import locutus_php_math_expm1 = require('locutus/php/math/expm1');
|
||||
import locutus_php_math_floor = require('locutus/php/math/floor');
|
||||
import locutus_php_math_fmod = require('locutus/php/math/fmod');
|
||||
import locutus_php_math_getrandmax = require('locutus/php/math/getrandmax');
|
||||
import locutus_php_math_hexdec = require('locutus/php/math/hexdec');
|
||||
import locutus_php_math_hypot = require('locutus/php/math/hypot');
|
||||
import locutus_php_math_is_finite = require('locutus/php/math/is_finite');
|
||||
import locutus_php_math_is_infinite = require('locutus/php/math/is_infinite');
|
||||
import locutus_php_math_is_nan = require('locutus/php/math/is_nan');
|
||||
import locutus_php_math_lcg_value = require('locutus/php/math/lcg_value');
|
||||
import locutus_php_math_log = require('locutus/php/math/log');
|
||||
import locutus_php_math_log10 = require('locutus/php/math/log10');
|
||||
import locutus_php_math_log1p = require('locutus/php/math/log1p');
|
||||
import locutus_php_math_max = require('locutus/php/math/max');
|
||||
import locutus_php_math_min = require('locutus/php/math/min');
|
||||
import locutus_php_math_mt_getrandmax = require('locutus/php/math/mt_getrandmax');
|
||||
import locutus_php_math_mt_rand = require('locutus/php/math/mt_rand');
|
||||
import locutus_php_math_octdec = require('locutus/php/math/octdec');
|
||||
import locutus_php_math_pi = require('locutus/php/math/pi');
|
||||
import locutus_php_math_pow = require('locutus/php/math/pow');
|
||||
import locutus_php_math_rad2deg = require('locutus/php/math/rad2deg');
|
||||
import locutus_php_math_rand = require('locutus/php/math/rand');
|
||||
import locutus_php_math_round = require('locutus/php/math/round');
|
||||
import locutus_php_math_sin = require('locutus/php/math/sin');
|
||||
import locutus_php_math_sinh = require('locutus/php/math/sinh');
|
||||
import locutus_php_math_sqrt = require('locutus/php/math/sqrt');
|
||||
import locutus_php_math_tan = require('locutus/php/math/tan');
|
||||
import locutus_php_math_tanh = require('locutus/php/math/tanh');
|
||||
import locutus_php_misc_pack = require('locutus/php/misc/pack');
|
||||
import locutus_php_misc_uniqid = require('locutus/php/misc/uniqid');
|
||||
import locutus_php_net_gopher_gopher_parsedir = require('locutus/php/net-gopher/gopher_parsedir');
|
||||
import locutus_php_network_inet_ntop = require('locutus/php/network/inet_ntop');
|
||||
import locutus_php_network_inet_pton = require('locutus/php/network/inet_pton');
|
||||
import locutus_php_network_ip2long = require('locutus/php/network/ip2long');
|
||||
import locutus_php_network_long2ip = require('locutus/php/network/long2ip');
|
||||
import locutus_php_network_setcookie = require('locutus/php/network/setcookie');
|
||||
import locutus_php_network_setrawcookie = require('locutus/php/network/setrawcookie');
|
||||
import locutus_php_pcre_preg_quote = require('locutus/php/pcre/preg_quote');
|
||||
import locutus_php_pcre_sql_regcase = require('locutus/php/pcre/sql_regcase');
|
||||
import locutus_php_strings_addcslashes = require('locutus/php/strings/addcslashes');
|
||||
import locutus_php_strings_addslashes = require('locutus/php/strings/addslashes');
|
||||
import locutus_php_strings_bin2hex = require('locutus/php/strings/bin2hex');
|
||||
import locutus_php_strings_chop = require('locutus/php/strings/chop');
|
||||
import locutus_php_strings_chr = require('locutus/php/strings/chr');
|
||||
import locutus_php_strings_chunk_split = require('locutus/php/strings/chunk_split');
|
||||
import locutus_php_strings_convert_cyr_string = require('locutus/php/strings/convert_cyr_string');
|
||||
import locutus_php_strings_convert_uuencode = require('locutus/php/strings/convert_uuencode');
|
||||
import locutus_php_strings_count_chars = require('locutus/php/strings/count_chars');
|
||||
import locutus_php_strings_crc32 = require('locutus/php/strings/crc32');
|
||||
import locutus_php_strings_echo = require('locutus/php/strings/echo');
|
||||
import locutus_php_strings_explode = require('locutus/php/strings/explode');
|
||||
import locutus_php_strings_get_html_translation_table = require('locutus/php/strings/get_html_translation_table');
|
||||
import locutus_php_strings_hex2bin = require('locutus/php/strings/hex2bin');
|
||||
import locutus_php_strings_html_entity_decode = require('locutus/php/strings/html_entity_decode');
|
||||
import locutus_php_strings_htmlentities = require('locutus/php/strings/htmlentities');
|
||||
import locutus_php_strings_htmlspecialchars = require('locutus/php/strings/htmlspecialchars');
|
||||
import locutus_php_strings_htmlspecialchars_decode = require('locutus/php/strings/htmlspecialchars_decode');
|
||||
import locutus_php_strings_implode = require('locutus/php/strings/implode');
|
||||
import locutus_php_strings_join = require('locutus/php/strings/join');
|
||||
import locutus_php_strings_lcfirst = require('locutus/php/strings/lcfirst');
|
||||
import locutus_php_strings_levenshtein = require('locutus/php/strings/levenshtein');
|
||||
import locutus_php_strings_localeconv = require('locutus/php/strings/localeconv');
|
||||
import locutus_php_strings_ltrim = require('locutus/php/strings/ltrim');
|
||||
import locutus_php_strings_md5 = require('locutus/php/strings/md5');
|
||||
import locutus_php_strings_md5_file = require('locutus/php/strings/md5_file');
|
||||
import locutus_php_strings_metaphone = require('locutus/php/strings/metaphone');
|
||||
import locutus_php_strings_money_format = require('locutus/php/strings/money_format');
|
||||
import locutus_php_strings_nl2br = require('locutus/php/strings/nl2br');
|
||||
import locutus_php_strings_nl_langinfo = require('locutus/php/strings/nl_langinfo');
|
||||
import locutus_php_strings_number_format = require('locutus/php/strings/number_format');
|
||||
import locutus_php_strings_ord = require('locutus/php/strings/ord');
|
||||
import locutus_php_strings_parse_str = require('locutus/php/strings/parse_str');
|
||||
import locutus_php_strings_printf = require('locutus/php/strings/printf');
|
||||
import locutus_php_strings_quoted_printable_decode = require('locutus/php/strings/quoted_printable_decode');
|
||||
import locutus_php_strings_quoted_printable_encode = require('locutus/php/strings/quoted_printable_encode');
|
||||
import locutus_php_strings_quotemeta = require('locutus/php/strings/quotemeta');
|
||||
import locutus_php_strings_rtrim = require('locutus/php/strings/rtrim');
|
||||
import locutus_php_strings_setlocale = require('locutus/php/strings/setlocale');
|
||||
import locutus_php_strings_sha1 = require('locutus/php/strings/sha1');
|
||||
import locutus_php_strings_sha1_file = require('locutus/php/strings/sha1_file');
|
||||
import locutus_php_strings_similar_text = require('locutus/php/strings/similar_text');
|
||||
import locutus_php_strings_soundex = require('locutus/php/strings/soundex');
|
||||
import locutus_php_strings_split = require('locutus/php/strings/split');
|
||||
import locutus_php_strings_sprintf = require('locutus/php/strings/sprintf');
|
||||
import locutus_php_strings_sscanf = require('locutus/php/strings/sscanf');
|
||||
import locutus_php_strings_str_getcsv = require('locutus/php/strings/str_getcsv');
|
||||
import locutus_php_strings_str_ireplace = require('locutus/php/strings/str_ireplace');
|
||||
import locutus_php_strings_str_pad = require('locutus/php/strings/str_pad');
|
||||
import locutus_php_strings_str_repeat = require('locutus/php/strings/str_repeat');
|
||||
import locutus_php_strings_str_replace = require('locutus/php/strings/str_replace');
|
||||
import locutus_php_strings_str_rot13 = require('locutus/php/strings/str_rot13');
|
||||
import locutus_php_strings_str_shuffle = require('locutus/php/strings/str_shuffle');
|
||||
import locutus_php_strings_str_split = require('locutus/php/strings/str_split');
|
||||
import locutus_php_strings_str_word_count = require('locutus/php/strings/str_word_count');
|
||||
import locutus_php_strings_strcasecmp = require('locutus/php/strings/strcasecmp');
|
||||
import locutus_php_strings_strchr = require('locutus/php/strings/strchr');
|
||||
import locutus_php_strings_strcmp = require('locutus/php/strings/strcmp');
|
||||
import locutus_php_strings_strcoll = require('locutus/php/strings/strcoll');
|
||||
import locutus_php_strings_strcspn = require('locutus/php/strings/strcspn');
|
||||
import locutus_php_strings_strip_tags = require('locutus/php/strings/strip_tags');
|
||||
import locutus_php_strings_stripos = require('locutus/php/strings/stripos');
|
||||
import locutus_php_strings_stripslashes = require('locutus/php/strings/stripslashes');
|
||||
import locutus_php_strings_stristr = require('locutus/php/strings/stristr');
|
||||
import locutus_php_strings_strlen = require('locutus/php/strings/strlen');
|
||||
import locutus_php_strings_strnatcasecmp = require('locutus/php/strings/strnatcasecmp');
|
||||
import locutus_php_strings_strnatcmp = require('locutus/php/strings/strnatcmp');
|
||||
import locutus_php_strings_strncasecmp = require('locutus/php/strings/strncasecmp');
|
||||
import locutus_php_strings_strncmp = require('locutus/php/strings/strncmp');
|
||||
import locutus_php_strings_strpbrk = require('locutus/php/strings/strpbrk');
|
||||
import locutus_php_strings_strpos = require('locutus/php/strings/strpos');
|
||||
import locutus_php_strings_strrchr = require('locutus/php/strings/strrchr');
|
||||
import locutus_php_strings_strrev = require('locutus/php/strings/strrev');
|
||||
import locutus_php_strings_strripos = require('locutus/php/strings/strripos');
|
||||
import locutus_php_strings_strrpos = require('locutus/php/strings/strrpos');
|
||||
import locutus_php_strings_strspn = require('locutus/php/strings/strspn');
|
||||
import locutus_php_strings_strstr = require('locutus/php/strings/strstr');
|
||||
import locutus_php_strings_strtok = require('locutus/php/strings/strtok');
|
||||
import locutus_php_strings_strtolower = require('locutus/php/strings/strtolower');
|
||||
import locutus_php_strings_strtoupper = require('locutus/php/strings/strtoupper');
|
||||
import locutus_php_strings_strtr = require('locutus/php/strings/strtr');
|
||||
import locutus_php_strings_substr = require('locutus/php/strings/substr');
|
||||
import locutus_php_strings_substr_compare = require('locutus/php/strings/substr_compare');
|
||||
import locutus_php_strings_substr_count = require('locutus/php/strings/substr_count');
|
||||
import locutus_php_strings_substr_replace = require('locutus/php/strings/substr_replace');
|
||||
import locutus_php_strings_trim = require('locutus/php/strings/trim');
|
||||
import locutus_php_strings_ucfirst = require('locutus/php/strings/ucfirst');
|
||||
import locutus_php_strings_ucwords = require('locutus/php/strings/ucwords');
|
||||
import locutus_php_strings_vprintf = require('locutus/php/strings/vprintf');
|
||||
import locutus_php_strings_vsprintf = require('locutus/php/strings/vsprintf');
|
||||
import locutus_php_strings_wordwrap = require('locutus/php/strings/wordwrap');
|
||||
import locutus_php_url_base64_decode = require('locutus/php/url/base64_decode');
|
||||
import locutus_php_url_base64_encode = require('locutus/php/url/base64_encode');
|
||||
import locutus_php_url_http_build_query = require('locutus/php/url/http_build_query');
|
||||
import locutus_php_url_parse_url = require('locutus/php/url/parse_url');
|
||||
import locutus_php_url_rawurldecode = require('locutus/php/url/rawurldecode');
|
||||
import locutus_php_url_rawurlencode = require('locutus/php/url/rawurlencode');
|
||||
import locutus_php_url_urldecode = require('locutus/php/url/urldecode');
|
||||
import locutus_php_url_urlencode = require('locutus/php/url/urlencode');
|
||||
import locutus_php_var_doubleval = require('locutus/php/var/doubleval');
|
||||
import locutus_php_var_empty = require('locutus/php/var/empty');
|
||||
import locutus_php_var_floatval = require('locutus/php/var/floatval');
|
||||
import locutus_php_var_gettype = require('locutus/php/var/gettype');
|
||||
import locutus_php_var_intval = require('locutus/php/var/intval');
|
||||
import locutus_php_var_is_array = require('locutus/php/var/is_array');
|
||||
import locutus_php_var_is_binary = require('locutus/php/var/is_binary');
|
||||
import locutus_php_var_is_bool = require('locutus/php/var/is_bool');
|
||||
import locutus_php_var_is_buffer = require('locutus/php/var/is_buffer');
|
||||
import locutus_php_var_is_callable = require('locutus/php/var/is_callable');
|
||||
import locutus_php_var_is_double = require('locutus/php/var/is_double');
|
||||
import locutus_php_var_is_float = require('locutus/php/var/is_float');
|
||||
import locutus_php_var_is_int = require('locutus/php/var/is_int');
|
||||
import locutus_php_var_is_integer = require('locutus/php/var/is_integer');
|
||||
import locutus_php_var_is_long = require('locutus/php/var/is_long');
|
||||
import locutus_php_var_is_null = require('locutus/php/var/is_null');
|
||||
import locutus_php_var_is_numeric = require('locutus/php/var/is_numeric');
|
||||
import locutus_php_var_is_object = require('locutus/php/var/is_object');
|
||||
import locutus_php_var_is_real = require('locutus/php/var/is_real');
|
||||
import locutus_php_var_is_scalar = require('locutus/php/var/is_scalar');
|
||||
import locutus_php_var_is_string = require('locutus/php/var/is_string');
|
||||
import locutus_php_var_is_unicode = require('locutus/php/var/is_unicode');
|
||||
import locutus_php_var_isset = require('locutus/php/var/isset');
|
||||
import locutus_php_var_print_r = require('locutus/php/var/print_r');
|
||||
import locutus_php_var_serialize = require('locutus/php/var/serialize');
|
||||
import locutus_php_var_strval = require('locutus/php/var/strval');
|
||||
import locutus_php_var_unserialize = require('locutus/php/var/unserialize');
|
||||
import locutus_php_var_var_dump = require('locutus/php/var/var_dump');
|
||||
import locutus_php_var_var_export = require('locutus/php/var/var_export');
|
||||
import locutus_php_xdiff_xdiff_string_diff = require('locutus/php/xdiff/xdiff_string_diff');
|
||||
import locutus_php_xdiff_xdiff_string_patch = require('locutus/php/xdiff/xdiff_string_patch');
|
||||
import locutus_php_xml_utf8_decode = require('locutus/php/xml/utf8_decode');
|
||||
import locutus_php_xml_utf8_encode = require('locutus/php/xml/utf8_encode');
|
||||
import locutus_python_string_capwords = require('locutus/python/string/capwords');
|
||||
import locutus_ruby_Math_acos = require('locutus/ruby/Math/acos');
|
||||
import locutus_c_math = require('locutus/c/math');
|
||||
import locutus_golang_strings = require('locutus/golang/strings');
|
||||
import locutus_php_array = require('locutus/php/array');
|
||||
import locutus_php_bc = require('locutus/php/bc');
|
||||
import locutus_php_ctype = require('locutus/php/ctype');
|
||||
import locutus_php_datetime = require('locutus/php/datetime');
|
||||
import locutus_php_exec = require('locutus/php/exec');
|
||||
import locutus_php_filesystem = require('locutus/php/filesystem');
|
||||
import locutus_php_funchand = require('locutus/php/funchand');
|
||||
import locutus_php_i18n = require('locutus/php/i18n');
|
||||
import locutus_php_info = require('locutus/php/info');
|
||||
import locutus_php_json = require('locutus/php/json');
|
||||
import locutus_php_math = require('locutus/php/math');
|
||||
import locutus_php_misc = require('locutus/php/misc');
|
||||
import locutus_php_net_gopher = require('locutus/php/net-gopher');
|
||||
import locutus_php_network = require('locutus/php/network');
|
||||
import locutus_php_pcre = require('locutus/php/pcre');
|
||||
import locutus_php_strings = require('locutus/php/strings');
|
||||
import locutus_php_url = require('locutus/php/url');
|
||||
import locutus_php_var = require('locutus/php/var');
|
||||
import locutus_php_xdiff = require('locutus/php/xdiff');
|
||||
import locutus_php_xml = require('locutus/php/xml');
|
||||
import locutus_python_string = require('locutus/python/string');
|
||||
import locutus_ruby_Math = require('locutus/ruby/Math');
|
||||
import locutus_c = require('locutus/c');
|
||||
import locutus_golang = require('locutus/golang');
|
||||
import locutus_php = require('locutus/php');
|
||||
import locutus_python = require('locutus/python');
|
||||
import locutus_ruby = require('locutus/ruby');
|
||||
import locutus = require('locutus');
|
||||
1734
locutus/locutus.d.ts
vendored
Normal file
1734
locutus/locutus.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
188
locutus/locutus_print.ts
Normal file
188
locutus/locutus_print.ts
Normal file
@ -0,0 +1,188 @@
|
||||
// Automatically generate script for locutus
|
||||
// Written by: Hookclaw <https://github.com/hookclaw>
|
||||
|
||||
/* Usage
|
||||
tsc locutus_print.ts
|
||||
node locutus_print.js define
|
||||
*/
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="./locutus.d.ts" />
|
||||
|
||||
var locutus = require('locutus');
|
||||
|
||||
type f = (...args:any[]) => any;
|
||||
type e = {[key:string]:f};
|
||||
type d = {[key:string]:e};
|
||||
type c = {[key:string]:d};
|
||||
|
||||
let loc:c = locutus;
|
||||
|
||||
let run = ():void => {
|
||||
if(process.argv.length > 1) {
|
||||
switch(process.argv[2]) {
|
||||
case 'define':
|
||||
define();
|
||||
return;
|
||||
case 'test':
|
||||
test();
|
||||
return;
|
||||
case 'settings':
|
||||
settings();
|
||||
return;
|
||||
}
|
||||
}
|
||||
console.log('settings,list,define');
|
||||
};
|
||||
|
||||
let define = ():void => {
|
||||
console.log('// Type definitions for locutus');
|
||||
console.log('// Project: http://locutusjs.io');
|
||||
console.log('// Definitions by: Hookclaw <https://github.com/hookclaw>');
|
||||
console.log('// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped');
|
||||
console.log('');
|
||||
|
||||
for(let key1 in loc) {
|
||||
for(let key2 in loc[key1]) {
|
||||
for(let key3 in loc[key1][key2]) {
|
||||
printSingle(loc,key1,key2,key3);
|
||||
}
|
||||
}
|
||||
}
|
||||
for(let key1 in loc) {
|
||||
for(let key2 in loc[key1]) {
|
||||
let modulename = 'locutus/' + key1 + '/' + key2;
|
||||
printGroup(modulename, loc[key1][key2]);
|
||||
}
|
||||
}
|
||||
for(let key1 in loc) {
|
||||
let modulename = 'locutus/' + key1;
|
||||
printGroup(modulename, loc[key1]);
|
||||
}
|
||||
let modulename = 'locutus';
|
||||
printGroup(modulename, loc);
|
||||
}
|
||||
|
||||
let printSingle = (loc:c,key1:string,key2:string,key3:string):void => {
|
||||
console.log('declare module "locutus/' + key1 + '/' + key2 + '/' + key3 + '" {');
|
||||
console.log('\tfunction ' + key3 + arg(loc,key1,key2,key3) + ':any;');
|
||||
console.log('\texport = ' + key3 + ';');
|
||||
console.log('}');
|
||||
}
|
||||
|
||||
let printGroup = (modulename:string,loc:{}):void => {
|
||||
let s:string[] = [];
|
||||
let c = '';
|
||||
console.log('declare module "' + modulename + '" {');
|
||||
for(let key in loc) {
|
||||
let com = '';
|
||||
let tmp = replace(key);
|
||||
if(tmp == key) {
|
||||
s.push(key);
|
||||
} else {
|
||||
com = '// ';
|
||||
// s.push('"' + key + '":' + tmp);
|
||||
c += ' /* ,"' + key + '":' + tmp + ' */';
|
||||
}
|
||||
console.log('\t' + com + 'import ' + tmp + ' = require("' + modulename + '/' + key + '");');
|
||||
}
|
||||
console.log('\texport {' + s.join(',') + c + '};');
|
||||
console.log('}');
|
||||
}
|
||||
|
||||
let replace = (name:string):string => {
|
||||
if(name == 'var') {
|
||||
return 'Var';
|
||||
}
|
||||
// if(name == 'string') {
|
||||
// return 'String';
|
||||
// }
|
||||
return name.replace('-','_');
|
||||
}
|
||||
|
||||
let func = (loc:c,key1:string,key2:string,key3:string):string => {
|
||||
return '"' + key3 + '":' + arg(loc,key1,key2,key3) + ' => any';
|
||||
}
|
||||
|
||||
const ARG1 = "(...args:any[])";
|
||||
|
||||
let arg = (loc:c,key1:string,key2:string,key3:string):string => {
|
||||
let src = loc[key1][key2][key3].toString();
|
||||
let mArguments = /[^a-zA-Z0-9_]arguments[^a-zA-Z0-9_]/;
|
||||
if(mArguments.test(src)) {
|
||||
return ARG1;
|
||||
}
|
||||
let mFunction = /^function [a-zA-Z0-9_]+\(/g;
|
||||
let result1 = mFunction.exec(src);
|
||||
if(result1 == null) {
|
||||
return ARG1;
|
||||
}
|
||||
let mFunction2 = /(\s*[,]?\s*[a-zA-Z0-9_]+)*\)/g;
|
||||
mFunction2.lastIndex = mFunction.lastIndex;
|
||||
let result12 = mFunction2.exec(src);
|
||||
let mParameter = /\s*[,]?\s*[a-zA-Z0-9_]+/g;
|
||||
let args:string[] = [];
|
||||
let i = 0;
|
||||
let result2:any;
|
||||
while((result2 = mParameter.exec(result12[0])) != null) {
|
||||
args.push(result2[0]+'?:any');
|
||||
i++;
|
||||
}
|
||||
return '('+args.join('')+')';
|
||||
}
|
||||
|
||||
let test = ():void => {
|
||||
console.log('/// <reference path="locutus.d.ts" />');
|
||||
for(let key1 in loc) {
|
||||
for(let key2 in loc[key1]) {
|
||||
for(let key3 in loc[key1][key2]) {
|
||||
let modulename = 'locutus/' + key1 + '/' + key2 + '/' + key3;
|
||||
testsub(modulename);
|
||||
}
|
||||
}
|
||||
}
|
||||
for(let key1 in loc) {
|
||||
for(let key2 in loc[key1]) {
|
||||
let modulename = 'locutus/' + key1 + '/' + key2;
|
||||
testsub(modulename);
|
||||
}
|
||||
}
|
||||
for(let key1 in loc) {
|
||||
let modulename = 'locutus/' + key1;
|
||||
testsub(modulename);
|
||||
}
|
||||
let modulename = 'locutus';
|
||||
testsub(modulename);
|
||||
}
|
||||
|
||||
let testsub = (modulename:string):void => {
|
||||
let varname = modulename.replace(/[-/]/g,'_');
|
||||
console.log("import " + varname + " = require('" + modulename + "');");
|
||||
}
|
||||
|
||||
let settings = ():void => {
|
||||
let s = '';
|
||||
for(let key1 in loc) {
|
||||
if(key1 != 'php') {
|
||||
continue;
|
||||
}
|
||||
for(let key2 in loc[key1]) {
|
||||
for(let key3 in loc[key1][key2]) {
|
||||
if(s != '') {
|
||||
s += ',\n';
|
||||
}
|
||||
let len = 21 - key3.length;
|
||||
let tab = '';
|
||||
while(len > 0) {
|
||||
tab += '\t';
|
||||
len -= 4;
|
||||
}
|
||||
//"var_dump": {"cod":"var_dump", "mod":["var_dump","locutus/php/var/var_dump"]}
|
||||
s += '\t\t\t\t"' + key3 + '":' + tab + '{"cod":"' + key3 + '","mod":["' + key3 + '","locutus/' + key1 + '/' + key2 + '/' + key3 + '"]}';
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(s);
|
||||
}
|
||||
|
||||
run();
|
||||
9
long/index.d.ts
vendored
9
long/index.d.ts
vendored
@ -4,6 +4,10 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// Definitions by: Denis Cappellin <http://github.com/cappellin>
|
||||
|
||||
export = Long;
|
||||
export as namespace Long;
|
||||
|
||||
declare namespace Long {}
|
||||
declare class Long
|
||||
{
|
||||
/**
|
||||
@ -346,8 +350,3 @@ declare class Long
|
||||
*/
|
||||
xor( other: Long | number | string ): Long;
|
||||
}
|
||||
|
||||
declare namespace Long {}
|
||||
export = Long;
|
||||
export as namespace Long;
|
||||
|
||||
9496
material-ui/index.d.ts
vendored
9496
material-ui/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
2302
material-ui/legacy/material-ui-0.14.4-tests.tsx
Normal file
2302
material-ui/legacy/material-ui-0.14.4-tests.tsx
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1 @@
|
||||
--experimentalDecorators
|
||||
8246
material-ui/legacy/material-ui-0.14.4.d.ts
vendored
Normal file
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
9
mongodb/index.d.ts
vendored
9
mongodb/index.d.ts
vendored
@ -695,6 +695,13 @@ export interface Collection {
|
||||
//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>;
|
||||
@ -706,7 +713,9 @@ export interface Collection {
|
||||
//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;
|
||||
|
||||
@ -24,7 +24,8 @@ assert.notStrictEqual(2, "2", "uses === comparator");
|
||||
assert.throws(() => { throw "a hammer at your face"; }, undefined, "DODGED IT");
|
||||
|
||||
assert.doesNotThrow(() => {
|
||||
if (false) { throw "a hammer at your face"; }
|
||||
const b = false;
|
||||
if (b) { throw "a hammer at your face"; }
|
||||
}, undefined, "What the...*crunch*");
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
@ -26,7 +26,8 @@ assert.notStrictEqual(2, "2", "uses === comparator");
|
||||
assert.throws(() => { throw "a hammer at your face"; }, undefined, "DODGED IT");
|
||||
|
||||
assert.doesNotThrow(() => {
|
||||
if (false) { throw "a hammer at your face"; }
|
||||
const b = false;
|
||||
if (b) { throw "a hammer at your face"; }
|
||||
}, undefined, "What the...*crunch*");
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
2
node/node-4.d.ts
vendored
2
node/node-4.d.ts
vendored
@ -465,7 +465,7 @@ interface NodeBuffer extends Uint8Array {
|
||||
writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
|
||||
writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
|
||||
writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
|
||||
fill(value: any, offset?: number, end?: number): Buffer;
|
||||
fill(value: any, offset?: number, end?: number): this;
|
||||
// TODO: encoding param
|
||||
indexOf(value: string | number | Buffer, byteOffset?: number): number;
|
||||
// TODO: entries
|
||||
|
||||
2
pdf/index.d.ts
vendored
2
pdf/index.d.ts
vendored
@ -32,7 +32,7 @@ interface PDFPromise<T> {
|
||||
isRejected(): boolean;
|
||||
resolve(value: T): void;
|
||||
reject(reason: string): void;
|
||||
then(onResolve: (promise: T) => void, onReject?: (reason: string) => void): PDFPromise<T>;
|
||||
then<U>(onResolve: (promise: T) => U, onReject?: (reason: string) => void): PDFPromise<U>;
|
||||
}
|
||||
|
||||
interface PDFTreeNode {
|
||||
|
||||
@ -43,3 +43,10 @@ function goNext() {
|
||||
renderPage(pageNum);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Test PDFPromise allows return value mutation
|
||||
//
|
||||
var promise: PDFPromise<string> = PDFJS.getDocument('helloworld.pdf').then(pdf => {
|
||||
return "arbitrary string";
|
||||
});
|
||||
4
preloadjs/index.d.ts
vendored
4
preloadjs/index.d.ts
vendored
@ -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;
|
||||
|
||||
94
react-bootstrap/index.d.ts
vendored
94
react-bootstrap/index.d.ts
vendored
@ -1,6 +1,6 @@
|
||||
// Type definitions for react-bootstrap
|
||||
// Project: https://github.com/react-bootstrap/react-bootstrap
|
||||
// Definitions by: Walker Burgin <https://github.com/walkerburgin>, Vincent Siao <https://github.com/vsiao>
|
||||
// Definitions by: Walker Burgin <https://github.com/walkerburgin>, Vincent Siao <https://github.com/vsiao>, Danilo Barros <https://github.com/danilojrr>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
///<reference types="react"/>
|
||||
@ -21,7 +21,7 @@ declare module "react-bootstrap" {
|
||||
bsSize?: string;
|
||||
navItem?: boolean;
|
||||
navDropdown?: boolean;
|
||||
componentClass?: string;
|
||||
componentClass?: React.ReactType;
|
||||
}
|
||||
type Button = React.ClassicComponent<ButtonProps, {}>;
|
||||
var Button: React.ClassicComponentClass<ButtonProps>;
|
||||
@ -335,7 +335,7 @@ declare module "react-bootstrap" {
|
||||
brand?: any; // TODO: Add more specific type
|
||||
bsSize?: string;
|
||||
bsStyle?: string;
|
||||
componentClass?: any; // TODO: Add more specific type
|
||||
componentClass?: React.ReactType;
|
||||
defaultNavExpanded?: boolean;
|
||||
eventKey?: any;
|
||||
fixedBottom?: boolean;
|
||||
@ -386,7 +386,7 @@ declare module "react-bootstrap" {
|
||||
brand?: any; // TODO: Add more specific type
|
||||
bsSize?: string;
|
||||
bsStyle?: string;
|
||||
componentClass?: any; // TODO: Add more specific type
|
||||
componentClass?: React.ReactType;
|
||||
defaultNavExpanded?: boolean;
|
||||
fixedBottom?: boolean;
|
||||
fixedTop?: boolean;
|
||||
@ -461,7 +461,7 @@ declare module "react-bootstrap" {
|
||||
activePage?: number;
|
||||
bsSize?: string;
|
||||
bsStyle?: string;
|
||||
buttonComponentClass?: any; // TODO: Add more specific type
|
||||
buttonComponentClass?: React.ReactType;
|
||||
ellipsis?: boolean;
|
||||
first?: boolean;
|
||||
items?: number;
|
||||
@ -522,7 +522,7 @@ declare module "react-bootstrap" {
|
||||
// <Grid />
|
||||
// ----------------------------------------
|
||||
interface GridProps extends React.HTMLAttributes<{}>{
|
||||
componentClass?: any; // TODO: Add more specific type
|
||||
componentClass?: React.ReactType;
|
||||
fluid?: boolean;
|
||||
}
|
||||
type Grid = React.ClassicComponent<GridProps, {}>;
|
||||
@ -531,7 +531,7 @@ declare module "react-bootstrap" {
|
||||
// <Row />
|
||||
// ----------------------------------------
|
||||
interface RowProps extends React.HTMLAttributes<{}>{
|
||||
componentClass?: any; // TODO: Add more specific type
|
||||
componentClass?: React.ReactType;
|
||||
}
|
||||
type Row = React.ClassicComponent<RowProps, {}>;
|
||||
var Row: React.ClassicComponentClass<RowProps>;
|
||||
@ -539,7 +539,7 @@ declare module "react-bootstrap" {
|
||||
// <Col />
|
||||
// ----------------------------------------
|
||||
interface ColProps extends React.HTMLAttributes<{}>{
|
||||
componentClass?: any; // TODO: Add more specific type
|
||||
componentClass?: React.ReactType;
|
||||
lg?: number;
|
||||
lgHidden?: boolean;
|
||||
lgOffset?: number;
|
||||
@ -615,7 +615,7 @@ declare module "react-bootstrap" {
|
||||
// <Jumbotron />
|
||||
// ----------------------------------------
|
||||
interface JumbotronProps extends React.HTMLAttributes<{}>{
|
||||
componentClass?: any; // TODO: Add more specific type
|
||||
componentClass?: React.ReactType;
|
||||
}
|
||||
type Jumbotron = React.ClassicComponent<JumbotronProps, {}>;
|
||||
var Jumbotron: React.ClassicComponentClass<JumbotronProps>;
|
||||
@ -710,6 +710,82 @@ declare module "react-bootstrap" {
|
||||
}
|
||||
var FormControls: FormControlsClass;
|
||||
|
||||
// <Form />
|
||||
// ----------------------------------------
|
||||
interface FormProps extends React.HTMLAttributes<{}> {
|
||||
bsClass?: string;
|
||||
componentClass?: React.ReactType;
|
||||
horizontal?: boolean;
|
||||
inline?: boolean;
|
||||
}
|
||||
class Form extends React.Component<FormProps, {}> {}
|
||||
|
||||
// <FormGroup />
|
||||
// ----------------------------------------
|
||||
interface FormGroupProps extends React.HTMLAttributes<{}> {
|
||||
bsClass?: string;
|
||||
bsSize?: "sm" | "small" | "lg" | "large";
|
||||
controlId?: string;
|
||||
validationState?: "success" | "warning" | "error";
|
||||
}
|
||||
class FormGroup extends React.Component<FormGroupProps, {}> {}
|
||||
|
||||
// <ControlLabel />
|
||||
// ----------------------------------------
|
||||
interface ControlLabelProps extends React.HTMLAttributes<{}> {
|
||||
bsClass?: string;
|
||||
htmlFor?: string;
|
||||
srOnly?: boolean;
|
||||
}
|
||||
class ControlLabel extends React.Component<ControlLabelProps, {}> {}
|
||||
|
||||
// <FormControl.Feedback />
|
||||
// ----------------------------------------
|
||||
interface FormControlFeedbackProps extends React.HTMLAttributes<{}> {
|
||||
}
|
||||
class FormControlFeedback extends React.Component<FormControlFeedbackProps, {}> {
|
||||
}
|
||||
|
||||
// <FormControl />
|
||||
// ----------------------------------------
|
||||
interface FormControlProps extends React.HTMLAttributes<{}> {
|
||||
bsClass?: string;
|
||||
componentClass?: React.ReactType;
|
||||
id?: string;
|
||||
type?: string;
|
||||
}
|
||||
interface FormControlClass extends React.ClassicComponentClass<FormControlProps> {
|
||||
Feedback: typeof FormControlFeedback;
|
||||
}
|
||||
type FormControl = React.Component<FormControlProps, {}>;
|
||||
var FormControl: FormControlClass;
|
||||
|
||||
// <HelpBlock />
|
||||
// ----------------------------------------
|
||||
interface HelpBlockProps extends React.HTMLAttributes<{}> {
|
||||
bsClass?: string;
|
||||
}
|
||||
class HelpBlock extends React.Component<HelpBlockProps, {}> {}
|
||||
|
||||
// <Checkbox />
|
||||
// ----------------------------------------
|
||||
interface CheckboxProps extends React.HTMLAttributes<{}> {
|
||||
bsClass?: string;
|
||||
disabled?: boolean;
|
||||
inline?: boolean;
|
||||
validationState?: "success" | "warning" | "error";
|
||||
}
|
||||
class Checkbox extends React.Component<CheckboxProps, {}> {}
|
||||
|
||||
// <Radio />
|
||||
// ----------------------------------------
|
||||
interface RadioProps extends React.HTMLAttributes<{}> {
|
||||
bsClass?: string;
|
||||
disabled?: boolean;
|
||||
inline?: boolean;
|
||||
validationState?: "success" | "warning" | "error";
|
||||
}
|
||||
class Radio extends React.Component<RadioProps, {}> {}
|
||||
|
||||
// <Portal />
|
||||
// ----------------------------------------
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
// --------------------------------------------------------------------------------
|
||||
import * as React from 'react';
|
||||
import { Component, CSSProperties } from 'react';
|
||||
import { Button, ButtonToolbar, Modal, Well, ButtonGroup, DropdownButton, MenuItem, Panel, ListGroup, ListGroupItem, Accordion, Tooltip, OverlayTrigger, Popover, ProgressBar, Nav, NavItem, Navbar, NavDropdown, Tabs, Tab, Pager, PageItem, Pagination, Alert, Carousel, CarouselItem, Grid, Row, Col, Thumbnail, Label, Badge, Jumbotron, PageHeader, Glyphicon, Table, Input, ButtonInput, FormControls } from 'react-bootstrap';
|
||||
import { Button, ButtonToolbar, Modal, Well, ButtonGroup, DropdownButton, MenuItem, Panel, ListGroup, ListGroupItem, Accordion, Tooltip, OverlayTrigger, Popover, ProgressBar, Nav, NavItem, Navbar, NavDropdown, Tabs, Tab, Pager, PageItem, Pagination, Alert, Carousel, CarouselItem, Grid, Row, Col, Thumbnail, Label, Badge, Jumbotron, PageHeader, Glyphicon, Table, Input, ButtonInput, FormControls, Form, FormGroup, ControlLabel, FormControl, HelpBlock, Radio, Checkbox } from 'react-bootstrap';
|
||||
|
||||
|
||||
export class ReactBootstrapTest extends Component<any, any> {
|
||||
@ -910,6 +910,37 @@ export class ReactBootstrapTest extends Component<any, any> {
|
||||
</Row>
|
||||
</Input>
|
||||
</div>
|
||||
|
||||
<div style={style}>
|
||||
<Form>
|
||||
<FormGroup
|
||||
controlId="formBasicText"
|
||||
>
|
||||
<ControlLabel>Control Label</ControlLabel>
|
||||
<FormControl
|
||||
type="text"
|
||||
placeholder="Enter text"
|
||||
/>
|
||||
<FormControl.Feedback />
|
||||
<HelpBlock>Help block message.</HelpBlock>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<Checkbox name="checkbox" inline>1</Checkbox>
|
||||
{' '}
|
||||
<Checkbox name="checkbox" inline>2</Checkbox>
|
||||
{' '}
|
||||
<Checkbox name="checkbox" inline>3</Checkbox>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<Radio name="radio" inline>1</Radio>
|
||||
{' '}
|
||||
<Radio name="radio" inline>2</Radio>
|
||||
{' '}
|
||||
<Radio name="radio" inline>3</Radio>
|
||||
</FormGroup>
|
||||
</Form>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
4
react-input-calendar/index.d.ts
vendored
4
react-input-calendar/index.d.ts
vendored
@ -51,6 +51,10 @@ declare namespace reactInputCalendar {
|
||||
*/
|
||||
onBlur?: (event: React.SyntheticEvent<ReactInputCalendar>, computableDate: string) => void;
|
||||
/**
|
||||
* Set a function that will be triggered when the input field is focused.
|
||||
*/
|
||||
onFocus?: (event: __React.SyntheticEvent) => void;
|
||||
/**
|
||||
* Define state when date picker would close once the user has clicked on a date.
|
||||
*/
|
||||
closeOnSelect?: boolean;
|
||||
|
||||
49
react-modal/react-modal-tests.tsx
Normal file
49
react-modal/react-modal-tests.tsx
Normal 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
28
react-modal/react-modal.d.ts
vendored
Normal 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;
|
||||
}
|
||||
8
react-tap-event-plugin/index.d.ts
vendored
8
react-tap-event-plugin/index.d.ts
vendored
@ -3,6 +3,10 @@
|
||||
// Definitions by: Michael Ledin <https://github.com/mxl>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface StrategyOverrides {
|
||||
shouldRejectClick?: (lastTouchEventTimestamp: Date, clickEventTimestamp: Date) => boolean;
|
||||
}
|
||||
|
||||
declare var exports: () => any;
|
||||
export = exports;
|
||||
declare var injectTapEventPlugin: (strategyOverrides?: StrategyOverrides) => void;
|
||||
|
||||
export = injectTapEventPlugin;
|
||||
|
||||
@ -1,3 +1,11 @@
|
||||
import * as injectTapEventPlugin from 'react-tap-event-plugin';
|
||||
// since the export is a function, this is the only actual correct way:
|
||||
import injectTapEventPluginRequire = require("react-tap-event-plugin");
|
||||
|
||||
injectTapEventPlugin();
|
||||
injectTapEventPluginRequire({
|
||||
shouldRejectClick: function (lastTouchEventTimestamp, clickEventTimestamp) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
injectTapEventPluginRequire();
|
||||
injectTapEventPluginRequire({});
|
||||
|
||||
25
react/index.d.ts
vendored
25
react/index.d.ts
vendored
@ -153,6 +153,7 @@ declare namespace React {
|
||||
var DOM: ReactDOM;
|
||||
var PropTypes: ReactPropTypes;
|
||||
var Children: ReactChildren;
|
||||
var version: string;
|
||||
|
||||
//
|
||||
// Component API
|
||||
@ -349,13 +350,25 @@ declare namespace React {
|
||||
view: AbstractView;
|
||||
}
|
||||
|
||||
interface WheelEvent<T> extends SyntheticEvent<T> {
|
||||
interface WheelEvent<T> extends MouseEvent<T> {
|
||||
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
|
||||
// ----------------------------------------------------------------------
|
||||
@ -376,6 +389,8 @@ declare namespace React {
|
||||
type TouchEventHandler<T> = EventHandler<TouchEvent<T>>;
|
||||
type UIEventHandler<T> = EventHandler<UIEvent<T>>;
|
||||
type WheelEventHandler<T> = EventHandler<WheelEvent<T>>;
|
||||
type AnimationEventHandler = EventHandler<AnimationEvent>;
|
||||
type TransitionEventHandler = EventHandler<TransitionEvent>;
|
||||
|
||||
//
|
||||
// Props / DOM Attributes
|
||||
@ -499,6 +514,14 @@ declare namespace React {
|
||||
|
||||
// Wheel Events
|
||||
onWheel?: WheelEventHandler<T>;
|
||||
|
||||
// Animation Events
|
||||
onAnimationStart?: AnimationEventHandler;
|
||||
onAnimationEnd?: AnimationEventHandler;
|
||||
onAnimationIteration?: AnimationEventHandler;
|
||||
|
||||
// Transition Events
|
||||
onTransitionEnd?: TransitionEventHandler;
|
||||
}
|
||||
|
||||
// This interface is not complete. Only properties accepting
|
||||
|
||||
1
rx/rx-lite.d.ts
vendored
1
rx/rx-lite.d.ts
vendored
@ -325,6 +325,7 @@ declare namespace Rx {
|
||||
materialize(): Observable<Notification<T>>;
|
||||
repeat(repeatCount?: number): Observable<T>;
|
||||
retry(retryCount?: number): Observable<T>;
|
||||
retryWhen<TError>(notifier: (errors: Observable<TError>) => Observable<any>): Observable<T>;
|
||||
|
||||
/**
|
||||
* Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value.
|
||||
|
||||
7
samchon-collection/samchon-collection-tests.ts
Normal file
7
samchon-collection/samchon-collection-tests.ts
Normal 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);
|
||||
23
samchon-collection/samchon-collection.d.ts
vendored
Normal file
23
samchon-collection/samchon-collection.d.ts
vendored
Normal 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;
|
||||
7
samchon-framework/samchon-framework-tests.ts
Normal file
7
samchon-framework/samchon-framework-tests.ts
Normal 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
2710
samchon-framework/samchon-framework.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
samchon-library/samchon-library-tests.ts
Normal file
7
samchon-library/samchon-library-tests.ts
Normal 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
23
samchon-library/samchon-library.d.ts
vendored
Normal 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;
|
||||
128
sequelize/index.d.ts
vendored
128
sequelize/index.d.ts
vendored
@ -2949,8 +2949,20 @@ declare namespace sequelize {
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope Options for Model.scope
|
||||
*/
|
||||
* 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
|
||||
*/
|
||||
interface ScopeOptions {
|
||||
|
||||
/**
|
||||
@ -3121,7 +3133,7 @@ declare namespace 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 | [string, string]>;
|
||||
attributes?: Array<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 namespace 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;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3641,52 +3659,64 @@ declare namespace sequelize {
|
||||
getTableName(options?: { logging: Function }): string | Object;
|
||||
|
||||
/**
|
||||
* Apply a scope created in `define` to the model. First let's look at how to create scopes:
|
||||
* ```js
|
||||
* var Model = sequelize.define('model', attributes, {
|
||||
* defaultScope: {
|
||||
* where: {
|
||||
* username: 'dan'
|
||||
* },
|
||||
* limit: 12
|
||||
* },
|
||||
* scopes: {
|
||||
* isALie: {
|
||||
* where: {
|
||||
* stuff: 'cake'
|
||||
* }
|
||||
* },
|
||||
* complexFunction: function(email, accessLevel) {
|
||||
* return {
|
||||
* where: {
|
||||
* email: {
|
||||
* $like: email
|
||||
* },
|
||||
* accesss_level {
|
||||
* $gte: accessLevel
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* })
|
||||
* ```
|
||||
* Now, since you defined a default scope, every time you do Model.find, the default scope is appended to
|
||||
* your query. Here's a couple of examples:
|
||||
* ```js
|
||||
* Model.findAll() // WHERE username = 'dan'
|
||||
* Model.findAll({ where: { age: { gt: 12 } } }) // WHERE age > 12 AND username = 'dan'
|
||||
* ```
|
||||
*
|
||||
* To invoke scope functions you can do:
|
||||
* ```js
|
||||
* Model.scope({ method: ['complexFunction' 'dan@sequelize.com', 42]}).findAll()
|
||||
* // WHERE email like 'dan@sequelize.com%' AND access_level >= 42
|
||||
* ```
|
||||
*
|
||||
* @return Model A reference to the model, with the scope(s) applied. Calling scope again on the returned
|
||||
* model will clear the previous scope.
|
||||
*/
|
||||
* 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
|
||||
* var Model = sequelize.define('model', attributes, {
|
||||
* defaultScope: {
|
||||
* where: {
|
||||
* username: 'dan'
|
||||
* },
|
||||
* limit: 12
|
||||
* },
|
||||
* scopes: {
|
||||
* isALie: {
|
||||
* where: {
|
||||
* stuff: 'cake'
|
||||
* }
|
||||
* },
|
||||
* complexFunction: function(email, accessLevel) {
|
||||
* return {
|
||||
* where: {
|
||||
* email: {
|
||||
* $like: email
|
||||
* },
|
||||
* accesss_level {
|
||||
* $gte: accessLevel
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* })
|
||||
* ```
|
||||
* Now, since you defined a default scope, every time you do Model.find, the default scope is appended to
|
||||
* your query. Here's a couple of examples:
|
||||
* ```js
|
||||
* Model.findAll() // WHERE username = 'dan'
|
||||
* Model.findAll({ where: { age: { gt: 12 } } }) // WHERE age > 12 AND username = 'dan'
|
||||
* ```
|
||||
*
|
||||
* To invoke scope functions you can do:
|
||||
* ```js
|
||||
* Model.scope({ method: ['complexFunction' 'dan@sequelize.com', 42]}).findAll()
|
||||
* // WHERE email like 'dan@sequelize.com%' AND access_level >= 42
|
||||
* ```
|
||||
*
|
||||
* @return Model A reference to the model, with the scope(s) applied. Calling scope again on the returned
|
||||
* model will clear the previous scope.
|
||||
*/
|
||||
scope(options?: string | string[] | ScopeOptions | WhereOptions): this;
|
||||
|
||||
/**
|
||||
|
||||
@ -839,6 +839,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 } } );
|
||||
|
||||
@ -880,6 +884,12 @@ User.findAll( { order : [['id', ';DELETE YOLO INJECTIONS']] } );
|
||||
User.findAll( { include : [User], order : [[User, 'id', ';DELETE YOLO INJECTIONS']] } );
|
||||
User.findAll( { include : [User], order : [['id', 'ASC NULLS LAST'], [User, 'id', 'DESC NULLS FIRST']] } );
|
||||
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' );
|
||||
|
||||
|
||||
15
serialport/serialport-tests.ts
Normal file
15
serialport/serialport-tests.ts
Normal 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
39
serialport/serialport.d.ts
vendored
Normal 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
|
||||
}
|
||||
}
|
||||
4
sharepoint/index.d.ts
vendored
4
sharepoint/index.d.ts
vendored
@ -6947,8 +6947,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 {
|
||||
|
||||
2
shelljs/index.d.ts
vendored
2
shelljs/index.d.ts
vendored
@ -463,7 +463,7 @@ export declare function exec(command: string, options: ExecOptions, callback: Ex
|
||||
export declare function exec(command: string, callback: ExecCallback): child.ChildProcess;
|
||||
|
||||
export interface ExecCallback {
|
||||
(code: number, output: string): any;
|
||||
(code: number, output: string, error?: string): any;
|
||||
}
|
||||
|
||||
export interface ExecOptions {
|
||||
|
||||
6
svgjs.draggable/index.d.ts
vendored
6
svgjs.draggable/index.d.ts
vendored
@ -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
three/index.d.ts
vendored
2
three/index.d.ts
vendored
@ -4183,7 +4183,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;
|
||||
|
||||
2187
typescript-stl/typescript-stl.d.ts
vendored
2187
typescript-stl/typescript-stl.d.ts
vendored
File diff suppressed because it is too large
Load Diff
5
urijs/index.d.ts
vendored
5
urijs/index.d.ts
vendored
@ -52,6 +52,8 @@ declare namespace uri {
|
||||
is(qry: string): boolean;
|
||||
iso8859(): URI;
|
||||
|
||||
joinPaths(...paths: (string | URI)[]): URI;
|
||||
|
||||
normalize(): URI;
|
||||
normalizeFragment(): URI;
|
||||
normalizeHash(): URI;
|
||||
@ -63,6 +65,9 @@ declare namespace uri {
|
||||
normalizeQuery(): URI;
|
||||
normalizeSearch(): URI;
|
||||
|
||||
origin(): string;
|
||||
origin(uri: string | URI): URI;
|
||||
|
||||
password(): string;
|
||||
password(pw: string): URI;
|
||||
path(): string;
|
||||
|
||||
2
yamljs/index.d.ts
vendored
2
yamljs/index.d.ts
vendored
@ -9,6 +9,8 @@ export = YAML;
|
||||
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;
|
||||
|
||||
6
z-schema/index.d.ts
vendored
6
z-schema/index.d.ts
vendored
@ -42,6 +42,12 @@ declare namespace ZSchema {
|
||||
export class Validator {
|
||||
constructor(options: Options);
|
||||
|
||||
/**
|
||||
* @param schema - JSON object representing schema
|
||||
* @returns {boolean} true if schema is valid.
|
||||
*/
|
||||
validateSchema(schema: any): boolean;
|
||||
|
||||
/**
|
||||
* @param json - either a JSON string or a parsed JSON object
|
||||
* @param schema - the JSON object representing the schema
|
||||
|
||||
@ -21,6 +21,7 @@ var schema: any = {
|
||||
},
|
||||
};
|
||||
|
||||
validator.validateSchema(schema);
|
||||
validator.validate(json, schema);
|
||||
validator.validate(json, schema, function (err: any, valid: boolean) {
|
||||
if (err) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user