import { Methods } from "./methods.js"; import { CustomField } from "./types/gumroad.js"; //#region src/custom-fields.d.ts /** Bindings for {@link CustomField} */ interface CustomFieldProps { /** * Updates the custom field * * @param options Options * * @returns On success, a {@link CustomField} */ update(options: { name?: string | undefined; required?: boolean | undefined; type?: 'text' | 'checkbox' | 'terms' | undefined; variant?: string | undefined; }, requestOptions: { signal?: AbortSignal; }): Promise; /** * Deletes the custom field * * @returns On success `true` */ delete(requestOptions?: { signal?: AbortSignal; }): Promise; } /** A class having API methods related to Custom Fields */ declare class CustomFieldsMethods extends Methods { protected _bindCustomField(custom_field: CustomField, product_id: string): CustomField & CustomFieldProps; /** * Retrieve all of the existing custom fields for a product. * * @param product_id The id of the product * * @returns On success, an Array of {@link CustomField} * * @see https://app.gumroad.com/api#get-/products/:product_id/custom_fields */ list(product_id: string, { signal }?: { signal?: AbortSignal; }): Promise<(CustomField & CustomFieldProps)[]>; /** * Create a new custom field for a product. * * @param product_id The id of the product * @param name The name of the custom field to be created * @param options (Optional) Options * * @returns On success, a {@link CustomField} * * @see https://app.gumroad.com/api#post-/products/:product_id/custom_fields */ create(product_id: string, name: string, options?: { required?: boolean; type?: 'text' | 'checkbox' | 'terms'; variant?: string; }, { signal }?: { signal?: AbortSignal; }): Promise; /** * Edit an existing product's custom field. * * @param product_id The id of the product * @param name The name of the custom filed * @param options (Optional) Options * * @returns On success, a {@link CustomField} * * @see https://app.gumroad.com/api#put-/products/:product_id/custom_fields/:name */ update(product_id: string, name: string, options?: { name?: string; type?: 'text' | 'checkbox' | 'terms'; required?: boolean; variant?: string; }, { signal }?: { signal?: AbortSignal; }): Promise; /** * Permanently delete a product's custom field. * * @param product_id The id of the product * @param name The name of the custom field * * @returns On success, `true` * * @see https://app.gumroad.com/api#delete-/products/:product_id/custom_fields/:name */ delete(product_id: string, name: string, { signal }?: { signal?: AbortSignal; }): Promise; } //#endregion export { CustomFieldProps, CustomFieldsMethods }; //# sourceMappingURL=custom-fields.d.ts.map