import type { DidResolutionResult } from '@enbox/dids';
import type { Dwn } from '../../src/dwn.js';
import type { GeneralJws } from '../../src/types/jws-types.js';
import type { MessageSigner } from '../../src/types/signer.js';
import type { ProgressToken } from '../../src/types/subscriptions.js';
import type { AuthorizationModel, Pagination } from '../../src/types/message-types.js';
import type { EncryptionInput } from '../../src/interfaces/records-write.js';
import type { DataEncodedRecordsWriteMessage, DateSort, RecordsCountMessage, RecordsDeleteMessage, RecordsFilter, RecordsQueryMessage, RecordsWriteTags } from '../../src/types/records-types.js';
import type { MessagesFilter, MessagesQueryMessage, MessagesReadMessage, MessagesSubscribeMessage } from '../../src/types/messages-types.js';
import type { PermissionConditions, PermissionScope } from '../../src/types/permission-types.js';
import type { PrivateKeyJwk, PublicKeyJwk } from '../../src/types/jose-types.js';
import type { ProtocolDefinition, ProtocolsConfigureMessage, ProtocolsQueryMessage } from '../../src/types/protocols-types.js';
import type { RecordsSubscribeMessage, RecordsWriteMessage } from '../../src/types/records-types.js';
import { MessagesQuery } from '../../src/interfaces/messages-query.js';
import { MessagesRead } from '../../src/interfaces/messages-read.js';
import { MessagesSubscribe } from '../../src/interfaces/messages-subscribe.js';
import { ProtocolsConfigure } from '../../src/interfaces/protocols-configure.js';
import { ProtocolsQuery } from '../../src/interfaces/protocols-query.js';
import { RecordsDelete } from '../../src/interfaces/records-delete.js';
import { RecordsWrite } from '../../src/interfaces/records-write.js';
/**
 * A logical grouping of user data used to generate test messages.
 */
