import type { TSchema } from '../schema/index'; import type { Ensure } from '../helpers/index'; import { OptionalKind } from '../symbols/index'; import type { TMappedResult } from '../mapped/index'; import { type TOptionalFromMappedResult } from './optional-from-mapped-result'; type TRemoveOptional = T extends TOptional ? S : T; type TAddOptional = T extends TOptional ? TOptional : Ensure>; export type TOptionalWithFlag = F extends false ? TRemoveOptional : TAddOptional; export type TOptional = T & { [OptionalKind]: 'Optional'; }; /** `[Json]` Creates a Optional property */ export declare function Optional(schema: T, enable: F): TOptionalFromMappedResult; /** `[Json]` Creates a Optional property */ export declare function Optional(schema: T, enable: F): TOptionalWithFlag; /** `[Json]` Creates a Optional property */ export declare function Optional(schema: T): TOptionalFromMappedResult; /** `[Json]` Creates a Optional property */ export declare function Optional(schema: T): TOptionalWithFlag; export {};