mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Merge pull request #32737 from j-em/master
Add typings for react-motion-loop.
This commit is contained in:
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for react-motion-loop 2.0
|
||||
// Project: https://github.com/nkbt/react-motion-loop
|
||||
// Definitions by: Jeremy Allard <https://github.com/j-em>
|
||||
// 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<MotionProps> {
|
||||
styleFrom: Style;
|
||||
styleTo: Style;
|
||||
children?: (interpolatedStyle: PlainStyle) => ReactElement<any>;
|
||||
}
|
||||
export class ReactMotionLoop extends Component<ReactMotionLoopProps> {}
|
||||
|
||||
export as namespace ReactMotionLoop;
|
||||
@@ -0,0 +1,16 @@
|
||||
import * as React from "react";
|
||||
import { ReactMotionLoop } from "react-motion-loop";
|
||||
import { spring } from "react-motion";
|
||||
|
||||
const TestComponent: React.FunctionComponent<never> = props => (
|
||||
<ReactMotionLoop
|
||||
styleFrom={{ rotate: spring(0) }}
|
||||
styleTo={{ rotate: spring(180) }}
|
||||
>
|
||||
{interpolatedStyle => (
|
||||
<p
|
||||
style={{ transform: `rotate( ${interpolatedStyle.rotate}deg)` }}
|
||||
/>
|
||||
)}
|
||||
</ReactMotionLoop>
|
||||
);
|
||||
@@ -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"]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"strict-export-declare-modifiers": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user