import type { M } from "ts-algebra"; import type { DeserializationPattern, JSONSchema } from "../definitions"; import type { And, DoesExtend } from "../type-utils"; import type { AllOfSchema, ParseAllOfSchema } from "./allOf"; import type { AnyOfSchema, ParseAnyOfSchema } from "./anyOf"; import type { ConstSchema, ParseConstSchema } from "./const"; import type { DeserializeSchema } from "./deserialize"; import type { EnumSchema, ParseEnumSchema } from "./enum"; import type { IfThenElseSchema, ParseIfThenElseSchema } from "./ifThenElse"; import type { MultipleTypesSchema, ParseMultipleTypesSchema } from "./multipleTypes"; import type { NotSchema, ParseNotSchema } from "./not"; import type { NullableSchema, ParseNullableSchema } from "./nullable"; import type { OneOfSchema, ParseOneOfSchema } from "./oneOf"; import type { ParseReferenceSchema, ReferencingSchema } from "./references"; import type { ParseSingleTypeSchema, SingleTypeSchema } from "./singleType"; export type ParseSchemaOptions = { parseNotKeyword: boolean; parseIfThenElseKeywords: boolean; keepDefaultedPropertiesOptional: boolean; rootSchema: JSONSchema; references: Record; deserialize: DeserializationPattern[] | false; }; export type ParseSchema : SCHEMA extends ReferencingSchema ? ParseReferenceSchema : And, DoesExtend> extends true ? SCHEMA extends IfThenElseSchema ? ParseIfThenElseSchema : never : And, DoesExtend> extends true ? SCHEMA extends NotSchema ? ParseNotSchema : never : SCHEMA extends AllOfSchema ? ParseAllOfSchema : SCHEMA extends OneOfSchema ? ParseOneOfSchema : SCHEMA extends AnyOfSchema ? ParseAnyOfSchema : SCHEMA extends EnumSchema ? ParseEnumSchema : SCHEMA extends ConstSchema ? ParseConstSchema : SCHEMA extends MultipleTypesSchema ? ParseMultipleTypesSchema : SCHEMA extends SingleTypeSchema ? ParseSingleTypeSchema : M.Any> = OPTIONS extends { deserialize: DeserializationPattern[]; } ? M.$Intersect, RESULT> : RESULT;