import type { RemapObject } from 'r-assign/lib/internal'; type Constructor = new (...args: any[]) => T; type InferConstructor = T extends Constructor ? I : never; type Literal = bigint | boolean | null | number | string | undefined; type Literals = [L, ...L[]]; type InferLiterals< L extends Literal, T extends Literals > = T extends (infer S)[] ? S : never; type PartialUndefined = { [P in keyof T]?: T[P] | undefined; }; type TypeGuard = ((value?: any) => value is T) & {}; type CompositeTypeGuard = T extends never ? never : TypeGuard; type AnyTag = { any: true }; type AnyTypeGuard = TypeGuard & AnyTag; type OptionalTag = { optional: true }; type OptionalTypeGuard = TypeGuard & OptionalTag; type RestTag = { rest: true }; type RestTypeGuard = TypeGuard<(T | unknown)[]> & RestTag; type BaseTypeGuard = T extends OptionalTypeGuard ? never : T extends RestTypeGuard ? never : T; type InferTypeGuard = G extends OptionalTypeGuard ? T : G extends TypeGuard ? T : never; type InferRestTypeGuard = G extends RestTypeGuard< infer T > ? T[] : never; type Intersection = [TypeGuard, TypeGuard, ...TypeGuard[]]; type InferIntersection = T extends [infer F, infer S] ? F extends TypeGuard ? S extends TypeGuard ? InferTypeGuard & InferTypeGuard extends infer I ? RemapObject : never : never : never : T extends [infer F, infer S, ...infer R] ? F extends TypeGuard ? S extends TypeGuard ? R extends TypeGuard[] ? [ TypeGuard & InferTypeGuard>, ...R ] extends infer I ? I extends Intersection ? InferIntersection : never : never : never : never : never : never; type InferPromise = Promise>; type Stringify = T extends TypeGuard ? `${InferTypeGuard}` : T extends Literal ? `${T}` : never; type TemplateLiteral = (TypeGuard | L)[] | []; type InferTemplateLiteral = T extends [] ? '' : T extends [infer G] ? Stringify : T extends [infer H, ...infer R] ? H extends TypeGuard ? O extends object ? never : R extends TemplateLiteral ? `${Stringify}${InferTemplateLiteral}` : never : H extends Literal ? R extends TemplateLiteral ? `${Stringify}${InferTemplateLiteral}` : never : never : never; type Tuple = TypeGuard[] | []; type InferTupleWithRest = T extends [] ? [] : T extends [infer G] ? G extends OptionalTypeGuard ? never : G extends RestTypeGuard ? never : G extends TypeGuard ? [InferTypeGuard] : never : T extends [infer H, ...infer R] ? H extends OptionalTypeGuard ? never : H extends RestTypeGuard ? never : H extends TypeGuard ? R extends Tuple ? [InferTypeGuard, ...InferTupleWithRest] : never : never : never; type InferTupleWithOptional = T extends [] ? [] : T extends [infer G] ? G extends OptionalTypeGuard ? [InferTypeGuard?] : G extends RestTypeGuard ? InferRestTypeGuard : never : T extends [infer H, ...infer R] ? H extends OptionalTypeGuard ? R extends Tuple ? [InferTypeGuard?, ...InferTupleWithOptional] : never : H extends RestTypeGuard ? R extends Tuple ? [...InferRestTypeGuard, ...InferTupleWithRest] : never : never : never; type InferTuple = T extends [] ? [] : T extends [infer G] ? G extends OptionalTypeGuard ? [InferTypeGuard?] : G extends RestTypeGuard ? InferRestTypeGuard : G extends TypeGuard ? [InferTypeGuard] : never : T extends [infer H, ...infer R] ? H extends OptionalTypeGuard ? R extends Tuple ? [InferTypeGuard?, ...InferTupleWithOptional] : never : H extends RestTypeGuard ? R extends Tuple ? [...InferRestTypeGuard, ...InferTupleWithRest] : never : H extends TypeGuard ? R extends Tuple ? [InferTypeGuard, ...InferTuple] : never : never : never; type InferFunction = (( ...args: InferTuple ) => InferTypeGuard) & {}; type InferAsyncFunction = (( ...args: InferTuple ) => Promise>) & {}; type Shape = Record; type KeysOfType = { [K in keyof T]: T[K] extends U ? K : never; }[keyof T]; type OptionalShape = { [P in keyof (Omit & Partial>)]: P extends keyof S ? S[P] extends RestTypeGuard ? never : InferTypeGuard : never; } & {}; type InferShape< S extends Shape, M extends TypeGuard> | undefined = undefined > = RemapObject< OptionalShape> & (M extends undefined ? {} : M extends TypeGuard ? InferTypeGuard> : never) >; type Union = [TypeGuard, TypeGuard, ...TypeGuard[]]; type InferUnion = T extends TypeGuard[] ? U : never; type RefineFunction = (value: T) => T; export * from 'r-assign/lib/any'; export * from 'r-assign/lib/array'; export * from 'r-assign/lib/assert-type'; export * from 'r-assign/lib/bigint'; export * from 'r-assign/lib/boolean'; export * from 'r-assign/lib/date'; export * from 'r-assign/lib/function'; export * from 'r-assign/lib/get-type'; export * from 'r-assign/lib/instance'; export * from 'r-assign/lib/intersection'; export * from 'r-assign/lib/literal'; export * from 'r-assign/lib/never'; export * from 'r-assign/lib/null'; export * from 'r-assign/lib/number'; export * from 'r-assign/lib/object'; export * from 'r-assign/lib/optional'; export * from 'r-assign/lib/parse-type'; export * from 'r-assign/lib/partial'; export * from 'r-assign/lib/promise'; export * from 'r-assign/lib/record'; export * from 'r-assign/lib/required'; export * from 'r-assign/lib/same'; export * from 'r-assign/lib/string'; export * from 'r-assign/lib/symbol'; export * from 'r-assign/lib/template-literal'; export * from 'r-assign/lib/tuple'; export * from 'r-assign/lib/undefined'; export * from 'r-assign/lib/union'; export type { AnyTypeGuard, AnyTypeGuard as ATG, BaseTypeGuard, BaseTypeGuard as BTG, CompositeTypeGuard, CompositeTypeGuard as CTG, Constructor, InferAsyncFunction, InferAsyncFunction as InferAF, InferConstructor, InferConstructor as InferC, InferFunction, InferFunction as InferF, InferIntersection, InferIntersection as InferInt, InferLiterals, InferLiterals as InferL, InferPromise, InferPromise as InferP, InferShape, InferShape as InferS, InferTemplateLiteral, InferTemplateLiteral as InferTL, InferTuple, InferTuple as InferT, InferTypeGuard, InferTypeGuard as InferTG, InferUnion, InferUnion as InferU, Intersection, Literal, Literals, OptionalTypeGuard, OptionalTypeGuard as OTG, PartialUndefined, PartialUndefined as PU, RefineFunction, RefineFunction as RF, RestTypeGuard, RestTypeGuard as RTG, Shape, TemplateLiteral, TemplateLiteral as TL, Tuple, TypeGuard, TypeGuard as TG, Union };