export interface SingletonPromiseReturn { (): Promise; /** * Reset current staled promise. * await it to have proper shutdown. */ reset: () => Promise; } /** * Create singleton promise function * * @example * ``` * const promise = createSingletonPromise(async () => { ... }) * * await promise() * await promise() // all of them will be bind to a single promise instance * await promise() // and be resolved together * ``` */ export default function createSingletonPromise(fn: () => Promise): SingletonPromiseReturn;