diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..54803b8 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,20 @@ +declare module 'react-async-script-loader' { + type scriptType = string | string[]; + + type scriptLoaderType = (...args: scriptType[]) => scriptLoaderHOC; + + type scriptLoaderHOC =

>( + Component: T & React.ComponentClass

, + ) => React.ComponentType>; + + type Omit = Pick>; + + export type scriptLoaderInjectedProps = { + isScriptLoaded: boolean; + isScriptLoadSucceed: boolean; + onScriptLoaded: () => void; + }; + + const scriptLoader: scriptLoaderType; + export default scriptLoader; +}