mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
update(react-faux-dom): Update types to reflect new library version.
This commit is contained in:
Vendored
+7
-8
@@ -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 <https://github.com/alitaheri>
|
||||
// Cleve Littlefield <https://github.com/cleverguy25>
|
||||
// Michał Kostrzyński <https://github.com/deviousm>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -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<P>(WrappedComponent: any): React.ClassicComponentClass<P & ReactFauxDomProps>;
|
||||
|
||||
@@ -34,9 +34,18 @@ class MyReactComponent extends React.Component<ChartProps> {
|
||||
.append('div')
|
||||
.html('Hello World!');
|
||||
this.props.animateFauxDOM(800);
|
||||
console.log(this.props.isAnimatingFauxDOM());
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
this.props.drawFauxDOM();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.props.stopAnimatingFauxDOM();
|
||||
}
|
||||
|
||||
render() {
|
||||
return <div>
|
||||
<h2>Here is some fancy data:</h2>
|
||||
|
||||
Reference in New Issue
Block a user