diff --git a/react-table-filter/index.d.ts b/react-table-filter/index.d.ts
new file mode 100644
index 0000000000..8f9c50a26f
--- /dev/null
+++ b/react-table-filter/index.d.ts
@@ -0,0 +1,16 @@
+// Type definitions for react-table-filter 1.0.0
+// Project: https://github.com/cheekujha/react-table-filter
+// Definitions by: Gnanavel N
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.8
+
+import * as React from 'react';
+
+export interface TabfilterProps {
+ rows: string | Array | { [name: string]: boolean; };
+ onFilterUpdate: (filteredArray: Array, currentFilters: any[]) => any[] | void;
+ rowClass?: string;
+ initialFilters?: string | Array | { [name: string]: boolean; };
+}
+
+export declare class TableFilter extends React.Component {}
\ No newline at end of file
diff --git a/react-table-filter/react-table-filter-tests.ts b/react-table-filter/react-table-filter-tests.ts
new file mode 100644
index 0000000000..051f694f75
--- /dev/null
+++ b/react-table-filter/react-table-filter-tests.ts
@@ -0,0 +1,18 @@
+import * as React from "react";
+import * as ReactDOM from "react-dom";
+import { TableFilter } from "react-table-filter";
+
+interface TestTableFilterProps extends TableFilter {}
+
+class TestApp extends React.Component {
+ onFilterUpdate = (filteredArray: Array, currentFilters: any[]) => {
+ console.log("Filtered Array: " + filteredArray);
+ console.log("Current Filters: " + currentFilters);
+ }
+
+ render() {
+ return React.createElement(TableFilter, {onFilterUpdate: this.onFilterUpdate});
+ }
+}
+
+ReactDOM.render(React.createElement(TestApp, {}), document.getElementById("test-app"));
\ No newline at end of file
diff --git a/react-table-filter/tsconfig.json b/react-table-filter/tsconfig.json
new file mode 100644
index 0000000000..ca4a35b1cb
--- /dev/null
+++ b/react-table-filter/tsconfig.json
@@ -0,0 +1,22 @@
+{
+ "files": [
+ "index.d.ts"
+ ],
+ "compilerOptions": {
+ "module": "commonjs",
+ "lib": [
+ "es6"
+ ],
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "strictFunctionTypes": true,
+ "baseUrl": "../",
+ "typeRoots": [
+ "../"
+ ],
+ "types": [],
+ "noEmit": true,
+ "forceConsistentCasingInFileNames": true
+ }
+}
diff --git a/react-table-filter/tslint.json b/react-table-filter/tslint.json
new file mode 100644
index 0000000000..d88586e5bd
--- /dev/null
+++ b/react-table-filter/tslint.json
@@ -0,0 +1,3 @@
+{
+ "extends": "dtslint/dt.json"
+}
diff --git a/types/d3-request/d3-request-tests.ts b/types/d3-request/d3-request-tests.ts
index 8b2130240a..e2208481d8 100644
--- a/types/d3-request/d3-request-tests.ts
+++ b/types/d3-request/d3-request-tests.ts
@@ -36,13 +36,13 @@ interface ResponseDatumPOST {
success: boolean;
}
-let listenerXhr: (this: d3Request.Request, xhr: XMLHttpRequest) => void;
+let listenerXhr: ((this: d3Request.Request, xhr: XMLHttpRequest) => void) | undefined;
-let listenerProgress: (this: d3Request.Request, progEvent: ProgressEvent) => void;
+let listenerProgress: ((this: d3Request.Request, progEvent: ProgressEvent) => void) | undefined;
-let listenerError: (this: d3Request.Request, error: any) => void;
+let listenerError: ((this: d3Request.Request, error: any) => void) | undefined;
-let listenerResult: (this: d3Request.Request, result: ResponseDatumGET[]) => void;
+let listenerResult: ((this: d3Request.Request, result: ResponseDatumGET[]) => void) | undefined;
// -------------------------------------------------------------------------------
// Generic Request
@@ -108,7 +108,7 @@ const r7: d3Request.Request = request.header('Accept-Encoding', null);
// Mime Type -------------------------------------------------------------------
// get
-let mimeType: string = request.mimeType();
+let mimeType: string | null = request.mimeType();
// set
const r8: d3Request.Request = request.mimeType('application/json');
// remove
@@ -162,11 +162,12 @@ r10 = r10.on('load', function(result: ResponseDatumGET[]) {
// do something;
});
-// r10 = r10.on('load', function(result: number) { // fails, wrong argument type for callback
-// const that: d3Request.Request = this;
-// const res: number = result;
-// // do something;
-// });
+// $ExpectError
+r10 = r10.on('load', function(result: number) { // fails, wrong argument type for callback
+ const that: d3Request.Request = this;
+ const res: number = result;
+ // do something;
+});
listenerResult = r10.on('load');
@@ -191,9 +192,10 @@ listenerError = r10.on('error.foo');
// Password ---------------------------------------------------------------------
// get
-const password: string = request.password();
+const password: string | null = request.password();
// set
const r11: d3Request.Request = request.password('MyPassword');
+const r25: d3Request.Request = request.password(null);
// Post -------------------------------------------------------------------------
@@ -238,11 +240,11 @@ const r16: d3Request.Request = d3Request.request(url)
// ResponseType -----------------------------------------------------------------
// get
-const responseType: string = d3Request.request(url)
+const responseType: XMLHttpRequestResponseType | undefined = d3Request.request(url)
.responseType();
// set
const r17: d3Request.Request = d3Request.request(url)
- .responseType('application/json');
+ .responseType('json');
// Send ------------------------------------------------------------------------
@@ -259,7 +261,7 @@ const r20: d3Request.Request = d3Request.request(url)
.response(xhr2Listing)
.send('GET', (error, response) => {
if (!error) {
- const r: ResponseDatumGET[] = response;
+ const r: ResponseDatumGET[] | null = response;
console.log(r);
}
});
@@ -269,7 +271,7 @@ const r21: d3Request.Request = d3Request.request(url)
.response(xhr2Listing)
.send('GET', { kind: 'Listing' }, (error, response) => {
if (!error) {
- const r: ResponseDatumGET[] = response;
+ const r: ResponseDatumGET[] | null = response;
console.log(r);
}
});
@@ -286,9 +288,10 @@ const r22: d3Request.Request = d3Request.request(url)
// User----------------------------------------------------------------------------
// get
-const user: string = request.user();
+const user: string | null = request.user();
// set
const r23: d3Request.Request = request.user('User');
+const r24: d3Request.Request = request.user(null);
// -------------------------------------------------------------------------------
// HTML Request
@@ -360,8 +363,8 @@ const csvRequestWithRowWithCallback: d3Request.DsvRequest = d3Request.csv, Alex Ford , Boris Yankov , Tom Wanzek
+// Definitions by: Hugues Stefanski
+// Alex Ford
+// Boris Yankov
+// Tom Wanzek
+// denisname
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.3
-// Last module patch version validated against: 1.0.2
+// Last module patch version validated against: 1.0.6
import { DSVParsedArray, DSVRowString, DSVRowAny } from 'd3-dsv';
export interface Request {
+ /**
+ * Aborts this request, if it is currently in-flight, and returns this request instance.
+ * See XMLHttpRequest’s abort.
+ */
abort(): this;
+ /**
+ * Equivalent to `request.send` with the GET method: `request.send("GET")`.
+ */
get(): this;
+ /**
+ * Equivalent to `request.send` with the GET method: `request.send("GET", data)`.
+ */
get(data: RequestData): this;
+ /**
+ * Equivalent to `request.send` with the GET method: `request.send("GET", callback)`.
+ */
get(callback: (error: any, d: ResponseData) => void): this;
+ /**
+ * Equivalent to `request.send` with the GET method: `request.send("GET", data, callback)`.
+ */
get(data: RequestData, callback: (error: any, d: ResponseData) => void): this;
+ /**
+ * Returns the current value of the request header with the specified name.
+ * Header names are case-insensitive.
+ */
header(name: string): string;
+ /**
+ * Sets the request header with the specified name to the specified value and returns this request instance.
+ * If value is null, removes the request header with the specified name instead.
+ * Header names are case-insensitive.
+ *
+ * Request headers can only be modified before the request is sent.
+ * Therefore, you cannot pass a callback to the request constructor if you wish to specify a header;
+ * use `request.get` or similar instead.
+ */
header(name: string, value: string | null): this;
+ /**
+ * Returns the current mime type, which defaults to null.
+ */
mimeType(): string | null;
+ /**
+ * Sets the request mime type to the specified value and returns this request instance.
+ * If type is null, clears the current mime type (if any) instead.
+ *
+ * The mime type is used to both set the "Accept" request header and for `overrideMimeType`, where supported.
+ *
+ * The request mime type can only be modified before the request is sent.
+ * Therefore, you cannot pass a callback to the request constructor if you wish to override the mime type;
+ * use `request.get` or similar instead.
+ */
mimeType(value: string | null): this;
- on(type: 'beforesend'): (this: this, xhr: XMLHttpRequest) => void;
- on(type: 'progress'): (this: this, progressEvent: ProgressEvent) => void;
- on(type: 'error'): (this: this, error: any) => void;
- on(type: 'load'): (this: this, data: ResponseData) => void;
- on(type: string): (this: this, data: any) => void;
+ /**
+ * Returns the currently-assigned listener for the "beforesend" type, if any.
+ */
+ on(type: 'beforesend'): ((this: this, xhr: XMLHttpRequest) => void) | undefined;
+ /**
+ * Returns the currently-assigned listener for the "progress" type, if any.
+ */
+ on(type: 'progress'): ((this: this, progressEvent: ProgressEvent) => void) | undefined;
+ /**
+ * Returns the currently-assigned listener for the "error" type, if any.
+ */
+ on(type: 'error'): ((this: this, error: any) => void) | undefined;
+ /**
+ * Returns the currently-assigned listener for the "load" type, if any.
+ */
+ on(type: 'load'): ((this: this, data: ResponseData) => void) | undefined;
+ /**
+ * Returns the currently-assigned listener for the specified type, if any.
+ */
+ on(type: string): ((this: this, data: any) => void) | undefined;
+
+ /**
+ * Removes the current event listener for the specified type, if any.
+ */
on(type: string, listener: null): this;
+
+ /**
+ * Sets the event listener for the "beforesend" type,
+ * to allow custom headers and the like to be set before the request is sent,
+ * and returns this request instance.
+ *
+ * If an event listener was already registered for the same type, the existing listener is removed before the new listener is added.
+ * To register multiple listeners for the same type, the type may be followed by an optional name, such as `beforesend.foo`. See d3-dispatch for details.
+ */
on(type: 'beforesend', listener: (this: this, xhr: XMLHttpRequest) => void): this;
+ /**
+ * Sets the event listener for the "progress" type,
+ * to monitor the progress of the request,
+ * and returns this request instance.
+ *
+ * If an event listener was already registered for the same type, the existing listener is removed before the new listener is added.
+ * To register multiple listeners for the same type, the type may be followed by an optional name, such as `progress.foo`. See d3-dispatch for details.
+ */
on(type: 'progress', listener: (this: this, progressEvent: ProgressEvent) => void): this;
+ /**
+ * Sets the event listener for the "error" type,
+ * when the request completes unsuccessfully; this includes 4xx and 5xx response codes,
+ * and returns this request instance.
+ *
+ * If an event listener was already registered for the same type, the existing listener is removed before the new listener is added.
+ * To register multiple listeners for the same type, the type may be followed by an optional name, such as `error.foo`. See d3-dispatch for details.
+ */
on(type: 'error', listener: (this: this, error: any) => void): this;
+ /**
+ * Sets the event listener for the "load" type,
+ * when the request completes successfully,
+ * and returns this request instance.
+ *
+ * If an event listener was already registered for the same type, the existing listener is removed before the new listener is added.
+ * To register multiple listeners for the same type, the type may be followed by an optional name, such as `load.foo`. See d3-dispatch for details.
+ */
on(type: 'load', listener: (this: this, data: ResponseData) => void): this;
+ /**
+ * Sets the event listener for the specified type,
+ * and returns this request instance.
+ *
+ * The type must be one of the following: "beforesend", "progress", "load", "error".
+ *
+ * If an event listener was already registered for the same type, the existing listener is removed before the new listener is added.
+ * To register multiple listeners for the same type, the type may be followed by an optional name, such as `load.foo`. See d3-dispatch for details.
+ */
on(type: string, listener: (this: this, data: any) => void): this;
+ /**
+ * Returns the current password, which defaults to null.
+ */
password(): string | null;
- password(value: string): this;
+ /**
+ * Sets the password for authentication to the specified string and returns this request instance.
+ */
+ password(value: string | null): this;
+ /**
+ * Equivalent to `request.send` with the POST method: `request.send("POST")`.
+ */
post(): this;
+ /**
+ * Equivalent to `request.send` with the POST method: `request.send("POST", data)`.
+ */
post(data: RequestData): this;
+ /**
+ * Equivalent to `request.send` with the POST method: `request.send("POST", callback)`.
+ */
post(callback: (this: this, error: any, d: ResponseData) => void): this;
+ /**
+ * Equivalent to `request.send` with the POST method: `request.send("POST", data, callback)`.
+ */
post(data: RequestData, callback: (this: this, error: any, d: ResponseData) => void): this;
+ /**
+ * Sets the response value function to the specified function and returns this request instance.
+ * The response value function is used to map the response XMLHttpRequest object to a useful data value.
+ * See the convenience methods `json` and `text` for examples.
+ */
response(callback: (this: this, response: XMLHttpRequest) => ResponseData): this;
- responseType(): string | null;
- responseType(value: string): this;
+ /**
+ * Returns the current response type, which defaults to `` (the empty string).
+ */
+ responseType(): XMLHttpRequestResponseType | undefined;
+ /**
+ * Sets the response type attribute of the request and returns this request instance. Typical values are: `` (the empty string), `arraybuffer`, `blob`, `document`, and `text`.
+ */
+ responseType(value: XMLHttpRequestResponseType): this;
+ /**
+ * Issues this request using the specified method (such as GET or POST).
+ *
+ * The listeners "load" and "error" should be registered via `request.on`.
+ */
send(method: string): this;
+ /**
+ * Issues this request using the specified method (such as GET or POST), posting the specified data in the request body, and returns this request instance.
+ *
+ * The listeners "load" and "error" should be registered via `request.on`.
+ */
send(method: string, data: RequestData): this;
+ /**
+ * Issues this request using the specified method (such as GET or POST) and returns this request instance.
+ * The callback will be invoked asynchronously when the request succeeds or fails.
+ * The callback is invoked with two arguments: the error, if any, and the response value.
+ * The response value is undefined if an error occurs.
+ */
send(method: string, callback: (this: this, error: any | null, d: ResponseData | null) => void): this;
+ /**
+ * Issues this request using the specified method (such as GET or POST), posting the specified data in the request body, and returns this request instance.
+ * The callback will be invoked asynchronously when the request succeeds or fails.
+ * The callback is invoked with two arguments: the error, if any, and the response value.
+ * The response value is undefined if an error occurs.
+ */
send(method: string, data: RequestData, callback: (this: this, error: any | null, d: ResponseData | null) => void): this;
+ /**
+ * Returns the current response timeout, which defaults to 0.
+ */
timeout(): number;
+ /**
+ * Sets the timeout attribute of the request to the specified number of milliseconds and returns this request instance.
+ */
timeout(value: number): this;
+ /**
+ * Returns the current user name, which defaults to null.
+ */
user(): string | null;
- user(value: string): this;
+ /**
+ * Sets the user name for authentication to the specified string and returns this request instance.
+ */
+ user(value: string | null): this;
}
export interface DsvRequest extends Request {
row(value: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow): DsvRequest;
}
+/**
+ * Returns a new request for the CSV file at the specified url with the default mime type `text/csv`.
+ */
export function csv(url: string): DsvRequest;
+/**
+ * Returns a new request for the CSV file at the specified url with the default mime type `text/csv`.
+ * And send a GET request.
+ */
export function csv(url: string, callback: (this: DsvRequest, error: any, d: DSVParsedArray) => void): DsvRequest;
+/**
+ * Returns a new request for the CSV file at the specified url with the default mime type `text/csv`.
+ * And send a GET request.
+ * Use a row conversion function to map and filter row objects to a more-specific representation; see `dsv.parse` for details.
+ */
export function csv(
url: string,
row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow,
callback: (this: DsvRequest, error: any, d: DSVParsedArray) => void
): DsvRequest;
+/**
+ * Returns a new request for the HTML file at the specified url with the default mime type `text/html`. The HTML file is returned as a document fragment.
+ */
export function html(url: string): Request;
+/**
+ * Returns a new request for the HTML file at the specified url with the default mime type `text/html`. The HTML file is returned as a document fragment.
+ * And send a GET request.
+ */
export function html(url: string, callback: (this: Request, error: any, d: DocumentFragment) => void): Request;
+/**
+ * Returns a new request to get the JSON file at the specified url with the default mime type `application/json`.
+ */
export function json(url: string): Request;
+/**
+ * Returns a new request to get the JSON file at the specified url with the default mime type `application/json`.
+ * And send a GET request.
+ */
export function json(url: string, callback: (this: Request, error: any, d: ParsedObject) => void): Request;
+/**
+ * Returns a new request for specified url. The returned request is not yet sent and can be further configured.
+ *
+ * See `d3.json`, `d3.csv`, `d3.tsv`, `d3.text`, `d3.html` and `d3.xml` for content-specific convenience constructors.
+ */
export function request(url: string): Request;
+/**
+ * Returns a new request for specified url. It is equivalent to calling `request.get` immediately after construction: `d3.request(url).get(callback)`.
+ * And send a GET request.
+ *
+ * If you wish to specify a request header or a mime type, you must not specify a callback to the constructor.
+ * Use `request.header` or `request.mimeType` followed by `request.get` instead.
+ *
+ * See `d3.json`, `d3.csv`, `d3.tsv`, `d3.text`, `d3.html` and `d3.xml` for content-specific convenience constructors.
+ */
export function request(url: string, callback: (this: Request, error: any, d: XMLHttpRequest) => void): Request;
+/**
+ * Returns a new request to get the text file at the specified url with the default mime type `text/plain`.
+ */
export function text(url: string): Request;
+/**
+ * Returns a new request to get the text file at the specified url with the default mime type `text/plain`.
+ * And send a GET request.
+ */
export function text(url: string, callback: (this: Request, error: any, d: string) => void): Request;
+/**
+ * Returns a new request for a TSV file at the specified url with the default mime type `text/tab-separated-values`.
+ */
export function tsv(url: string): DsvRequest;
+/**
+ * Returns a new request for a TSV file at the specified url with the default mime type `text/tab-separated-values`.
+ * And send a GET request.
+ */
export function tsv(url: string, callback: (this: DsvRequest, error: any, d: DSVParsedArray) => void): DsvRequest;
+/**
+ * Returns a new request for a TSV file at the specified url with the default mime type `text/tab-separated-values`.
+ * And send a GET request.
+ * Use a row conversion function to map and filter row objects to a more-specific representation; see `dsv.parse` for details.
+ */
export function tsv(
url: string,
row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow,
callback: (this: DsvRequest, error: any, d: DSVParsedArray) => void
): DsvRequest;
+/**
+ * Returns a new request to get the XML file at the specified url with the default mime type `application/xml`.
+ */
export function xml(url: string): Request;
+/**
+ * Returns a new request to get the XML file at the specified url with the default mime type `application/xml`.
+ * And send a GET request.
+ */
export function xml(url: string, callback: (this: Request, error: any, d: any) => void): Request;
diff --git a/types/d3-request/tsconfig.json b/types/d3-request/tsconfig.json
index a52d00ffaa..9ba2eb33f3 100644
--- a/types/d3-request/tsconfig.json
+++ b/types/d3-request/tsconfig.json
@@ -6,8 +6,8 @@
"dom"
],
"noImplicitAny": true,
- "noImplicitThis": false,
- "strictNullChecks": false,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
"strictFunctionTypes": false,
"baseUrl": "../",
"typeRoots": [
diff --git a/types/d3-request/tslint.json b/types/d3-request/tslint.json
index a965459d61..1aeb60bae1 100644
--- a/types/d3-request/tslint.json
+++ b/types/d3-request/tslint.json
@@ -3,9 +3,7 @@
"rules": {
// TODOs
"no-any-union": false,
- "no-this-assignment": false,
"no-unnecessary-generics": false,
- "unified-signatures": false,
- "max-line-length": [false, 145]
+ "unified-signatures": false
}
}
diff --git a/types/koa-bunyan-logger/index.d.ts b/types/koa-bunyan-logger/index.d.ts
new file mode 100644
index 0000000000..1cf77fec92
--- /dev/null
+++ b/types/koa-bunyan-logger/index.d.ts
@@ -0,0 +1,21 @@
+// Type definitions for koa-bunyan-logger 2.0
+// Project: https://github.com/koajs/bunyan-logger
+// Definitions by: Steven McDowall
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.3
+
+import { Middleware } from 'koa';
+
+import Logger = require('bunyan');
+
+export = koaBunyanLogger;
+
+declare function koaBunyanLogger(logger?: Logger): Middleware;
+
+// Extend the Koa context to add the logger..
+declare module 'koa' {
+ // tslint:disable-next-line: interface-name
+ interface BaseContext {
+ log: Logger;
+ }
+}
diff --git a/types/koa-bunyan-logger/koa-bunyan-logger-tests.ts b/types/koa-bunyan-logger/koa-bunyan-logger-tests.ts
new file mode 100644
index 0000000000..daaf26b7a3
--- /dev/null
+++ b/types/koa-bunyan-logger/koa-bunyan-logger-tests.ts
@@ -0,0 +1,12 @@
+import Koa = require('koa');
+import koaBunyanLogger = require('koa-bunyan-logger');
+
+const app = new Koa();
+app.use(koaBunyanLogger());
+
+app.use(async (ctx, next) => {
+ ctx.log.info('Got a request from %s for %s', ctx.request.ip, ctx.path);
+ await next();
+});
+
+app.listen(8000);
diff --git a/types/koa-bunyan-logger/tsconfig.json b/types/koa-bunyan-logger/tsconfig.json
new file mode 100644
index 0000000000..67657f2ec2
--- /dev/null
+++ b/types/koa-bunyan-logger/tsconfig.json
@@ -0,0 +1,23 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "lib": [
+ "es6"
+ ],
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "strictFunctionTypes": true,
+ "baseUrl": "../",
+ "typeRoots": [
+ "../"
+ ],
+ "types": [],
+ "noEmit": true,
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "koa-bunyan-logger-tests.ts"
+ ]
+}
diff --git a/types/koa-bunyan-logger/tslint.json b/types/koa-bunyan-logger/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/koa-bunyan-logger/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }
diff --git a/types/leaflet/index.d.ts b/types/leaflet/index.d.ts
index 0822dea605..8402d8bc9b 100644
--- a/types/leaflet/index.d.ts
+++ b/types/leaflet/index.d.ts
@@ -11,10 +11,12 @@ export as namespace L;
import * as geojson from 'geojson';
export class Class {
- static extend(props: any): any/* how to return constructor of self extended type ? */;
- static include(props: any): any /* how to return self extended type ? */;
- static mergeOptions(props: any): any /* how to return self extended type ? */;
- static addInitHook(initHookFn: () => void): any/* how to return self extended type ? */;
+ static extend(props: any): {new(...args: any[]): any} & typeof Class;
+ static include(props: any): any & typeof Class;
+ static mergeOptions(props: any): any & typeof Class;
+
+ static addInitHook(initHookFn: () => void): any & typeof Class;
+ static addInitHook(methodName: string, ...args: any[]): any & typeof Class;
}
export class Transformation {
@@ -1532,8 +1534,12 @@ export namespace Browser {
}
export namespace Util {
- function extend(dest: any, src?: any): any;
- function create(proto: any, properties?: any): any;
+ function extend(dest: D, src?: S1): D & S1;
+ function extend(dest: D, src1: S1, src2: S2): D & S1 & S2;
+ function extend(dest: D, src1: S1, src2: S2, src3: S3): D & S1 & S2 & S3;
+ function extend(dest: any, ...src: any[]): any;
+
+ function create(proto: object | null, properties?: PropertyDescriptorMap): any;
function bind(fn: () => void, ...obj: any[]): () => void;
function stamp(obj: any): number;
function throttle(fn: () => void, time: number, context: any): () => void;
@@ -1547,7 +1553,7 @@ export namespace Util {
function template(str: string, data: any): string;
function isArray(obj: any): boolean;
function indexOf(array: any[], el: any): number;
- function requestAnimFrame(fn: () => void, context?: any, immediate?: boolean): number;
+ function requestAnimFrame(fn: (timestamp: number) => void, context?: any, immediate?: boolean): number;
function cancelAnimFrame(id: number): void;
let lastId: number;
diff --git a/types/leaflet/leaflet-tests.ts b/types/leaflet/leaflet-tests.ts
index 66f12fd0ed..d1375fa83f 100644
--- a/types/leaflet/leaflet-tests.ts
+++ b/types/leaflet/leaflet-tests.ts
@@ -444,10 +444,13 @@ defaultIcon = new L.Icon.Default({imagePath: 'apath'});
const myControlClass = L.Control.extend({});
const myControl = new myControlClass();
+const myOtherControlClass = myControlClass.extend({});
+const myOtherControl = new myOtherControlClass();
L.Control.include({});
L.Control.mergeOptions({});
L.Control.addInitHook(() => {});
+L.Control.addInitHook('method1', 'hello', 1);
export class MyNewControl extends L.Control {
constructor() {
@@ -526,8 +529,35 @@ polyline = new L.Polyline(multiPolylineLatLngs);
polyline.setLatLngs(multiPolylineLatLngs);
const multiPolylineLatLngs2: L.LatLng[][] = polyline.getLatLngs() as L.LatLng[][];
-L.Util.extend({});
+const obj1 = {
+ prop1: 1,
+};
+
+const obj2 = {
+ prop2: '2',
+};
+
+const obj3 = {
+ prop3: 'three',
+};
+
+const obj4 = {
+ prop4: 'cuatro',
+};
+
+const obj5 = {
+ prop5: 'cinque',
+};
+
+const extended0: typeof obj1 = L.Util.extend(obj1);
+const extended1: typeof obj1 & typeof obj2 = L.Util.extend(obj1, obj2);
+const extended2: typeof obj1 & typeof obj2 & typeof obj3 = L.Util.extend(obj1, obj2, obj3);
+const extended3: typeof obj1 & typeof obj2 & typeof obj3 & typeof obj4 = L.Util.extend(obj1, obj2, obj3, obj4);
+const extended4: typeof obj1 & typeof obj2 & typeof obj3 & typeof obj4 & typeof obj5 = L.Util.extend(obj1, obj2, obj3, obj4, obj5);
+
L.Util.create({});
+L.Util.create(null, {foo: {writable: true, value: 'bar'}});
+
L.Util.bind(() => {}, {});
L.Util.stamp({});
L.Util.throttle(() => {}, 123, {});
@@ -546,7 +576,7 @@ L.Util.template('template', {});
L.Util.isArray({});
L.Util.indexOf([], {});
L.Util.requestAnimFrame(() => {});
-L.Util.requestAnimFrame(() => {}, {});
+L.Util.requestAnimFrame(timestamp => console.log(timestamp), {});
L.Util.requestAnimFrame(() => {}, {}, true);
L.Util.cancelAnimFrame(1);
L.Util.emptyImageUrl;
diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts
index 99d7ddac1b..73ca28ee82 100644
--- a/types/office-js/index.d.ts
+++ b/types/office-js/index.d.ts
@@ -11346,6 +11346,36 @@ declare namespace Office {
* @beta
*/
addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;
+
+ /**
+ * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}.
+ *
+ * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web
+ * for Office 365.
+ *
+ * [Api set: Mailbox Preview]
+ *
+ * @remarks
+ *
+ *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}
Appointment Attendee
+ *
+ * In addition to this signature, the method also has the following signature:
+ *
+ * `getInitializationContextAsync(callback?: (result: AsyncResult) => void): void;`
+ *
+ * @param options Optional. An object literal that contains one or more of the following properties.
+ * asyncContext: Developers can provide any object they wish to access in the callback method.
+ * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter,
+ * asyncResult, which is an Office.AsyncResult object.
+ * On success, the initialization data is provided in the asyncResult.value property as a string.
+ * If there is no initialization context, the asyncResult object will contain an Error object with its code property
+ * set to 9020 and its name property set to GenericResponseError.
+ *
+ * @beta
+ */
+ getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void;
/**
* Asynchronously loads custom properties for this add-in on the selected item.
diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts
index 5f62134c90..5d30bf798a 100644
--- a/types/puppeteer/index.d.ts
+++ b/types/puppeteer/index.d.ts
@@ -1647,6 +1647,35 @@ export interface LaunchOptions {
* Useful so that you can see what is going on.
*/
slowMo?: number;
+ /**
+ * Sets a consistent viewport for each page. Defaults to an 800x600 viewport. null disables the default viewport.
+ */
+ defaultViewport?: {
+ /**
+ * page width in pixels.
+ */
+ width?: number;
+ /**
+ * page height in pixels.
+ */
+ height?: number;
+ /**
+ * Specify device scale factor (can be thought of as dpr). Defaults to 1.
+ */
+ deviceScaleFactor?: number;
+ /**
+ * Whether the meta viewport tag is taken into account. Defaults to false.
+ */
+ isMobile?: boolean;
+ /**
+ * Specifies if viewport supports touch events. Defaults to false.
+ */
+ hasTouch?: boolean;
+ /**
+ * Specifies if viewport is in landscape mode. Defaults to false.
+ */
+ isLandscape?: boolean;
+ };
/**
* Additional arguments to pass to the Chromium instance. List of Chromium
* flags can be found here.
diff --git a/types/puppeteer/puppeteer-tests.ts b/types/puppeteer/puppeteer-tests.ts
index e883157fec..2db92a9171 100644
--- a/types/puppeteer/puppeteer-tests.ts
+++ b/types/puppeteer/puppeteer-tests.ts
@@ -167,6 +167,7 @@ puppeteer.launch().then(async browser => {
'--no-sandbox',
'--disable-setuid-sandbox',
],
+ defaultViewport: { width: 800, height: 600 },
handleSIGINT: true,
handleSIGHUP: true,
handleSIGTERM: true,
diff --git a/types/qunit/index.d.ts b/types/qunit/index.d.ts
index c5e677d187..120c61d667 100644
--- a/types/qunit/index.d.ts
+++ b/types/qunit/index.d.ts
@@ -7,14 +7,14 @@
interface Assert {
/**
* Instruct QUnit to wait for an asynchronous operation.
- *
+ *
* The callback returned from `assert.async()` will throw an Error if it is
* invoked more than once (or more often than the accepted call count, if
* provided).
*
* This replaces functionality previously provided by `QUnit.stop()` and
* `QUnit.start()`.
- *
+ *
* @param {number} [acceptCallCount=1] Number of expected callbacks before the test is done.
*/
async(acceptCallCount?: number): () => void;
@@ -22,179 +22,179 @@ interface Assert {
/**
* A deep recursive comparison, working on primitive types, arrays, objects,
* regular expressions, dates and functions.
- *
+ *
* The `deepEqual()` assertion can be used just like `equal()` when comparing
* the value of objects, such that `{ key: value }` is equal to
* `{ key: value }`. For non-scalar values, identity will be disregarded by
* deepEqual.
- *
+ *
* `notDeepEqual()` can be used to explicitly test deep, strict inequality.
- *
+ *
* @param actual Object or Expression being tested
* @param expected Known comparision value
- * @param {string} [message] A short description of the assertion
+ * @param {string} [message] A short description of the assertion
*/
- deepEqual(actual: any, expected: any, message?: string): void;
-
+ deepEqual(actual: T, expected: T, message?: string): void;
+
/**
* A non-strict comparison, roughly equivalent to JUnit's assertEquals.
- *
+ *
* The `equal` assertion uses the simple comparison operator (`==`) to
* compare the actual and expected arguments. When they are equal, the
* assertion passes; otherwise, it fails. When it fails, both actual and
* expected values are displayed in the test result, in addition to a given
* message.
- *
+ *
* `notEqual()` can be used to explicitly test inequality.
- *
+ *
* `strictEqual()` can be used to test strict equality.
- *
+ *
* @param actual Expression being tested
* @param expected Known comparison value
* @param {string} [message] A short description of the assertion
*/
equal(actual: any, expected: any, message?: string): void;
-
+
/**
* Specify how many assertions are expected to run within a test.
- *
+ *
* To ensure that an explicit number of assertions are run within any test,
* use `assert.expect( number )` to register an expected count. If the
* number of assertions run does not match the expected count, the test will
* fail.
- *
+ *
* @param {number} amount Number of assertions in this test.
*/
expect(amount: number): void;
-
+
/**
* An inverted deep recursive comparison, working on primitive types,
* arrays, objects, regular expressions, dates and functions.
- *
+ *
* @param actual Object or Expression being tested
* @param expected Known comparison value
* @param {string} [message] A short description of the assertion
*/
notDeepEqual(actual: any, expected: any, message?: string): void;
-
+
/**
* A non-strict comparison, checking for inequality.
- *
+ *
* The `notEqual` assertion uses the simple inverted comparison operator
* (`!=`) to compare the actual and expected arguments. When they aren't
* equal, the assertion passes; otherwise, it fails. When it fails, both
* actual and expected values are displayed in the test result, in addition
* to a given message.
- *
+ *
* `equal()` can be used to test equality.
- *
+ *
* `notStrictEqual()` can be used to test strict inequality.
- *
+ *
* @param actual Object or Expression being tested
* @param expected Known comparison value
* @param {string} [message] A short description of the assertion
*/
notEqual(actual: any, expected: any, message?: string): void;
-
+
/**
* A boolean check, inverse of `ok()` and CommonJS's `assert.ok()`, and
* equivalent to JUnit's `assertFalse()`. Passes if the first argument is
* falsy.
- *
+ *
* `notOk()` requires just one argument. If the argument evaluates to false,
* the assertion passes; otherwise, it fails. If a second message argument
* is provided, it will be displayed in place of the result.
- *
+ *
* @param state Expression being tested
* @param {string} [message] A short description of the assertion
*/
notOk(state: any, message?: string): void;
-
+
/**
* A strict comparison of an object's own properties, checking for inequality.
- *
+ *
* The `notPropEqual` assertion uses the strict inverted comparison operator
* (`!==`) to compare the actual and expected arguments as Objects regarding
* only their properties but not their constructors.
- *
+ *
* When they aren't equal, the assertion passes; otherwise, it fails. When
* it fails, both actual and expected values are displayed in the test
* result, in addition to a given message.
- *
+ *
* `equal()` can be used to test equality.
- *
+ *
* `propEqual()` can be used to test strict equality of an Object properties.
- *
+ *
* @param actual Object or Expression being tested
* @param expected Known comparison value
* @param {string} [message] A short description of the assertion
*/
notPropEqual(actual: any, expected: any, message?: string): void;
-
+
/**
* A strict comparison, checking for inequality.
- *
+ *
* The `notStrictEqual` assertion uses the strict inverted comparison
* operator (`!==`) to compare the actual and expected arguments. When they
* aren't equal, the assertion passes; otherwise, it fails. When it fails,
* both actual and expected values are displayed in the test result, in
* addition to a given message.
- *
+ *
* `equal()` can be used to test equality.
- *
+ *
* `strictEqual()` can be used to test strict equality.
- *
+ *
* @param actual Object or Expression being tested
* @param expected Known comparison value
* @param {string} [message] A short description of the assertion
*/
notStrictEqual(actual: any, expected: any, message?: string): void;
-
+
/**
* A boolean check, equivalent to CommonJS's assert.ok() and JUnit's
* assertTrue(). Passes if the first argument is truthy.
- *
+ *
* The most basic assertion in QUnit, ok() requires just one argument. If
* the argument evaluates to true, the assertion passes; otherwise, it
* fails. If a second message argument is provided, it will be displayed in
* place of the result.
- *
+ *
* @param state Expression being tested
* @param {string} message A short description of the assertion
*/
ok(state: any, message?: string): void;
-
+
/**
* A strict type and value comparison of an object's own properties.
- *
+ *
* The `propEqual()` assertion provides strictly (`===`) comparison of
* Object properties. Unlike `deepEqual()`, this assertion can be used to
* compare two objects made with different constructors and prototype.
- *
+ *
* `strictEqual()` can be used to test strict equality.
- *
+ *
* `notPropEqual()` can be used to explicitly test strict inequality of
* Object properties.
- *
+ *
* @param actual Object or Expression being tested
* @param expected Known comparison value
* @param {string} [message] A short description of the assertion
*/
propEqual(actual: any, expected: any, message?: string): void;
-
+
/**
* Report the result of a custom assertion
- *
+ *
* Some test suites may need to express an expectation that is not defined
* by any of QUnit's built-in assertions. This need may be met by
* encapsulating the expectation in a JavaScript function which returns a
* `Boolean` value representing the result; this value can then be passed
* into QUnit's `ok` assertion.
- *
+ *
* A more readable solution would involve defining a custom assertion. If
* the expectation function invokes `pushResult`, QUnit will be notified of
* the result and report it accordingly.
- *
+ *
* @param assertionResult The assertion result
*/
pushResult(assertResult: {
@@ -203,31 +203,31 @@ interface Assert {
expected: any;
message: string;
}): void;
-
+
/**
* A strict type and value comparison.
- *
+ *
* The `strictEqual()` assertion provides the most rigid comparison of type
* and value with the strict equality operator (`===`).
- *
+ *
* `equal()` can be used to test non-strict equality.
- *
+ *
* `notStrictEqual()` can be used to explicitly test strict inequality.
- *
+ *
* @param actual Object or Expression being tested
* @param expected Known comparison value
* @param {string} [message] A short description of the assertion
*/
- strictEqual(actual: any, expected: any, message?: string): void;
-
+ strictEqual(actual: T, expected: T, message?: string): void;
+
/**
* Test if a callback throws an exception, and optionally compare the thrown
* error.
- *
+ *
* When testing code that is expected to throw an exception based on a
* specific set of circumstances, use assert.throws() to catch the error
* object for testing and comparison.
- *
+ *
* In very few environments, like Closure Compiler, throws is considered a
* reserved word and will cause an error. For that case, an alias is bundled
* called `raises`. It has the same signature and behaviour, just a
@@ -238,30 +238,30 @@ interface Assert {
/**
* A marker for progress in a given test.
- *
- * The `step()` assertion registers a passing assertion with a provided message. This makes
- * it easy to check that specific portions of code are being executed, especially in
- * asynchronous test cases and when used with `verifySteps()`.
- *
+ *
+ * The `step()` assertion registers a passing assertion with a provided message. This makes
+ * it easy to check that specific portions of code are being executed, especially in
+ * asynchronous test cases and when used with `verifySteps()`.
+ *
* Together with the `verifySteps()` method, `step()` assertions give you an easy way
* to verify both the count and order of code execution.
- *
+ *
* @param message Message to display for the step
*/
step(message: string): void;
/**
* A helper assertion to verify the order and number of steps in a test.
- *
+ *
* The assert.verifySteps() assertion compares a given array of string values (representing steps)
* with the order and values of previous step() calls. This assertion is helpful for verifying
* the order and count of portions of code paths, especially asynchronous ones.
- *
+ *
* @param steps Array of strings representing steps to verify
* @param message A short description of the assertion
*/
verifySteps(steps: string[], message?: string): void;
-
+
}
interface Config {
@@ -296,7 +296,7 @@ interface Hooks {
/**
* Runs after the last test. If additional tests are defined after the
* module's queue has emptied, it will not run this hook again.
- */
+ */
after?: (assert: Assert) => void;
/**
@@ -320,7 +320,7 @@ interface NestedHooks {
/**
* Runs after the last test. If additional tests are defined after the
* module's queue has emptied, it will not run this hook again.
- */
+ */
after: (fn: (assert: Assert) => void) => void;
/**
@@ -337,7 +337,7 @@ interface NestedHooks {
* Runs before each test.
*/
beforeEach: (fn: (assert: Assert) => void) => void;
-
+
}
declare namespace QUnit {
@@ -373,30 +373,30 @@ declare namespace QUnit {
}
interface QUnit {
-
+
/**
* Namespace for QUnit assertions
- *
+ *
* QUnit's built-in assertions are defined on the `QUnit.assert` object. An
* instance of this object is passed as the only argument to the `QUnit.test`
* function callback.
- *
+ *
* This object has properties for each of QUnit's built-in assertion methods.
*/
assert: Assert;
/**
* Register a callback to fire whenever the test suite begins.
- *
+ *
* `QUnit.begin()` is called once before running any tests.
- *
+ *
* @callback callback Callback to execute.
*/
begin(callback: (details: QUnit.BeginDetails) => void): void;
/**
* Configuration for QUnit
- *
+ *
* QUnit has a bunch of internal configuration defaults, some of which are
* useful to override. Check the description for each option for details.
*/
@@ -404,23 +404,23 @@ interface QUnit {
/**
* Register a callback to fire whenever the test suite ends.
- *
+ *
* @param callback Callback to execute
*/
done(callback: (details: QUnit.DoneDetails) => void): void;
/**
* Advanced and extensible data dumping for JavaScript.
- *
+ *
* This method does string serialization by parsing data structures and
* objects. It parses DOM elements to a string representation of their outer
* HTML. By default, nested structures will be displayed up to five levels
* deep. Anything beyond that is replaced by `[object Object]` and
* `[object Array]` placeholders.
- *
+ *
* If you need more or less output, change the value of `QUnit.dump.maxDepth`,
* representing how deep the elements should be parsed.
- *
+ *
* Note: This method used to be in QUnit.jsDump, which was changed to
* QUnit.dump. The old property will be removed in QUnit 3.0.
*/
@@ -431,12 +431,12 @@ interface QUnit {
/**
* Copy the properties defined by the `mixin` object into the `target` object.
- *
+ *
* This method will modify the `target` object to contain the "own" properties
* defined by the `mixin`. If the `mixin` object specifies the value of any
* attribute as undefined, this property will instead be removed from the
* `target` object.
- *
+ *
* @param target An object whose properties are to be modified
* @param mixin An object describing which properties should be modified
*/
@@ -444,12 +444,12 @@ interface QUnit {
/**
* Register a callback to fire whenever an assertion completes.
- *
+ *
* This is one of several callbacks QUnit provides. Its intended for
* integration scenarios like PhantomJS or Jenkins. The properties of the
* details argument are listed below as options.
- *
- * @param callback Callback to execute
+ *
+ * @param callback Callback to execute
*/
log(callback: (details: QUnit.LogDetails) => void): void;
@@ -457,36 +457,36 @@ interface QUnit {
* Group related tests under a single label.
*
* You can use the module name to organize, select, and filter tests to run.
- *
+ *
* All tests inside a module callback function will be grouped into that
* module. The test names will all be preceded by the module name in the
* test results. Other modules can be nested inside this callback function,
* where their tests' names will be labeled by their names recursively
* prefixed by their parent modules.
- *
+ *
* If `QUnit.module` is defined without a `nested` callback argument, all
* subsequently defined tests will be grouped into the module until another
* module is defined.
- *
+ *
* Modules with test group functions allow you to define nested modules, and
* QUnit will run tests on the parent module before going deep on the nested
* ones, even if they're declared first. Additionally, any hook callbacks on
* a parent module will wrap the hooks on a nested module. In other words,
* `before` and `beforeEach` callbacks will form a queue while the
* `afterEach` and `after` callbacks will form a stack.
- *
+ *
* You can specify code to run before and after tests using the hooks
* argument, and also to create properties that will be shared on the
* testing context. Any additional properties on the `hooks` object will be
* added to that context. The `hooks` argument is still optional if you call
* `QUnit.module` with a callback argument.
- *
+ *
* The module's callback is invoked with the test environment as its `this`
* context, with the environment's properties copied to the module's tests,
* hooks, and nested modules. Note that changes on tests' `this` are not
* preserved between sibling tests, where `this` will be reset to the initial
* value for each test.
- *
+ *
* @param {string} name Label for this group of tests
* @param hookds Callbacks to run during test execution
* @param nested A callback with grouped tests and nested modules to run under the current module label
@@ -496,31 +496,31 @@ interface QUnit {
/**
* Register a callback to fire whenever a module ends.
- *
+ *
* @param callback Callback to execute
*/
moduleDone(callback: (details: QUnit.ModuleDoneDetails) => void): void;
/**
* Register a callback to fire whenever a module begins.
- *
+ *
* @param callback Callback to execute
*/
moduleStart(callback: (details: QUnit.ModuleStartDetails) => void): void;
/**
* Adds a test to exclusively run, preventing all other tests from running.
- *
+ *
* Use this method to focus your test suite on a specific test. QUnit.only
* will cause any other tests in your suite to be ignored.
- *
+ *
* Note, that if more than one QUnit.only is present only the first instance
* will run.
- *
+ *
* This is an alternative to filtering tests to run in the HTML reporter. It
* is especially useful when you use a console reporter or in a codebase
* with a large set of long running tests.
- *
+ *
* @param {string} name Title of unit being tested
* @param callback Function to close over assertions
*/
@@ -528,48 +528,48 @@ interface QUnit {
/**
* DEPRECATED: Report the result of a custom assertion.
- *
+ *
* This method is deprecated and it's recommended to use pushResult on its
* direct reference in the assertion context.
- *
+ *
* QUnit.push reflects to the current running test, and it may leak
* assertions in asynchronous mode. Checkout assert.pushResult() to set a
* proper custom assertion.
- *
+ *
* Invoking QUnit.push allows to create a readable expectation that is not
* defined by any of QUnit's built-in assertions.
- *
+ *
* @deprecated
*/
push(result: boolean, actual: any, expected: any, message: string): void;
/**
* Adds a test like object to be skipped.
- *
+ *
* Use this method to replace QUnit.test() instead of commenting out entire
* tests.
- *
+ *
* This test's prototype will be listed on the suite as a skipped test,
* ignoring the callback argument and the respective global and module's
* hooks.
- *
+ *
* @param {string} Title of unit being tested
*/
skip(name: string, callback?: (assert: Assert) => void): void;
/**
* Returns a single line string representing the stacktrace (call stack).
- *
+ *
* This method returns a single line string representing the stacktrace from
* where it was called. According to its offset argument, `QUnit.stack()` will
* return the correspondent line from the call stack.
- *
+ *
* The default `offset` is `0` and will return the current location where it
* was called.
- *
+ *
* Not all browsers support retrieving stracktraces. In those, `QUnit.stack()`
* will return undefined.
- *
+ *
* @param {number} offset Set the stacktrace line offset.
*/
stack(offset?: number): string;
@@ -577,10 +577,10 @@ interface QUnit {
/**
* `QUnit.start()` must be used to start a test run that has
* `QUnit.config.autostart` set to `false`.
- *
+ *
* This method was previously used to control async tests on text contexts
* along with QUnit.stop. For asynchronous tests, use assert.async instead.
- *
+ *
* When your async test has multiple exit points, call `QUnit.start()` for the
* corresponding number of `QUnit.stop()` increments.
*/
@@ -588,16 +588,16 @@ interface QUnit {
/**
* Add a test to run.
- *
+ *
* Add a test to run using `QUnit.test()`.
- *
+ *
* The `assert` argument to the callback contains all of QUnit's assertion
* methods. Use this argument to call your test assertions.
*
* `QUnit.test()` can automatically handle the asynchronous resolution of a
* Promise on your behalf if you return a thenable Promise as the result of
* your callback function.
- *
+ *
* @param {string} Title of unit being tested
* @param callback Function to close over assertions
*/
@@ -605,7 +605,7 @@ interface QUnit {
/**
* Register a callback to fire whenever a test ends.
- *
+ *
* @param callback Callback to execute
*/
testDone(callback: (details: {
@@ -619,7 +619,7 @@ interface QUnit {
/**
* Register a callback to fire whenever a test begins.
- *
+ *
* @param callback Callback to execute
*/
testStart(callback: (details: QUnit.TestStartDetails) => void): void;
@@ -649,7 +649,7 @@ interface QUnit {
/**
* Are the test running from the server or not.
- */
+ */
isLocal: boolean;
/**
diff --git a/types/react-data-grid/index.d.ts b/types/react-data-grid/index.d.ts
index bfa4ea979f..b41c2c2501 100644
--- a/types/react-data-grid/index.d.ts
+++ b/types/react-data-grid/index.d.ts
@@ -1,24 +1,43 @@
-// Type definitions for react-data-grid 2.0
+// Type definitions for react-data-grid 4.0
// Project: https://github.com/adazzle/react-data-grid.git
-// Definitions by: Simon Gellis , Kieran Peat , Martin Novak
+// Definitions by: Simon Gellis , Kieran Peat , Martin Novak , Sebastijan Grabar
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
///
declare namespace AdazzleReactDataGrid {
-
- interface SelectionParams {
- rowIdx: number,
- row: any
+ interface ExcelColumn {
+ editable: boolean;
+ name: any;
+ key: string;
+ width: number;
+ resizeable: boolean;
+ filterable: boolean;
}
- interface GridProps {
+ interface EditorBaseProps {
+ value: any;
+ column: ExcelColumn;
+ height: number;
+ onBlur: () => void;
+ onCommit: () => void;
+ onCommitCancel: () => void;
+ rowData: any;
+ rowMetaData: any;
+ }
+
+ interface SelectionParams {
+ rowIdx: number;
+ row: T;
+ }
+
+ interface GridProps {
/**
* Gets the data to render in each row. Required.
* Can be an array or a function that takes an index and returns an object.
*/
- rowGetter: Array