@jiminp/tooltool
    Preparing search index...

    Type Alias Promisable<T>

    Promisable: T | Promise<T>

    Represents a value that may or may not be wrapped in a Promise.

    Useful for APIs accepting both synchronous values and promises.

    Type Parameters

    • T

      The underlying value type.

    async function process(input: Promisable<string>): Promise<number> {
    const value = await input;
    return value.length;
    }

    process("hello"); // Synchronous value
    process(Promise.resolve("hello")); // Promise