import type { EnboxAgent } from './types/agent.js';
import type { CreateGrantParams, CreateRequestParams, CreateRevocationParams, FetchPermissionRequestParams, FetchPermissionsParams, GetPermissionParams, IsGrantRevokedParams, PermissionGrantEntry, PermissionRequestEntry, PermissionRevocationEntry, PermissionsApi } from './types/permissions.js';
import { DwnInterface } from './types/dwn.js';
export declare class AgentPermissionsApi implements PermissionsApi {
    /** cache for fetching a permission {@link PermissionGrant}, keyed by a specific MessageType and protocol */
    private readonly _cachedPermissions;
    private _agent?;
    get agent(): EnboxAgent;
    set agent(agent: EnboxAgent);
    constructor({ agent }?: {
        agent?: EnboxAgent;
    });
    getPermissionForRequest({ connectedDid, delegateDid, delegate, messageType, protocol, protocolPath, contextId, cached }: GetPermissionParams): Promise<PermissionGrantEntry>;
    fetchGrants({ author, target, grantee, grantor, protocol, remote, checkRevoked, }: FetchPermissionsParams): Promise<PermissionGrantEntry[]>;
    /**
     * Fetch all revocation record IDs for grants, returned as a Set of parent grant record IDs.
     * Issues a single RecordsQuery for all revocation records, optionally scoped to a grantor and protocol.
     */
    private fetchRevokedGrantIds;
    fetchRequests({ author, target, protocol, remote }: FetchPermissionRequestParams): Promise<PermissionRequestEntry[]>;
    isGrantRevoked({ author, target, grantRecordId, remote }: IsGrantRevokedParams): Promise<boolean>;
    createGrant(params: CreateGrantParams): Promise<PermissionGrantEntry>;
    createRequest(params: CreateRequestParams): Promise<PermissionRequestEntry>;
    createRevocation(params: CreateRevocationParams): Promise<PermissionRevocationEntry>;
    clear(): Promise<void>;
    /**
     * Matches the appropriate grant from an array of grants based on the provided parameters.
     *
     * @param delegated if true, only delegated grants are turned, if false all grants are returned including delegated ones.
     */
    static matchGrantFromArray<T extends DwnInterface>(grantor: string, grantee: string, messageParams: {
        messageType: T;
        protocol?: string;
        protocolPath?: string;
        contextId?: string;
    }, grants: PermissionGrantEntry[], delegated?: boolean): Promise<PermissionGrantEntry | undefined>;
    private static matchScopeFromGrant;
}
//# sourceMappingURL=permissions-api.d.ts.map