import type { NameLookup, ScheduledTransactionSnapshot, TransactionSnapshot } from "./types.js"; /** Branded numeric type representing amounts in milliunits (1/1000 of a currency unit). */ export type Milliunits = number & { readonly __brand: "milliunits"; }; /** Branded numeric type representing amounts in currency units (e.g. dollars). */ export type CurrencyUnits = number & { readonly __brand: "currency"; }; export interface CurrencyFormatLike { currency_symbol?: string; decimal_digits?: number; decimal_separator?: string; group_separator?: string; symbol_first?: boolean; display_symbol?: boolean; } /** Cast a raw number (from YNAB API) to Milliunits. Use at API boundaries only. */ export declare function asMilliunits(value: number): Milliunits; /** Cast a raw number (from user input) to CurrencyUnits. Use at API boundaries only. */ export declare function asCurrency(value: number): CurrencyUnits; export declare function currencyToMilliunits(amount: CurrencyUnits): Milliunits; export declare function milliunitsToCurrency(amount: Milliunits): CurrencyUnits; export declare function formatCurrency(amountMilliunits: Milliunits, currencyFormat?: CurrencyFormatLike): string; export declare function snapshotTransaction(transaction: { id: string; account_id: string; date: string; amount: number; payee_id?: string | null; payee_name?: string | null; category_id?: string | null; memo?: string | null; cleared: string; approved: boolean; flag_color?: string | null; subtransactions?: Array<{ amount: number; payee_id?: string | null; category_id?: string | null; memo?: string | null; deleted?: boolean; }>; }): TransactionSnapshot; export declare function snapshotScheduledTransaction(transaction: { id: string; account_id: string; date_first: string; amount: number; payee_id?: string | null; payee_name?: string | null; category_id?: string | null; memo?: string | null; frequency?: string; flag_color?: string | null; }): ScheduledTransactionSnapshot; export interface SubtransactionLike { id: string; amount: Milliunits; memo?: string | null; payee_id?: string | null; payee_name?: string | null; category_id?: string | null; category_name?: string | null; deleted: boolean; } export declare function formatTransactionForOutput(transaction: { id: string; date: string; amount: Milliunits; memo?: string | null; cleared: string; approved: boolean; account_id: string; payee_id?: string | null; category_id?: string | null; flag_color?: string | null; subtransactions?: SubtransactionLike[]; }, lookups: NameLookup, currencyFormat?: CurrencyFormatLike): { subtransactions?: { id: string; amount: CurrencyUnits; amount_display: string; memo: string | null; payee_id: string | null; payee_name: string | null; category_id: string | null; category_name: string | null; category_group_id: string | null; category_group_name: string | null; }[] | undefined; id: string; date: string; amount: CurrencyUnits; amount_display: string; memo: string | null; cleared: string; approved: boolean; flag_color: string | null; is_split: boolean; account_id: string; account_name: string | null; payee_id: string | null; payee_name: string | null; category_id: string | null; category_name: string | null; category_group_id: string | null; category_group_name: string | null; }; export declare function formatScheduledTransactionForOutput(transaction: { id: string; date_first: string; date_next: string; frequency: string; amount: Milliunits; memo?: string | null; account_id: string; payee_id?: string | null; category_id?: string | null; flag_color?: string | null; }, lookups: NameLookup, currencyFormat?: CurrencyFormatLike): { id: string; date_first: string; date_next: string; frequency: string; amount: CurrencyUnits; amount_display: string; memo: string | null; flag_color: string | null; account_id: string; account_name: string | null; payee_id: string | null; payee_name: string | null; category_id: string | null; category_name: string | null; category_group_id: string | null; category_group_name: string | null; };