mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-06 13:11:46 +00:00
Quick fix exports to match transpiled code of the library
This commit is contained in:
+34
-32
@@ -1,38 +1,40 @@
|
||||
import { Component } from "react";
|
||||
import { TransitionProps } from "react-transition-group/Transition";
|
||||
|
||||
export interface CSSTransitionClassNames {
|
||||
appear?: string;
|
||||
appearActive?: string;
|
||||
enter?: string;
|
||||
enterActive?: string;
|
||||
exit?: string;
|
||||
exitActive?: string;
|
||||
declare namespace CSSTransition {
|
||||
interface CSSTransitionClassNames {
|
||||
appear?: string;
|
||||
appearActive?: string;
|
||||
enter?: string;
|
||||
enterActive?: string;
|
||||
exit?: string;
|
||||
exitActive?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The animation classNames applied to the component as it enters or exits.
|
||||
* A single name can be provided and it will be suffixed for each stage: e.g.
|
||||
*
|
||||
* `classNames="fade"` applies `fade-enter`, `fade-enter-active`,
|
||||
* `fade-exit`, `fade-exit-active`, `fade-appear`, and `fade-appear-active`.
|
||||
* Each individual classNames can also be specified independently like:
|
||||
*
|
||||
* ```js
|
||||
* classNames={{
|
||||
* appear: 'my-appear',
|
||||
* appearActive: 'my-active-appear',
|
||||
* enter: 'my-enter',
|
||||
* enterActive: 'my-active-enter',
|
||||
* exit: 'my-exit',
|
||||
* exitActive: 'my-active-exit',
|
||||
* }}
|
||||
* ```
|
||||
*/
|
||||
interface CSSTransitionProps extends TransitionProps {
|
||||
classNames: string | CSSTransitionClassNames;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The animation classNames applied to the component as it enters or exits.
|
||||
* A single name can be provided and it will be suffixed for each stage: e.g.
|
||||
*
|
||||
* `classNames="fade"` applies `fade-enter`, `fade-enter-active`,
|
||||
* `fade-exit`, `fade-exit-active`, `fade-appear`, and `fade-appear-active`.
|
||||
* Each individual classNames can also be specified independently like:
|
||||
*
|
||||
* ```js
|
||||
* classNames={{
|
||||
* appear: 'my-appear',
|
||||
* appearActive: 'my-active-appear',
|
||||
* enter: 'my-enter',
|
||||
* enterActive: 'my-active-enter',
|
||||
* exit: 'my-exit',
|
||||
* exitActive: 'my-active-exit',
|
||||
* }}
|
||||
* ```
|
||||
*/
|
||||
export interface CSSTransitionProps extends TransitionProps {
|
||||
classNames: string | CSSTransitionClassNames;
|
||||
}
|
||||
declare class CSSTransition extends Component<CSSTransition.CSSTransitionProps> {}
|
||||
|
||||
declare class CSSTransition extends Component<CSSTransitionProps> {}
|
||||
|
||||
export default CSSTransition;
|
||||
export = CSSTransition;
|
||||
|
||||
+13
-10
@@ -1,18 +1,21 @@
|
||||
import { Component, ReactType, HTMLProps, ReactElement } from "react";
|
||||
import { TransitionActions, TransitionProps } from "react-transition-group/Transition";
|
||||
|
||||
export interface IntrinsicTransitionGroupProps<T extends keyof JSX.IntrinsicElements = "div"> extends TransitionActions {
|
||||
component?: T;
|
||||
}
|
||||
declare namespace TransitionGroup {
|
||||
interface IntrinsicTransitionGroupProps<T extends keyof JSX.IntrinsicElements = "div"> extends TransitionActions {
|
||||
component?: T;
|
||||
}
|
||||
|
||||
export interface ComponentTransitionGroupProps<T extends ReactType> extends TransitionActions {
|
||||
component: T;
|
||||
}
|
||||
interface ComponentTransitionGroupProps<T extends ReactType> extends TransitionActions {
|
||||
component: T;
|
||||
}
|
||||
|
||||
export type TransitionGroupProps<T extends keyof JSX.IntrinsicElements = "div", V extends ReactType = any> =
|
||||
(IntrinsicTransitionGroupProps<T> & JSX.IntrinsicElements[T]) | (ComponentTransitionGroupProps<V>) & {
|
||||
type TransitionGroupProps<T extends keyof JSX.IntrinsicElements = "div", V extends ReactType = any> =
|
||||
(IntrinsicTransitionGroupProps<T> & JSX.IntrinsicElements[T]) | (ComponentTransitionGroupProps<V>) & {
|
||||
children?: ReactElement<TransitionProps> | Array<ReactElement<TransitionProps>>;
|
||||
childFactory?(child: ReactElement<any>): ReactElement<any>;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The `<TransitionGroup>` component manages a set of `<Transition>` components
|
||||
@@ -71,6 +74,6 @@ export type TransitionGroupProps<T extends keyof JSX.IntrinsicElements = "div",
|
||||
* components. This means you can mix and match animations across different
|
||||
* list items.
|
||||
*/
|
||||
declare class TransitionGroup extends Component<TransitionGroupProps> {}
|
||||
declare class TransitionGroup extends Component<TransitionGroup.TransitionGroupProps> {}
|
||||
|
||||
export default TransitionGroup;
|
||||
export = TransitionGroup;
|
||||
|
||||
+2
-2
@@ -4,9 +4,9 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import CSSTransition from "react-transition-group/CSSTransition";
|
||||
import * as CSSTransition from "react-transition-group/CSSTransition";
|
||||
import Transition from "react-transition-group/Transition";
|
||||
import TransitionGroup from "react-transition-group/TransitionGroup";
|
||||
import * as TransitionGroup from "react-transition-group/TransitionGroup";
|
||||
|
||||
export = {
|
||||
CSSTransition,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from "react";
|
||||
import CSSTransition from "react-transition-group/CSSTransition";
|
||||
import * as CSSTransition from "react-transition-group/CSSTransition";
|
||||
import Transition from "react-transition-group/Transition";
|
||||
import TransitionGroup from "react-transition-group/TransitionGroup";
|
||||
import * as TransitionGroup from "react-transition-group/TransitionGroup";
|
||||
import Components = require("react-transition-group");
|
||||
|
||||
const Test: React.StatelessComponent = () => {
|
||||
@@ -17,6 +17,7 @@ const Test: React.StatelessComponent = () => {
|
||||
<TransitionGroup
|
||||
component="ul"
|
||||
className="animated-list"
|
||||
childFactory={ (child: React.ReactElement<any>) => child }
|
||||
>
|
||||
<Components.Transition
|
||||
in
|
||||
|
||||
Reference in New Issue
Block a user