import { TObject, TInteger, TOptional, TSchema, ObjectOptions, TIntersect, TUnion, type TRecord } from '@sinclair/typebox'; import { Validator, DataValidatorMap, Ajv } from '@feathersjs/schema'; export * from '@sinclair/typebox'; export * from './default-schemas'; export type TDataSchemaMap = { create: TObject; update?: TObject; patch?: TObject; }; /** * Returns a compiled validation function for a TypeBox object and AJV validator instance. * * @param schema The JSON schema definition * @param validator The AJV validation instance * @returns A compiled validation function */ export declare const getValidator: (schema: TObject | TIntersect | TUnion | TRecord, validator: Ajv) => Validator; /** * Returns compiled validation functions to validate data for the `create`, `update` and `patch` * service methods. If not passed explicitly, the `update` validator will be the same as the `create` * and `patch` will be the `create` validator with no required fields. * * @param def Either general TypeBox object definition or a mapping of `create`, `update` and `patch` * to their respective type object * @param validator The Ajv instance to use as the validator * @returns A map of validator functions */ export declare const getDataValidator: (def: TObject | TDataSchemaMap, validator: Ajv) => DataValidatorMap; /** * A TypeBox utility that converts an array of provided strings into a string enum. * @param allowedValues array of strings for the enum * @returns TypeBox.Type */ export declare function StringEnum(allowedValues: [...T], options?: { default: T[number]; }): import("@sinclair/typebox").TUnsafe; /** * Creates the `$sort` Feathers query syntax schema for an object schema * * @param schema The TypeBox object schema * @returns The `$sort` syntax schema */ export declare function sortDefinition(schema: T): TObject<{ [K in keyof T["properties"]]: TOptional; }>; /** * Returns the standard Feathers query syntax for a property schema, * including operators like `$gt`, `$lt` etc. for a single property * * @param def The property definition * @param extension Additional properties to add to the property query * @returns The Feathers query syntax schema */ export declare const queryProperty: (def: T, extension?: X) => TOptional; $nin: T | import("@sinclair/typebox").TArray; }>, TObject]>>]>>; /** * Creates a Feathers query syntax schema for the properties defined in `definition`. * * @param definition The properties to create the Feathers query syntax schema for * @param extensions Additional properties to add to a property query * @returns The Feathers query syntax schema */ export declare const queryProperties: (definition: T, extensions?: X) => TOptional; $nin: T["properties"][K] | import("@sinclair/typebox").TArray; }>, TObject]>>]>>; }>>; /** * Creates a TypeBox schema for the complete Feathers query syntax including `$limit`, $skip`, `$or` * and `$sort` and `$select` for the allowed properties. * * @param type The properties to create the query syntax for * @param extensions Additional properties to add to the query syntax * @param options Options for the TypeBox object schema * @returns A TypeBox object representing the complete Feathers query syntax for the given properties */ export declare const querySyntax: (type: T, extensions?: X, options?: ObjectOptions) => TIntersect<[import("@sinclair/typebox").TPartial; }>; $select: import("@sinclair/typebox").TUnsafe<(keyof T["properties"])[]>; $and: import("@sinclair/typebox").TArray; $nin: T["properties"][K_1] | import("@sinclair/typebox").TArray; }>, TObject]>>]>>; }>>, TObject<{ $or: import("@sinclair/typebox").TArray; $nin: T["properties"][K_1] | import("@sinclair/typebox").TArray; }>, TObject]>>]>>; }>>>; }>]>>; $or: import("@sinclair/typebox").TArray; $nin: T["properties"][K_1] | import("@sinclair/typebox").TArray; }>, TObject]>>]>>; }>>>; }>>, TOptional; $nin: T["properties"][K_1] | import("@sinclair/typebox").TArray; }>, TObject]>>]>>; }>>]>; export declare const ObjectIdSchema: () => TUnion<[import("@sinclair/typebox").TString, TObject<{}>]>;