import type { CreateInvoiceLinkParams } from '@puregram/api'; import { type Camelize } from './camelize.js'; type InvoiceBody = Omit; type CamelInvoice = Camelize; type StarsInput = Pick & Partial>; type FiatInput = Pick & { providerToken: string; } & Partial>; /** * static factories for invoice bodies shared by `sendInvoice` and `createInvoiceLink`. * * the two variants encode telegram's payment split as types rather than runtime errors: * `Invoice.stars` pins `currency` to `"XTR"`, sends an empty `provider_token`, and rejects the fiat-only * knobs (tips, shipping, `is_flexible`) while allowing `subscriptionPeriod`; `Invoice.fiat` requires a * `providerToken` + ISO 4217 `currency`, allows tips/shipping/flexible, and rejects `subscriptionPeriod`. * * the result carries every invoice-definition field but no delivery field — spread it into `sendInvoice` * (with `chat_id`) or pass it straight to `createInvoiceLink`. add `business_connection_id` at the call site. * * @example * ```ts * tg.api.sendInvoice({ * chat_id, * ...Invoice.fiat({ * title: 'Coffee', description: 'a good cup', payload: 'order_42', * providerToken: process.env.PROVIDER_TOKEN!, * currency: 'EUR', * prices: [LabeledPrice.of('cup', 500), LabeledPrice.of('shipping', 150)], * isFlexible: true * }) * }) * * const link = await tg.api.createInvoiceLink(Invoice.stars({ * title: 'Pro plan', description: 'monthly', payload: 'sub_pro', * prices: [LabeledPrice.of('1 month', 250)], * subscriptionPeriod: 2592000 * })) * ``` */ export declare class Invoice { /** fiat invoice body — `providerToken` + ISO 4217 `currency` required; `subscriptionPeriod` not accepted */ static fiat(params: FiatInput): InvoiceBody; /** telegram stars invoice body — `currency` is forced to `"XTR"`; fiat-only knobs are not accepted */ static stars(params: StarsInput): InvoiceBody; } export {}; //# sourceMappingURL=invoice.d.ts.map