import type { DelegatedGrantMessage } from '../types/delegated-grant-message.js'; import type { PermissionsGrantMessage } from '../types/permissions-types.js'; import type { PermissionsRequest } from './permissions-request.js'; import type { Signer } from '../types/signer.js'; import type { PermissionConditions, PermissionScope } from '../types/permissions-grant-descriptor.js'; import { AbstractMessage } from '../core/abstract-message.js'; export type PermissionsGrantOptions = { messageTimestamp?: string; dateExpires: string; description?: string; grantedTo: string; grantedBy: string; grantedFor: string; delegated?: boolean; permissionsRequestId?: string; scope: PermissionScope; conditions?: PermissionConditions; signer: Signer; }; export type CreateFromPermissionsRequestOverrides = { dateExpires: string; description?: string; grantedTo?: string; grantedBy?: string; grantedFor?: string; scope?: PermissionScope; conditions?: PermissionConditions; }; export declare class PermissionsGrant extends AbstractMessage { static parse(message: PermissionsGrantMessage): Promise; static create(options: PermissionsGrantOptions): Promise; /** * A convenience method for casting a PermissionsGrantMessage to a DelegatedGrantMessage if the `delegated` property is `true`. * @throws {DwnError} if the `delegated` property is not `true`. */ asDelegatedGrant(): DelegatedGrantMessage; /** * A convenience method for casting a PermissionsGrantMessage to a DelegatedGrantMessage if the `delegated` property is `true`. * @throws {DwnError} if the `delegated` property is not `true`. */ static asDelegatedGrant(message: PermissionsGrantMessage): DelegatedGrantMessage; /** * generates a PermissionsGrant using the provided PermissionsRequest * @param permissionsRequest * @param signer - the private key and additional signature material of the grantor * @param overrides - overrides that will be used instead of the properties in `permissionsRequest` */ static createFromPermissionsRequest(permissionsRequest: PermissionsRequest, signer: Signer, overrides: CreateFromPermissionsRequestOverrides): Promise; /** * Current implementation only allows the DWN owner to store grants they created. */ authorize(): void; /** * Validates scope structure for properties beyond `interface` and `method`. * Currently only grants for RecordsRead and RecordsWrite have such properties and need validation beyond JSON Schema. */ static validateScope(permissionsGrantMessage: PermissionsGrantMessage): void; } //# sourceMappingURL=permissions-grant.d.ts.map