Type helper that awaits Promise types and passes through non-Promise types.
This ensures that if a function returns a Promise, the once method also returns Promise,
and if the function returns T (non-Promise), once returns T directly.
Uses the built-in Awaited utility type to properly handle nested Promises and thenable objects.
Type helper that awaits Promise types and passes through non-Promise types. This ensures that if a function returns a Promise, the once method also returns Promise,
and if the function returns T (non-Promise), once returns T directly.
Uses the built-in Awaited utility type to properly handle nested Promises and thenable objects.