Currently, I am in the process of developing my initial declaration file for a foreign library known as react-native-background-timer. Within this library, there exists a default export that I am uncertain about how to declare within the index.d.ts file.
This is the default export found in the library:
export default new BackgroundTimer();
While I understand how to declare exported classes, I am unsure of the best method to declare an exported class instance.
Initially, my approach was as follows:
declare class BackgroundTimer {
[...]
}
declare const _BackgroundTimer: BackgroundTimer;
export default _BackgroundTimer;