import { type AuthorizerResponse, type BouncerAbility, type BouncerAuthorizer } from './types.ts'; /** * Abilities builder exposes a chainable API to fluently create an object * of abilities by chaining the ".define" method. This provides a fluent * interface for building collections of authorization abilities. * * @example * ```js * const abilities = new AbilitiesBuilder({}) * .define('editPost', (user, post) => user.id === post.authorId) * .define('viewPost', (user, post) => post.isPublished, { allowGuest: true }) * ``` */ export declare class AbilitiesBuilder>> { abilities: Abilities; /** * Create a new AbilitiesBuilder instance * * @param abilities Initial abilities object to build upon */ constructor(abilities: Abilities); /** * Helper to convert a user defined authorizer function to a bouncer ability * * @param name Unique name for the ability * @param authorizer Authorization function * @param options Optional configuration for the ability * * @example * ```js * builder.define('editPost', (user, post) => user.id === post.authorId) * ``` */ define>(name: Name, authorizer: Authorizer, options?: { allowGuest: boolean; }): AbilitiesBuilder AuthorizerResponse | Promise ? { allowGuest: false; original: Authorizer; execute(user: User | null, ...args: Args): ReturnType; } : never; }>; }