mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
Merge branch 'master' into update_cordova-plugin-inappbrowser
This commit is contained in:
4
types/dygraphs/index.d.ts
vendored
4
types/dygraphs/index.d.ts
vendored
@@ -1266,5 +1266,5 @@ declare class Dygraph {
|
||||
}
|
||||
|
||||
declare module "dygraphs" {
|
||||
export = Dygraph;
|
||||
}
|
||||
export default Dygraph;
|
||||
}
|
||||
|
||||
@@ -622,9 +622,6 @@ $('#calendar').fullCalendar({
|
||||
eventColor: '#378006'
|
||||
});
|
||||
|
||||
interface EventWithDescription extends FullCalendar.EventObject {
|
||||
description: string;
|
||||
}
|
||||
interface JQueryQTip extends JQuery {
|
||||
qtip(options: Object): JQuery; // dummy plugin interface
|
||||
}
|
||||
@@ -638,7 +635,7 @@ $('#calendar').fullCalendar({
|
||||
}
|
||||
// more events here
|
||||
],
|
||||
eventRender(event: EventWithDescription, element: JQueryQTip, view: FullCalendar.ViewObject) {
|
||||
eventRender(event: FullCalendar.EventObject, element: JQueryQTip, view: FullCalendar.ViewObject) {
|
||||
element.qtip({
|
||||
content: event.description
|
||||
});
|
||||
|
||||
3
types/fullcalendar/index.d.ts
vendored
3
types/fullcalendar/index.d.ts
vendored
@@ -2,6 +2,7 @@
|
||||
// Project: http://fullcalendar.io/
|
||||
// Definitions by: Neil Stalker <https://github.com/nestalk>, Marcelo Camargo <https://github.com/hasellcamargo>, Patrick Niemann <https://github.com/panic175>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery"/>
|
||||
|
||||
@@ -229,6 +230,8 @@ export interface EventObject extends Timespan {
|
||||
backgroundColor?: string;
|
||||
borderColor?: string;
|
||||
textColor?: string;
|
||||
// non-standard fields, see https://fullcalendar.io/docs/event_data/Event_Object/ and https://fullcalendar.io/docs/event_rendering/eventRender/
|
||||
[x: string]: any;
|
||||
}
|
||||
|
||||
export interface ViewObject extends Timespan {
|
||||
|
||||
5
types/inquirer/index.d.ts
vendored
5
types/inquirer/index.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
// Type definitions for Inquirer.js
|
||||
// Project: https://github.com/SBoudrias/Inquirer.js
|
||||
// Definitions by: Qubo <https://github.com/tkQubo>
|
||||
// Parvez <https://github.com/ppathan>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="rx" />
|
||||
@@ -110,6 +111,10 @@ declare namespace inquirer {
|
||||
* Change the number of lines that will be rendered when using list, rawList, expand or checkbox.
|
||||
*/
|
||||
pageSize?: number;
|
||||
/**
|
||||
* Add a mask when password will entered
|
||||
*/
|
||||
mask?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
4
types/jasmine/index.d.ts
vendored
4
types/jasmine/index.d.ts
vendored
@@ -137,8 +137,8 @@ declare namespace jasmine {
|
||||
function objectContaining<T>(sample: Partial<T>): ObjectContaining<T>;
|
||||
function createSpy(name: string, originalFn?: Function): Spy;
|
||||
|
||||
function createSpyObj(baseName: string, methodNames: any[]): any;
|
||||
function createSpyObj<T>(baseName: string, methodNames: any[]): SpyObj<T>;
|
||||
function createSpyObj(baseName: string, methodNames: any[] | {[methodName: string]: any}): any;
|
||||
function createSpyObj<T>(baseName: string, methodNames: any[] | {[methodName: string]: any}): SpyObj<T>;
|
||||
|
||||
function createSpyObj(baseName: string, methodNames: any): any;
|
||||
function createSpyObj(methodNames: any[]): any;
|
||||
|
||||
1
types/leaflet/index.d.ts
vendored
1
types/leaflet/index.d.ts
vendored
@@ -390,6 +390,7 @@ declare namespace L {
|
||||
|
||||
interface LayerOptions {
|
||||
pane?: string;
|
||||
attribution?: string;
|
||||
}
|
||||
|
||||
interface InteractiveLayerOptions extends LayerOptions {
|
||||
|
||||
40
types/lodash/index.d.ts
vendored
40
types/lodash/index.d.ts
vendored
@@ -10486,6 +10486,36 @@ declare namespace _ {
|
||||
(t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction1<T5, R>;
|
||||
(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R;
|
||||
}
|
||||
interface RightCurriedFunction1<T1, R>{
|
||||
():RightCurriedFunction1<T1, R>
|
||||
(t1:T1):R
|
||||
}
|
||||
interface RightCurriedFunction2<T1,T2, R>{
|
||||
():RightCurriedFunction2<T1,T2, R>
|
||||
(t2:T2):RightCurriedFunction1<T1, R>
|
||||
(t1:T1,t2:T2):R
|
||||
}
|
||||
interface RightCurriedFunction3<T1,T2,T3, R>{
|
||||
():RightCurriedFunction3<T1,T2,T3, R>
|
||||
(t3:T3):RightCurriedFunction2<T1,T2, R>
|
||||
(t2:T2,t3:T3):RightCurriedFunction1<T1, R>
|
||||
(t1:T1,t2:T2,t3:T3):R
|
||||
}
|
||||
interface RightCurriedFunction4<T1,T2,T3,T4, R>{
|
||||
():RightCurriedFunction4<T1,T2,T3,T4, R>
|
||||
(t4:T4):RightCurriedFunction3<T1,T2,T3, R>
|
||||
(t3:T3,t4:T4):RightCurriedFunction2<T1,T2, R>
|
||||
(t2:T2,t3:T3,t4:T4):RightCurriedFunction1<T1, R>
|
||||
(t1:T1,t2:T2,t3:T3,t4:T4):R
|
||||
}
|
||||
interface RightCurriedFunction5<T1,T2,T3,T4,T5, R>{
|
||||
():RightCurriedFunction5<T1,T2,T3,T4,T5, R>
|
||||
(t5:T5):RightCurriedFunction4<T1,T2,T3,T4, R>
|
||||
(t4:T4,t5:T5):RightCurriedFunction3<T1,T2,T3, R>
|
||||
(t3:T3,t4:T4,t5:T5):RightCurriedFunction2<T1,T2, R>
|
||||
(t2:T2,t3:T3,t4:T4,t5:T5):RightCurriedFunction1<T1, R>
|
||||
(t1:T1,t2:T2,t3:T3,t4:T4,t5:T5):R
|
||||
}
|
||||
|
||||
interface LoDashImplicitObjectWrapper<T> {
|
||||
/**
|
||||
@@ -10503,7 +10533,7 @@ declare namespace _ {
|
||||
* @return Returns the new curried function.
|
||||
*/
|
||||
curryRight<T1, R>(func: (t1: T1) => R):
|
||||
CurriedFunction1<T1, R>;
|
||||
RightCurriedFunction1<T1, R>;
|
||||
/**
|
||||
* This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
|
||||
* instead of _.partial.
|
||||
@@ -10511,7 +10541,7 @@ declare namespace _ {
|
||||
* @return Returns the new curried function.
|
||||
*/
|
||||
curryRight<T1, T2, R>(func: (t1: T1, t2: T2) => R):
|
||||
CurriedFunction2<T2, T1, R>;
|
||||
RightCurriedFunction2<T1, T2, R>;
|
||||
/**
|
||||
* This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
|
||||
* instead of _.partial.
|
||||
@@ -10519,7 +10549,7 @@ declare namespace _ {
|
||||
* @return Returns the new curried function.
|
||||
*/
|
||||
curryRight<T1, T2, T3, R>(func: (t1: T1, t2: T2, t3: T3) => R):
|
||||
CurriedFunction3<T3, T2, T1, R>;
|
||||
RightCurriedFunction3<T1, T2, T3, R>;
|
||||
/**
|
||||
* This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
|
||||
* instead of _.partial.
|
||||
@@ -10527,7 +10557,7 @@ declare namespace _ {
|
||||
* @return Returns the new curried function.
|
||||
*/
|
||||
curryRight<T1, T2, T3, T4, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R):
|
||||
CurriedFunction4<T4, T3, T2, T1, R>;
|
||||
RightCurriedFunction4<T1, T2, T3, T4, R>;
|
||||
/**
|
||||
* This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
|
||||
* instead of _.partial.
|
||||
@@ -10535,7 +10565,7 @@ declare namespace _ {
|
||||
* @return Returns the new curried function.
|
||||
*/
|
||||
curryRight<T1, T2, T3, T4, T5, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R):
|
||||
CurriedFunction5<T5, T4, T3, T2, T1, R>;
|
||||
RightCurriedFunction5<T1, T2, T3, T4, T5, R>;
|
||||
/**
|
||||
* This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
|
||||
* instead of _.partial.
|
||||
|
||||
@@ -5923,15 +5923,14 @@ curryResult0 = _.curryRight(testCurryRightFn)(1, 2, 3);
|
||||
curryResult2 = _.curryRight(testCurryRightFn)(1);
|
||||
curryResult0 = _(testCurryRightFn).curryRight().value()(1, 2, 3);
|
||||
curryResult2 = _(testCurryRightFn).curryRight().value()(1);
|
||||
|
||||
let curryResult7: _.CurriedFunction1<string, [string, number, boolean]>;
|
||||
let curryResult8: _.CurriedFunction2<number, string, [string, number, boolean]>;
|
||||
let curryResult9: _.CurriedFunction3<boolean, number, string, [string, number, boolean]>;
|
||||
curryResult3 = _.curryRight(testCurry2)(true, 2, "1");
|
||||
curryResult3 = _.curryRight(testCurry2)(true, 2)("1");
|
||||
curryResult3 = _.curryRight(testCurry2)(true)(2, "1");
|
||||
let curryResult7: _.RightCurriedFunction1<string, [string, number, boolean]>;
|
||||
let curryResult8: _.RightCurriedFunction2<string,number , [string, number, boolean]>;
|
||||
let curryResult9: _.RightCurriedFunction3<string, number, boolean, [string, number, boolean]>;
|
||||
curryResult3 = _.curryRight(testCurry2)("1", 2, true);
|
||||
curryResult3 = _.curryRight(testCurry2)( 2,true)("1");
|
||||
curryResult3 = _.curryRight(testCurry2)(true)( "1",2);
|
||||
curryResult3 = _.curryRight(testCurry2)(true)(2)("1");
|
||||
curryResult7 = _.curryRight(testCurry2)(true, 2);
|
||||
curryResult7 = _.curryRight(testCurry2)(2,true);
|
||||
curryResult7 = _.curryRight(testCurry2)(true)(2);
|
||||
curryResult8 = _.curryRight(testCurry2)(true);
|
||||
curryResult9 = _.curryRight(testCurry2);
|
||||
|
||||
42
types/multer/index.d.ts
vendored
42
types/multer/index.d.ts
vendored
@@ -1,9 +1,12 @@
|
||||
// Type definitions for multer
|
||||
// Type definitions for multer 1.3
|
||||
// Project: https://github.com/expressjs/multer
|
||||
// Definitions by: jt000 <https://github.com/jt000>, vilicvane <https://vilic.github.io/>, David Broder-Rodgers <https://github.com/DavidBR-SW>
|
||||
// Definitions by: jt000 <https://github.com/jt000>
|
||||
// vilicvane <https://vilic.github.io/>
|
||||
// David Broder-Rodgers <https://github.com/DavidBR-SW>
|
||||
// Michael Ledin <https://github.com/mxl>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import express = require('express');
|
||||
import * as express from 'express';
|
||||
|
||||
declare namespace multer {
|
||||
interface Field {
|
||||
@@ -18,7 +21,9 @@ declare namespace multer {
|
||||
dest?: string;
|
||||
/** The storage engine to use for uploaded files. */
|
||||
storage?: StorageEngine;
|
||||
/** An object specifying the size limits of the following optional properties. This object is passed to busboy directly, and the details of properties can be found on https://github.com/mscdex/busboy#busboy-methods */
|
||||
/** An object specifying the size limits of the following optional properties. This object is passed to busboy
|
||||
* directly, and the details of properties can be found on https://github.com/mscdex/busboy#busboy-methods
|
||||
*/
|
||||
limits?: {
|
||||
/** Max field name size (Default: 100 bytes) */
|
||||
fieldNameSize?: number;
|
||||
@@ -34,9 +39,12 @@ 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;
|
||||
fileFilter?(req: Express.Request, file: Express.Multer.File, callback: (error: Error, acceptFile: boolean) => void): void;
|
||||
}
|
||||
|
||||
interface StorageEngine {
|
||||
@@ -48,27 +56,23 @@ declare namespace multer {
|
||||
/** A function used to determine within which folder the uploaded files should be stored. Defaults to the system's default temporary directory. */
|
||||
destination?: string | ((req: Express.Request, file: Express.Multer.File, callback: (error: Error | null, destination: string) => void) => void);
|
||||
/** A function used to determine what the file should be named inside the folder. Defaults to a random name with no file extension. */
|
||||
filename?: (req: Express.Request, file: Express.Multer.File, callback: (error: Error | null, filename: string) => void) => void;
|
||||
filename?(req: Express.Request, file: Express.Multer.File, callback: (error: Error | null, filename: string) => void): void;
|
||||
}
|
||||
|
||||
interface Instance {
|
||||
/** In case you need to handle a text-only multipart form, you can use any of the multer methods (.single(), .array(), fields()), req.body contains the text fields */
|
||||
single(): express.RequestHandler;
|
||||
/** Accept a single file with the name fieldname. The single file will be stored in req.file. */
|
||||
single(fieldame: string): express.RequestHandler;
|
||||
/** In case you need to handle a text-only multipart form, you can use any of the multer methods (.single(), .array(), fields()), req.body contains the text fields */
|
||||
array(): express.RequestHandler;
|
||||
/** Accept an array of files, all with the name fieldname. Optionally error out if more than maxCount files are uploaded. The array of files will be stored in req.files. */
|
||||
array(fieldame: string, maxCount?: number): express.RequestHandler;
|
||||
/** Accept a single file with the name fieldName. The single file will be stored in req.file. */
|
||||
single(fieldName?: string): express.RequestHandler;
|
||||
/** Accept an array of files, all with the name fieldName. Optionally error out if more than maxCount files are uploaded. The array of files will be stored in req.files. */
|
||||
array(fieldName: string, maxCount?: number): express.RequestHandler;
|
||||
/** Accept a mix of files, specified by fields. An object with arrays of files will be stored in req.files. */
|
||||
fields(fields: Field[]): express.RequestHandler;
|
||||
/** In case you need to handle a text-only multipart form, you can use any of the multer methods (.single(), .array(), fields()), req.body contains the text fields */
|
||||
/** Accepts all files that comes over the wire. An array of files will be stored in req.files. */
|
||||
any(): express.RequestHandler;
|
||||
}
|
||||
}
|
||||
|
||||
interface Multer {
|
||||
|
||||
(options?: multer.Options): multer.Instance;
|
||||
|
||||
/* The disk storage engine gives you full control on storing files to disk. */
|
||||
@@ -77,21 +81,21 @@ interface Multer {
|
||||
memoryStorage(): multer.StorageEngine;
|
||||
}
|
||||
|
||||
declare var multer: Multer;
|
||||
declare const multer: Multer;
|
||||
|
||||
export = multer;
|
||||
|
||||
declare global {
|
||||
namespace Express {
|
||||
export interface Request {
|
||||
interface Request {
|
||||
file: Multer.File;
|
||||
files: {
|
||||
[fieldname: string]: Multer.File[];
|
||||
};
|
||||
} | Multer.File[];
|
||||
}
|
||||
|
||||
namespace Multer {
|
||||
export interface File {
|
||||
interface File {
|
||||
/** Field name specified in the form */
|
||||
fieldname: string;
|
||||
/** Name of the file on the user's computer */
|
||||
|
||||
@@ -1,33 +1,30 @@
|
||||
import * as express from 'express';
|
||||
import * as multer from 'multer';
|
||||
|
||||
const upload = multer({ dest: 'uploads/' });
|
||||
|
||||
const app = express();
|
||||
|
||||
import express = require('express');
|
||||
import multer = require('multer');
|
||||
|
||||
var upload = multer({ dest: 'uploads/' });
|
||||
|
||||
var app = express();
|
||||
|
||||
app.post('/profile', upload.single('avatar'), (req, res, next) => {
|
||||
app.post('/profile', upload.single('avatar'), (req: express.Request, res: express.Response, next: express.NextFunction) => {
|
||||
});
|
||||
|
||||
app.post('/photos/upload', upload.array('photos', 12), (req, res, next) => {
|
||||
app.post('/photos/upload', upload.array('photos', 12), (req: express.Request, res: express.Response, next: express.NextFunction) => {
|
||||
});
|
||||
|
||||
var cpUpload = upload.fields([{ name: 'avatar', maxCount: 1 }, { name: 'gallery', maxCount: 8 }])
|
||||
app.post('/cool-profile', cpUpload, (req, res, next) => {
|
||||
const cpUpload = upload.fields([{ name: 'avatar', maxCount: 1 }, { name: 'gallery', maxCount: 8 }]);
|
||||
app.post('/cool-profile', cpUpload, (req: express.Request, res: express.Response, next: express.NextFunction) => {
|
||||
});
|
||||
|
||||
var diskStorage = multer.diskStorage({
|
||||
const diskStorage = multer.diskStorage({
|
||||
destination(req, file, cb) {
|
||||
cb(null, '/tmp/my-uploads');
|
||||
},
|
||||
filename(req, file, cb) {
|
||||
cb(null, file.fieldname + '-' + Date.now());
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
var diskUpload = multer({ storage: diskStorage });
|
||||
const diskUpload = multer({ storage: diskStorage });
|
||||
|
||||
var memoryStorage = multer.memoryStorage();
|
||||
var memoryUpload = multer({ storage: memoryStorage });
|
||||
const memoryStorage = multer.memoryStorage();
|
||||
const memoryUpload = multer({ storage: memoryStorage });
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
@@ -19,4 +19,4 @@
|
||||
"index.d.ts",
|
||||
"multer-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
1
types/multer/tslint.json
Normal file
1
types/multer/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
11
types/noble/index.d.ts
vendored
11
types/noble/index.d.ts
vendored
@@ -1,6 +1,9 @@
|
||||
// Type definitions for noble
|
||||
// Project: https://github.com/sandeepmistry/noble
|
||||
// Definitions by: Seon-Wook Park <https://github.com/swook>, Hans Bakker <https://github.com/wind-rider>, Shantanu Bhadoria <https://github.com/shantanubhadoria>
|
||||
// Definitions by: Seon-Wook Park <https://github.com/swook>
|
||||
// Hans Bakker <https://github.com/wind-rider>
|
||||
// Shantanu Bhadoria <https://github.com/shantanubhadoria>
|
||||
// Luke Libraro <https://github.com/lukel99>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -8,9 +11,9 @@
|
||||
|
||||
import events = require("events");
|
||||
|
||||
export as namespace noble;
|
||||
|
||||
export declare function startScanning(serviceUUIDs?: string[], allowDuplicates?: boolean, callback?: (error: Error) => void): void;
|
||||
export declare function startScanning(callback?: (error?: Error) => void): void;
|
||||
export declare function startScanning(serviceUUIDs: string[], callback?: (error?: Error) => void): void;
|
||||
export declare function startScanning(serviceUUIDs: string[], allowDuplicates: boolean, callback?: (error?: Error) => void): void;
|
||||
export declare function stopScanning(callback?: () => void): void;
|
||||
|
||||
export declare function on(event: string, listener: Function): events.EventEmitter;
|
||||
|
||||
@@ -4,16 +4,18 @@ import noble = require("noble");
|
||||
function test_startScanning(): void {
|
||||
"use strict";
|
||||
noble.startScanning();
|
||||
noble.startScanning((err) => {});
|
||||
noble.startScanning(["0x180d"]);
|
||||
noble.startScanning(["0x180d"], (err) => {});
|
||||
noble.startScanning(["0x180d"], true);
|
||||
noble.startScanning(["0x180d"], true, (error: Error): void => {});
|
||||
noble.startScanning(["0x180d"], true, (err) => {});
|
||||
}
|
||||
test_startScanning();
|
||||
|
||||
function test_stopScanning(): void {
|
||||
"use strict";
|
||||
noble.stopScanning();
|
||||
noble.stopScanning((): void => {});
|
||||
noble.stopScanning(() => {});
|
||||
}
|
||||
test_stopScanning();
|
||||
|
||||
|
||||
@@ -19,4 +19,4 @@
|
||||
"index.d.ts",
|
||||
"noble-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
10
types/node-getopt/index.d.ts
vendored
10
types/node-getopt/index.d.ts
vendored
@@ -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 {
|
||||
|
||||
97
types/node/index.d.ts
vendored
97
types/node/index.d.ts
vendored
@@ -7,6 +7,7 @@
|
||||
// Christian Vaagland Tellnes <https://github.com/tellnes>
|
||||
// Wilco Bakker <https://github.com/WilcoBakker>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/************************************************
|
||||
* *
|
||||
@@ -377,6 +378,12 @@ declare namespace NodeJS {
|
||||
| 'sunos'
|
||||
| 'win32';
|
||||
|
||||
type Signals =
|
||||
"SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" |
|
||||
"SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" |
|
||||
"SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" |
|
||||
"SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ";
|
||||
|
||||
export interface Socket extends ReadWriteStream {
|
||||
isTTY?: true;
|
||||
}
|
||||
@@ -449,6 +456,74 @@ declare namespace NodeJS {
|
||||
send?(message: any, sendHandle?: any): void;
|
||||
disconnect(): void;
|
||||
connected: boolean;
|
||||
|
||||
/**
|
||||
* EventEmitter
|
||||
* 1. beforeExit
|
||||
* 2. disconnect
|
||||
* 3. exit
|
||||
* 4. message
|
||||
* 5. rejectionHandled
|
||||
* 6. uncaughtException
|
||||
* 7. unhandledRejection
|
||||
* 8. warning
|
||||
* 9. <All OS Signals>
|
||||
*/
|
||||
|
||||
addListener(event: "beforeExit", listener: (code: number) => void): this;
|
||||
addListener(event: "disconnect", listener: () => void): this;
|
||||
addListener(event: "exit", listener: (code: number) => void): this;
|
||||
addListener(event: "rejectionHandled", listener: (promise: Promise<any>) => void): this;
|
||||
addListener(event: "uncaughtException", listener: (error: Error) => void): this;
|
||||
addListener(event: "unhandledRejection", listener: (reason: any, promise: Promise<any>) => void): this;
|
||||
addListener(event: "warning", listener: (warning: Error) => void): this;
|
||||
addListener(event: Signals, listener: () => void): this;
|
||||
|
||||
emit(event: "beforeExit", listener: (code: number) => void): boolean;
|
||||
emit(event: "disconnect", listener: () => void): boolean;
|
||||
emit(event: "exit", listener: (code: number) => void): boolean;
|
||||
emit(event: "rejectionHandled", listener: (promise: Promise<any>) => void): boolean;
|
||||
emit(event: "uncaughtException", listener: (error: Error) => void): boolean;
|
||||
emit(event: "unhandledRejection", listener: (reason: any, promise: Promise<any>) => void): boolean;
|
||||
emit(event: "warning", listener: (warning: Error) => void): boolean;
|
||||
emit(event: Signals, listener: () => void): boolean;
|
||||
|
||||
on(event: "beforeExit", listener: (code: number) => void): this;
|
||||
on(event: "disconnect", listener: () => void): this;
|
||||
on(event: "exit", listener: (code: number) => void): this;
|
||||
on(event: "rejectionHandled", listener: (promise: Promise<any>) => void): this;
|
||||
on(event: "uncaughtException", listener: (error: Error) => void): this;
|
||||
on(event: "unhandledRejection", listener: (reason: any, promise: Promise<any>) => void): this;
|
||||
on(event: "warning", listener: (warning: Error) => void): this;
|
||||
on(event: "message", listener: (message: any, sendHandle: any) => void): this;
|
||||
on(event: Signals, listener: () => void): this;
|
||||
|
||||
once(event: "beforeExit", listener: (code: number) => void): this;
|
||||
once(event: "disconnect", listener: () => void): this;
|
||||
once(event: "exit", listener: (code: number) => void): this;
|
||||
once(event: "rejectionHandled", listener: (promise: Promise<any>) => void): this;
|
||||
once(event: "uncaughtException", listener: (error: Error) => void): this;
|
||||
once(event: "unhandledRejection", listener: (reason: any, promise: Promise<any>) => void): this;
|
||||
once(event: "warning", listener: (warning: Error) => void): this;
|
||||
once(event: Signals, listener: () => void): this;
|
||||
|
||||
prependListener(event: "beforeExit", listener: (code: number) => void): this;
|
||||
prependListener(event: "disconnect", listener: () => void): this;
|
||||
prependListener(event: "exit", listener: (code: number) => void): this;
|
||||
prependListener(event: "rejectionHandled", listener: (promise: Promise<any>) => void): this;
|
||||
prependListener(event: "uncaughtException", listener: (error: Error) => void): this;
|
||||
prependListener(event: "unhandledRejection", listener: (reason: any, promise: Promise<any>) => void): this;
|
||||
prependListener(event: "warning", listener: (warning: Error) => void): this;
|
||||
prependListener(event: Signals, listener: () => void): this;
|
||||
|
||||
prependOnceListener(event: "beforeExit", listener: (code: number) => void): this;
|
||||
prependOnceListener(event: "disconnect", listener: () => void): this;
|
||||
prependOnceListener(event: "exit", listener: (code: number) => void): this;
|
||||
prependOnceListener(event: "rejectionHandled", listener: (promise: Promise<any>) => void): this;
|
||||
prependOnceListener(event: "uncaughtException", listener: (error: Error) => void): this;
|
||||
prependOnceListener(event: "unhandledRejection", listener: (reason: any, promise: Promise<any>) => void): this;
|
||||
prependOnceListener(event: "warning", listener: (warning: Error) => void): this;
|
||||
prependOnceListener(event: Signals, listener: () => void): this;
|
||||
}
|
||||
|
||||
export interface Global {
|
||||
@@ -734,10 +809,10 @@ declare module "http" {
|
||||
httpVersionMajor: number;
|
||||
httpVersionMinor: number;
|
||||
connection: net.Socket;
|
||||
headers: any;
|
||||
headers: { [key: string]: string | string[] };
|
||||
rawHeaders: string[];
|
||||
trailers: any;
|
||||
rawTrailers: any;
|
||||
trailers: { [key: string]: string };
|
||||
rawTrailers: string[];
|
||||
setTimeout(msecs: number, callback: Function): NodeJS.Timer;
|
||||
/**
|
||||
* Only valid for request obtained from http.Server.
|
||||
@@ -920,8 +995,8 @@ declare module "cluster" {
|
||||
// TODO: cluster.schedulingPolicy
|
||||
settings: ClusterSettings;
|
||||
setupMaster(settings?: ClusterSetupMasterSettings): void;
|
||||
worker: Worker;
|
||||
workers: {
|
||||
worker?: Worker;
|
||||
workers?: {
|
||||
[index: string]: Worker
|
||||
};
|
||||
|
||||
@@ -1391,6 +1466,12 @@ declare module "https" {
|
||||
secureProtocol?: string;
|
||||
}
|
||||
|
||||
export interface ClientRequest extends http.ClientRequest {}
|
||||
|
||||
export interface IncomingMessage extends http.IncomingMessage {}
|
||||
|
||||
export interface ServerResponse extends http.ServerResponse { }
|
||||
|
||||
export interface Agent extends http.Agent { }
|
||||
|
||||
export interface AgentOptions extends http.AgentOptions {
|
||||
@@ -1409,9 +1490,9 @@ declare module "https" {
|
||||
new (options?: AgentOptions): Agent;
|
||||
};
|
||||
export interface Server extends tls.Server { }
|
||||
export function createServer(options: ServerOptions, requestListener?: Function): Server;
|
||||
export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||
export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||
export function createServer(options: ServerOptions, requestListener?: (req: IncomingMessage, res: ServerResponse) => void): Server;
|
||||
export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
|
||||
export function get(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
|
||||
export var globalAgent: Agent;
|
||||
}
|
||||
|
||||
|
||||
@@ -1890,6 +1890,9 @@ namespace process_tests {
|
||||
var module: NodeModule | undefined;
|
||||
module = process.mainModule;
|
||||
}
|
||||
{
|
||||
process.on("message", (req: any) => { });
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
21
types/normalize-url/index.d.ts
vendored
Normal file
21
types/normalize-url/index.d.ts
vendored
Normal 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
types/normalize-url/tsconfig.json
Normal file
21
types/normalize-url/tsconfig.json
Normal 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
types/normalize-url/tslint.json
Normal file
7
types/normalize-url/tslint.json
Normal 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
|
||||
}
|
||||
}
|
||||
484
types/packery/index.d.ts
vendored
484
types/packery/index.d.ts
vendored
@@ -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;
|
||||
}
|
||||
@@ -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');
|
||||
|
||||
19
types/react-icon-base/index.d.ts
vendored
19
types/react-icon-base/index.d.ts
vendored
@@ -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" } } />;
|
||||
|
||||
56
types/react-leaflet/index.d.ts
vendored
56
types/react-leaflet/index.d.ts
vendored
@@ -1,8 +1,8 @@
|
||||
// Type definitions for react-leaflet 1.1
|
||||
// Project: https://github.com/PaulLeCam/react-leaflet
|
||||
// Definitions by: Dave Leaver <https://github.com/danzel>, David Schneider <https://github.com/davschne>
|
||||
// Definitions by: Dave Leaver <https://github.com/danzel>, David Schneider <https://github.com/davschne>, Yui T. <https://github.com/yuit>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as Leaflet from 'leaflet';
|
||||
import * as React from 'react';
|
||||
@@ -143,7 +143,7 @@ export interface MapProps extends MapEvents, Leaflet.MapOptions, Leaflet.LocateO
|
||||
zoom?: number;
|
||||
}
|
||||
|
||||
export class Map<P extends MapProps, E extends Leaflet.Map> extends MapComponent<P, E> {
|
||||
export class Map<P extends MapProps = MapProps, E extends Leaflet.Map = Leaflet.Map> extends MapComponent<P, E> {
|
||||
className?: string;
|
||||
container: HTMLDivElement;
|
||||
getChildContext(): { layerContainer: E, map: E };
|
||||
@@ -165,7 +165,7 @@ export interface PaneProps {
|
||||
export interface PaneState {
|
||||
name?: string;
|
||||
}
|
||||
export class Pane<P extends PaneProps, S extends PaneState> extends React.Component<P, S> {
|
||||
export class Pane<P extends PaneProps = PaneProps, S extends PaneState = PaneState> extends React.Component<P, S> {
|
||||
getChildContext(): { pane: string };
|
||||
createPane(props: P): void;
|
||||
removePane(): void;
|
||||
@@ -181,7 +181,7 @@ export interface LayerContainer {
|
||||
addLayer(layer: Leaflet.Layer): this;
|
||||
removeLayer(layer: number | Leaflet.Layer): this;
|
||||
}
|
||||
export class MapLayer<P extends MapLayerProps, E extends Leaflet.Class> extends MapComponent<P, E> {
|
||||
export class MapLayer<P extends MapLayerProps = MapLayerProps, E extends Leaflet.Class = Leaflet.Class> extends MapComponent<P, E> {
|
||||
createLeafletElement(props: P): E;
|
||||
updateLeafletElement(fromProps: P, toProps: P): void;
|
||||
readonly layerContainer: LayerContainer | Leaflet.Map;
|
||||
@@ -190,33 +190,33 @@ export class MapLayer<P extends MapLayerProps, E extends Leaflet.Class> extends
|
||||
export interface GridLayerProps extends Leaflet.GridLayerOptions {
|
||||
children?: Children;
|
||||
}
|
||||
export class GridLayer<P extends GridLayerProps, E extends Leaflet.GridLayer> extends MapLayer<P, E> {}
|
||||
export class GridLayer<P extends GridLayerProps = GridLayerProps, E extends Leaflet.GridLayer = Leaflet.GridLayer> extends MapLayer<P, E> {}
|
||||
|
||||
export interface TileLayerProps extends TileLayerEvents, Leaflet.TileLayerOptions {
|
||||
children?: Children;
|
||||
url: string;
|
||||
}
|
||||
export class TileLayer<P extends TileLayerProps, E extends Leaflet.TileLayer> extends GridLayer<P, E> { }
|
||||
export class TileLayer<P extends TileLayerProps = TileLayerProps, E extends Leaflet.TileLayer = Leaflet.TileLayer> extends GridLayer<P, E> { }
|
||||
|
||||
export interface WMSTileLayerProps extends TileLayerEvents, Leaflet.WMSOptions {
|
||||
children?: Children;
|
||||
url: string;
|
||||
}
|
||||
export class WMSTileLayer<P extends WMSTileLayerProps, E extends Leaflet.TileLayer.WMS> extends GridLayer<P, E> { }
|
||||
export class WMSTileLayer<P extends WMSTileLayerProps = WMSTileLayerProps, E extends Leaflet.TileLayer.WMS = Leaflet.TileLayer.WMS> extends GridLayer<P, E> { }
|
||||
|
||||
export interface ImageOverlayProps extends Leaflet.ImageOverlayOptions {
|
||||
bounds: Leaflet.LatLngBoundsExpression;
|
||||
children?: Children;
|
||||
url: string;
|
||||
}
|
||||
export class ImageOverlay<P extends ImageOverlayProps, E extends Leaflet.ImageOverlay> extends MapLayer<P, E> {
|
||||
export class ImageOverlay<P extends ImageOverlayProps = ImageOverlayProps, E extends Leaflet.ImageOverlay = Leaflet.ImageOverlay> extends MapLayer<P, E> {
|
||||
getChildContext(): { popupContainer: E };
|
||||
}
|
||||
|
||||
export interface LayerGroupProps {
|
||||
children?: Children;
|
||||
}
|
||||
export class LayerGroup<P extends LayerGroupProps, E extends Leaflet.LayerGroup> extends MapLayer<P, E> {
|
||||
export class LayerGroup<P extends LayerGroupProps = LayerGroupProps, E extends Leaflet.LayerGroup = Leaflet.LayerGroup> extends MapLayer<P, E> {
|
||||
getChildContext(): { layerContainer: E };
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ export interface MarkerProps extends MarkerEvents, Leaflet.MarkerOptions {
|
||||
children?: Children;
|
||||
position: Leaflet.LatLngExpression;
|
||||
}
|
||||
export class Marker<P extends MarkerProps, E extends Leaflet.Marker> extends MapLayer<P, E> {
|
||||
export class Marker<P extends MarkerProps = MarkerProps, E extends Leaflet.Marker = Leaflet.Marker> extends MapLayer<P, E> {
|
||||
getChildContext(): { popupContainer: E };
|
||||
}
|
||||
|
||||
@@ -241,19 +241,19 @@ export interface CircleProps extends PathEvents, Leaflet.CircleMarkerOptions {
|
||||
children?: Children;
|
||||
radius: number;
|
||||
}
|
||||
export class Circle<P extends CircleProps, E extends Leaflet.Circle> extends Path<P, E> { }
|
||||
export class Circle<P extends CircleProps = CircleProps, E extends Leaflet.Circle = Leaflet.Circle> extends Path<P, E> { }
|
||||
|
||||
export interface CircleMarkerProps extends PathEvents, Leaflet.CircleMarkerOptions {
|
||||
center: Leaflet.LatLngExpression;
|
||||
children?: Children;
|
||||
radius: number;
|
||||
}
|
||||
export class CircleMarker<P extends CircleMarkerProps, E extends Leaflet.CircleMarker> extends Path<P, E> { }
|
||||
export class CircleMarker<P extends CircleMarkerProps = CircleMarkerProps, E extends Leaflet.CircleMarker = Leaflet.CircleMarker> extends Path<P, E> { }
|
||||
|
||||
export interface FeatureGroupProps extends FeatureGroupEvents, Leaflet.PathOptions {
|
||||
children?: Children;
|
||||
}
|
||||
export class FeatureGroup<P extends FeatureGroupProps, E extends Leaflet.FeatureGroup> extends Path<P, E> {
|
||||
export class FeatureGroup<P extends FeatureGroupProps = FeatureGroupProps, E extends Leaflet.FeatureGroup = Leaflet.FeatureGroup> extends Path<P, E> {
|
||||
getChildContext(): { layerContainer: E, popupContainer: E };
|
||||
}
|
||||
|
||||
@@ -262,33 +262,33 @@ export interface GeoJSONProps extends FeatureGroupEvents, Leaflet.GeoJSONOptions
|
||||
data: GeoJSON.GeoJsonObject;
|
||||
style?: Leaflet.StyleFunction;
|
||||
}
|
||||
export class GeoJSON<P extends GeoJSONProps, E extends Leaflet.GeoJSON> extends Path<P, E> { }
|
||||
export class GeoJSON<P extends GeoJSONProps = GeoJSONProps, E extends Leaflet.GeoJSON = Leaflet.GeoJSON> extends Path<P, E> { }
|
||||
|
||||
export interface PolylineProps extends PathEvents, Leaflet.PolylineOptions {
|
||||
children?: Children;
|
||||
positions: Leaflet.LatLngExpression[] | Leaflet.LatLngExpression[][];
|
||||
}
|
||||
export class Polyline<P extends PolylineProps, E extends Leaflet.Polyline> extends Path<P, E> { }
|
||||
export class Polyline<P extends PolylineProps = PolylineProps, E extends Leaflet.Polyline = Leaflet.Polyline> extends Path<P, E> { }
|
||||
|
||||
export interface PolygonProps extends PathEvents, Leaflet.PolylineOptions {
|
||||
children?: Children;
|
||||
popupContainer?: Leaflet.FeatureGroup;
|
||||
positions: Leaflet.LatLngExpression[] | Leaflet.LatLngExpression[][] | Leaflet.LatLngExpression[][][];
|
||||
}
|
||||
export class Polygon<P extends PolygonProps, E extends Leaflet.Polygon> extends Path<P, E> { }
|
||||
export class Polygon<P extends PolygonProps = PolygonProps, E extends Leaflet.Polygon = Leaflet.Polygon> extends Path<P, E> { }
|
||||
|
||||
export interface RectangleProps extends PathEvents, Leaflet.PolylineOptions {
|
||||
children?: Children;
|
||||
bounds: Leaflet.LatLngBoundsExpression;
|
||||
popupContainer?: Leaflet.FeatureGroup;
|
||||
}
|
||||
export class Rectangle<P extends RectangleProps, E extends Leaflet.Rectangle> extends Path<P, E> { }
|
||||
export class Rectangle<P extends RectangleProps = RectangleProps, E extends Leaflet.Rectangle = Leaflet.Rectangle> extends Path<P, E> { }
|
||||
|
||||
export interface PopupProps extends Leaflet.PopupOptions {
|
||||
children?: Children;
|
||||
position?: Leaflet.LatLngExpression;
|
||||
}
|
||||
export class Popup<P extends PopupProps, E extends Leaflet.Popup> extends MapComponent<P, E> {
|
||||
export class Popup<P extends PopupProps = PopupProps, E extends Leaflet.Popup = Leaflet.Popup> extends MapComponent<P, E> {
|
||||
onPopupOpen(arg: { popup: E }): void;
|
||||
onPopupClose(arg: { popup: E }): void;
|
||||
renderPopupContent(): void;
|
||||
@@ -298,7 +298,7 @@ export class Popup<P extends PopupProps, E extends Leaflet.Popup> extends MapCom
|
||||
export interface TooltipProps extends Leaflet.TooltipOptions {
|
||||
children?: Children;
|
||||
}
|
||||
export class Tooltip<P extends TooltipProps, E extends Leaflet.Tooltip> extends MapComponent<P, E> {
|
||||
export class Tooltip<P extends TooltipProps = TooltipProps, E extends Leaflet.Tooltip = Leaflet.Tooltip> extends MapComponent<P, E> {
|
||||
onTooltipOpen(arg: { tooltip: E }): void;
|
||||
onTooltipClose(arg: { tooltip: E }): void;
|
||||
renderTooltipContent(): void;
|
||||
@@ -306,21 +306,21 @@ export class Tooltip<P extends TooltipProps, E extends Leaflet.Tooltip> extends
|
||||
}
|
||||
|
||||
export type MapControlProps = Leaflet.ControlOptions;
|
||||
export class MapControl<P extends MapControlProps, E extends Leaflet.Control> extends React.Component<P, {}> {
|
||||
export class MapControl<P extends MapControlProps = MapControlProps, E extends Leaflet.Control = Leaflet.Control> extends React.Component<P, {}> {
|
||||
leafletElement: E;
|
||||
createLeafletElement(props: P): E;
|
||||
updateLeafletElement(fromProps: P, toProps: P): void;
|
||||
}
|
||||
|
||||
export type AttributionControlProps = Leaflet.Control.AttributionOptions;
|
||||
export class AttributionControl<P extends AttributionControlProps, E extends Leaflet.Control.Attribution> extends MapControl<P, E> { }
|
||||
export class AttributionControl<P extends AttributionControlProps = AttributionControlProps, E extends Leaflet.Control.Attribution = Leaflet.Control.Attribution> extends MapControl<P, E> { }
|
||||
|
||||
export interface LayersControlProps extends LayersControlEvents, Leaflet.Control.LayersOptions {
|
||||
baseLayers?: Leaflet.Control.LayersObject;
|
||||
children?: Children;
|
||||
overlays?: Leaflet.Control.LayersObject;
|
||||
}
|
||||
export class LayersControl<P extends AttributionControlProps, E extends Leaflet.Control.Layers> extends MapControl<P, E> { }
|
||||
export class LayersControl<P extends LayersControlProps = LayersControlProps, E extends Leaflet.Control.Layers = Leaflet.Control.Layers> extends MapControl<P, E> { }
|
||||
|
||||
export namespace LayersControl {
|
||||
interface BaseControlledLayerProps {
|
||||
@@ -334,18 +334,18 @@ export namespace LayersControl {
|
||||
addOverlay?(layer: Leaflet.Layer, name: string, checked: boolean): void;
|
||||
name: string;
|
||||
}
|
||||
class ControlledLayer<P extends BaseControlledLayerProps> extends React.Component<P, {}> {
|
||||
class ControlledLayer<P extends BaseControlledLayerProps = BaseControlledLayerProps> extends React.Component<P, {}> {
|
||||
layer?: Leaflet.Layer;
|
||||
getChildContext(): { layerContainer: LayerContainer };
|
||||
addLayer(): void;
|
||||
removeLayer(layer: Leaflet.Layer): void;
|
||||
}
|
||||
class BaseLayer<P extends ControlledLayerProps> extends ControlledLayer<P> { }
|
||||
class Overlay<P extends ControlledLayerProps> extends ControlledLayer<P> { }
|
||||
class BaseLayer<P extends ControlledLayerProps = ControlledLayerProps> extends ControlledLayer<P> { }
|
||||
class Overlay<P extends ControlledLayerProps = ControlledLayerProps> extends ControlledLayer<P> { }
|
||||
}
|
||||
|
||||
export type ScaleControlProps = Leaflet.Control.ScaleOptions;
|
||||
export class ScaleControl<P extends ScaleControlProps, E extends Leaflet.Control.Scale> extends MapControl<P, E> { }
|
||||
export class ScaleControl<P extends ScaleControlProps = ScaleControlProps, E extends Leaflet.Control.Scale = Leaflet.Control.Scale> extends MapControl<P, E> { }
|
||||
|
||||
export type ZoomControlProps = Leaflet.Control.ZoomOptions;
|
||||
export class ZoomControl<P extends ZoomControlProps, E extends Leaflet.Control.Zoom> extends MapControl<P, E> { }
|
||||
export class ZoomControl<P extends ZoomControlProps = ZoomControlProps, E extends Leaflet.Control.Zoom = Leaflet.Control.Zoom> extends MapControl<P, E> { }
|
||||
|
||||
@@ -686,7 +686,7 @@ class CenterControl extends MapControl<MapControlProps, Leaflet.Control> { // n
|
||||
const centerControl = new L.Control({ position: 'bottomright' }); // see http://leafletjs.com/reference.html#control-positions for other positions
|
||||
const jsx = (
|
||||
// PUT YOUR JSX FOR THE COMPONENT HERE:
|
||||
<div {...this.props}>
|
||||
<div>
|
||||
{/* add your JSX */}
|
||||
</div>
|
||||
);
|
||||
@@ -713,7 +713,7 @@ class LegendControl extends MapControl<MapControlProps & { className?: string },
|
||||
componentWillMount() {
|
||||
const legend = new L.Control({ position: 'bottomright' });
|
||||
const jsx = (
|
||||
<div {...this.props}>
|
||||
<div>
|
||||
{this.props.children}
|
||||
</div>
|
||||
);
|
||||
|
||||
4
types/react-motion/index.d.ts
vendored
4
types/react-motion/index.d.ts
vendored
@@ -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 {
|
||||
|
||||
22
types/react-redux/index.d.ts
vendored
22
types/react-redux/index.d.ts
vendored
@@ -15,12 +15,12 @@ type Store<S> = Redux.Store<S>;
|
||||
type Dispatch<S> = Redux.Dispatch<S>;
|
||||
type ActionCreator<A> = Redux.ActionCreator<A>;
|
||||
|
||||
export interface DispatchProp<T> {
|
||||
dispatch: Dispatch<T>
|
||||
export interface DispatchProp<S> {
|
||||
dispatch: Dispatch<S>;
|
||||
}
|
||||
|
||||
interface ComponentDecorator<TMergedProps> {
|
||||
<TOwnProps>(component: Component<(TOwnProps & TMergedProps) | TOwnProps>): ComponentClass<TOwnProps>;
|
||||
interface ComponentDecorator<TMergedProps, TOwnProps> {
|
||||
<T extends TOwnProps>(component: Component<T & TMergedProps>): ComponentClass<T>;
|
||||
}
|
||||
|
||||
interface ComponentMergeDecorator<TMergedProps, TOwnProps> {
|
||||
@@ -46,21 +46,21 @@ interface ComponentMergeDecorator<TMergedProps, TOwnProps> {
|
||||
* @param mergeProps
|
||||
* @param options
|
||||
*/
|
||||
export declare function connect(): ComponentDecorator<DispatchProp<any>>;
|
||||
export declare function connect(): ComponentDecorator<DispatchProp<any>, {}>;
|
||||
|
||||
export declare function connect<TStateProps, no_dispatch, TOwnProps>(
|
||||
mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps>
|
||||
): ComponentDecorator<DispatchProp<any> & TStateProps>;
|
||||
): ComponentDecorator<DispatchProp<any> & TStateProps, TOwnProps>;
|
||||
|
||||
export declare function connect<no_state, TDispatchProps, TOwnProps>(
|
||||
mapStateToProps: null | undefined,
|
||||
mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>
|
||||
): ComponentDecorator<TDispatchProps & TOwnProps>;
|
||||
): ComponentDecorator<TDispatchProps, TOwnProps>;
|
||||
|
||||
export declare function connect<TStateProps, TDispatchProps, TOwnProps>(
|
||||
mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps>,
|
||||
mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>
|
||||
): ComponentDecorator<TStateProps & TDispatchProps>;
|
||||
): ComponentDecorator<TStateProps & TDispatchProps, TOwnProps>;
|
||||
|
||||
export declare function connect<TStateProps, no_dispatch, TOwnProps, TMergedProps>(
|
||||
mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps>,
|
||||
@@ -91,21 +91,21 @@ export declare function connect<TStateProps, no_dispatch, TOwnProps>(
|
||||
mapDispatchToProps: null | undefined,
|
||||
mergeProps: null | undefined,
|
||||
options: Options
|
||||
): ComponentDecorator<DispatchProp<any> & TStateProps & TOwnProps>;
|
||||
): ComponentDecorator<DispatchProp<any> & TStateProps, TOwnProps>;
|
||||
|
||||
export declare function connect<no_state, TDispatchProps, TOwnProps>(
|
||||
mapStateToProps: null | undefined,
|
||||
mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,
|
||||
mergeProps: null | undefined,
|
||||
options: Options
|
||||
): ComponentDecorator<TDispatchProps>;
|
||||
): ComponentDecorator<TDispatchProps, TOwnProps>;
|
||||
|
||||
export declare function connect<TStateProps, TDispatchProps, TOwnProps>(
|
||||
mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps>,
|
||||
mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,
|
||||
mergeProps: null | undefined,
|
||||
options: Options
|
||||
): ComponentDecorator<TStateProps & TDispatchProps>;
|
||||
): ComponentDecorator<TStateProps & TDispatchProps, TOwnProps>;
|
||||
|
||||
export declare function connect<TStateProps, TDispatchProps, TOwnProps, TMergedProps>(
|
||||
mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps>,
|
||||
|
||||
@@ -108,12 +108,7 @@ declare var store: Store<TodoState>;
|
||||
class MyRootComponent extends Component<any, any> {
|
||||
|
||||
}
|
||||
class TodoApp extends Component<DispatchProp<any>, any> {
|
||||
render (): null {
|
||||
this.props.dispatch({ type: 'test' })
|
||||
return null
|
||||
}
|
||||
}
|
||||
class TodoApp extends Component<any, any> {}
|
||||
interface TodoState {
|
||||
todos: string[]|string;
|
||||
}
|
||||
@@ -156,9 +151,10 @@ ReactDOM.render(
|
||||
|
||||
// Inject just dispatch and don't listen to store
|
||||
|
||||
const WrappedTodoApp = connect()<{}>(TodoApp);
|
||||
const AppWrap = (props: DispatchProp<any> & { children?: React.ReactNode }) => <div />
|
||||
const WrappedApp = connect()(AppWrap);
|
||||
|
||||
<WrappedTodoApp />
|
||||
<WrappedApp />
|
||||
|
||||
// Inject dispatch and every field in the global state
|
||||
|
||||
@@ -281,7 +277,7 @@ interface TestState {
|
||||
isLoaded: boolean;
|
||||
state1: number;
|
||||
}
|
||||
class TestComponent extends Component<TestProp, TestState> { }
|
||||
class TestComponent extends Component<TestProp & DispatchProp<any>, TestState> { }
|
||||
const WrappedTestComponent = connect()(TestComponent);
|
||||
|
||||
// return value of the connect()(TestComponent) is of the type TestComponent
|
||||
@@ -290,7 +286,6 @@ ATestComponent = TestComponent;
|
||||
ATestComponent = WrappedTestComponent;
|
||||
|
||||
let anElement: ReactElement<TestProp>;
|
||||
<TestComponent property1={42} />;
|
||||
<WrappedTestComponent property1={42} />;
|
||||
<ATestComponent property1={42} />;
|
||||
|
||||
@@ -348,7 +343,7 @@ namespace TestTOwnPropsInference {
|
||||
state: string;
|
||||
}
|
||||
|
||||
class OwnPropsComponent extends React.Component<OwnProps & StateProps, void> {
|
||||
class OwnPropsComponent extends React.Component<StateProps & OwnProps & DispatchProp<any>, void> {
|
||||
render() {
|
||||
return <div/>;
|
||||
}
|
||||
@@ -370,13 +365,13 @@ namespace TestTOwnPropsInference {
|
||||
// React.createElement(ConnectedWithoutOwnProps, { anything: 'goes!' });
|
||||
|
||||
// This compiles, as expected.
|
||||
React.createElement(ConnectedWithOwnProps, { state: 'string', own: 'string' });
|
||||
React.createElement(ConnectedWithOwnProps, { own: 'string' });
|
||||
|
||||
// This should not compile, which is good.
|
||||
// React.createElement(ConnectedWithOwnProps, { anything: 'goes!' });
|
||||
|
||||
// This compiles, as expected.
|
||||
React.createElement(ConnectedWithTypeHint, { state: 'string', own: 'string' });
|
||||
React.createElement(ConnectedWithTypeHint, { own: 'string' });
|
||||
|
||||
// This should not compile, which is good.
|
||||
// React.createElement(ConnectedWithTypeHint, { anything: 'goes!' });
|
||||
@@ -438,3 +433,44 @@ namespace TestMergedPropsInference {
|
||||
}),
|
||||
)(MergedPropsComponent);
|
||||
}
|
||||
|
||||
namespace Issue16652 {
|
||||
interface PassedProps {
|
||||
commentIds: string[];
|
||||
}
|
||||
|
||||
interface GeneratedStateProps {
|
||||
comments: ({ id: string } | undefined)[];
|
||||
}
|
||||
|
||||
class CommentList extends React.Component<PassedProps & GeneratedStateProps & DispatchProp<any>, void> {}
|
||||
|
||||
const mapStateToProps = (state: any, ownProps: PassedProps): GeneratedStateProps => {
|
||||
return {
|
||||
comments: ownProps.commentIds.map(id => ({ id })),
|
||||
};
|
||||
};
|
||||
|
||||
const ConnectedCommentList = connect<GeneratedStateProps, {}, PassedProps>(mapStateToProps)(
|
||||
CommentList
|
||||
);
|
||||
|
||||
<ConnectedCommentList commentIds={['a', 'b', 'c']} />
|
||||
}
|
||||
|
||||
namespace Issue15463 {
|
||||
interface ISpinnerProps{
|
||||
showGlobalSpinner: boolean;
|
||||
}
|
||||
class SpinnerClass extends React.Component<ISpinnerProps & DispatchProp<any>, undefined> {
|
||||
render() {
|
||||
return (<div />);
|
||||
}
|
||||
}
|
||||
|
||||
export const Spinner = connect((state: any) => {
|
||||
return { showGlobalSpinner: true };
|
||||
})(SpinnerClass);
|
||||
|
||||
<Spinner />
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ reduxForm({
|
||||
|
||||
// adapted from: http://redux-form.com/6.0.0-alpha.4/examples/initializeFromState/
|
||||
|
||||
import { connect } from 'react-redux'
|
||||
import { connect, DispatchProp } from 'react-redux'
|
||||
const { DOM: { input } } = React
|
||||
|
||||
interface DataShape {
|
||||
@@ -125,7 +125,7 @@ const ConnectedDecoratedInitializeFromStateFormFunction = connect(
|
||||
|
||||
// React ComponentClass instead of StatelessComponent
|
||||
|
||||
class InitializeFromStateFormClass extends React.Component<Props, {}> {
|
||||
class InitializeFromStateFormClass extends React.Component<Props & DispatchProp<any>, {}> {
|
||||
render() {
|
||||
return InitializeFromStateFormFunction(this.props);
|
||||
}
|
||||
|
||||
4
types/webix/index.d.ts
vendored
4
types/webix/index.d.ts
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user