import { type TUnreachable } from '../../system/unreachable/index.mjs'; import { Memory } from '../../system/memory/index.mjs'; import { type TProperties } from '../types/properties.mjs'; import { type TSchema } from '../types/schema.mjs'; import { type TOptional } from '../types/_optional.mjs'; import { type TInfer } from '../types/infer.mjs'; import { type TNever } from '../types/never.mjs'; import { type TObject } from '../types/object.mjs'; import { type TRecord } from '../types/record.mjs'; import { type TUnion } from '../types/union.mjs'; import { type TExtendsLeft } from './extends_left.mjs'; import { type TExtendsRight } from './extends_right.mjs'; import { type TUnionToTuple } from '../engine/helpers/union.mjs'; import * as Result from './result.mjs'; type TExtendsPropertyOptional = (Left extends TOptional ? Right extends TOptional ? Result.TExtendsTrue : Result.TExtendsFalse : Result.TExtendsTrue); type TExtendsProperty = (Right extends TInfer ? Result.TExtendsFalse : TExtendsLeft extends Result.TExtendsTrueLike ? TExtendsPropertyOptional : Result.TExtendsFalse); type TExtractInferredProperties, Result extends TProperties = {}> = (Keys extends [infer Left extends PropertyKey, ...infer Right extends PropertyKey[]] ? Left extends keyof Properties ? Properties[Left] extends Result.TExtendsTrueLike ? TExtractInferredProperties : TExtractInferredProperties : TUnreachable : Result); type TExtendsPropertiesComparer = { [RightKey in keyof Right]: (RightKey extends keyof Left ? TExtendsProperty<{}, Left[RightKey], Right[RightKey]> : Right[RightKey] extends TOptional ? Right[RightKey] extends TInfer ? Result.TExtendsTrue> : Result.TExtendsTrue : Result.TExtendsFalse); }, Checked extends boolean = Properties[keyof Right] extends Result.TExtendsTrueLike ? true : false, Extracted extends TProperties = Checked extends true ? TExtractInferredProperties, Properties> : {}> = (Checked extends true ? Result.TExtendsTrue : Result.TExtendsFalse); type TExtendsProperties> = (Compared extends Result.TExtendsTrueLike ? Result.TExtendsTrue> : Result.TExtendsFalse); type TExtendsObjectToObject = (TExtendsProperties); type TRecordMergeInferred ? TUnion<[...Types, Right[Key]]> : TUnion<[Left[Key], Right[Key]]> : Right[Key]; }> = Result; type TExtendsRecordComparer = (Keys extends [infer Left extends (keyof Properties), ...infer Right extends (keyof Properties)[]] ? TExtendsLeft<{}, Properties[Left], Type> extends Result.TExtendsTrueLike ? TExtendsRecordComparer> : Result.TExtendsFalse : Result.TExtendsTrue); type TExtendsObjectToRecord, Result extends Result.TResult = TExtendsRecordComparer> = Result; export type TExtendsObject = (Right extends TRecord ? TExtendsObjectToRecord : Right extends TObject ? TExtendsObjectToObject : TExtendsRight, Right>); export declare function ExtendsObject(inferred: Inferred, left: Left, right: Right): TExtendsObject; export {};