Dorian 0d073fa89e Add comprehensive installation and setup documentation
- Add GETTING_STARTED.md with quick start guide and development modes
- Add INSTALL.sh automated installation script
- Add INSTALLATION_CHECKLIST.md, INSTALLATION_SUCCESS.md, and INSTALLATION_SUMMARY.md
- Add QUICK_REFERENCE.md for common commands
- Add SETUP_GUIDE.md with detailed setup instructions
- Update README.md with improved project overview
- Add did-wallet app dependencies and node_modules
2026-01-27 17:18:21 +00:00

40 lines
832 B
TypeScript

export interface DeferredPromise<ValueType> {
/**
The deferred promise.
*/
promise: Promise<ValueType>;
/**
Resolves the promise with a value or the result of another promise.
@param value - The value to resolve the promise with.
*/
resolve(this: void, value?: ValueType | PromiseLike<ValueType>): void;
/**
Reject the promise with a provided reason or error.
@param reason - The reason or error to reject the promise with.
*/
reject(this: void, reason?: unknown): void;
}
/**
Create a deferred promise.
@example
```
import pDefer from 'p-defer';
function delay(milliseconds) {
const deferred = pDefer();
setTimeout(deferred.resolve, milliseconds, '🦄');
return deferred.promise;
}
console.log(await delay(100));
//=> '🦄'
```
*/
export default function pDefer<ValueType>(): DeferredPromise<ValueType>;