DefinitelyTyped/types/why-did-you-update/index.d.ts
Connor Schlesiger 6a36646bbf [@types/why-did-you-update] Add missing properties to Options interface (#33810)
* Add missing properties to `Options` interface

The options interface was missing some options outlined here: https://github.com/maicki/why-did-you-update#options

* Make notifier optional
2019-03-12 11:02:40 -07:00

32 lines
850 B
TypeScript

// Type definitions for why-did-you-update v0.0.8
// Project: https://github.com/garbles/why-did-you-update
// Definitions by: rhysd <https://rhysd.github.io>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
/// <reference types="react" />
declare module "why-did-you-update" {
interface Diffs {
name: string;
prev: any;
next: any;
type: any;
}
interface Options {
include?: RegExp;
exclude?: RegExp;
groupByComment?: boolean;
collapseComponentGroups?: boolean;
notifier?: (
groupByComponent: boolean,
collapseComponentGroups: boolean,
displayName: string,
diffs: Diffs[]
) => void;
}
export function whyDidYouUpdate(react: typeof React, options?: Options): void;
}