Represents a value that may or may not be wrapped in a Promise.
Promise
Convenient for APIs that accept both synchronous and asynchronous return values, avoiding the need for callers to wrap synchronous results.
The underlying value type.
async function process(input: Promisable<string>): Promise<number> { const value = await input; return value.length;}process('hello'); // ✓ OK — synchronousprocess(Promise.resolve('hello')); // ✓ OK — asynchronous Copy
async function process(input: Promisable<string>): Promise<number> { const value = await input; return value.length;}process('hello'); // ✓ OK — synchronousprocess(Promise.resolve('hello')); // ✓ OK — asynchronous
Represents a value that may or may not be wrapped in a
Promise.Convenient for APIs that accept both synchronous and asynchronous return values, avoiding the need for callers to wrap synchronous results.