import { Policy, PolicyUsage, UsageEntry } from "./policy-types.mjs"; //#region extensions/crypto/src/services/policy-store.d.ts declare class PolicyStore { private cache; private usageCache; /** Set of userIds whose policy files are corrupted. Fail-closed: block all. */ private _corrupted; /** Check if the store is corrupted for a user (fail-closed). */ isCorrupted(userId: string): boolean; /** Find the first userId directory that has policies (for command fallback). */ findFirstUserWithPolicies(): string | null; /** Load all policies for a user. */ listPolicies(userId: string): Policy[]; /** Get active policies only. */ getActivePolicies(userId: string): Policy[]; /** Get a single policy by ID. */ getPolicy(userId: string, policyId: string): Policy | undefined; /** Get a single policy by name (case-insensitive). */ getPolicyByName(userId: string, name: string): Policy | undefined; /** Create or update a policy. Throws if max count exceeded on insert. */ savePolicy(policy: Policy): void; /** Delete a policy by ID. */ deletePolicy(userId: string, policyId: string): boolean; /** Load usage data for a user, pruning stale entries. */ loadUsage(userId: string): PolicyUsage[]; /** Get usage for a specific policy. */ getUsage(userId: string, policyId: string): PolicyUsage | undefined; /** Record a usage entry for a policy. */ recordUsage(userId: string, policyId: string, entry: UsageEntry): void; /** Get total spend in a time window for a policy. */ getSpendInWindow(userId: string, policyId: string, windowMs: number): number; /** Get call count in a time window for a policy. */ getCallsInWindow(userId: string, policyId: string, windowMs: number): number; private persist; private persistUsage; /** Clear all caches (for testing). */ reset(): void; } declare function getPolicyStore(): PolicyStore; declare function resetPolicyStore(): void; //#endregion export { PolicyStore, getPolicyStore, resetPolicyStore }; //# sourceMappingURL=policy-store.d.mts.map