From 0bd8b84dde08e0a12aa0f1f044a132c7c8453e0a Mon Sep 17 00:00:00 2001 From: Jeremy Allard Date: Wed, 23 Jan 2019 18:52:53 -0500 Subject: [PATCH] Add typings for react-motion-loop. --- types/react-motion-loop/index.d.ts | 17 +++++++++++++++++ .../react-motion-loop-tests.tsx | 16 ++++++++++++++++ types/react-motion-loop/tsconfig.json | 17 +++++++++++++++++ types/react-motion-loop/tslint.json | 6 ++++++ 4 files changed, 56 insertions(+) create mode 100644 types/react-motion-loop/index.d.ts create mode 100644 types/react-motion-loop/react-motion-loop-tests.tsx create mode 100644 types/react-motion-loop/tsconfig.json create mode 100644 types/react-motion-loop/tslint.json diff --git a/types/react-motion-loop/index.d.ts b/types/react-motion-loop/index.d.ts new file mode 100644 index 0000000000..acb7910911 --- /dev/null +++ b/types/react-motion-loop/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for react-motion-loop 2.0 +// Project: https://github.com/nkbt/react-motion-loop +// Definitions by: Jeremy Allard +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.1 + +import { Component, ReactElement } from "react"; +import { MotionProps, PlainStyle, Style } from "react-motion"; + +interface ReactMotionLoopProps extends Partial { + styleFrom: Style; + styleTo: Style; + children?: (interpolatedStyle: PlainStyle) => ReactElement; +} +export class ReactMotionLoop extends Component {} + +export as namespace ReactMotionLoop; diff --git a/types/react-motion-loop/react-motion-loop-tests.tsx b/types/react-motion-loop/react-motion-loop-tests.tsx new file mode 100644 index 0000000000..b00bd0645a --- /dev/null +++ b/types/react-motion-loop/react-motion-loop-tests.tsx @@ -0,0 +1,16 @@ +import * as React from "react"; +import { ReactMotionLoop } from "react-motion-loop"; +import { spring } from "react-motion"; + +const TestComponent: React.FunctionComponent = props => ( + + {interpolatedStyle => ( +

+ )} + +); diff --git a/types/react-motion-loop/tsconfig.json b/types/react-motion-loop/tsconfig.json new file mode 100644 index 0000000000..51191b85ce --- /dev/null +++ b/types/react-motion-loop/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "react-motion-loop-tests.tsx"] +} diff --git a/types/react-motion-loop/tslint.json b/types/react-motion-loop/tslint.json new file mode 100644 index 0000000000..4c4fc86ace --- /dev/null +++ b/types/react-motion-loop/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "strict-export-declare-modifiers": false + } +}