https://kotlinlang.org logo
g

galex

04/06/2020, 4:41 PM
Here’s my .d.ts:
Copy code
export namespace mySdk {
    type Nullable<T> = T | null | undefined
    namespace com.mySdk.core.feature.login.repository {
        interface EnterEmailBaseRepository extends com.mySdk.core.repository.BaseRepository {
            emailExists(email: string, block: (p0: boolean) => void): void
        }
    }
}
How do I access this class in a React app? I tried a few things, the closest is the following:
Copy code
import * as mySdk from 'mySdk';
Somewhere in a
React.Component
class:
Copy code
console.log(mySdk); // prints an object with the 'package' inside as attributes
But the following line to access the package fails:
Copy code
console.log(<http://mySdk.com|mySdk.com>.mySdk.core.feature.login.repository.EnterEmailRepository);
Error:
Copy code
// -> Property 'com' does not exist on type 'typeof import(...)
What am I doing wrong here?