This commit is contained in:
Jason Unger
2018-07-03 15:11:58 -07:00
committed by Mohamed Hegazy
parent f3c6f4aec3
commit 97d56c9a1b
4 changed files with 65 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
// Type definitions for react-motion-ui-pack 0.10
// Project: https://github.com/souporserious/react-motion-ui-pack
// Definitions by: Jason Unger <https://github.com/jsonunger>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
import * as React from 'react';
import * as motion from 'react-motion';
declare namespace Transition {
interface TransitionProps {
component?: string | boolean | React.ReactElement<any>;
runOnMount?: boolean;
appear?: motion.Style;
enter?: motion.Style;
leave?: motion.Style;
onEnter?: (style: motion.PlainStyle) => void;
onLeave?: (style: motion.Style) => void;
}
}
declare const Transition: React.ComponentClass<Transition.TransitionProps>;
export default Transition;
@@ -0,0 +1,16 @@
import * as React from "react";
import { spring } from "react-motion";
import Transition from "react-motion-ui-pack";
class ReactMotionUIPackTransition extends React.Component {
render() {
return (
<Transition
enter={{ opacity: 1 }}
leave={{ opacity: spring(0, { stiffness: 120, damping: 9 }) }}
>
<div>Hello world.</div>
</Transition>
);
}
}
+25
View File
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react"
},
"files": [
"index.d.ts",
"react-motion-ui-pack-tests.tsx"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }