/** * The core type: either an Error or a value T. * Unlike Result, this is just a union - no wrapper needed. */ export type Errore = E | T /** * Extract the error type from an Errore union. * @example InferError // NetworkError */ export type InferError = T extends Error ? T : never /** * Extract the value type from an Errore union. * @example InferValue // User */ export type InferValue = T extends Error ? never : T /** * Utility to ensure T is not an Error type. * Used to prevent ambiguous unions like Error | Error. */ export type EnsureNotError = T extends Error ? 'Error: Value type T cannot extend Error - this would make the union ambiguous' : T