import type Stripe from 'stripe'; import { type ManagesInvoicesContract } from './contracts.js'; import { Tax } from './tax.js'; import { Discount } from './discount.js'; import { DateTime, type Zone } from 'luxon'; import { InvoiceLineItem } from './invoice_line_item.js'; export declare class Invoice { #private; constructor(owner: ManagesInvoicesContract, invoice: Stripe.Invoice); /** * Get a DateTime instance for the invoicing date. */ date(timezone?: string | Zone): DateTime; /** * Get a DateTime instance for the invoice's due date. */ dueDate(timezone?: string | Zone): DateTime | null; /** * Get the total amount minus the starting balance that was paid (or will be paid). */ total(): string; /** * Get the raw total amount minus the starting balance that was paid (or will be paid). */ rawTotal(): number; /** * Get the total amount that was paid (or will be paid). */ realTotal(): string; /** * Get the raw total amount that was paid (or will be paid). */ rawRealTotal(): number; /** * Get the total of the invoice (before discounts). */ subtotal(): string; /** * Get the amount due for the invoice. */ amountDue(): string; /** * Get the raw amount due for the invoice. */ rawAmountDue(): number; /** * Determine if the account had a starting balance. */ hasStartingBalance(): boolean; /** * Get the starting balance for the invoice. */ startingBalance(): string; /** * Get the raw starting balance for the invoice. */ rawStartingBalance(): number; /** * Determine if the account had an ending balance. */ hasEndingBalance(): boolean; /** * Get the ending balance for the invoice. */ endingBalance(): string; /** * Get the raw ending balance for the invoice. */ rawEndingBalance(): number; /** * Determine if the invoice has balance applied. */ hasAppliedBalance(): boolean; /** * Get the applied balance for the invoice. */ appliedBalance(): string; /** * Get the raw applied balance for the invoice. */ rawAppliedBalance(): number; /** * Determine if the invoice has one or more discounts applied. */ hasDiscount(): boolean; /** * Get all of the discount objects from the Stripe invoice. */ discounts(): Promise; /** * Calculate the amount for a given discount. */ discountFor(discount: Discount): string | null; /** * Calculate the raw amount for a given discount. */ rawDiscountFor(discount: Discount): number | null; /** * Get the total discount amount. */ discount(): string; /** * Get the raw total discount amount. */ rawDiscount(): number; /** * Get the total tax amount. */ tax(): string; /** * Determine if the invoice has tax applied. */ hasTax(): Promise; /** * Get the taxes applied to the invoice. */ taxes(): Promise; /** * Determine if the customer is not exempted from taxes. */ isNotTaxExempt(): boolean; /** * Determine if the customer is exempted from taxes. */ isTaxExempt(): boolean; /** * Determine if reverse charge applies to the customer. */ reverseChargesApplies(): boolean; /** * Determine if the invoice will charge the customer automatically. */ chargesAutomatically(): boolean; /** * Determine if the invoice will send an invoice to the customer. */ sendsInvoice(): boolean; /** * Get all of the "invoice item" line items. */ invoiceItems(): Promise; /** * Get all of the "subscription" line items. */ subscriptions(): Promise; /** * Get all of the invoice items. */ invoiceLineItems(): Promise; /** * Add a custom amount item to this invoice. */ addItem(description: string, amount: number, params?: Partial & { price_data?: Omit & { currency?: string; }; }>): Promise; /** * Add a price-based item to this invoice. */ addPrice(price: string, quantity?: number, params?: Partial): Promise; /** * Refresh the invoice. */ refresh(): Promise; /** * Refresh the invoice with expanded objects. */ refreshWithExpandedData(): Promise; /** * Format the given amount into a displayable currency. */ formatAmount(amount: number): string; /** * Return the Tax Ids of the account. */ accountTaxIds(): (Stripe.TaxId | Stripe.DeletedTaxId | string)[]; /** * Return the Tax Ids of the customer. */ customerTaxIds(): Stripe.Invoice.CustomerTaxId[]; /** * Finalize the Stripe invoice. */ finalize(params?: Stripe.InvoiceFinalizeInvoiceParams): Promise; /** * Pay the Stripe invoice. */ pay(params?: Stripe.InvoicePayParams): Promise; /** * Send the Stripe invoice to the customer. */ send(params?: Stripe.InvoiceSendInvoiceParams): Promise; /** * Void the Stripe invoice. */ void(params?: Stripe.InvoiceVoidInvoiceParams): Promise; /** * Mark an invoice as uncollectible. */ markUncollectible(params?: Stripe.InvoiceMarkUncollectibleParams): Promise; /** * Delete the Stripe invoice. */ delete(params?: Stripe.InvoiceDeleteParams): Promise; /** * Determine if the invoice is open. */ isOpen(): boolean; /** * Determine if the invoice is draft. */ isDraft(): boolean; /** * Determine if the invoice is paid. */ isPaid(): boolean; /** * Determine if the invoice is uncollectible. */ isUncollectible(): boolean; /** * Determine if the invoice is void. */ isVoid(): boolean; /** * Get the Stripe model instance. */ owner(): ManagesInvoicesContract; /** * Get the Stripe invoice instance. */ asStripeInvoice(): Stripe.Invoice; }