import { Methods } from "./methods.js"; import { Purchase } from "./types/gumroad.js"; //#region src/licenses.d.ts /** Bindings for {@link Purchase} */ interface PurchaseProps { /** The number of license uses */ readonly license_uses: number; /** * Verifies the license of the purchase * * @returns On success, a {@link Purchase} */ verify(options: { /** If `true`, increment the uses count of a license. Default: `true` */ increment_uses_count?: boolean; }, requestOptions?: { signal?: AbortSignal; }): Promise; /** * Enables the license of the purchase * * @returns On success, a {@link Purchase} */ enable(requestOptions?: { signal?: AbortSignal; }): Promise; /** * Disables the license of the purchase * * @returns On success, a {@link Purchase} */ disable(requestOptions?: { signal?: AbortSignal; }): Promise; /** * Decrement the uses count of the license of the product * * @returns On success, a {@link Purchase} */ decrementUsesCount(requestOptions?: { signal?: AbortSignal; }): Promise; } /** A class having API methods related to Licenses */ declare class LicensesMethods extends Methods { protected _bindPurchase({ purchase, uses, product_id, license_key }: { purchase: Purchase; uses: number; product_id: string; license_key: string; }): Purchase & PurchaseProps; /** * Verify a license * * @param product_id The unique ID of the product, available on product's edit page * @param license_key The license key provided by your customer * * @returns On success, a {@link Purchase} * * @see https://app.gumroad.com/api#post-/licenses/verify */ verify(product_id: string, license_key: string, options?: { /** If `true`, increment the uses count of a license. Default: `true` */ increment_uses_count?: boolean; }, { signal }?: { signal?: AbortSignal; }): Promise; /** * Enable a license * * @param product_id The unique ID of the product, available on product's edit page * @param license_key The license key provided by your customer * * @returns On success, a {@link Purchase} * * @see https://app.gumroad.com/api#put-/licenses/enable */ enable(product_id: string, license_key: string, { signal }?: { signal?: AbortSignal; }): Promise; /** * Disable a license * * @param product_id The unique ID of the product, available on product's edit page * @param license_key The license key provided by your customer * * @returns On success, a {@link Purchase} * * @see https://app.gumroad.com/api#put-/licenses/disable */ disable(product_id: string, license_key: string, { signal }?: { signal?: AbortSignal; }): Promise; /** * Decrement the uses count of a license * * @param product_id The unique ID of the product, available on product's edit page * @param license_key The license key provided by your customer * * @returns On success, a {@link Purchase} * * @see https://app.gumroad.com/api#put-/licenses/decrement_uses_count */ decrementUsesCount(product_id: string, license_key: string, { signal }?: { signal?: AbortSignal; }): Promise; /** * Rotate a license key. The old license key will no longer be valid. * * @param product_id The unique ID of the product, available on product's edit page * @param license_key The license key provided by your customer * * @returns On success, a {@link Purchase} * * @see https://app.gumroad.com/api#put-/licenses/rotate */ rotate(product_id: string, license_key: string, { signal }?: { signal?: AbortSignal; }): Promise; } //#endregion export { LicensesMethods, PurchaseProps }; //# sourceMappingURL=licenses.d.ts.map