export type Persona = {
    did: string;
    keyId: string;
    keyPair: {
        publicJwk: PublicKeyJwk;
        privateJwk: PrivateKeyJwk;
    };
    /** X25519 key pair for encryption (key agreement). Separate from the signing key pair. */
    encryptionKeyPair: {
        publicJwk: PublicKeyJwk;
        privateJwk: PrivateKeyJwk;
    };
    signer: MessageSigner;
};
export type GenerateProtocolsConfigureInput = {
    /**
     * Denotes if the Protocol Definition can be returned by unauthenticated `ProtocolsQuery`.
     * Only takes effect if `protocolDefinition` is not explicitly set. Defaults to false if not specified.
     */
    published?: boolean;
    /**
     * Author who will be signing the protocol config created.
     */
    author?: Persona;
    messageTimestamp?: string;
    protocolDefinition?: ProtocolDefinition;
    permissionGrantId?: string;
    delegatedGrant?: DataEncodedRecordsWriteMessage;
};
export type GenerateProtocolsConfigureOutput = {
    author: Persona;
    message: ProtocolsConfigureMessage;
    protocolsConfigure: ProtocolsConfigure;
};
export type GenerateProtocolsQueryInput = {
    author?: Persona;
    messageTimestamp?: string;
    permissionGrantId?: string;
    filter?: {
        protocol: string;
    };
};
export type GenerateProtocolsQueryOutput = {
    author: Persona;
    message: ProtocolsQueryMessage;
    protocolsQuery: ProtocolsQuery;
};
export type GenerateGrantCreateInput = {
    author?: Persona;
    grantedTo?: Persona;
    dateGranted?: string;
    dateExpires?: string;
    requestId?: string;
    description?: string;
    delegated?: boolean;
    scope?: PermissionScope;
    conditions?: PermissionConditions;
};
export type GenerateGrantCreateOutput = {
    message: RecordsWriteMessage;
    dataBytes: Uint8Array;
    dataStream: ReadableStream<Uint8Array>;
    recordsWrite: RecordsWrite;
    dataEncodedMessage: DataEncodedRecordsWriteMessage;
};
export type GenerateRecordsWriteInput = {
    author?: Persona;
    attesters?: Persona[];
    recipient?: string;
    protocol?: string;
    protocolPath?: string;
    protocolRole?: string;
    schema?: string;
    tags?: RecordsWriteTags;
    recordId?: string;
    parentContextId?: string;
    published?: boolean;
    data?: Uint8Array;
    dataCid?: string;
    dataSize?: number;
    dataFormat?: string;
    dateCreated?: string;
    messageTimestamp?: string;
    datePublished?: string;
    encryptionInput?: EncryptionInput;
    permissionGrantId?: string;
    squash?: true;
};
export type GenerateFromRecordsWriteInput = {
    author: Persona;
    existingWrite: RecordsWrite;
    data?: Uint8Array;
    published?: boolean;
    tags?: RecordsWriteTags;
    messageTimestamp?: string;
    datePublished?: string;
    protocolRole?: string;
};
export type GenerateFromRecordsWriteOut = {
    message: RecordsWriteMessage;
    dataBytes: Uint8Array;
    dataStream: ReadableStream<Uint8Array>;
    recordsWrite: RecordsWrite;
};
export type GenerateRecordsWriteOutput = {
    author: Persona;
    message: RecordsWriteMessage;
    dataCid?: string;
    dataSize?: number;
    dataBytes?: Uint8Array;
    dataStream?: ReadableStream<Uint8Array>;
    recordsWrite: RecordsWrite;
};
export type GenerateRecordsQueryInput = {
    /**
     * Treated as `false` if not given.
     */
    anonymous?: boolean;
    author?: Persona;
    messageTimestamp?: string;
    filter?: RecordsFilter;
    dateSort?: DateSort;
    pagination?: Pagination;
    permissionGrantId?: string;
    protocolRole?: string;
};
export type GenerateRecordsQueryOutput = {
    author: Persona | undefined;
    message: RecordsQueryMessage;
};
export type GenerateRecordsSubscribeInput = {
    /**
     * Treated as `false` if not given.
     */
    anonymous?: boolean;
    author?: Persona;
    messageTimestamp?: string;
    filter?: RecordsFilter;
    dateSort?: DateSort;
    pagination?: Pagination;
    permissionGrantId?: string;
    protocolRole?: string;
    /** Progress token for catch-up + EOSE subscribe. */
    cursor?: ProgressToken;
};
export type GenerateRecordsSubscribeOutput = {
    author: Persona | undefined;
    message: RecordsSubscribeMessage;
};
export type GenerateRecordsCountInput = {
    /**
     * Treated as `false` if not given.
     */
    anonymous?: boolean;
    author?: Persona;
    messageTimestamp?: string;
    filter?: RecordsFilter;
    permissionGrantId?: string;
    protocolRole?: string;
};
export type GenerateRecordsCountOutput = {
    author: Persona | undefined;
    message: RecordsCountMessage;
};
export type GenerateRecordsDeleteInput = {
    author?: Persona;
    recordId?: string;
    protocolRole?: string;
};
export type GenerateRecordsDeleteOutput = {
    author: Persona;
    recordsDelete: RecordsDelete;
    message: RecordsDeleteMessage;
};
export type GenerateMessagesSubscribeInput = {
    author: Persona;
    filters?: MessagesFilter[];
    messageTimestamp?: string;
    permissionGrantIds?: string[];
    /** Progress token for catch-up + EOSE subscribe. */
    cursor?: ProgressToken;
};
export type GenerateMessagesSubscribeOutput = {
    author: Persona;
    messagesSubscribe: MessagesSubscribe;
    message: MessagesSubscribeMessage;
};
export type GenerateMessagesQueryInput = {
    author: Persona;
    filters?: MessagesFilter[];
    messageTimestamp?: string;
    permissionGrantIds?: string[];
    cursor?: ProgressToken;
    limit?: number;
    cidsOnly?: boolean;
};
export type GenerateMessagesQueryOutput = {
    author: Persona;
    messagesQuery: MessagesQuery;
    message: MessagesQueryMessage;
};
export type GenerateMessagesReadInput = {
    author?: Persona;
    messageCid: string;
    permissionGrantIds?: string[];
};
export type GenerateMessagesReadOutput = {
    author: Persona;
    message: MessagesReadMessage;
    messagesRead: MessagesRead;
};
/**
 * Protocol definition that matches the defaults used by `TestDataGenerator.generateRecordsWrite()`:
 * `protocol: 'http://test-protocol.xyz'`, `protocolPath: 'testRecord'`.
 *
 * Install via `TestDataGenerator.installDefaultTestProtocol(dwn, persona)`.
 */
export declare const defaultTestProtocolDefinition: ProtocolDefinition;
/**
 * Utility class for generating data for testing.
 */
