/**
 * Represents the result of an asynchronous operation that may succeed or fail.
 * Either contains the successful data or an error, but not both.
 *
 * @template T - The type of data returned on successful operations
 */
export type CallbackResult<T> =
  | { data: T; error?: unknown }
  | { data?: T; error: unknown };

/**
 * Function type for callbacks that receive operation results.
 * Typically used for handling asynchronous operation completions.
 *
 * @template T - The type of data returned on successful operations
 */
export type Callback<T> = (result: CallbackResult<T>) => void;
