import { type TSchema } from '../types/schema.mjs'; import { type TProperties } from '../types/properties.mjs'; import { type TArray } from '../types/array.mjs'; import { type TTuple } from '../types/tuple.mjs'; import { type TExtendsLeft } from './extends_left.mjs'; import { type TExtendsRight } from './extends_right.mjs'; import * as Result from './result.mjs'; import { type TInstantiateElements } from '../engine/instantiate.mjs'; import { type TState } from '../engine/instantiate.mjs'; import { type TTryRestInferable, type TTryInferable, type TInferable, type TInferTupleResult, type TInferUnionResult } from './inference.mjs'; type TReverse = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TReverse : Result); type TApplyReverse = Reversed extends true ? TReverse : Types; type TReversed : undefined, Result extends boolean = Inferable extends TSchema ? true : false> = Result; type TElementsCompare = (TExtendsLeft extends Result.TExtendsTrueLike ? TElements : Result.TExtendsFalse); type TElementsLeft> = (Inferable extends TInferable ? TInferTupleResult, Inferable['type']> : LeftRest extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TElementsCompare : Result.TExtendsFalse); type TElementsRight = (RightRest extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TElementsLeft : LeftRest['length'] extends 0 ? Result.TExtendsTrue : Result.TExtendsFalse); type TElements = TElementsRight; type TExtendsTupleToTuple, Right>, Reversed extends boolean = TReversed> = TElements, TApplyReverse>; type TExtendsTupleToArrayReduce = (Left extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TExtendsLeft extends Result.TExtendsTrueLike ? TExtendsTupleToArrayReduce : Result.TExtendsFalse : Result.TExtendsTrue); type TExtendsTupleToArray> = (Inferrable extends TInferable ? TInferUnionResult : TExtendsTupleToArrayReduce); export type TExtendsTuple, Left>> = (Right extends TTuple ? TExtendsTupleToTuple : Right extends TArray ? TExtendsTupleToArray : TExtendsRight, Right>); export declare function ExtendsTuple(inferred: Inferred, left: Left, right: Right): TExtendsTuple; export {};