From 97d56c9a1b71f5ac8bed4026733f4cfcf73e3ce0 Mon Sep 17 00:00:00 2001 From: Jason Unger Date: Tue, 3 Jul 2018 18:11:58 -0400 Subject: [PATCH] Add types for react-motion-ui-pack@0.10 (#27034) --- types/react-motion-ui-pack/index.d.ts | 23 +++++++++++++++++ .../react-motion-ui-pack-tests.tsx | 16 ++++++++++++ types/react-motion-ui-pack/tsconfig.json | 25 +++++++++++++++++++ types/react-motion-ui-pack/tslint.json | 1 + 4 files changed, 65 insertions(+) create mode 100644 types/react-motion-ui-pack/index.d.ts create mode 100644 types/react-motion-ui-pack/react-motion-ui-pack-tests.tsx create mode 100644 types/react-motion-ui-pack/tsconfig.json create mode 100644 types/react-motion-ui-pack/tslint.json diff --git a/types/react-motion-ui-pack/index.d.ts b/types/react-motion-ui-pack/index.d.ts new file mode 100644 index 0000000000..0e0e518f70 --- /dev/null +++ b/types/react-motion-ui-pack/index.d.ts @@ -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 +// 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; + 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; +export default Transition; diff --git a/types/react-motion-ui-pack/react-motion-ui-pack-tests.tsx b/types/react-motion-ui-pack/react-motion-ui-pack-tests.tsx new file mode 100644 index 0000000000..3bbeafc295 --- /dev/null +++ b/types/react-motion-ui-pack/react-motion-ui-pack-tests.tsx @@ -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 ( + +
Hello world.
+
+ ); + } +} diff --git a/types/react-motion-ui-pack/tsconfig.json b/types/react-motion-ui-pack/tsconfig.json new file mode 100644 index 0000000000..a30b04f804 --- /dev/null +++ b/types/react-motion-ui-pack/tsconfig.json @@ -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" + ] +} diff --git a/types/react-motion-ui-pack/tslint.json b/types/react-motion-ui-pack/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-motion-ui-pack/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }