diff --git a/types/react-faux-dom/index.d.ts b/types/react-faux-dom/index.d.ts index 70257b5ce5..5b56953198 100644 --- a/types/react-faux-dom/index.d.ts +++ b/types/react-faux-dom/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for react-faux-dom 3.2 +// Type definitions for react-faux-dom 4.1 // Project: https://github.com/Olical/react-faux-dom // Definitions by: Ali Taheri Moghaddar // Cleve Littlefield +// Michał Kostrzyński // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -19,11 +20,6 @@ export const defaultView: { getComputedStyle(node: Element): { getPropertyValue(name: string): string }; }; -export namespace mixins { - const core: any; - const anim: any; -} - export function createElement(nodeName: string): Element; export function createElementNS(namespace: string, nodeName: string): Element; @@ -31,8 +27,11 @@ export function createElementNS(namespace: string, nodeName: string): Element; export function compareDocumentPosition(): number; export interface ReactFauxDomProps { - connectFauxDOM?(node: string, name: string, discardNode?: any): Element; - animateFauxDOM?(duration: number): void; + connectFauxDOM(node: string, name: string, discardNode?: any): Element; + drawFauxDOM(): void; + animateFauxDOM(duration: number): void; + stopAnimatingFauxDOM(): void; + isAnimatingFauxDOM(): boolean; } export function withFauxDOM

(WrappedComponent: any): React.ClassicComponentClass

; diff --git a/types/react-faux-dom/react-faux-dom-tests.tsx b/types/react-faux-dom/react-faux-dom-tests.tsx index 2d864744bc..8bdd06a1e8 100644 --- a/types/react-faux-dom/react-faux-dom-tests.tsx +++ b/types/react-faux-dom/react-faux-dom-tests.tsx @@ -34,9 +34,18 @@ class MyReactComponent extends React.Component { .append('div') .html('Hello World!'); this.props.animateFauxDOM(800); + console.log(this.props.isAnimatingFauxDOM()); } } + componentDidUpdate() { + this.props.drawFauxDOM(); + } + + componentWillUnmount() { + this.props.stopAnimatingFauxDOM(); + } + render() { return

Here is some fancy data: