Last active
August 31, 2016 13:17
-
-
Save alex3165/e2bd0aefa27024b5a10d81bde508a581 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
declare interface LoadingProps { | |
color? : string; | |
height? : any; | |
width? : any; | |
type? : string; | |
} | |
declare interface LoadingState { | |
delayed : boolean; | |
} | |
declare class Loading extends React.Component<LoadingProps, LoadingState> {} | |
declare module 'react-loading' { // invalid module name in augmentation, module 'react-loading' cannot be found | |
export = Loading; | |
} |
/// <reference path="../typings/globals/react/index.d.ts" />
declare namespace Loading {
interface LoadingProps {
color? : string;
height? : any;
width? : any;
type? : string;
}
interface LoadingState {
delayed : boolean;
}
export default class Loading extends __React.Component<LoadingProps, LoadingState> {}
}
declare module 'react-loading' {
export = Loading;
}
Usage :
import Loading from 'react-loading';
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And if i remove
import * as React from 'react';
i can declare the module correctly