import { CID } from 'multiformats';
import { z } from 'zod';
import { RepoRecord } from '@atproto/lexicon';
import { BlockMap } from './block-map';
import { CidSet } from './cid-set';
declare const unsignedCommit: z.ZodObject<{
    did: z.ZodString;
    version: z.ZodLiteral<3>;
    data: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
    rev: z.ZodString;
    prev: z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>>;
}, "strip", z.ZodTypeAny, {
    did: string;
    version: 3;
    data: CID;
    rev: string;
    prev: CID | null;
}, {
    did: string;
    version: 3;
    rev: string;
    data?: any;
    prev?: any;
}>;
export type UnsignedCommit = z.infer<typeof unsignedCommit> & {
    sig?: never;
};
declare const commit: z.ZodObject<{
    did: z.ZodString;
    version: z.ZodLiteral<3>;
    data: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
    rev: z.ZodString;
    prev: z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>>;
    sig: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
}, "strip", z.ZodTypeAny, {
    did: string;
    version: 3;
    data: CID;
    rev: string;
    prev: CID | null;
    sig: Uint8Array;
}, {
    did: string;
    version: 3;
    rev: string;
    sig: Uint8Array;
    data?: any;
    prev?: any;
}>;
export type Commit = z.infer<typeof commit>;
declare const legacyV2Commit: z.ZodObject<{
    did: z.ZodString;
    version: z.ZodLiteral<2>;
    data: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
    rev: z.ZodOptional<z.ZodString>;
    prev: z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>>;
    sig: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
}, "strip", z.ZodTypeAny, {
    did: string;
    version: 2;
    data: CID;
    prev: CID | null;
    sig: Uint8Array;
    rev?: string | undefined;
}, {
    did: string;
    version: 2;
    sig: Uint8Array;
    data?: any;
    rev?: string | undefined;
    prev?: any;
}>;
export type LegacyV2Commit = z.infer<typeof legacyV2Commit>;
declare const versionedCommit: z.ZodDiscriminatedUnion<"version", [z.ZodObject<{
    did: z.ZodString;
    version: z.ZodLiteral<3>;
    data: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
    rev: z.ZodString;
    prev: z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>>;
    sig: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
}, "strip", z.ZodTypeAny, {
    did: string;
    version: 3;
    data: CID;
    rev: string;
    prev: CID | null;
    sig: Uint8Array;
}, {
    did: string;
    version: 3;
    rev: string;
    sig: Uint8Array;
    data?: any;
    prev?: any;
}>, z.ZodObject<{
    did: z.ZodString;
    version: z.ZodLiteral<2>;
    data: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
    rev: z.ZodOptional<z.ZodString>;
    prev: z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>>;
    sig: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
}, "strip", z.ZodTypeAny, {
    did: string;
    version: 2;
    data: CID;
    prev: CID | null;
    sig: Uint8Array;
    rev?: string | undefined;
}, {
    did: string;
    version: 2;
    sig: Uint8Array;
    data?: any;
    rev?: string | undefined;
    prev?: any;
}>]>;
export type VersionedCommit = z.infer<typeof versionedCommit>;
export declare const schema: {
    commit: z.ZodObject<{
        did: z.ZodString;
        version: z.ZodLiteral<3>;
        data: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
        rev: z.ZodString;
        prev: z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>>;
        sig: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
    }, "strip", z.ZodTypeAny, {
        did: string;
        version: 3;
        data: CID;
        rev: string;
        prev: CID | null;
        sig: Uint8Array;
    }, {
        did: string;
        version: 3;
        rev: string;
        sig: Uint8Array;
        data?: any;
        prev?: any;
    }>;
    legacyV2Commit: z.ZodObject<{
        did: z.ZodString;
        version: z.ZodLiteral<2>;
        data: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
        rev: z.ZodOptional<z.ZodString>;
        prev: z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>>;
        sig: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
    }, "strip", z.ZodTypeAny, {
        did: string;
        version: 2;
        data: CID;
        prev: CID | null;
        sig: Uint8Array;
        rev?: string | undefined;
    }, {
        did: string;
        version: 2;
        sig: Uint8Array;
        data?: any;
        rev?: string | undefined;
        prev?: any;
    }>;
    versionedCommit: z.ZodDiscriminatedUnion<"version", [z.ZodObject<{
        did: z.ZodString;
        version: z.ZodLiteral<3>;
        data: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
        rev: z.ZodString;
        prev: z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>>;
        sig: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
    }, "strip", z.ZodTypeAny, {
        did: string;
        version: 3;
        data: CID;
        rev: string;
        prev: CID | null;
        sig: Uint8Array;
    }, {
        did: string;
        version: 3;
        rev: string;
        sig: Uint8Array;
        data?: any;
        prev?: any;
    }>, z.ZodObject<{
        did: z.ZodString;
        version: z.ZodLiteral<2>;
        data: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
        rev: z.ZodOptional<z.ZodString>;
        prev: z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>>;
        sig: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
    }, "strip", z.ZodTypeAny, {
        did: string;
        version: 2;
        data: CID;
        prev: CID | null;
        sig: Uint8Array;
        rev?: string | undefined;
    }, {
        did: string;
        version: 2;
        sig: Uint8Array;
        data?: any;
        rev?: string | undefined;
        prev?: any;
    }>]>;
    cid: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
    carHeader: z.ZodObject<{
        version: z.ZodLiteral<1>;
        roots: z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>, "many">;
    }, "strip", z.ZodTypeAny, {
        version: 1;
        roots: CID[];
    }, {
        version: 1;
        roots: any[];
    }>;
    bytes: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
    string: z.ZodString;
    array: z.ZodArray<z.ZodUnknown, "many">;
    map: z.ZodRecord<z.ZodString, z.ZodUnknown>;
    unknown: z.ZodUnknown;
};
export declare const def: {
    commit: {
        name: string;
        schema: z.ZodObject<{
            did: z.ZodString;
            version: z.ZodLiteral<3>;
            data: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
            rev: z.ZodString;
            prev: z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>>;
            sig: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
        }, "strip", z.ZodTypeAny, {
            did: string;
            version: 3;
            data: CID;
            rev: string;
            prev: CID | null;
            sig: Uint8Array;
        }, {
            did: string;
            version: 3;
            rev: string;
            sig: Uint8Array;
            data?: any;
            prev?: any;
        }>;
    };
    versionedCommit: {
        name: string;
        schema: z.ZodDiscriminatedUnion<"version", [z.ZodObject<{
            did: z.ZodString;
            version: z.ZodLiteral<3>;
            data: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
            rev: z.ZodString;
            prev: z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>>;
            sig: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
        }, "strip", z.ZodTypeAny, {
            did: string;
            version: 3;
            data: CID;
            rev: string;
            prev: CID | null;
            sig: Uint8Array;
        }, {
            did: string;
            version: 3;
            rev: string;
            sig: Uint8Array;
            data?: any;
            prev?: any;
        }>, z.ZodObject<{
            did: z.ZodString;
            version: z.ZodLiteral<2>;
            data: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
            rev: z.ZodOptional<z.ZodString>;
            prev: z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>>;
            sig: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
        }, "strip", z.ZodTypeAny, {
            did: string;
            version: 2;
            data: CID;
            prev: CID | null;
            sig: Uint8Array;
            rev?: string | undefined;
        }, {
            did: string;
            version: 2;
            sig: Uint8Array;
            data?: any;
            rev?: string | undefined;
            prev?: any;
        }>]>;
    };
    cid: import("@atproto/common-web/dist/check").Def<CID>;
    carHeader: import("@atproto/common-web/dist/check").Def<import("@atproto/common").CarHeader>;
    bytes: import("@atproto/common-web/dist/check").Def<Uint8Array>;
    string: import("@atproto/common-web/dist/check").Def<string>;
    map: import("@atproto/common-web/dist/check").Def<Record<string, unknown>>;
    unknown: import("@atproto/common-web/dist/check").Def<unknown>;
};
export declare enum WriteOpAction {
    Create = "create",
    Update = "update",
    Delete = "delete"
}
export type RecordCreateOp = {
    action: WriteOpAction.Create;
    collection: string;
    rkey: string;
    record: RepoRecord;
};
export type RecordUpdateOp = {
    action: WriteOpAction.Update;
    collection: string;
    rkey: string;
    record: RepoRecord;
};
export type RecordDeleteOp = {
    action: WriteOpAction.Delete;
    collection: string;
    rkey: string;
};
export type RecordWriteOp = RecordCreateOp | RecordUpdateOp | RecordDeleteOp;
export type RecordCreateDescript = {
    action: WriteOpAction.Create;
    collection: string;
    rkey: string;
    cid: CID;
};
export type RecordUpdateDescript = {
    action: WriteOpAction.Update;
    collection: string;
    rkey: string;
    prev: CID;
    cid: CID;
};
export type RecordDeleteDescript = {
    action: WriteOpAction.Delete;
    collection: string;
    rkey: string;
    cid: CID;
};
export type RecordWriteDescript = RecordCreateDescript | RecordUpdateDescript | RecordDeleteDescript;
export type WriteLog = RecordWriteDescript[][];
export type CommitData = {
    cid: CID;
    rev: string;
    since: string | null;
    prev: CID | null;
    newBlocks: BlockMap;
    relevantBlocks: BlockMap;
    removedCids: CidSet;
};
export type RepoUpdate = CommitData & {
    ops: RecordWriteOp[];
};
export type CollectionContents = Record<string, RepoRecord>;
export type RepoContents = Record<string, CollectionContents>;
export type RepoRecordWithCid = {
    cid: CID;
    value: RepoRecord;
};
export type CollectionContentsWithCids = Record<string, RepoRecordWithCid>;
export type RepoContentsWithCids = Record<string, CollectionContentsWithCids>;
export type DatastoreContents = Record<string, CID>;
export type RecordPath = {
    collection: string;
    rkey: string;
};
export type RecordCidClaim = {
    collection: string;
    rkey: string;
    cid: CID | null;
};
export type RecordClaim = {
    collection: string;
    rkey: string;
    record: RepoRecord | null;
};
export type VerifiedDiff = {
    writes: RecordWriteDescript[];
    commit: CommitData;
};
export type VerifiedRepo = {
    creates: RecordCreateDescript[];
    commit: CommitData;
};
export type CarBlock = {
    cid: CID;
    bytes: Uint8Array;
};
export {};
//# sourceMappingURL=types.d.ts.map