import * as z from 'zod'; import { type OptionDoc } from '../../../schemas/db'; import { type Collection, type Key } from '../../../schemas/satellite'; import { type HookContext } from '../context'; import { type DocAssertDelete, type DocAssertSet, type DocUpsert } from './payload'; /** * @see DocContext */ export declare const DocContextSchema: (dataSchema: T) => z.ZodObject<{ collection: z.ZodString; key: z.ZodString; data: T; }, z.core.$strict>; /** * Represents the context of a document operation within a collection. * * @template T - The type of data associated with the document. */ export interface DocContext { /** * The name of the collection where the document is stored. */ collection: Collection; /** * The key identifying the document within the collection. */ key: Key; /** * The data associated with the document operation. */ data: T; } /** * @see OnSetDocContext */ export declare const OnSetDocContextSchema: z.ZodObject<{ caller: z.ZodCustom, Uint8Array>; data: z.ZodObject<{ collection: z.ZodString; key: z.ZodString; data: z.ZodObject<{ before: z.ZodOptional, Uint8Array>; data: z.ZodCustom, Uint8Array>; description: z.ZodOptional; created_at: z.ZodBigInt; updated_at: z.ZodBigInt; version: z.ZodOptional; }, z.core.$strict>>; after: z.ZodObject<{ owner: z.ZodCustom, Uint8Array>; data: z.ZodCustom, Uint8Array>; description: z.ZodOptional; created_at: z.ZodBigInt; updated_at: z.ZodBigInt; version: z.ZodOptional; }, z.core.$strict>; }, z.core.$strict>; }, z.core.$strict>; }, z.core.$strict>; /** * The context provided to the `onSetDoc` hook. * * This context contains information about the document being created or updated, * along with details about the user who triggered the operation. */ export type OnSetDocContext = HookContext>; /** * @see OnSetManyDocsContext */ export declare const OnSetManyDocsContextSchema: z.ZodObject<{ caller: z.ZodCustom, Uint8Array>; data: z.ZodArray, Uint8Array>; data: z.ZodCustom, Uint8Array>; description: z.ZodOptional; created_at: z.ZodBigInt; updated_at: z.ZodBigInt; version: z.ZodOptional; }, z.core.$strict>>; after: z.ZodObject<{ owner: z.ZodCustom, Uint8Array>; data: z.ZodCustom, Uint8Array>; description: z.ZodOptional; created_at: z.ZodBigInt; updated_at: z.ZodBigInt; version: z.ZodOptional; }, z.core.$strict>; }, z.core.$strict>; }, z.core.$strict>>; }, z.core.$strict>; /** * The context provided to the `onSetManyDocs` hook. * * This context contains information about multiple documents being created or updated * in a single operation, along with details about the user who triggered it. */ export type OnSetManyDocsContext = HookContext[]>; /** * @see OnDeleteDocContext */ export declare const OnDeleteDocContextSchema: z.ZodObject<{ caller: z.ZodCustom, Uint8Array>; data: z.ZodObject<{ collection: z.ZodString; key: z.ZodString; data: z.ZodOptional, Uint8Array>; data: z.ZodCustom, Uint8Array>; description: z.ZodOptional; created_at: z.ZodBigInt; updated_at: z.ZodBigInt; version: z.ZodOptional; }, z.core.$strict>>; }, z.core.$strict>; }, z.core.$strict>; /** * The context provided to the `onDeleteDoc` hook. * * This context contains information about a single document being deleted, * along with details about the user who triggered the operation. */ export type OnDeleteDocContext = HookContext>; /** * @see OnDeleteManyDocsContext */ export declare const OnDeleteManyDocsContextSchema: z.ZodObject<{ caller: z.ZodCustom, Uint8Array>; data: z.ZodArray, Uint8Array>; data: z.ZodCustom, Uint8Array>; description: z.ZodOptional; created_at: z.ZodBigInt; updated_at: z.ZodBigInt; version: z.ZodOptional; }, z.core.$strict>>; }, z.core.$strict>>; }, z.core.$strict>; /** * The context provided to the `onDeleteManyDocs` hook. * * This context contains information about multiple documents being deleted, * along with details about the user who triggered the operation. */ export type OnDeleteManyDocsContext = HookContext[]>; /** * @see OnDeleteFilteredDocsContext */ export declare const OnDeleteFilteredDocsContextSchema: z.ZodObject<{ caller: z.ZodCustom, Uint8Array>; data: z.ZodArray, Uint8Array>; data: z.ZodCustom, Uint8Array>; description: z.ZodOptional; created_at: z.ZodBigInt; updated_at: z.ZodBigInt; version: z.ZodOptional; }, z.core.$strict>>; }, z.core.$strict>>; }, z.core.$strict>; /** * The context provided to the `onDeleteFilteredDocs` hook. * * This context contains information about documents deleted as a result of a filter, * along with details about the user who triggered the operation. */ export type OnDeleteFilteredDocsContext = HookContext[]>; /** * @see AssertSetDocContext */ export declare const AssertSetDocContextSchema: z.ZodObject<{ caller: z.ZodCustom, Uint8Array>; data: z.ZodObject<{ collection: z.ZodString; key: z.ZodString; data: z.ZodObject<{ current: z.ZodOptional, Uint8Array>; data: z.ZodCustom, Uint8Array>; description: z.ZodOptional; created_at: z.ZodBigInt; updated_at: z.ZodBigInt; version: z.ZodOptional; }, z.core.$strict>>; proposed: z.ZodObject<{ data: z.ZodCustom, Uint8Array>; description: z.ZodOptional; version: z.ZodOptional; }, z.core.$strict>; }, z.core.$strict>; }, z.core.$strict>; }, z.core.$strict>; /** * The context provided to the `assertDeleteDoc` hook. * * This context contains information about the document being validated before * it is created or updated. If validation fails, the developer should throw an error. */ export type AssertSetDocContext = HookContext>; /** * @see AssertDeleteDocContext */ export declare const AssertDeleteDocContextSchema: z.ZodObject<{ caller: z.ZodCustom, Uint8Array>; data: z.ZodObject<{ collection: z.ZodString; key: z.ZodString; data: z.ZodObject<{ current: z.ZodOptional, Uint8Array>; data: z.ZodCustom, Uint8Array>; description: z.ZodOptional; created_at: z.ZodBigInt; updated_at: z.ZodBigInt; version: z.ZodOptional; }, z.core.$strict>>; proposed: z.ZodObject<{ version: z.ZodOptional; }, z.core.$strict>; }, z.core.$strict>; }, z.core.$strict>; }, z.core.$strict>; /** * The context provided to the `assertDeleteDoc` hook. * * This context contains information about the document being validated before * it is deleted. If validation fails, the developer should throw an error. */ export type AssertDeleteDocContext = HookContext>;