import { ControlOptions } from './common.type'; import { Policy } from './policy.type'; import { OK } from '../consts'; export type PropType = 'subject' | 'action' | 'object'; export type PropValue = { main: M; scope?: S; }; export type CacheKey = { subject?: Sub | (PropValue & ControlOptions); action?: Act | (PropValue & ControlOptions); object?: Obj | (PropValue & ControlOptions); } & ControlOptions; export interface CacheInterfaceOptions { sep?: string; prefix?: string; } export interface CacheInterface { clear(): typeof OK | Promise; get(cKey: CacheKey): Policy[] | Promise[]>; set(policy: Policy): typeof OK | Promise; del(policy: Policy): typeof OK | Promise; has(policy: Policy, options?: ControlOptions): boolean | Promise; }