UNPKG

spaps-types

Version:

Shared TypeScript types for SPAPS ecosystem

29 lines 1.55 kB
import { z } from 'zod'; declare const defaultMetadataSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>; /** * Factory for secure message creation payload schemas. * Consumers can pass a custom metadata schema to get typed inference. */ export declare const createSecureMessageRequestSchema: <MetadataSchema extends z.ZodTypeAny = typeof defaultMetadataSchema>(metadataSchema?: MetadataSchema) => z.ZodObject<{ patientId: z.ZodString; practitionerId: z.ZodString; content: z.ZodString; metadata: z.ZodOptional<MetadataSchema>; }, z.core.$strip>; /** * Factory for secure message response schemas. * Allows callers to reuse a metadata schema so inference stays in sync across stack. */ export declare const secureMessageSchema: <MetadataSchema extends z.ZodTypeAny = typeof defaultMetadataSchema>(metadataSchema?: MetadataSchema) => z.ZodObject<{ id: z.ZodString; application_id: z.ZodString; patient_id: z.ZodString; practitioner_id: z.ZodString; content: z.ZodString; metadata: MetadataSchema; created_at: z.ZodString; }, z.core.$strip>; export type CreateSecureMessageInput<MetadataSchema extends z.ZodTypeAny = typeof defaultMetadataSchema> = z.infer<ReturnType<typeof createSecureMessageRequestSchema<MetadataSchema>>>; export type SecureMessageOutput<MetadataSchema extends z.ZodTypeAny = typeof defaultMetadataSchema> = z.infer<ReturnType<typeof secureMessageSchema<MetadataSchema>>>; export { defaultMetadataSchema as secureMessageMetadataSchema }; //# sourceMappingURL=secureMessages.d.ts.map