export declare class TestDataGenerator {
    /**
     * Generates a persona.
     */
    static generatePersona(input?: Partial<Persona>): Promise<Persona>;
    /**
     * Installs the default test protocol (`http://test-protocol.xyz` with `testRecord` type)
     * on the given DWN for the given persona. Call this before processing any RecordsWrite
     * created with `generateRecordsWrite()` that uses the default protocol.
     */
    static installDefaultTestProtocol(dwn: Dwn, persona: Persona): Promise<void>;
    /**
     * Generates a ProtocolsConfigure message for testing.
     * Optional parameters are generated if not given.
     * Implementation currently uses `ProtocolsConfigure.create()`.
     */
    static generateProtocolsConfigure(input?: GenerateProtocolsConfigureInput): Promise<GenerateProtocolsConfigureOutput>;
    /**
     * Generates a ProtocolsQuery message for testing.
     */
    static generateProtocolsQuery(input?: GenerateProtocolsQueryInput): Promise<GenerateProtocolsQueryOutput>;
    static generateGrantCreate(input?: GenerateGrantCreateInput): Promise<GenerateGrantCreateOutput>;
    /**
     * Generates a RecordsWrite message for testing.
     * `dataBytes` & `dataStream` returned will be `undefined` as long as `dataCid` or `dataSize` is given.
     * Implementation currently uses `RecordsWrite.create()`.
     * @param input.attesters Attesters of the message. Will NOT be generated if not given.
     * @param input.data Data that belongs to the record. Generated when not given only if `dataCid` and `dataSize` are also not given.
     * @param input.dataFormat Format of the data. Defaults to 'application/json' if not given.
     * @param input.signer MessageSigner of the message. Generated if not given.
     * @param input.schema Schema of the message. Randomly generated if not given.
     */
    static generateRecordsWrite(input?: GenerateRecordsWriteInput): Promise<GenerateRecordsWriteOutput>;
    /**
     * Generates a encrypted RecordsWrite message for testing.
     *
     * @param input.protocolDefinition Protocol definition used to generate the RecordsWrite.
     *        Must be the RECIPIENT's protocol definition if `encryptSymmetricKeyWithProtocolPathDerivedKey` is true,
     *        because the recipient's public keys will be needed to encrypt the symmetric key.
     *
     * @param input.encryptSymmetricKeyWithProtocolPathDerivedKey
     *        Set to `true` to attach the symmetric key encrypted by the protocol path derived public key
     *
     */
    static generateProtocolEncryptedRecordsWrite(input: {
        plaintextBytes: Uint8Array;
        author: Persona;
        recipient?: string;
        protocolDefinition: ProtocolDefinition;
        protocolPath: string;
        protocolParentContextId?: string;
        encryptSymmetricKeyWithProtocolPathDerivedKey: boolean;
    }): Promise<{
        message: RecordsWriteMessage;
        dataStream: ReadableStream<Uint8Array>;
        recordsWrite: RecordsWrite;
        encryptionInput: EncryptionInput;
        encryptedDataBytes: Uint8Array;
    }>;
    /**
     * Generates a valid RecordsWrite that modifies the given an existing write.
     * Any mutable property is not specified will be automatically mutated.
     * e.g. if `published` is not specified, it will be toggled from the state of the given existing write.
     */
    static generateFromRecordsWrite(input: GenerateFromRecordsWriteInput): Promise<GenerateFromRecordsWriteOut>;
    /**
     * Generates a RecordsQuery message for testing.
     */
    static generateRecordsQuery(input?: GenerateRecordsQueryInput): Promise<GenerateRecordsQueryOutput>;
    /**
     * Generates a RecordsSubscribe message for testing.
     */
    static generateRecordsSubscribe(input?: GenerateRecordsSubscribeInput): Promise<GenerateRecordsSubscribeOutput>;
    /**
     * Generates a RecordsCount message for testing.
     */
    static generateRecordsCount(input?: GenerateRecordsCountInput): Promise<GenerateRecordsCountOutput>;
    /**
     * Generates a RecordsDelete for testing.
     */
    static generateRecordsDelete(input?: GenerateRecordsDeleteInput): Promise<GenerateRecordsDeleteOutput>;
    /**
     * Generates a MessagesSubscribe message for testing.
     */
    static generateMessagesSubscribe(input?: GenerateMessagesSubscribeInput): Promise<GenerateMessagesSubscribeOutput>;
    /**
     * Generates a MessagesQuery message for testing.
     */
    static generateMessagesQuery(input?: GenerateMessagesQueryInput): Promise<GenerateMessagesQueryOutput>;
    static generateMessagesRead(input: GenerateMessagesReadInput): Promise<GenerateMessagesReadOutput>;
    /**
     * Generates a dummy `authorization` property for a DWN message that only conforms to schema validation.
     */
    static generateAuthorization(): AuthorizationModel;
    /**
     * Generates a dummy `authorization` property for a DWN message that only conforms to schema validation.
     */
    static generateAuthorizationSignature(): GeneralJws;
    /**
     * Generates a random but well-formed signature string in Base64Url format.
     */
    static randomSignatureString(): Promise<string>;
    /**
     * Generates a random alpha-numeric string.
     */
    static randomString(length: number): string;
    /**
     * Generates a random byte array of given length.
     */
    static randomBytes(length: number): Uint8Array;
    /**
     * Generates a random CBOR SHA256 CID.
     */
    static randomCborSha256Cid(): Promise<string>;
    /**
     * Generates a random within a range (inclusive).
     * @param min lowest potential value.
     * @param max greatest potential value.
     */
    static randomInt(min: number, max: number): number;
    /**
     * Generates a random timestamp. Optionally allows you to set specific non-randomized values for the timestamp.
     *
     * @returns random UTC ISO-8601 timestamp
     */
    static randomTimestamp(options?: {
        year?: number;
        month?: number;
        day?: number;
        hour?: number;
        minute?: number;
        second?: number;
        millisecond?: number;
        microsecond?: number;
    }): string;
    /**
     * Creates a mock DID resolution result for testing purposes.
     */
    static createDidResolutionResult(persona: Persona): DidResolutionResult;
    /**
     * Generates a did:key persona.
     */
    static generateDidKeyPersona(): Promise<Persona>;
}
//# sourceMappingURL=test-data-generator.d.ts.map