mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Add types for react-motion-ui-pack@0.10 (#27034)
This commit is contained in:
committed by
Mohamed Hegazy
parent
f3c6f4aec3
commit
97d56c9a1b
+23
@@ -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>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user