Merge branch 'master' of github.com:DefinitelyTyped/DefinitelyTyped into master_x

This commit is contained in:
Bernd Hacker
2017-06-12 08:37:20 +02:00
73 changed files with 3008 additions and 848 deletions
@@ -118,7 +118,18 @@ const envelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(dat
context.track(envelope);
context.addTelemetryInitializer(telemetryEnvelope => false);
context.addTelemetryInitializer(envelope => false);
context.addTelemetryInitializer(envelope => { });
// a sample from: https://github.com/Microsoft/ApplicationInsights-JS/blob/master/API-reference.md#example
context.addTelemetryInitializer(envelope => {
let telemetryItem = envelope.data.baseData;
if (envelope.name === Microsoft.ApplicationInsights.Telemetry.PageView.envelopeType) {
telemetryItem.url = "URL CENSORED";
}
telemetryItem.properties = telemetryItem.properties || {};
telemetryItem.properties["globalProperty"] = "boo";
});
// track event
const eventObj = new Microsoft.ApplicationInsights.Telemetry.Event("test", null, null);
+3 -1
View File
@@ -572,6 +572,7 @@ declare module Microsoft.ApplicationInsights {
isPerfAnalyzerEnabled?: boolean;
url?: string;
isStorageUseDisabled?: boolean;
isBeaconApiDisabled?: boolean;
}
/**
@@ -611,6 +612,7 @@ declare module Microsoft.ApplicationInsights {
tags: {
[name: string]: any;
};
data: any;
}
interface ITelemetryContext {
@@ -650,7 +652,7 @@ declare module Microsoft.ApplicationInsights {
* Adds telemetry initializer to the collection. Telemetry initializers will be called one by one
* before telemetry item is pushed for sending and in the order they were added.
*/
addTelemetryInitializer(telemetryInitializer: (envelope: Microsoft.ApplicationInsights.IEnvelope) => boolean): any;
addTelemetryInitializer(telemetryInitializer: (envelope: Microsoft.ApplicationInsights.IEnvelope) => boolean | void): any;
/**
* Tracks telemetry object.
*/
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for node-bunyan 1.8
// Type definitions for bunyan 1.8
// Project: https://github.com/trentm/node-bunyan
// Definitions by: Alex Mikhalev <https://github.com/amikhalev>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+26
View File
@@ -401,3 +401,29 @@ var overlappingBarsResponsiveOptions: Array<Chartist.IResponsiveOptionTuple<Char
];
new Chartist.Bar('.ct-chart', overlappingBarsData, overlappingBarsOptions, overlappingBarsResponsiveOptions);
new Chartist.Candle('.ct-chart', {
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
series: [
[5, 4, 3, 7],
[3, 2, 9, 5],
[5, 4, 3, 7],
[3, 2, 9, 5],
[5, 4, 3, 7],
[3, 2, 9, 5],
[3, 2, 9, 5]
]
}, {
axisX: {
labelOffset: {
x: -10,
y: 0
}
},
axisY: {
showGrid: false,
labelInterpolationFnc: function (value: any) {
return value + 12000;
}
}
});
+125 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for Chartist v0.9.5
// Type definitions for Chartist v0.9.6
// Project: https://github.com/gionkunz/chartist-js
// Definitions by: Matt Gibbs <https://github.com/mtgibbs>
// Definitions by: Matt Gibbs <https://github.com/mtgibbs>, Simon Pfeifer <https://github.com/psimonski>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace Chartist {
@@ -20,6 +20,7 @@ declare namespace Chartist {
Pie: IChartistPieChart;
Bar: IChartistBarChart;
Line: IChartistLineChart;
Candle: IChartistCandleChart;
FixedScaleAxis: IFixedScaleAxisStatic;
AutoScaleAxis: IAutoScaleAxisStatic;
@@ -138,6 +139,10 @@ declare namespace Chartist {
new (target: any, data: IChartistData, options?: IBarChartOptions, responsiveOptions?: Array<IResponsiveOptionTuple<IBarChartOptions>>): IChartistBarChart;
}
interface IChartistCandleChart extends IChartistBase<ICandleChartOptions> {
new (target: any, data: IChartistData, options?: ICandleChartOptions, responsiveOptions?: Array<IResponsiveOptionTuple<ICandleChartOptions>>): IChartistCandleChart;
}
interface IChartOptions {
/**
* If true the whole data is reversed including labels, the series order as well as the whole series data arrays.
@@ -352,6 +357,124 @@ declare namespace Chartist {
end?: string;
}
interface ICandleChartOptions extends IChartOptions {
/**
* Options for X-Axis
*/
axisX?: ICandleChartAxis;
/**
* Options for Y-Axis
*/
axisY?: ICandleChartAxis;
/**
* Specify a fixed width for the chart as a string (i.e. '100px' or '50%')
*/
width?: number | string;
/**
* Specify a fixed height for the chart as a string (i.e. '100px' or '50%')
*/
height?: number | string;
/**
* Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value
*/
hight?: number | string;
/**
* Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value
*/
low?: number | string;
/**
* Width of candle body in pixel (IMO is 2 px best minimum value)
*/
candleWidth?: number | string;
/**
* Width of candle wick in pixel (IMO is 1 px best minimum value)
*/
candleWickWidth?: number | string;
/**
* Use calculated x-axis step length, depending on the number of quotes to display, as candle width. Otherwise the candleWidth is being used.
*/
useStepLengthAsCandleWidth?: boolean | string;
/**
* Use 1/3 of candle body width as width for the candle wick, otherwise the candleWickWidth is being used.
*/
useOneThirdAsCandleWickWidth?: boolean | string;
/**
* Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}
*/
chartPadding?: IChartPadding | number;
/**
* When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler.
*/
fullWidth?: boolean | string;
/**
* Override the class names that get used to generate the SVG structure of the chart
*/
classNames?: ICandleChartClasses;
}
interface ICandleChartAxis {
/**
* The offset of the chart drawing area to the border of the container
*/
offset?: number;
/**
* Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.
*/
position?: string;
/**
* Allows you to correct label positioning on this axis by positive or negative x and y offset.
*/
labelOffset?: {
x?: number;
y?: number;
};
/**
* If labels should be shown or not
*/
showLabel?: boolean;
/**
* If the axis grid should be drawn or not
*/
showGrid?: boolean;
/**
* Interpolation function that allows you to intercept the value from the axis label
*/
labelInterpolationFnc?: Function;
/**
* Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.
*/
type?: any;
}
interface ICandleChartClasses {
chart?: string;
label?: string;
labelGroup?: string;
series?: string;
candlePositive?: string;
candleNegative?: string,
grid?: string,
gridGroup?: string,
gridBackground?: string,
vertical?: string,
horizontal?: string,
start?: string,
end?: string,
}
interface ChartistSvgStatic {
new (name: HTMLElement | string, attributes: Object, className?: string, parent?: Object, insertFirst?: boolean): IChartistSvg;
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for node-convict v3.0.0
// Type definitions for convict 3.0
// Project: https://github.com/mozilla/node-convict
// Definitions by: Wim Looman <https://github.com/Nemo157>, Vesa Poikajärvi <https://github.com/vesse>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+1 -1
View File
@@ -104,7 +104,7 @@ function zoomedCanvas(this: HTMLCanvasElement, d: CanvasDatum) {
let canvasZoom: d3Zoom.ZoomBehavior<HTMLCanvasElement, CanvasDatum>;
canvasZoom = d3Zoom.zoom()
canvasZoom = d3Zoom.zoom<HTMLCanvasElement, CanvasDatum>()
.scaleExtent([1 / 2, 4])
.on('zoom', zoomedCanvas);
+2 -2
View File
@@ -1266,5 +1266,5 @@ declare class Dygraph {
}
declare module "dygraphs" {
export = Dygraph;
}
export default Dygraph;
}
+1673 -74
View File
File diff suppressed because it is too large Load Diff
+1 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for Express 4.x
// Project: http://expressjs.com
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Michał Lytek <https://github.com/19majkel94>
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Michał Lytek <https://github.com/19majkel94>, Kacper Polak <https://github.com/kacepe>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// This extracts the core definitions from express to prevent a circular dependency between express and serve-static
/// <reference types="node" />
@@ -475,7 +475,6 @@ interface MediaType {
}
interface Send {
(status: number, body?: any): Response;
(body?: any): Response;
}
+16 -3
View File
@@ -1256,13 +1256,14 @@ export interface RoutingTableEntry {
/**
* [See docs](https://hapijs.com/api/16.1.1#servertablehost) > return value
* For source [See source](https://github.com/hapijs/hapi/blob/v16.1.1/lib/route.js#L71)
*/
export interface Route {
/**
* the route config with defaults applied.
* TODO check type of RouteConfiguration here is correct
*/
settings: RouteConfiguration;
settings: RouteAdditionalConfigurationOptions;
/**
* the HTTP method in lower case.
* TODO, check if it can contain 'head' or not.
@@ -1270,6 +1271,18 @@ export interface Route {
method: HTTP_METHODS_PARTIAL_lowercase;
/** the route path. */
path: string;
params: string[];
connection: ServerConnection;
fingerprint: string;
plugin?: any;
public: RoutePublicInterface;
server: Server;
}
/**
@@ -1618,8 +1631,8 @@ export interface ServerConnection {
/** Described in server.inject [See docs](https://hapijs.com/api/16.1.1#serverinjectoptions-callback) */
inject(options: string | InjectedRequestOptions, callback: (res: InjectedResponseObject) => void): void;
inject(options: string | InjectedRequestOptions, ): Promise<InjectedResponseObject>;
/** Described in server.table [See docs](https://hapijs.com/api/16.1.1#servertablehost) */
table(host?: string): RoutingTableEntry;
/** Mentioned but not documented under server.connections [See docs](https://hapijs.com/api/16.1.1#serverconnections) */
table(host?: string): Route[];
/** Described in server.table [See docs](https://hapijs.com/api/16.1.1#serverlookupid) */
lookup(id: string): RoutePublicInterface | null;
/** Described in server.table [See docs](https://hapijs.com/api/16.1.1#servermatchmethod-path-host) */
+2
View File
@@ -18,3 +18,5 @@ const table = connection.table();
}
]
*/
table.map(({method, path, settings: {description}}) => { });
+7
View File
@@ -0,0 +1,7 @@
// Type definitions for jest-matchers 20.0
// Project: https://github.com/facebook/jest#readme
// Definitions by: Joscha Feth <https://github.com/joscha>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="jest" />
export = expect;
@@ -0,0 +1,3 @@
import * as expect from 'jest-matchers';
expect('x').toEqual('x');
+22
View File
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"jest-matchers-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+4
View File
@@ -133,6 +133,10 @@ interface PNotifyOptions {
* Whether to escape the content of the text. (Not allow HTML.)
*/
text_escape?: boolean;
/**
* Support for PNotifyconfirm options
*/
confirm?: PNotifyconfirm
/**
* What styling classes to use. (Can be either "brighttheme", "jqueryui", "bootstrap2", "bootstrap3", "fontawesome" or a custom style object)
*/
+3 -3
View File
@@ -1,12 +1,12 @@
// Type definitions for jwt-decode v1.4.0
// Type definitions for jwt-decode v2.2.0
// Project: https://github.com/auth0/jwt-decode
// Definitions by: Giedrius Grabauskas <https://github.com/QuatroDevOfficial/>
// Definitions by: Giedrius Grabauskas <https://github.com/QuatroDevOfficial/>, Mads Madsen <https://github.com/madsmadsen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace JwtDecode {
interface JwtDecodeStatic {
(token: string): any;
(token: string, options?: { header: boolean }): any;
}
}
+7 -1
View File
@@ -9,4 +9,10 @@ interface TokenDto {
iat: number;
}
let decodedToken = jwtDecode(token) as TokenDto;
interface TokenHeaderDto {
typ: string;
alg: string;
}
let decodedTokenPayload = jwtDecode(token) as TokenDto;
let decodedTokenHeader = jwtDecode(token, { header: true }) as TokenHeaderDto;
+34 -97
View File
@@ -1,105 +1,42 @@
// Type definitions for massive-js 2.2
// Project: https://github.com/robconery/massive-js
// Type definitions for massive 3.x
// Project: https://github.com/dmfay/massive-js.git
// Definitions by: Pascal Birchler <https://github.com/swissspidy>
// Clarence Ho <https://github.com/clarenceh>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
export namespace massive {
interface ConnectionOptions {
connectionString?: string;
db?: string;
}
/// <reference types="node" />
interface Doc {
findDoc(context: any, callback: ResultCallback): void;
searchDoc(
options: { keys: string[], term: string },
callback: ResultCallback): void;
saveDoc(context: string, callback: ResultCallback): void;
destroy(context: any, callback: ResultCallback): void;
}
export = massive;
interface QueryFile {
schema: string;
name: string;
db: Massive;
delimitedName: string;
delimitedSchema: string;
fullname: string;
delimitedFullName: string;
sql: string;
filePath: string;
}
declare function massive(
connection: object | string,
loaderConfig?: object,
driverConfig?: object): Promise<massive.Database>;
interface QueryFunction {
find(params: any|any[], callback: ResultCallback): void;
}
declare namespace massive {
interface ConnectionInfo {
user?: string;
database?: string;
password?: string | null;
port?: number;
host?: string;
ssl?: boolean;
application_name?: string;
fallback_application_name?: boolean;
}
interface QueryArguments {
sql: string;
options: any;
params: any;
next: ResultCallback;
}
interface Database {
attach(ctor: any, ...sources: any[]): Promise<any>;
detach(entity: string, collection: string): void;
reload(): void;
query(query: any, params: any, options: any): Promise<any>;
saveDoc(collection: any, doc: any): any;
createDocumentTable(path: any): Promise<any>;
getObject(path: any, collection: any): object;
dropTable(table: string, options: any): void;
createSchema(schemaName: string): void;
dropSchema(schemaName: string, options: any): void;
[name: string]: any;
}
}
export interface Massive {
custom: any;
comment: Table;
friendship: Table;
participation: Table;
person: Table;
practice: Table;
practicesession: Table;
sport: Table;
testdata(callback: ResultCallback): void;
team: Table;
teammember: Table;
teamsport: Table;
scriptsDir: string;
connectionString: string;
query(): void;
stream(): void;
executeSqlFile(args: any, next: ResultCallback): void;
end(): void;
tables: Array<massive.Doc|Table>;
views: any[];
queryFiles: massive.QueryFile[];
schemas: any[];
functions: any[];
allowedSchemas: string;
blacklist: string;
exceptions: string;
excludeFunctions: boolean;
functionBlacklist: string;
}
export type ResultCallback = (err: Error, res: any) => void;
export type ConnectCallback = (err: Error, db: Massive) => void;
export interface QueryOptions {
limit?: number;
order?: string;
offset?: number;
columns?: string[];
}
export interface Table {
count(context: any, callback: ResultCallback): void;
find(context: any, callback: ResultCallback): void;
find(context: any, options: QueryOptions, callback: ResultCallback): void;
findOne(context: any, callback: ResultCallback): void;
findOne(context: any, options: QueryOptions, callback: ResultCallback): void;
insert(context: any, callback: ResultCallback): void;
save(context: any, callback: ResultCallback): void;
update(context: any, callback: ResultCallback): void;
update(context: any, data: any, callback: ResultCallback): void;
destroy(context: any, callback: ResultCallback): void;
}
export function connectSync(options: massive.ConnectionOptions): Massive;
export function connect(options: massive.ConnectionOptions, callback: ConnectCallback): void;
export function run(context: string, filter: number|number[], callback: ResultCallback): void;
export function saveDoc(name: string, data: any, callback: ResultCallback): void;
+8 -3
View File
@@ -1,5 +1,10 @@
import * as Massive from 'massive';
import massive = require('massive');
Massive.connect({connectionString: 'foo'}, (err: Error, db: Massive.Massive) => {});
let dbconn: massive.Database;
Massive.run('foo', 123, (err: Error, db: Massive.Massive) => {});
massive('postgres://app:password@localhost:5432/app').then( db => {
console.log(`DB connected successfully`);
dbconn = db;
}).catch(err => {
console.error(`Error connecting DB`);
});
+2 -2
View File
@@ -2,7 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5"
"es2015"
],
"noImplicitAny": true,
"noImplicitThis": true,
@@ -19,4 +19,4 @@
"index.d.ts",
"massive-tests.ts"
]
}
}
+2 -2
View File
@@ -319,8 +319,8 @@ class DeepDownTheTree extends React.Component<{} & {muiTheme: MuiTheme}, {}> {
}
}
const MuiThemeableFunction = muiThemeable()((props: {label: string, muiTheme?: MuiTheme}) => {
type Props = { label: string, muiTheme?: MuiTheme };
const MuiThemeableFunction = muiThemeable()<React.StatelessComponent<Props>, Props>(props => {
return (
<span style={{color: props.muiTheme.palette.textColor}}>
Applied the Theme to functional component: {props.label}.
+2 -1
View File
@@ -316,8 +316,9 @@ declare namespace Materialize {
* The string function call that you want to make when the user scrolls to the threshold.
* It will only be called once.
* Example: 'console.log("hello, world!")';
* or callback: () => { console.log('hello world'); }
*/
callback?: string;
callback?: string | (() => void);
}
interface TabOptions {
+44 -46
View File
@@ -48,12 +48,12 @@ export interface MongoClientOptions extends
SocketOptions,
SSLOptions,
HighAvailabilityOptions {
// The logging level (error/warn/info/debug)
loggerLevel?: string;
// Custom logger object
logger?: Object;
// Default: false;
validateOptions?: Object;
// The logging level (error/warn/info/debug)
loggerLevel?: string;
// Custom logger object
logger?: Object;
// Default: false;
validateOptions?: Object;
}
export interface SSLOptions {
@@ -93,7 +93,7 @@ export class ReadPreference {
constructor(mode: string, tags: Object);
mode: string;
tags: any;
options: { maxStalenessSeconds?: number}; // Max Secondary Read Stalleness in Seconds
options: { maxStalenessSeconds?: number }; // Max Secondary Read Stalleness in Seconds
static PRIMARY: string;
static PRIMARY_PREFERRED: string;
static SECONDARY: string;
@@ -105,7 +105,7 @@ export class ReadPreference {
// http://mongodb.github.io/node-mongodb-native/2.2/api/Db.html
export interface DbCreateOptions {
// If the database authentication is dependent on another databaseName.
authSource?: string;
// Default: null;https://docs.mongodb.com/manual/reference/write-concern/#write-concern
@@ -170,14 +170,14 @@ export interface ServerOptions extends SSLOptions {
}
// http://mongodb.github.io/node-mongodb-native/2.2/api/Mongos.html
export interface MongosOptions extends SSLOptions, HighAvailabilityOptions{
export interface MongosOptions extends SSLOptions, HighAvailabilityOptions {
// Default: 15; Cutoff latency point in MS for MongoS proxy selection
acceptableLatencyMS?: number;
socketOptions?: SocketOptions;
}
// http://mongodb.github.io/node-mongodb-native/2.2/api/ReplSet.html
export interface ReplSetOptions extends SSLOptions, HighAvailabilityOptions {
export interface ReplSetOptions extends SSLOptions, HighAvailabilityOptions {
// The max staleness to secondary reads (values under 10 seconds cannot be guaranteed);
maxStalenessSeconds?: number;
// The name of the replicaset to connect to.
@@ -215,20 +215,20 @@ export class Db extends EventEmitter {
close(forceClose?: boolean): Promise<void>;
close(forceClose: boolean, callback: MongoCallback<void>): void;
// http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#collection
collection(name: string): Collection;
collection(name: string, callback: MongoCallback<Collection>): Collection;
collection(name: string, options: DbCollectionOptions, callback: MongoCallback<Collection>): Collection;
collection<TSchema = Default>(name: string): Collection<TSchema>;
collection<TSchema = Default>(name: string, callback: MongoCallback<Collection<TSchema>>): Collection<TSchema>;
collection<TSchema = Default>(name: string, options: DbCollectionOptions, callback: MongoCallback<Collection<TSchema>>): Collection<TSchema>;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#collections
collections(): Promise<Collection[]>;
collections(callback: MongoCallback<Collection[]>): void;
collections(): Promise<Collection<Default>[]>;
collections(callback: MongoCallback<Collection<Default>[]>): void;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#command
command(command: Object, callback: MongoCallback<any>): void;
command(command: Object, options?: { readPreference: ReadPreference | string }): Promise<any>;
command(command: Object, options: { readPreference: ReadPreference | string }, callback: MongoCallback<any>): void;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#createCollection
createCollection(name: string, callback: MongoCallback<Collection>): void;
createCollection(name: string, options?: CollectionCreateOptions): Promise<Collection>;
createCollection(name: string, options: CollectionCreateOptions, callback: MongoCallback<Collection>): void;
createCollection<TSchema = Default>(name: string, callback: MongoCallback<Collection<TSchema>>): void;
createCollection<TSchema = Default>(name: string, options?: CollectionCreateOptions): Promise<Collection<TSchema>>;
createCollection<TSchema = Default>(name: string, options: CollectionCreateOptions, callback: MongoCallback<Collection<TSchema>>): void;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#createIndex
createIndex(name: string, fieldOrSpec: string | Object, callback: MongoCallback<any>): void;
createIndex(name: string, fieldOrSpec: string | Object, options?: IndexOptions): Promise<any>;
@@ -270,9 +270,9 @@ export class Db extends EventEmitter {
removeUser(username: string, options?: { w?: number | string, wtimeout?: number, j?: boolean }): Promise<any>;
removeUser(username: string, options: { w?: number | string, wtimeout?: number, j?: boolean }, callback: MongoCallback<any>): void;
// http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#renameCollection
renameCollection(fromCollection: string, toCollection: string, callback: MongoCallback<Collection>): void;
renameCollection(fromCollection: string, toCollection: string, options?: { dropTarget?: boolean }): Promise<Collection>;
renameCollection(fromCollection: string, toCollection: string, options: { dropTarget?: boolean }, callback: MongoCallback<Collection>): void;
renameCollection<TSchema = Default>(fromCollection: string, toCollection: string, callback: MongoCallback<Collection<TSchema>>): void;
renameCollection<TSchema = Default>(fromCollection: string, toCollection: string, options?: { dropTarget?: boolean }): Promise<Collection<TSchema>>;
renameCollection<TSchema = Default>(fromCollection: string, toCollection: string, options: { dropTarget?: boolean }, callback: MongoCallback<Collection<TSchema>>): void;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#stats
stats(callback: MongoCallback<any>): void;
stats(options?: { scale?: number }): Promise<any>;
@@ -443,7 +443,7 @@ export interface FSyncOptions {
}
// Documentation : http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html
export interface Collection {
export interface Collection<TSchema = Default> {
// Get the collection name.
collectionName: string;
// Get the full collection namespace.
@@ -455,10 +455,8 @@ export interface Collection {
// Get current index hint for collection.
hint: any;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#aggregate
aggregate(pipeline: Object[], callback: MongoCallback<any>): AggregationCursor<any>;
aggregate(pipeline: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback<any>): AggregationCursor<any>;
aggregate<T>(pipeline: Object[], callback: MongoCallback<any>): AggregationCursor<T>;
aggregate<T>(pipeline: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback<any>): AggregationCursor<T>;
aggregate<T = TSchema>(pipeline: Object[], callback: MongoCallback<T[]>): AggregationCursor<T>;
aggregate<T = TSchema>(pipeline: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback<T[]>): AggregationCursor<T>;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#bulkWrite
bulkWrite(operations: Object[], callback: MongoCallback<BulkWriteOpResultObject>): void;
bulkWrite(operations: Object[], options?: CollectionBluckWriteOptions): Promise<BulkWriteOpResultObject>;
@@ -497,25 +495,25 @@ export interface Collection {
dropIndexes(): Promise<any>;
dropIndexes(callback?: MongoCallback<any>): void;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#find
find<T = Default>(query?: Object): Cursor<T>;
find<T = TSchema>(query?: Object): Cursor<T>;
/** @deprecated */
find<T = Default>(query: Object, fields?: Object, skip?: number, limit?: number, timeout?: number): Cursor<T>;
find<T = TSchema>(query: Object, fields?: Object, skip?: number, limit?: number, timeout?: number): Cursor<T>;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOne
findOne<T = Default>(filter: Object, callback: MongoCallback<T>): void;
findOne<T = Default>(filter: Object, options?: FindOneOptions): Promise<T>;
findOne<T = Default>(filter: Object, options: FindOneOptions, callback: MongoCallback<T>): void;
findOne<T = TSchema>(filter: Object, callback: MongoCallback<T>): void;
findOne<T = TSchema>(filter: Object, options?: FindOneOptions): Promise<T>;
findOne<T = TSchema>(filter: Object, options: FindOneOptions, callback: MongoCallback<T>): void;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndDelete
findOneAndDelete(filter: Object, callback: MongoCallback<FindAndModifyWriteOpResultObject>): void;
findOneAndDelete(filter: Object, options?: { projection?: Object, sort?: Object, maxTimeMS?: number }): Promise<FindAndModifyWriteOpResultObject>;
findOneAndDelete(filter: Object, options: { projection?: Object, sort?: Object, maxTimeMS?: number }, callback: MongoCallback<FindAndModifyWriteOpResultObject>): void;
findOneAndDelete(filter: Object, callback: MongoCallback<FindAndModifyWriteOpResultObject<TSchema>>): void;
findOneAndDelete(filter: Object, options?: { projection?: Object, sort?: Object, maxTimeMS?: number }): Promise<FindAndModifyWriteOpResultObject<TSchema>>;
findOneAndDelete(filter: Object, options: { projection?: Object, sort?: Object, maxTimeMS?: number }, callback: MongoCallback<FindAndModifyWriteOpResultObject<TSchema>>): void;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndReplace
findOneAndReplace(filter: Object, replacement: Object, callback: MongoCallback<FindAndModifyWriteOpResultObject>): void;
findOneAndReplace(filter: Object, replacement: Object, options?: FindOneAndReplaceOption): Promise<FindAndModifyWriteOpResultObject>;
findOneAndReplace(filter: Object, replacement: Object, options: FindOneAndReplaceOption, callback: MongoCallback<FindAndModifyWriteOpResultObject>): void;
findOneAndReplace(filter: Object, replacement: Object, callback: MongoCallback<FindAndModifyWriteOpResultObject<TSchema>>): void;
findOneAndReplace(filter: Object, replacement: Object, options?: FindOneAndReplaceOption): Promise<FindAndModifyWriteOpResultObject<TSchema>>;
findOneAndReplace(filter: Object, replacement: Object, options: FindOneAndReplaceOption, callback: MongoCallback<FindAndModifyWriteOpResultObject<TSchema>>): void;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndUpdate
findOneAndUpdate(filter: Object, update: Object, callback: MongoCallback<FindAndModifyWriteOpResultObject>): void;
findOneAndUpdate(filter: Object, update: Object, options?: FindOneAndReplaceOption): Promise<FindAndModifyWriteOpResultObject>;
findOneAndUpdate(filter: Object, update: Object, options: FindOneAndReplaceOption, callback: MongoCallback<FindAndModifyWriteOpResultObject>): void;
findOneAndUpdate(filter: Object, update: Object, callback: MongoCallback<FindAndModifyWriteOpResultObject<TSchema>>): void;
findOneAndUpdate(filter: Object, update: Object, options?: FindOneAndReplaceOption): Promise<FindAndModifyWriteOpResultObject<TSchema>>;
findOneAndUpdate(filter: Object, update: Object, options: FindOneAndReplaceOption, callback: MongoCallback<FindAndModifyWriteOpResultObject<TSchema>>): void;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#geoHaystackSearch
geoHaystackSearch(x: number, y: number, callback: MongoCallback<any>): void;
geoHaystackSearch(x: number, y: number, options?: GeoHaystackSearchOptions): Promise<any>;
@@ -584,9 +582,9 @@ export interface Collection {
/** @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>;
rename(newName: string, options: { dropTarget?: boolean }, callback: MongoCallback<Collection>): void;
rename(newName: string, callback: MongoCallback<Collection<TSchema>>): void;
rename(newName: string, options?: { dropTarget?: boolean }): Promise<Collection<TSchema>>;
rename(newName: string, options: { dropTarget?: boolean }, callback: MongoCallback<Collection<TSchema>>): void;
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#replaceOne
replaceOne(filter: Object, doc: Object, callback: MongoCallback<UpdateWriteOpResult>): void;
replaceOne(filter: Object, doc: Object, options?: ReplaceOneOptions): Promise<UpdateWriteOpResult>;
@@ -743,9 +741,9 @@ export interface DeleteWriteOpResultObject {
}
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#~findAndModifyWriteOpResult
export interface FindAndModifyWriteOpResultObject {
export interface FindAndModifyWriteOpResultObject<TSchema = Default> {
//Document returned from findAndModify command.
value?: any;
value?: TSchema;
//The raw lastErrorObject returned from the command.
lastErrorObject?: any;
//Is 1 if the command executed correctly.
@@ -1239,7 +1237,7 @@ export interface GridFSBucketOpenUploadStreamOptions {
// https://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucketReadStream.html
export class GridFSBucketReadStream extends Readable {
constructor(chunks: Collection, files: Collection, readPreference: Object, filter: Object, options?: GridFSBucketReadStreamOptions);
constructor(chunks: Collection<any>, files: Collection<any>, readPreference: Object, filter: Object, options?: GridFSBucketReadStreamOptions);
}
// https://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucketReadStream.html
+3
View File
@@ -34,6 +34,9 @@ declare namespace multer {
parts?: number;
/** For multipart forms, the max number of header key=> value pairs to parse Default: 2000(same as node's http). */
headerPairs?: number;
/** Keep the full path of files instead of just the base name (Default: false) */
preservePath?: boolean;
};
/** A function to control which files to upload and which to skip. */
fileFilter?: (req: Express.Request, file: Express.Multer.File, callback: (error: Error, acceptFile: boolean) => void) => void;
+2 -10
View File
@@ -448,9 +448,9 @@ declare namespace multiplex {
/**
* Performs the specified action on each element of the List.
* @param action The action function to perform on each element of the List.
* @param action The action function to perform on each element of an List; the second parameter of the function represents the index of the source element.
*/
forEach(action: (item: T) => void): void
forEach(action: (item: T, index: number) => void): void
/**
@@ -1741,14 +1741,6 @@ declare namespace multiplex {
*/
firstOrDefault(predicate: (item: T) => boolean, defaultValue: T): T
/**
* Performs the specified action on each element of an Enumerable.
* @param action The action function to perform on each element of an Enumerable.
*/
forEach(action: (item: T) => void): void
/**
* Performs the specified action on each element of an Enumerable.
* @param action The action function to perform on each element of an Enumerable; the second parameter of the function represents the index of the source element.
+5 -5
View File
@@ -8,8 +8,8 @@
*/
interface StringMap {
[index: string]: string;
interface OptionMap {
[index: string]: string | string[] | boolean;
}
/**
@@ -17,14 +17,14 @@ interface StringMap {
*/
declare class ParsedOption {
public argv: string[];
public options: StringMap;
public options: OptionMap;
constructor(argv: string[], options: StringMap);
constructor(argv: string[], options: OptionMap);
public empty(): boolean;
}
interface EventCallback {
(args: string[], options: StringMap): void;
(args: string[], options: OptionMap): void;
}
interface ErrorFunc {
+21
View File
@@ -0,0 +1,21 @@
// Type definitions for normalize-url 1.9
// Project: https://github.com/sindresorhus/normalize-url
// Definitions by: odin3 <https://github.com/odin3>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace NormalizeUrl {
interface NormalizeUrlArgs {
normalizeProtocol?: boolean;
normalizeHttps?: boolean;
stripFragment?: boolean;
stripWWW?: boolean;
removeQueryParameters?: string[];
removeTrailingSlash?: boolean;
removeDirectoryIndex?: RegExp[];
}
// tslint:disable-next-line align
function normalizeUrl(url: string, args?: NormalizeUrlArgs): string;
}
export = NormalizeUrl.normalizeUrl;
+21
View File
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts"
]
}
+7
View File
@@ -0,0 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
// This package uses the Function type, and it will take effort to fix.
"ban-types": false
}
}
+1 -1
View File
@@ -102,7 +102,7 @@ declare namespace observejs {
}
interface ArrayObserver_instance extends Observable {
open(onChange:(splices:Array<splice>)=>any):void
open(onChange: (splices: Array<splice>, oldSplices: Array<splice>) => any): void
}
/**
+243 -241
View File
@@ -1,293 +1,295 @@
// Type definitions for Packery v1.4.1
// Project: http://packery.metafizzy.co
// Definitions by: Piraveen Kamalathas from Kilix <https://github.com/piraveen>
// Definitions by: Piraveen Kamalathas from Kilix <https://github.com/piraveen>
// Juliën Hanssens <https://github.com/hanssens>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'packery' {
interface PackeryOptions {
/**
* [itemSelector Specifies which child elements to be used as item elements. Setting itemSelector is always recommended. itemSelector is useful to exclude sizing elements]
* @type {string}
*/
itemSelector?: string;
export interface PackeryOptions {
/**
* [itemSelector Specifies which child elements to be used as item elements. Setting itemSelector is always recommended. itemSelector is useful to exclude sizing elements]
* @type {string}
*/
itemSelector?: string;
/**
* [columnWidth The width of a column of a horizontal grid. When set, Packery will align item elements horizontally to this grid]
* @type {number}
*/
columnWidth?: number;
/**
* [columnWidth The width of a column of a horizontal grid. When set, Packery will align item elements horizontally to this grid]
* @type {number}
*/
columnWidth?: number;
/**
* [rowHeight Height of a row of a vertical grid. When set, Packery will align item elements vertically to this grid]
* @type {number}
*/
rowHeight?: number;
/**
* [rowHeight Height of a row of a vertical grid. When set, Packery will align item elements vertically to this grid]
* @type {number}
*/
rowHeight?: number;
/**
* [gutter The space between item elements, both vertically and horizontally]
* @type {number}
*/
gutter?: number;
/**
* [gutter The space between item elements, both vertically and horizontally]
* @type {number}
*/
gutter?: number;
/**
* [percentPosition Will set item position in percent values, rather than pixel values. percentPosition works well with percent-width items, as items will not transition their position on resize]
* @type {boolean}
*/
percentPosition?: boolean;
/**
* [percentPosition Will set item position in percent values, rather than pixel values. percentPosition works well with percent-width items, as items will not transition their position on resize]
* @type {boolean}
*/
percentPosition?: boolean;
/**
* [stamp Specifies which elements are stamped within the layout. These are special layout elements which will not be laid out by Packery. Rather, Packery will layout item elements around stamped elements]
* @type {string}
*/
stamp?: string;
/**
* [stamp Specifies which elements are stamped within the layout. These are special layout elements which will not be laid out by Packery. Rather, Packery will layout item elements around stamped elements]
* @type {string}
*/
stamp?: string;
/**
* [isHorizontal Arranges items horizontally instead of vertically]
* @type {boolean}
*/
isHorizontal?: boolean;
/**
* [isHorizontal Arranges items horizontally instead of vertically]
* @type {boolean}
*/
isHorizontal?: boolean;
/**
* [isOriginLeft Controls the horizontal flow of the layout. By default, item elements start positioning at the left. Set to false for right-to-left layouts]
* @type {boolean}
*/
isOriginLeft?: boolean;
/**
* [isOriginLeft Controls the horizontal flow of the layout. By default, item elements start positioning at the left. Set to false for right-to-left layouts]
* @type {boolean}
*/
isOriginLeft?: boolean;
/**
* [isOriginTop Controls the vertical flow of the layout. By default, item elements start positioning at the top. Set to false for bottom-up layouts. It’s like Tetris!]
* @type {boolean}
*/
isOriginTop?: boolean;
/**
* [isOriginTop Controls the vertical flow of the layout. By default, item elements start positioning at the top. Set to false for bottom-up layouts. It’s like Tetris!]
* @type {boolean}
*/
isOriginTop?: boolean;
/**
* [transitionDuration The time duration of transitions for item elements]
* @type {string}
*/
transitionDuration?: string;
/**
* [transitionDuration The time duration of transitions for item elements]
* @type {string}
*/
transitionDuration?: string;
/**
* [containerStyle CSS styles that are applied to the container element. To disable Packery from setting any CSS to the container element, set containerStyle: null]
* @type {Object}
*/
containerStyle?: Object;
/**
* [containerStyle CSS styles that are applied to the container element. To disable Packery from setting any CSS to the container element, set containerStyle: null]
* @type {Object}
*/
containerStyle?: Object;
/**
* [isResizeBound Binds layout to window resizing]
* @type {boolean}
*/
isResizeBound?: boolean;
/**
* [isResizeBound Binds layout to window resizing]
* @type {boolean}
*/
isResizeBound?: boolean;
/**
* [isInitLayout Enables layout on initialization. Set this to false to disable layout on initialization, so you can use methods or add events before the initial layout]
* @type {boolean}
*/
isInitLayout?: boolean;
}
/**
* [isInitLayout Enables layout on initialization. Set this to false to disable layout on initialization, so you can use methods or add events before the initial layout]
* @type {boolean}
*/
isInitLayout?: boolean;
}
declare class Packery {
constructor(element: Element, options?: Object);
export class Packery {
constructor(element: Element, options?: Object);
/**
* [addItems Add item elements to the Packery instance]
* @param {Element} elements [description]
*/
addItems(elements: Element): void;
/**
* [addItems Add item elements to the Packery instance]
* @param {Element} elements [description]
*/
addItems(elements: Element): void;
/**
* [addItems Add item elements to the Packery instance]
* @param {NodeList} elements [description]
*/
addItems(elements: NodeList): void;
/**
* [addItems Add item elements to the Packery instance]
* @param {NodeList} elements [description]
*/
addItems(elements: NodeList): void;
/**
* [addItems Add item elements to the Packery instance]
* @param {Array<Element>} elements [description]
*/
addItems(elements: Array<Element>): void;
/**
* [addItems Add item elements to the Packery instance]
* @param {Array<Element>} elements [description]
*/
addItems(elements: Array<Element>): void;
/**
* [appended Add and lay out newly appended item elements]
* @param {Element} elements [description]
*/
appended(elements: Element): void;
/**
* [appended Add and lay out newly appended item elements]
* @param {Element} elements [description]
*/
appended(elements: Element): void;
/**
* [appended Add and lay out newly appended item elements]
* @param {NodeList} elements [description]
*/
appended(elements: NodeList): void;
/**
* [appended Add and lay out newly appended item elements]
* @param {NodeList} elements [description]
*/
appended(elements: NodeList): void;
/**
* [appended Add and lay out newly appended item elements]
* @param {Array<Element>} elements [description]
*/
appended(elements: Array<Element>): void;
/**
* [appended Add and lay out newly appended item elements]
* @param {Array<Element>} elements [description]
*/
appended(elements: Array<Element>): void;
/**
* [bindDraggabillyEvents Bind Draggabilly events, so that the Packery instance will layout around the dragged element]
* @param {any} draggie [description]
*/
bindDraggabillyEvents(draggie: any): void;
/**
* [bindDraggabillyEvents Bind Draggabilly events, so that the Packery instance will layout around the dragged element]
* @param {any} draggie [description]
*/
bindDraggabillyEvents(draggie: any): void;
/**
* [bindResize Binds event listener to window resize, so layout is triggered when the browser window is resized]
*/
bindResize(): void;
/**
* [bindResize Binds event listener to window resize, so layout is triggered when the browser window is resized]
*/
bindResize(): void;
/**
* [bindUIDraggableEvents Bind jQuery UI Draggable events, so that the Packery instance will layout around the dragged element]
* @param {any} elements [jQuery UI]
*/
bindUIDraggableEvents($element: any): void;
/**
* [bindUIDraggableEvents Bind jQuery UI Draggable events, so that the Packery instance will layout around the dragged element]
* @param {any} elements [jQuery UI]
*/
bindUIDraggableEvents($element: any): void;
/**
* [data Get the Packery instance from an element. Note this method is of Packery, rather than of a Packery instance]
* @param {Element} element [description]
* @return {Packery} [description]
*/
data(element: Element): Packery;
/**
* [data Get the Packery instance from an element. Note this method is of Packery, rather than of a Packery instance]
* @param {Element} element [description]
* @return {Packery} [description]
*/
data(element: Element): Packery;
/**
* [destroy Removes the Packery functionality completely. This will return the element back to its pre-initialized state]
*/
destroy(): void;
/**
* [destroy Removes the Packery functionality completely. This will return the element back to its pre-initialized state]
*/
destroy(): void;
/**
* [fit Fit an item element within the layout, and have other item elements laid out around it. This method is useful when expanding an element, and keeping it in its same position.]
* @param {any} element [description]
* @param {number} x [description]
* @param {number} y [description]
*/
fit(element: Element, x?: number, y?: number): void;
/**
* [fit Fit an item element within the layout, and have other item elements laid out around it. This method is useful when expanding an element, and keeping it in its same position.]
* @param {any} element [description]
* @param {number} x [description]
* @param {number} y [description]
*/
fit(element: Element, x?: number, y?: number): void;
/**
* [getItemElements Get an array of elements used as the Packery instance's items.]
* @return {Array<Element>} [description]
*/
getItemElements(): Array<Element>;
/**
* [getItemElements Get an array of elements used as the Packery instance's items.]
* @return {Array<Element>} [description]
*/
getItemElements(): Array<Element>;
/**
* [getItem Get a Packery.Item from an element]
* @param {Element} element [description]
* @return {any} [Packery.item]
*/
getItem(element: Element): any;
/**
* [getItem Get a Packery.Item from an element]
* @param {Element} element [description]
* @return {any} [Packery.item]
*/
getItem(element: Element): any;
/**
* [layout Lay out all item elements.]
*/
layout(): void;
/**
* [layout Lay out all item elements.]
*/
layout(): void;
/**
* [layoutItems Lay out specified items]
* @param {Array<Packery.items>} items [description]
*/
layoutItems(items: Array<any>): void;
/**
* [layoutItems Lay out specified items]
* @param {Array<Packery.items>} items [description]
*/
layoutItems(items: Array<any>): void;
/**
* [off Remove an event listener]
* @param {string} eventName [description]
* @param {Function} listener [description]
* @return {Packery} [description]
*/
off(eventName: string, listener: Function): Packery;
/**
* [off Remove an event listener]
* @param {string} eventName [description]
* @param {Function} listener [description]
* @return {Packery} [description]
*/
off(eventName: string, listener: Function): Packery;
/**
* [on Add an event listener for certain events]
* @param {string} eventName [description]
* @param {Function} listener [description]
* @return {Packery} [description]
*/
on(eventName: string, listener: Function): Packery;
/**
* [on Add an event listener for certain events]
* @param {string} eventName [description]
* @param {Function} listener [description]
* @return {Packery} [description]
*/
on(eventName: string, listener: Function): Packery;
/**
* [once Add an event listener for certain events, to be triggered once]
* @param {string} eventName [description]
* @param {Function} listener [description]
*/
once(eventName: string, listener: Function): void;
/**
* [once Add an event listener for certain events, to be triggered once]
* @param {string} eventName [description]
* @param {Function} listener [description]
*/
once(eventName: string, listener: Function): void;
/**
* [prepended Add and lay out newly prepended item elements at the beginning of layout]
* @param {Element} elements [description]
*/
prepended(elements: Element): void;
/**
* [prepended Add and lay out newly prepended item elements at the beginning of layout]
* @param {Element} elements [description]
*/
prepended(elements: Element): void;
/**
* [prepended Add and lay out newly prepended item elements at the beginning of layout]
* @param {NodeList} elements [description]
*/
prepended(elements: NodeList): void;
/**
* [prepended Add and lay out newly prepended item elements at the beginning of layout]
* @param {NodeList} elements [description]
*/
prepended(elements: NodeList): void;
/**
* [prepended Add and lay out newly prepended item elements at the beginning of layout]
* @param {Array<Element>} elements [description]
*/
prepended(elements: Array<Element>): void;
/**
* [prepended Add and lay out newly prepended item elements at the beginning of layout]
* @param {Array<Element>} elements [description]
*/
prepended(elements: Array<Element>): void;
/**
* [reloadItems Recollect all item elements]
*/
reloadItems(): void;
/**
* [reloadItems Recollect all item elements]
*/
reloadItems(): void;
/**
* [remove Remove elements from the Packery instance, then from the DOM]
* @param {Element} elements [description]
*/
remove(elements: Element): void;
/**
* [remove Remove elements from the Packery instance, then from the DOM]
* @param {Element} elements [description]
*/
remove(elements: Element): void;
/**
* [remove Remove elements from the Packery instance, then from the DOM]
* @param {NodeList} elements [description]
*/
remove(elements: NodeList): void;
/**
* [remove Remove elements from the Packery instance, then from the DOM]
* @param {NodeList} elements [description]
*/
remove(elements: NodeList): void;
/**
* [remove Remove elements from the Packery instance, then from the DOM]
* @param {Array<Element>} elements [description]
*/
remove(elements: Array<Element>): void;
/**
* [remove Remove elements from the Packery instance, then from the DOM]
* @param {Array<Element>} elements [description]
*/
remove(elements: Array<Element>): void;
/**
* [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element]
* @param {Element} elements [description]
*/
stamp(elements: Element): void;
/**
* [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element]
* @param {Element} elements [description]
*/
stamp(elements: Element): void;
/**
* [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element]
* @param {NodeList} elements [description]
*/
stamp(elements: NodeList): void;
/**
* [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element]
* @param {NodeList} elements [description]
*/
stamp(elements: NodeList): void;
/**
* [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element]
* @param {Array<Element>} elements [description]
*/
stamp(elements: Array<Element>): void;
/**
* [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element]
* @param {Array<Element>} elements [description]
*/
stamp(elements: Array<Element>): void;
/**
* [unbindResize Un-bind layout to window resize event]
*/
unbindResize(): void;
/**
* [unbindResize Un-bind layout to window resize event]
*/
unbindResize(): void;
/**
* [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them]
* @param {Element} element [description]
*/
unstamp(element: Element): void;
/**
* [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them]
* @param {Element} element [description]
*/
unstamp(element: Element): void;
/**
* [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them]
* @param {NodeList} element [description]
*/
unstamp(element: NodeList): void;
/**
* [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them]
* @param {NodeList} element [description]
*/
unstamp(element: NodeList): void;
/**
* [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them]
* @param {Array<Element>} element [description]
*/
unstamp(element: Array<Element>): void;
}
/**
* [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them]
* @param {Array<Element>} element [description]
*/
unstamp(element: Array<Element>): void;
}
export = Packery;
}
+2 -4
View File
@@ -1,7 +1,5 @@
/// <reference types="jquery" />
import Packery = require('packery');
import { Packery, PackeryOptions } from 'packery';
import * as $ from 'jquery';
// TODO Add Draggabilly to bind Draggabilly Events
var container = document.querySelector('#container');
+1 -1
View File
@@ -198,7 +198,7 @@ function test_file() {
// The file either could n ot be read, or could not be saved to Parse.
});
Parse.Cloud.httpRequest({ url: file.url() }).then((response: Parse.Promise<Parse.Cloud.HttpResponse>) => {
Parse.Cloud.httpRequest({ url: file.url() }).then((response: Parse.Cloud.HttpResponse) => {
// result
});
@@ -31,13 +31,13 @@ interface User extends PassportLocalDocument {
last: Date;
}
const UserSchema: PassportLocalSchema = new Schema({
const UserSchema = new Schema({
username: String,
hash: String,
salt: String,
attempts: Number,
last: Date
});
}) as PassportLocalSchema;
let options: PassportLocalOptions = <PassportLocalOptions>{};
options.iterations = 25000;
+498 -266
View File
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -24,7 +24,7 @@ function basics() {
private renderer: PIXI.WebGLRenderer;
constructor() {
// Renderer should allow options from both WebGLRenderer and underlying SystemRenderer
this.renderer = new PIXI.WebGLRenderer(0, 0, { backgroundColor : 0x272d37, forceFXAA: true });
this.renderer = new PIXI.WebGLRenderer(0, 0, { backgroundColor: 0x272d37, forceFXAA: true });
}
}
@@ -1507,7 +1507,8 @@ function filters() {
maggot.position.y = Math.random() * bounds.height;
maggot.scale.set(1 + Math.random() * 0.3);
maggot.original = maggot.scale.clone();
//tslint:disable-next-line:whitespace
maggot.original = (<PIXI.Point>maggot.scale).clone();
this.maggots.push(maggot);
}
+1 -1
View File
@@ -170,7 +170,7 @@ function test_addContainer()
function test_on_EventType1(){
var quillEditor = new Quill('#editor');
quillEditor.on('text-change', (newDelta, oldDelta, source)=>{
quillEditor.on('text-change', <T>(newDelta: T, oldDelta: T, source: string)=>{
// happened
});
+45 -1
View File
@@ -1,6 +1,10 @@
// Type definitions for ramda
// Project: https://github.com/donnut/typescript-ramda
// Definitions by: Erwin Poeze <https://github.com/donnut>, Matt DeKrey <https://github.com/mdekrey>, Liam Goodacre <https://github.com/LiamGoodacre>, Matt Dziuban <https://github.com/mrdziuban>
// Definitions by: Erwin Poeze <https://github.com/donnut>
// Matt DeKrey <https://github.com/mdekrey>
// Liam Goodacre <https://github.com/LiamGoodacre>
// Matt Dziuban <https://github.com/mrdziuban>
// Stephen King <https://github.com/sbking>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@@ -75,6 +79,41 @@ declare namespace R {
}
// @see https://gist.github.com/donnut/fd56232da58d25ceecf1, comment by @albrow
interface CurriedTypeGuard2<T1, T2, R extends T2> {
(t1: T1): (t2: T2) => t2 is R;
(t1: T1, t2: T2): t2 is R;
}
interface CurriedTypeGuard3<T1, T2, T3, R extends T3> {
(t1: T1): CurriedTypeGuard2<T2, T3, R>;
(t1: T1, t2: T2): (t3: T3) => t3 is R;
(t1: T1, t2: T2, t3: T3): t3 is R;
}
interface CurriedTypeGuard4<T1, T2, T3, T4, R extends T4> {
(t1: T1): CurriedTypeGuard3<T2, T3, T4, R>;
(t1: T1, t2: T2): CurriedTypeGuard2<T3, T4, R>;
(t1: T1, t2: T2, t3: T3): (t4: T4) => t4 is R;
(t1: T1, t2: T2, t3: T3, t4: T4): t4 is R;
}
interface CurriedTypeGuard5<T1, T2, T3, T4, T5, R extends T5> {
(t1: T1): CurriedTypeGuard4<T2, T3, T4, T5, R>;
(t1: T1, t2: T2): CurriedTypeGuard3<T3, T4, T5, R>;
(t1: T1, t2: T2, t3: T3): CurriedTypeGuard2<T4, T5, R>;
(t1: T1, t2: T2, t3: T3, t4: T4): (t5: T5) => t5 is R;
(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): t5 is R;
}
interface CurriedTypeGuard6<T1, T2, T3, T4, T5, T6, R extends T6> {
(t1: T1): CurriedTypeGuard5<T2, T3, T4, T5, T6, R>;
(t1: T1, t2: T2): CurriedTypeGuard4<T3, T4, T5, T6, R>;
(t1: T1, t2: T2, t3: T3): CurriedTypeGuard3<T4, T5, T6, R>;
(t1: T1, t2: T2, t3: T3, t4: T4): CurriedTypeGuard2<T5, T6, R>;
(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): (t6: T6) => t6 is R;
(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6): t6 is R;
}
interface CurriedFunction2<T1, T2, R> {
(t1: T1): (t2: T2) => R;
(t1: T1, t2: T2): R;
@@ -392,6 +431,11 @@ declare namespace R {
* Returns a curried equivalent of the provided function. The curried function has two unusual capabilities.
* First, its arguments needn't be provided one at a time.
*/
curry<T1, T2, TResult extends T2>(fn: (a: T1, b: T2) => b is TResult): CurriedTypeGuard2<T1,T2, TResult>
curry<T1, T2, T3, TResult extends T3>(fn: (a: T1, b: T2, c: T3) => c is TResult): CurriedTypeGuard3<T1,T2, T3, TResult>
curry<T1, T2, T3, T4, TResult extends T4>(fn: (a: T1, b: T2, c: T3, d: T4) => d is TResult): CurriedTypeGuard4<T1,T2, T3, T4, TResult>
curry<T1, T2, T3, T4, T5, TResult extends T5>(fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => e is TResult): CurriedTypeGuard5<T1,T2, T3, T4, T5, TResult>
curry<T1, T2, T3, T4, T5, T6, TResult extends T6>(fn: (a: T1, b: T2, c: T3, d: T4, e: T5, f: T6) => f is TResult): CurriedTypeGuard6<T1,T2, T3, T4, T5, T6, TResult>
curry<T1, T2, TResult>(fn: (a: T1, b: T2) => TResult): CurriedFunction2<T1,T2, TResult>
curry<T1, T2, T3, TResult>(fn: (a: T1, b: T2, c: T3) => TResult): CurriedFunction3<T1,T2, T3, TResult>
curry<T1, T2, T3, T4, TResult>(fn: (a: T1, b: T2, c: T3, d: T4) => TResult): CurriedFunction4<T1,T2, T3, T4, TResult>
+19
View File
@@ -86,6 +86,25 @@ class F2 {
var z2:number = addTwoNumbersCurried(2,3);
}
() => {
interface Car { speed?: number; }
interface FastCar { speed: number; }
const typeGuard = function(a: number, b: number, c: number, d: number, e: number, car: Car): car is FastCar {
return car.speed !== undefined;
}
const typeGuardCurried = R.curry(typeGuard);
const drive = function(fastCar: FastCar) {};
const cars: Car[] = [{ speed: 65 }, {}];
for (const car of cars) {
if (typeGuardCurried(1)(2)(3)(4)(5)(car)) {
drive(car);
}
}
}
() => {
const addFour = (a:number) => (b:number) => (c:number) => (d:number) => a + b + c + d;
const uncurriedAddFour = R.uncurryN<number>(4, addFour);
+12 -7
View File
@@ -1,15 +1,20 @@
// Type definitions for react-icon-base 2.0
// Project: https://github.com/gorangajic/react-icon-base#readme
// Definitions by: Alexandre Paré <https://github.com/apare>
// Definitions by: Alexandre Paré <https://github.com/apare>, Karol Janyst <https://github.com/LKay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
import * as React from 'react';
import * as React from "react";
export interface IconBaseProps {
color?: string;
size?: string | number;
style?: React.CSSProperties;
export = IconBaseClass;
declare namespace IconBaseClass {
interface IconBaseProps {
color?: string;
size?: string | number;
style?: React.CSSProperties;
viewBox?: string;
}
}
export default class IconBase extends React.Component<IconBaseProps, any> {}
declare class IconBaseClass extends React.Component<IconBaseClass.IconBaseProps, any> {}
@@ -1,4 +1,4 @@
import * as React from 'react';
import IconBase from 'react-icon-base';
import * as React from "react";
import * as IconBase from "react-icon-base";
export default <IconBase size={30} color='aliceblue' style={{ margin: "30px" }} />;
export default <IconBase size={ 30 } color="aliceblue" style={ { margin: "30px" } } />;
+2 -2
View File
@@ -111,7 +111,7 @@ interface TransitionProps {
* <StaggeredMotion/>
*/
styles: Array<TransitionStyle> | InterpolateFunction;
children: (interpolatedStyles: Array<TransitionPlainStyle>) => ReactElement<any>;
children?: (interpolatedStyles: Array<TransitionPlainStyle>) => ReactElement<any>;
/**
* Triggers when new elements appears
* @param styleThatEntered
@@ -123,7 +123,7 @@ interface TransitionProps {
*/
willLeave?: (styleThatLeft: TransitionStyle) => Style | void;
}
export class TransitionMotion extends Component<any, any> { }
export class TransitionMotion extends Component<TransitionProps, any> { }
interface StaggeredMotionProps {
+2 -2
View File
@@ -7273,9 +7273,9 @@ export interface SettingsStatic {
/**
* @enum('default', 'light-content')
* @enum('default', 'light-content', 'dark-content')
*/
export type StatusBarStyle = "default" | "light-content"
export type StatusBarStyle = "default" | "light-content" | "dark-content"
/**
* @enum('fade', 'slide')
+3 -1
View File
@@ -434,7 +434,9 @@ declare namespace ReactSelectClass {
/**
* function to call to load options asynchronously
*/
loadOptions: (input: string, callback: (err: any, result: AutocompleteResult) => any) => any;
loadOptions:
| ((input: string) => Promise<AutocompleteResult>)
| ((input: string, callback: (err: any, result: AutocompleteResult) => void) => void);
/**
* replaces the placeholder while options are loading
+46
View File
@@ -209,6 +209,52 @@ class SelectAsyncTest extends React.Component<React.Props<{}>, {}> {
}
class SelectAsyncPromiseTest extends React.Component<React.Props<{}>, {}> {
render() {
const getOptions = (input: string): Promise<AutocompleteResult> => {
return new Promise(resolve => {
setTimeout(function() {
return resolve({
options: options,
complete: true
});
}, 500);
});
};
const options: Option[] = [{ label: "Foo", value: "bar" }];
const onChange = (value: any) => console.log(value);
const asyncSelectProps: ReactAsyncSelectProps = {
name: "test-select-async-promise",
className: "test-select",
key: "1",
matchPos: "any",
matchProp: "any",
multi: true,
onValueClick: onChange,
valueKey: "github",
labelKey: "name",
onChange: onChange,
simpleValue: undefined,
value: options,
loadOptions: getOptions,
cache: {},
ignoreAccents: false,
ignoreCase: true,
isLoading: false,
minimumInput: 5,
searchPromptText: "search...",
searchingText: "searching...",
};
return <div>
<Select.Async {...asyncSelectProps} />
</div>;
}
}
class SelectCreatableTest extends React.Component<React.Props<{}>, {}> {
render() {
+2 -2
View File
@@ -185,7 +185,7 @@ declare namespace React {
setState<K extends keyof S>(f: (prevState: S, props: P) => Pick<S, K>, callback?: () => any): void;
setState<K extends keyof S>(state: Pick<S, K>, callback?: () => any): void;
forceUpdate(callBack?: () => any): void;
render(): JSX.Element | null;
render(): JSX.Element | null | false;
// React.Props<T> is now deprecated, which means that the `children`
// property is not available on `P` by default, even though you can
@@ -2728,7 +2728,7 @@ declare global {
namespace JSX {
interface Element extends React.ReactElement<any> { }
interface ElementClass extends React.Component<any, any> {
render(): JSX.Element | null;
render(): JSX.Element | null | false;
}
interface ElementAttributesProperty { props: {}; }
interface ElementChildrenAttribute { children: {}; }
+1 -1
View File
@@ -3,6 +3,7 @@
export interface UncontrolledProps {
isOpen?: boolean;
toggle?: () => void;
className?: string;
}
export interface Props extends UncontrolledProps {
@@ -12,7 +13,6 @@ export interface Props extends UncontrolledProps {
size?: string;
tag?: React.ReactType;
tether?: boolean | Tether.ITetherOptions;
className?: string;
}
declare var Dropdown: React.StatelessComponent<Props>;
+2 -2
View File
@@ -1,8 +1,8 @@
interface Props {
interface Props extends React.HTMLProps< HTMLElement> {
className?: string;
tag?: React.ReactType;
noGutters?: boolean;
}
declare var Row: React.StatelessComponent<React.HTMLProps<any>>;
declare var Row: React.StatelessComponent<Props>;
export default Row;
+2 -2
View File
@@ -549,7 +549,7 @@ const Example26 = (props: any) => {
const Example27 = (props: any) => {
return (
<Row>
<Row noGutters>
<Col sm="6">
<Card block>
<CardTitle>Special Title Treatment</CardTitle>
@@ -1051,7 +1051,7 @@ class Example43 extends React.Component<any, any> {
function Example44() {
return (
<UncontrolledDropdown>
<UncontrolledDropdown className="some-class">
<DropdownToggle caret>
Dropdown
</DropdownToggle>
+6 -9
View File
@@ -1,4 +1,4 @@
// Type definitions for Redux Mock Store v0.0.6
// Type definitions for Redux Mock Store v0.0.7
// Project: https://github.com/arnaudbenard/redux-mock-store
// Definitions by: Marian Palkus <https://github.com/MarianPalkus>, Cap3 <http://www.cap3.de>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -6,19 +6,16 @@
///<reference types="redux" />
declare module 'redux-mock-store' {
import * as Redux from 'redux'
import * as Redux from 'redux';
function createMockStore<T>(middlewares?: Redux.Middleware[]): mockStore<T>;
export type mockStore<T> = (state?: T) => IStore<T>;
export interface IStore<T> {
dispatch(action: any): any;
getState(): T;
interface MockStore<T> extends Redux.Store<T> {
getActions(): any[];
clearActions(): void;
subscribe(listener: Function): Function;
}
export default createMockStore
export type mockStore<T> = (state?: T) => MockStore<T>;
export default createMockStore;
}
+3 -2
View File
@@ -1,5 +1,6 @@
{
"dependencies": {
"redux": "^3.6.0"
"redux": "^3.6.0",
"redux-mock-store": "^1.2.3"
}
}
}
@@ -1,5 +1,5 @@
import * as Redux from 'redux';
import configureStore, {IStore} from 'redux-mock-store';
import configureStore from 'redux-mock-store';
// Redux store API tests
// The following test are taken from ../redux/redux-tests.ts
@@ -26,9 +26,8 @@ function loggingMiddleware() {
const storeMock = configureStore<number>([loggingMiddleware]);
const initialState = 0
let store: IStore<number>;
store = storeMock(initialState);
const store = storeMock(initialState);
store.subscribe(() => {
// ...
@@ -44,4 +43,4 @@ store.clearActions();
// actions access without the need to cast
var actions2 = store.getActions();
actions2[10].payload.id;
actions2[10].payload.id;
+2 -1
View File
@@ -483,13 +483,14 @@ export interface Client {
basicAuth(username: string, password: string): any;
}
export interface HttpClient extends Client {
export interface HttpClient {
get(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any;
head(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any;
post(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any;
put(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any;
patch(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any;
del(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any;
basicAuth(username: string, password: string): any;
}
export interface ThrottleOptions {
+1 -1
View File
@@ -3,7 +3,7 @@
// Definitions by: Carl de Billy <http://carl.debilly.net/>, Igor Oleinikov <https://github.com/Igorbek>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference types="rx-core"/>
/// <reference types="rx-core" />
declare namespace Rx {
interface ISubject<T> extends Observable<T>, Observer<T>, IDisposable {
+1 -1
View File
@@ -3,7 +3,7 @@
// Definitions by: Carl de Billy <http://carl.debilly.net/>, Igor Oleinikov <https://github.com/Igorbek>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference types="rx-lite" />
/// <reference types="rx-lite" />
declare namespace Rx {
interface Observable<T> {
+1 -1
View File
@@ -3,7 +3,7 @@
// Definitions by: zoetrope <https://github.com/zoetrope>, Igor Oleinikov <https://github.com/Igorbek>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference types="rx-lite" />
/// <reference types="rx-lite" />
declare namespace Rx {
interface ObservableStatic {
+1 -1
View File
@@ -3,7 +3,7 @@
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference types="rx-lite"/>
/// <reference types="rx-lite" />
declare namespace Rx {
interface Observable<T> {
+1 -1
View File
@@ -3,7 +3,7 @@
// Definitions by: Carl de Billy <http://carl.debilly.net/>, Igor Oleinikov <https://github.com/Igorbek>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference types="rx-lite" />
/// <reference types="rx-lite" />
declare namespace Rx {
interface Observable<T> {
+1 -1
View File
@@ -3,7 +3,7 @@
// Definitions by: Carl de Billy <http://carl.debilly.net/>, Igor Oleinikov <https://github.com/Igorbek>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference types="rx-lite" />
/// <reference types="rx-lite" />
declare namespace Rx {
interface Observable<T> {
+1 -1
View File
@@ -3,7 +3,7 @@
// Definitions by: gsino <http://www.codeplex.com/site/users/view/gsino>, Igor Oleinikov <https://github.com/Igorbek>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference types="rx-lite" />
/// <reference types="rx-lite" />
declare namespace Rx {
interface VirtualTimeScheduler<TAbsolute, TRelative> extends Scheduler {
+4 -4
View File
@@ -811,7 +811,7 @@ declare namespace sequelize {
*/
(
newAssociations?: Array<TInstance | TInstancePrimaryKey>,
options?: BelongsToManySetAssociationsMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | TJoinTableAttributes
options?: BelongsToManySetAssociationsMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | { through: TJoinTableAttributes }
): Promise<void>;
}
@@ -860,7 +860,7 @@ declare namespace sequelize {
*/
(
newAssociations?: Array<TInstance | TInstancePrimaryKey>,
options?: BelongsToManyAddAssociationsMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | TJoinTableAttributes
options?: BelongsToManyAddAssociationsMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | { through: TJoinTableAttributes }
): Promise<void>;
}
@@ -909,7 +909,7 @@ declare namespace sequelize {
*/
(
newAssociation?: TInstance | TInstancePrimaryKey,
options?: BelongsToManyAddAssociationMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | TJoinTableAttributes
options?: BelongsToManyAddAssociationMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | { through: TJoinTableAttributes }
): Promise<void>;
}
@@ -952,7 +952,7 @@ declare namespace sequelize {
*/
(
values?: TAttributes,
options?: BelongsToManyCreateAssociationMixinOptions | CreateOptions | TJoinTableAttributes
options?: BelongsToManyCreateAssociationMixinOptions | CreateOptions | { through: TJoinTableAttributes }
): Promise<TInstance>;
}
+4 -4
View File
@@ -270,19 +270,19 @@ warehouse.getBranches({ where: {} }).then((branches) => branches[0].rank);
warehouse.setBranches();
warehouse.setBranches([branch]);
warehouse.setBranches([branch, 2], { validate: true, distance: 1 }).then(() => { });
warehouse.setBranches([branch, 2], { validate: true, through: { distance: 1 } }).then(() => { });
warehouse.addBranches();
warehouse.addBranches([branch]);
warehouse.addBranches([branch, 2], { validate: false, distance: 1 }).then(() => { });
warehouse.addBranches([branch, 2], { validate: false, through: { distance: 1 } }).then(() => { });
warehouse.addBranch();
warehouse.addBranch(branch);
warehouse.addBranch(2, { validate: true, distance: 1 }).then(() => { });
warehouse.addBranch(2, { validate: true, through: { distance: 1 } }).then(() => { });
warehouse.createBranch();
warehouse.createBranch({ id: 1, address: 'baz' });
warehouse.createBranch({ id: 1 }, { silent: true, distance: 1 }).then((branch) => { });
warehouse.createBranch({ id: 1 }, { silent: true, through: { distance: 1 } }).then((branch) => { });
warehouse.removeBranches();
warehouse.removeBranches([branch]);
+7
View File
@@ -179,6 +179,13 @@ declare class _spPageContextInfo {
static webUIVersion: number; // 15
}
declare class _spFriendlyUrlPageContextInfo {
static termId: string;
static termSetId: string;
static termStoreId: string;
static title: string;
}
declare function STSHtmlEncode(value: string): string;
declare function STSHtmlDecode(value: string): string;
+9 -1
View File
@@ -1,6 +1,7 @@
// Type definitions for stacktrace.js
// Project: https://github.com/stacktracejs/stacktrace.js
// Definitions by: Exceptionless <https://github.com/exceptionless>
// Chun-Yan Ho <https://github.com/pilagod>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace StackTrace {
@@ -34,7 +35,7 @@ declare namespace StackTrace {
isNative: boolean;
toString(): string;
}
export interface RequestOptions {
headers: { [id: string]: string };
}
@@ -46,6 +47,13 @@ declare namespace StackTrace {
*/
export function get(options?: StackTraceOptions): Promise<StackFrame[]>;
/**
* Get a backtrace from invocation point synchronously.
* @param options Options Object
* @return Array[StackFrame]
*/
export function getSync(options?: StackTraceOptions): StackFrame[];
/**
* Given an error object, parse it.
* @param error Error object
@@ -29,6 +29,7 @@ const options: StackTrace.StackTraceOptions = {
const error = new Error('BOOM!');
StackTrace.get(options).then(logger);
logger(StackTrace.getSync(options))
StackTrace.fromError(error, options).then(logger);
StackTrace.generateArtificially(options).then(logger);
+1 -1
View File
@@ -22,7 +22,7 @@ declare class Cache<K, V> {
}
declare namespace Cache {
type OptionsCallback<K, V> = (error: any, value: V, options?: string | SetOptions<K, V>) => void;
type OptionsCallback<K, V> = (error: any, value?: V, options?: string | SetOptions<K, V>) => void;
type RevalidationCallback<K, V> = (key: K, callback: OptionsCallback<K, V>) => void;
interface CacheOptions<K, V> {
+1 -1
View File
@@ -12,7 +12,7 @@ const verror3 = new VError({
name: "fooError",
cause: error,
info: {
"info0": "baz"
info0: "baz"
}
}, "bar");
+3 -3
View File
@@ -72,9 +72,9 @@ describe('File', () => {
});
it('should set stat to given value', done => {
var val = {};
var file = new File(<fs.Stats><any>{stat: val});
file.stat.should.equal(val);
var stat = {} as fs.Stats;
var file = new File({ stat });
file.stat.should.equal(stat);
done();
});
+4 -2
View File
@@ -1,6 +1,8 @@
// Type definitions for WebdriverIO 4.7
// Project: http://www.webdriver.io/
// Definitions by: Nick Malaguti <https://github.com/nmalaguti/>, Tim Brust <https://github.com/timbru31>
// Definitions by: Nick Malaguti <https://github.com/nmalaguti>
// Tim Brust <https://github.com/timbru31>
// Fredrik Smedberg <https://github.com/fsmedberg-tc>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node"/>
@@ -1551,7 +1553,7 @@ declare namespace WebdriverIO {
$(selector: string): Client<RawResult<Element>> & RawResult<Element>;
$<P>(selector: string): Client<P>;
$$(selector: string): Client<RawResult<Element[]>> & RawResult<Element[]>;
$$(selector: string): Client<Array<RawResult<Element>>> & Array<RawResult<Element>>;
$$<P>(selector: string): Client<P>;
addCommand(
+2 -2
View File
@@ -200,7 +200,7 @@ function delay(code:WebixCallback, owner?:any, params?:any[], delay?:number):num
function detachEvent(id:string):void;
function dp(name:string):any;
function editStop():void;
function event(node:HTMLElement|string, event:string, handler:WebixCallback, context?:any):string|number;
function event(node:HTMLElement|Window|string, event:string, handler:WebixCallback, context?:any):string|number;
function eventRemove(id:string|number):void;
function exec(code:string):void;
function extend(target:any, source:any, overwrite?:boolean):any;
@@ -811,7 +811,7 @@ interface TreeCollection{
clearAll():void;
clearValidation():void;
copy(sid:string|number, tindex:number, tobj?:any, details?:any):void;
count():number;
count():number;
define(property:string, value:any):void;
destructor():void;
detachEvent(id:string):void;
-8
View File
@@ -585,14 +585,6 @@ class TestResolvePlugin implements webpack.ResolvePlugin {
}
}
const resolve: webpack.Resolve = {
plugins: [
new TestResolvePlugin()
],
symlinks: false,
cachePredicate: 'boo' // why does this test _not_ fail!?
};
const performance: webpack.Options.Performance = {
hints: 'error',
maxEntrypointSize: 400000,