mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Create conductor-animate types (#37431)
Cleanup Add TS version Use interface over type Remove unnecessary semicolons Use TS version 2.8
This commit is contained in:
parent
9fa6c4b9cd
commit
217f9fc253
29
types/conductor-animate/conductor-animate-tests.tsx
Normal file
29
types/conductor-animate/conductor-animate-tests.tsx
Normal file
@ -0,0 +1,29 @@
|
||||
import * as React from 'react';
|
||||
import { Conductor, Animated } from 'conductor-animate';
|
||||
|
||||
// Define the Animation mapping
|
||||
const animations = {
|
||||
Fade: () => <div>Fake Animation</div>,
|
||||
};
|
||||
|
||||
// Define the configuration
|
||||
const config = {
|
||||
HeaderSection: {
|
||||
animation: 'Fade',
|
||||
duration: 500,
|
||||
delay: 200,
|
||||
},
|
||||
};
|
||||
|
||||
const App = () => {
|
||||
// Render the Page w/ the Conductor and Animated
|
||||
return (
|
||||
<Conductor animations={animations} config={config}>
|
||||
<Animated id="HeaderSection">
|
||||
<h1>This Header will fade in </h1>
|
||||
</Animated>
|
||||
</Conductor>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
32
types/conductor-animate/index.d.ts
vendored
Normal file
32
types/conductor-animate/index.d.ts
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
// Type definitions for conductor-animate 1.0
|
||||
// Project: https://github.com/TaeKimJR/conductor-animate#readme
|
||||
// Definitions by: Tae Kim <https://github.com/DefinitelyTyped>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
import * as React from 'react';
|
||||
|
||||
interface Animations {
|
||||
[K: string]: React.ComponentClass<any> | React.FunctionComponent<any>;
|
||||
}
|
||||
|
||||
interface Config {
|
||||
animation: string;
|
||||
}
|
||||
|
||||
interface AnimatedProps {
|
||||
additional?: object;
|
||||
children?: React.ReactNode | React.ReactNodeArray | null;
|
||||
id: string;
|
||||
}
|
||||
|
||||
declare class Animated extends React.PureComponent<AnimatedProps> { }
|
||||
|
||||
interface ConductorProps {
|
||||
animations: Animations;
|
||||
children: React.ReactNode | React.ReactNodeArray;
|
||||
config: { [K: string]: Config } | ((id: string, additional: object) => Config);
|
||||
}
|
||||
|
||||
declare class Conductor extends React.PureComponent<ConductorProps> { }
|
||||
|
||||
export { Animated, Conductor };
|
||||
26
types/conductor-animate/tsconfig.json
Normal file
26
types/conductor-animate/tsconfig.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "react"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"conductor-animate-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/conductor-animate/tslint.json
Normal file
1
types/conductor-animate/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user