import { IArkosPolicy } from "./types"; /** * Creates a typed policy for a Prisma model resource. * * Each `.rule()` call registers an action and returns the policy * with a typed `can{Action}` permission checker and a typed `{Action}` * entry — both passable to the `authentication` field on `ArkosRouteHook` * and `ArkosRouter`, and callable for fine-grained permission checks. * * @param resource - The resource name in kebab-case (e.g. `"user"`, `"blog-post"`) * * @example * ```ts * const userPolicy = ArkosPolicy("user") * .rule("Create", ["Admin", "Editor"]) * .rule("View", "*") * .rule("Delete", ["Admin"]); * * // Pass to authentication field * userRouter.post({ path: "/users", authentication: userPolicy.Create }); * userRouteHook.deleteOne({ authentication: userPolicy.Delete }); * * // Fine-grained check * if (userPolicy.canCreate(req.user)) { ... } * * export default userPolicy; * ``` * * @see {@link https://www.arkosjs.com/docs/api-referency/arkos-policy} */ export declare function ArkosPolicy(resource: TResource): IArkosPolicy;