import { Methods } from "./methods.js"; import { Variant } from "./types/gumroad.js"; //#region src/variants.d.ts /** Bindings for {@link Variant} */ interface VariantProps { /** * Updates the variant * * @param options Options, provide at-least one property (`name`, `price_difference_cents` or `max_purchase_count`) * * @returns On success, a {@link Variant} */ update(options: { name?: string | undefined; price_difference_cents?: number | undefined; max_purchase_count?: number | undefined; }, requestOptions?: { signal?: AbortSignal; }): Promise; /** * Deletes the variant * * @returns On success, `true` */ delete(requestOptions?: { signal?: AbortSignal; }): Promise; } /** A class having API methods related to Variants */ declare class VariantsMethods extends Methods { protected _bindVariant(variant: Variant, product_id: string, variant_category_id: string): Variant & VariantProps; /** * Retrieve all of the existing variants in a variant category. * * @param product_id The id of the product * @param variant_category_id The id of the variant category * * @returns On success, an Array of {@link Variant} * * @see https://app.gumroad.com/api#get-/products/:product_id/variant_categories/:variant_category_id/variants */ list(product_id: string, variant_category_id: string, { signal }?: { signal?: AbortSignal; }): Promise<(Variant & VariantProps)[]>; /** * Retrieve the details of a variant of a product. * * @param product_id The id of the product * @param variant_category_id The id of the variant category * @param variant_id The id of the variant * * @returns On success, a {@link Variant} * * @see https://app.gumroad.com/api#get-/products/:product_id/variant_categories/:variant_category_id/variants/:id */ get(product_id: string, variant_category_id: string, variant_id: string, { signal }?: { signal?: AbortSignal; }): Promise; /** * Create a new variant of a product. * * @param product_id The id of the product * @param variant_category_id The id of variant category * @param name The name of the variant to create * @param price_difference_cents The price difference in cents * * @returns On success, a {@link Variant} * * @see https://app.gumroad.com/api#post-/products/:product_id/variant_categories/:variant_category_id/variants */ create(product_id: string, variant_category_id: string, name: string, price_difference_cents: number, options?: { /** The maximum purchase count */ max_purchase_count?: number; }, { signal }?: { signal?: AbortSignal; }): Promise; /** * Edit a variant of an existing product. * * @param product_id The id of the product * @param variant_category_id The id of the variant category * @param variant_id The id of the category * @param options Options, provide at-least one property (`name`, `price_difference_cents` or `max_purchase_count`) * * @returns On success, a {@link Variant} * * @see https://app.gumroad.com/api#put-/products/:product_id/variant_categories/:variant_category_id/variants/:id */ update(product_id: string, variant_category_id: string, variant_id: string, options?: { name?: string; price_difference_cents?: number; max_purchase_count?: number; }, { signal }?: { signal?: AbortSignal; }): Promise; /** * Permanently delete a variant of a product. * * @param product_id The id of the product * @param variant_category_id The id of the variant category * @param variant_id The id of the variant * * @returns On success, `true` * * @see https://app.gumroad.com/api#delete-/products/:product_id/variant_categories/:variant_category_id/variants/:id */ delete(product_id: string, variant_category_id: string, variant_id: string, { signal }?: { signal?: AbortSignal; }): Promise; } //#endregion export { VariantProps, VariantsMethods }; //# sourceMappingURL=variants.d.ts.map