/** * The `throw` keyword is a statement, which means it can not be used as an expression, * eg. as a default value for a function parameter. * This function makes it possible to throw an error as an expression. * * @example * ``` typescript * // this is invalid code * function foo(bar: string = throw new Error('bar is not defined')) { * const baz = bar ?? throw new Error('bar is not defined') * } * * // but this is valid * function foo(bar: string = reject(new Error('bar is not defined'))) { * const baz = bar ?? reject(new Error('bar is not defined')) * } * ``` * * @param error value to throw */ export declare function reject(error?: unknown): never;