import type { TFilterCriteria } from '@neon.id/query'; import type { NActionDef, NRoleDef } from '@neon.id/types'; import type { TAbilityInstance } from '../ability'; import type { TPermitResult } from '../types'; export interface TGuardCheckOptions { model?: string; isDebug?: boolean; } export interface TGuardDefinition { id?: string; role?: NRoleDef | NRoleDef[]; action?: NActionDef | NActionDef[]; data?: TFilterCriteria>; } export interface TGuardInstance { id?: string; roles: NRoleDef[]; actions?: NActionDef[]; get isPublic(): boolean; get isUser(): boolean; check(ability: TAbilityInstance, data?: Record, options?: TGuardCheckOptions): TPermitResult; }