@ibnlanre/types

Search for an npm package

@ibnlanre/types

module "@ibnlanre/types" {

Returns the absolute value of a number.

more
less

@param — - The number to get the absolute value of.

@returns — The absolute value of the number.

@example — ```ts import { Absolute } from "@ibnlanre/types";

type Test = Absolute<-5>; // ^? 5

export type Absolute<Number extends number> = import(Math).Absolute<Number>
Referenced by
  • TAbsolute

Adds two numbers.

more
less

@param — - The number to add to.

@param — - The number to add.

@returns — The sum of the two numbers.

export type Add<Augend extends number, Addend extends number> = import(Math).Add<Augend, Addend>
Referenced by
export type Addition<Numbers extends number[]> = import(Math).Addition<Numbers>
Referenced by
export type Anchor<List extends unknown[]> = List extends [infer Shank extends unknown, ...infer Rest extends unknown[]] ? AnchorHelper<Shuffle<Rest>, Shank> : List
Referenced by
Unexported symbols referenced here
type AnchorHelper<List extends unknown[][], Shank extends unknown, Result extends unknown[] = []> = List extends AnchorStructure<infer First, infer Rest> ? AnchorHelper<Rest, Shank, [...Result, Insert<First, 0, Shank>]> : Result
Referenced by
type AnchorStructure<List extends unknown[], Rest extends unknown[][]> = [List, ...Rest]
Referenced by

A type representing the result of a bitwise AND operation.

more
less

@param — - The first bit to AND.

@param — - The second bit to AND.

@returns — The result of the AND operation.

@example — ```ts import { And } from "@ibnlanre/types";

type Test = And<0, 1>; // ^? 0

export type And<Left extends Bit, Right extends Bit> = AndHelper[Left][Right]
Referenced by
Unexported symbols referenced here
type AndHelper = FourBitSquareMatrix<[0, 0, 0, 1]>
Referenced by
export type AnyExtend<List extends unknown[], Element extends unknown> = List extends [infer Head, ...infer Rest] ? [Head] extends [Element] ? 1 : AnyExtend<Rest, Element> : 0
Referenced by
export type Append<Text extends string, Segment extends string> = `${Text}${Segment}`
Referenced by
export type Apply<Callback extends Fn, List extends NonEmptyArray<Arguments<Callback>>> = (Callback & {
args: Select<Callback["slot"], List>;
})["data"]
Referenced by
export type ArrayOf<Length extends number, Element extends unknown = any> = ArrayOfHelper<Length, Element>
Referenced by
Unexported symbols referenced here
type ArrayOfHelper<Length extends number, Element extends unknown, Result extends unknown[] = []> = Result["length"] extends Length ? Result : ArrayOfHelper<Length, Element, [Element, ...Result]>
Referenced by
export type Arrays = any[] | readonly any[]
Referenced by
export type Assign<ObjectType extends Dictionary, PathType extends Paths<ObjectType> | ArbitraryKey<number> = "", ValueType extends any = never> = PathType extends keyof ObjectType | `${infer Head}.${string}` | "" ? Head extends keyof ObjectType ? Setter<ObjectType, Stringify<PathType>, ValueType> : Intersect<Setter<ObjectType, Stringify<PathType>, ValueType> & ObjectFromPath<Stringify<PathType>, ValueType>> : [ValueType] extends [never] ? Setter<ObjectType, Stringify<PathType>> : ObjectType extends Dictionary ? {
[Key in keyof ObjectType | PathType]: Key extends keyof ObjectType ? ObjectType[Key] : ValueType;
} : ObjectType
Referenced by
Unexported symbols referenced here
type Setter<ObjectType extends Dictionary, PathType extends string, ValueType = never> = Intersect<{
[Key in RequiredKeys<ObjectType> as [ValueType] extends [never] ? Exclude<Key, PathType> : Key]: AssignHelper<ObjectType, PathType, Key, ValueType>;
} & {
[Key in OptionalKeys<ObjectType> as [ValueType] extends [never] ? Exclude<Key, PathType> : Key]?: AssignHelper<ObjectType, PathType, Key, ValueType>;
}>
Referenced by
type AssignHelper<ObjectType extends Dictionary, PathType extends string, Key extends string, ValueType = never> = PathType extends `${Key}.${infer Rest}` ? ObjectType[Key] extends infer ObjectType ? ObjectType extends Dictionary ? Assign<ObjectType, Rest, ValueType> : Assign<ObjectFromPath<Rest, ValueType>> : never : PathType extends Key ? ValueType : ObjectType[Key] extends Dictionary ? Assign<ObjectType[Key]> : ObjectType[Key]
Referenced by
export type Bit = 0 | 1
export namespace Bit {
export type BitMap<False = unknown, True = unknown> = {
0: False;
1: True;
}
Referenced by
export type FourBitRowVector = [Bit, Bit, Bit, Bit]
Referenced by
export type FourBitSquareMatrix<Nibble extends FourBitRowVector> = BitMap<BitMap<Nibble[0], Nibble[1]>, BitMap<Nibble[2], Nibble[3]>>
Referenced by
}
Referenced by
export type Branch<Comparison extends ComparisonResult, Positive extends number, Zero extends number, Negative extends number> = Branch$1<Comparison, Positive, Zero, Negative>
Referenced by
export type Buffers = SharedArrayBuffer | SharedArrayBufferConstructor | Atomics
export type Call<Callback extends Fn> = (Callback & {
args: Callback["slot"];
})["data"]
Referenced by
export type Ceil<Value extends number> = CeilHelper<Value>
Referenced by
Unexported symbols referenced here
type CeilHelper<Value extends number, DecimalPart extends number = Mod<Value, 1>, IntegerPart extends number = Subtract<Value, DecimalPart>> = DecimalPart extends 0 ? Value : `${Value}` extends `-${number}` ? IntegerPart : Add<IntegerPart, 1>
Referenced by
export type Circle<List extends unknown[], Result extends unknown[][] = []> = Size<Result> extends Size<List> ? Result : Circle<RotateLeft<List>, [...Result, List]>
Referenced by
export type Clamp<Value extends number, LowerBound extends number, UpperBound extends number> = import(Math).Clamp<Value, LowerBound, UpperBound>
Referenced by
export type Collect<ObjectType extends Dictionary, PickType extends Dictionary<string, Paths<ObjectType>> | Paths<ObjectType>[] | Paths<ObjectType>> = Unionize<PickType extends Paths<ObjectType>[] ? ArrayHelper<ObjectType, PickType> : PickType extends Dictionary<string, Paths<ObjectType>> ? ObjectHelper<ObjectType, PickType> : PickType extends Paths<ObjectType> ? StringHelper<ObjectType, PickType> : never>
Referenced by
Unexported symbols referenced here
type ArrayHelper<ObjectType extends Dictionary, PickType extends Paths<ObjectType>[]> = {
[Key in PickType[number]]: Get<ObjectType, Key>;
}
Referenced by
type ObjectHelper<ObjectType extends Dictionary, PickType extends Dictionary<string, Paths<ObjectType>>> = {
[Key in keyof PickType]: Get<ObjectType, PickType[Key]>;
}
Referenced by
type StringHelper<ObjectType extends Dictionary, PickType extends string> = {
[Key in PickType]: Get<ObjectType, Key>;
}
Referenced by
export type Combine<Source extends Dictionary[]> = CombineHelper<Source>
Referenced by
Unexported symbols referenced here
type CombineHelper<Source extends Dictionary[], Result extends Dictionary = {}> = Source extends [infer Head extends Dictionary, ...infer Rest extends Dictionary[]] ? CombineHelper<Rest, Merge<Result, Head>> : Source extends Dictionary ? Merge<Result, Source> : Result
Referenced by

Compares two numbers.

more
less

@description — The result of the comparison is:

  • 0 if the two numbers are equal.
  • 1 if the first number is greater than the second number.
  • -1 if the first number is less than the second number.

@param — - The left side of the comparison.

@param — - The right side of the comparison.

@returns — The result of the comparison.

export type Compare<Left extends number, Right extends number> = Compare$1<Left, Right>
Referenced by
export type Concat<Left extends unknown[], Right extends unknown[]> = [...Left, ...Right]
Referenced by
export type Contains<Text extends string, Segment extends Serializable> = Text extends `${string}${Segment}${string}` ? 1 : 0
Referenced by
export type Count<List extends unknown[], Value extends unknown> = List extends [] ? 0 : List extends [infer Head, ...infer Rest] ? IsExact<Head, Value> extends 1 ? Add$1<1, Count<Rest, Value>> : Count<Rest, Value> : 0
Referenced by
export type Decrement<Number extends number> = Subtract<Number, 1>
Referenced by
export type DeepPartial<ObjectType extends Dictionary, PathType extends ArbitraryKey | Paths<ObjectType> = never> = [PathType] extends [never] ? {
[Key in Keys<ObjectType>]?: DeepPartialHelper<ObjectType, PathType, Key>;
} : ObjectType extends Dictionary ? Intersect<{
[Key in Exclude<RequiredKeys<ObjectType>, PathType>]: DeepPartialHelper<ObjectType, PathType, Key>;
} & {
[Key in Exclude<OptionalKeys<ObjectType>, PathType>]?: DeepPartialHelper<ObjectType, PathType, Key>;
} & {
[Key in IncludeKeys<ObjectType, PathType>]?: DeepPartialHelper<ObjectType, PathType, Key>;
}> : ObjectType
Referenced by
Unexported symbols referenced here
type DeepPartialHelper<ObjectType extends Dictionary, PathType extends string, Key extends string> = ObjectType[Key] extends Dictionary ? [PathType] extends [never] ? DeepPartial<ObjectType[Key]> : PathType extends `${Key}.${infer Rest}` ? DeepPartial<ObjectType[Key], Rest> : DeepPartial<ObjectType[Key], ""> : ObjectType[Key]
Referenced by
export type DeepRequired<ObjectType extends Dictionary, PathType extends ArbitraryKey | Paths<ObjectType> = never> = [PathType] extends [never] ? {
[Key in Keys<ObjectType>]: RequireValue<DeepRequiredHelper<ObjectType, PathType, Key>>;
} : ObjectType extends Dictionary ? Intersect<{
[Key in Exclude<RequiredKeys<ObjectType>, PathType>]: DeepRequiredHelper<ObjectType, PathType, Key>;
} & {
[Key in Exclude<OptionalKeys<ObjectType>, PathType>]?: DeepRequiredHelper<ObjectType, PathType, Key>;
} & {
[Key in IncludeKeys<ObjectType, PathType>]: RequireValue<DeepRequiredHelper<ObjectType, PathType, Key>>;
}> : ObjectType
Referenced by
Unexported symbols referenced here
type DeepRequiredHelper<ObjectType extends Dictionary, PathType extends string, Key extends string> = ObjectType[Key] extends Dictionary ? [PathType] extends [never] ? DeepRequired<ObjectType[Key]> : PathType extends `${Key}.${infer Rest}` ? DeepRequired<ObjectType[Key], Rest> : DeepRequired<ObjectType[Key], ""> : ObjectType[Key]
Referenced by
export type Derivatives = RegExp | Date | JSON
Referenced by
export type Dictionary<Key extends PropertyKey = string, Type extends unknown = unknown> = Record<Key, Type>
Referenced by
export type Diff<Left extends Dictionary, Right extends Dictionary> = Merge<Pick<Left, Exclude<keyof Left, keyof Right>>, Pick<Right, Exclude<keyof Right, keyof Left>>>
Referenced by
export type Digit = Tuple[number]
export namespace Digit {

Stringified digit.

export type String = `${Digit}`
Referenced by

Serialized digits of numbers.

export type Serialized = `${number}`
Referenced by

Negative digit.

export type Negative = Negate$1<Digit>

@category — Digit

more
less

@namespace — Negative

@public —

export namespace Negative {
export type String = `${Negative}`
Referenced by
}
Referenced by

Signed digit.

export type Signed = Digit | Negative

@category — Digit

more
less

@namespace — Signed

@public —

export namespace Signed {
export type String = `${Signed}`
Referenced by
}
Referenced by

Tuple of digits.

export type Tuple = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

@category — Digit

more
less

@namespace — Tuple

@public —

export namespace Tuple {
export type Negative = UnionToTuple<import(Digit).Negative>
export namespace Negative {
export type String = UnionToTuple<import(import(Digit).Negative).String>
Referenced by
}
Referenced by
export type Signed = UnionToTuple<import(Digit).Signed>
export namespace Signed {
export type String = UnionToTuple<import(import(Digit).Signed).String>
Referenced by
}
Referenced by
}
Referenced by
}
Referenced by
export type Divide<Dividend extends number, Divisor extends number, Type extends TypeOptions = "Integer"> = Type extends "Integer" ? import(Math).Divide<Dividend, Divisor> : Type extends "Euclidean" ? EuclideanDivision<Dividend, Divisor> : Type extends "Truncating" ? TruncatingDivision<Dividend, Divisor> : Type extends "Floored" ? FlooredDivision<Dividend, Divisor> : never
Referenced by
Unexported symbols referenced here
type TypeOptions = "Euclidean" | "Truncating" | "Floored" | "Integer"
Referenced by
type EuclideanDivision<Dividend extends number, Divisor extends number> = Multiply<Signum<Divisor>, Floor$1<Divide<Dividend, Absolute<Divisor>>>>
Referenced by
type TruncatingDivision<Dividend extends number, Divisor extends number> = Trunc<Divide<Dividend, Divisor>>
Referenced by
type FlooredDivision<Dividend extends number, Divisor extends number> = Floor$1<Divide<Dividend, Divisor>>
Referenced by
export type Division<Numbers extends number[]> = import(Math).Division<Numbers>
Referenced by
export type Drop<List extends unknown[], Index extends number> = [...SliceTo<List, Index>, ...SliceFrom<List, Add$1<Index, 1>>]
Referenced by
export type Elements<List extends any[]> = List[number]
Referenced by
export type ElseIf<Comparison extends Bit, Positive extends unknown = never, Zero extends unknown = never> = If<Comparison, Positive, Zero>
Referenced by
export type EmptyObject = Record<PropertyKey, never>
export type EndsWith<Text extends string, Segment extends Serializable> = Text extends `${string}${Segment}` ? 1 : 0
Referenced by
export type Entries<List extends unknown[]> = UnionToTuple<{
[Key in Exclude<keyof List, keyof any[]>]: [ParseInt<Key>, List[Key]];
}[Exclude<keyof List, keyof any[]>]> extends infer Result extends unknown[][] ? Result : never
Referenced by
export type Equal<Left extends number, Right extends number> = Equal$1<Left, Right>
Referenced by
export type Errors = Error | ErrorConstructor | EvalError | RangeError | ReferenceError | SyntaxError | TypeError | URIError
export type Events = Event | ErrorEvent | DOMException | CustomEvent | EventTarget | EventListener | EventListenerObject | EventListenerOrEventListenerObject | EventListenerOptions
export type Every<Callback extends Fn, List extends Arguments<Callback>[]> = List extends [] ? 1 : List extends [infer Element extends Arguments<Callback>, ...infer Rest extends Arguments<Callback>[]] ? Apply<Callback, [Element]> extends 1 ? Every<Callback, Rest> : 0 : 0
Referenced by
export type ExcludeKeys<ObjectType extends Dictionary, PathType extends ArbitraryKey | Paths<ObjectType> = never> = Exclude<Keys<ObjectType>, PathType>
Referenced by
export type Expand<List extends unknown[]> = List extends [infer Head, ...infer Tail] ? Head extends unknown[] ? [Expand<Head>, ...Expand<Tail>] : [Head, ...Expand<Tail>] : []
Referenced by
export type ExtractNestedKeys<Text extends string, Delimiter extends string = "."> = Text extends `${string}${Delimiter}${infer Segment}` ? Segment : Text
Referenced by
export type ExtractRootKey<Text extends string, Delimiter extends string = "."> = Text extends `${infer Segment}${Delimiter}${string}` ? Segment : Text
Referenced by
export type FallbackTo<ActualValue, FallbackValue, PreventableValue = undefined> = [PreventableValue] extends [ActualValue] ? FallbackValue : RequireValue<ActualValue>
Referenced by
export type Filter<Callback extends Fn, List extends Arguments<Callback>[]> = List extends [infer Element extends Arguments<Callback>, ...infer Rest extends Arguments<Callback>[]] ? Apply<Callback, [Element]> extends 1 ? [Element, ...Filter<Callback, Rest>] : Filter<Callback, Rest> : []
Referenced by
export type FirstOfUnion<Union extends unknown> = FirstOfUnionHelper<Union>
Referenced by
Unexported symbols referenced here
type FirstOfUnionHelper<Union extends unknown, Result = keyof Union> = UnionToIntersection<Union extends any ? () => Union : never> extends () => infer First ? FirstOfUnionHelper<Exclude<Union, First>, First> : Result
Referenced by
export type Flat<List extends unknown[], Depth extends number = -1> = Depth extends -1 ? InfiniteFlat<List> : FiniteFlat<List, Depth>
Referenced by
Unexported symbols referenced here
type InfiniteFlat<List extends unknown[], Result extends unknown[] = []> = List extends [infer Head extends unknown[], ...infer Rest] ? InfiniteFlat<Rest, Concat<Result, Head>> : List extends [infer Head, ...infer Rest] ? InfiniteFlat<Rest, Push<Result, Head>> : Result
Referenced by
type FiniteFlat<List extends unknown[], Depth extends number = 0> = Depth extends 0 ? List : List extends [infer Head, ...infer Rest] ? Head extends unknown[] ? Concat<FiniteFlat<Head, Decrement<Depth>>, FiniteFlat<Rest, Depth>> : Unshift<FiniteFlat<Rest, Depth>, Head> : List
Referenced by
export type Flip<Pair extends [unknown, unknown]> = [Pair[1], Pair[0]]
Referenced by
export type Floor<Value extends number> = import(Math).Floor<Value>
Referenced by

Parameterized function type

more
less

@see — ://github.com/microsoft/TypeScript/issues/1213#issuecomment-1215039765

@see — ://stackoverflow.com/a/73533674

export interface Fn<Params extends Dictionary<number> = {}> extends FnArgs {
input_size: Size<TakeFromArray<this["slot"], void>>;

Field for parameters within higher-order functions

more
less

@description — This field is used to represent parameters in a higher-order function.

params: [Params[0], Params[1], Params[2], Params[3], Params[4], Params[5], Params[6], Params[7], Params[8], Params[9]];
}
export namespace Fn {

Get the arguments of a function

more
less

@param — The function to get its arguments

@returns — The arguments of the function

@example — ```ts import { Fn } from "@ibnlanre/types";

type Test = Fn.Arguments; // ^? string

export type Arguments<Callback extends Fn> = Callback["slot"] extends unknown[] ? SingleOut<MarkOut<Callback["slot"], Parameters$1<Callback>>> : never
Referenced by
Unexported symbols referenced here
type SingleOut<List extends unknown[]> = List extends [infer Value] ? Value : List
Referenced by

Mark out the void values in a list

more
less

@param — The list to mark out void values

@param — The parameters to compare with the list

@returns — The list with void values marked out

@description — - never extends void, but void does not extend never

  • If void extends the value, we return the value
type MarkOut<List extends unknown[], Params> = List extends [...infer Ls, infer Lv] ? Params extends [...infer Ts, infer Tv] ? IsVoid<Lv> extends 1 ? [...MarkOut<Ls, Ts>, Tv] : MarkOut<Ls, Ts> : [] : []
Referenced by
export type Collect<List> = List extends unknown[] ? List : [List]
Referenced by

Returns an Error object if the result from a function cannot be applied to the next function.

more
less

@summary — Returns never if the argument can be applied to all the functions passed.

@param — - The argument to be passed to the functions.

@param — - The list of functions to be applied to the argument.

@returns — An Error object if the argument cannot be applied to any of the functions passed.

export type ComposeLeft<Argument extends unknown, Callbacks extends Fn[]> = ComposeLeftHelper<Argument, Callbacks>
Referenced by
Unexported symbols referenced here
type ComposeLeftHelper<Argument extends unknown, Callbacks extends Fn[], Position extends number = 0> = Callbacks extends [infer Callback extends Fn, ...infer Rest extends Fn[]] ? Argument extends Arguments<Callback> ? ComposeLeftHelper<Apply<Callback, [Argument]>, Rest, Add$1<Position, 1>> : {
position: Position;
scenario: Error;
callback: Callback;
expected: Arguments<Callback>;
received: Argument;
} : never
Referenced by

Returns a list of functions that can accept the result of the previous function

more
less

@summary — - Omits functions that cannot be applied to the argument.

  • Starts calculating from the argument passed

@param — - The argument to be passed to the functions.

@param — - The list of functions to be applied to the argument.

@returns — A list of functions that can be applied to the argument in reverse order.

export type ComposeRight<Argument extends unknown, Callbacks extends Fn[]> = Callbacks extends [infer Callback extends Fn, ...infer Rest extends Fn[]] ? Argument extends Arguments<Callback> ? [Callback, ...ComposeRight<Apply<Callback, [Argument]>, Rest>] : [] : Callbacks
Referenced by
export type Devoid<List extends unknown[]> = DevoidHelper<List>
Referenced by
Unexported symbols referenced here
type DevoidHelper<List extends unknown[], Result extends unknown[] = []> = List extends [] ? Result : List extends [infer Head, ...infer Rest] ? IsVoid<Head> extends 1 ? DevoidHelper<Rest, Result> : DevoidHelper<Rest, [...Result, Head]> : Result
Referenced by
export interface Lambda<Input extends unknown> extends Fn {
input_size: Size<Preset<Reflect<Input>>>;
}
Referenced by
export type Parameters<Callback extends Fn> = SliceTo<Callback["params"], Size<Callback["slot"]>>
Referenced by

Returns a tuple of widened types or void.

more
less

@param — - The tuple to widen.

@returns — A tuple of widened types or void.

@example — ```ts import { Preset } from "@ibnlanre/function";

type Test = Preset<[1, "b"]>; // ^? [number | void, string | void]

type Test2 = Preset<"a">; // ^? [string | void]

export type Preset<Argument extends unknown> = Argument extends unknown[] ? Argument extends [infer Head, ...infer Rest] ? [Widen<Head> | void, ...Preset<Rest>] : [] : [Widen<Argument> | void]
Referenced by
export type Reflect<Input extends unknown> = Input extends unknown[] ? [Input] : Input
Referenced by
export type Select<Left extends unknown, Right extends unknown> = SelectHelper<Collect<Left>, Devoid<Elect<Collect<Left>, Collect<Right>>>>
Referenced by
Unexported symbols referenced here
type SelectHelper<Left extends unknown[], Right extends unknown[], Result extends unknown[] = []> = Left extends [] ? Result : Left extends Last<infer LeftRest, infer LeftTail> ? Right extends Last<infer RightRest, infer RightTail> ? IsVoid<LeftTail> extends 1 ? SelectHelper<LeftRest, RightRest, First<RightTail, Result>> : SelectHelper<LeftRest, Right, First<LeftTail, Result>> : Devoid<Concat<Left, Result>> : Result
Referenced by
type Elect<Left extends unknown[], Right extends unknown[]> = Right extends (infer Elements extends unknown[])[] ? Or<IsNever<Elements>, IsUnary<Count<Left, void>>> extends 1 ? Right : Elements : Right
Referenced by
type Last<Rest extends unknown[], Tail extends unknown> = [...Rest, Tail]
Referenced by
type First<Head extends unknown, Rest extends unknown[]> = [Head, ...Rest]
Referenced by
export type Signature<Callback extends Fn> = Elements<Arguments<Callback>>
Referenced by
}
Referenced by
Unexported symbols referenced here
interface FnArgs extends FnImpl {
0: Retrieve<this["args"], 0>;
1: Retrieve<this["args"], 1>;
2: Retrieve<this["args"], 2>;
3: Retrieve<this["args"], 3>;
4: Retrieve<this["args"], 4>;
5: Retrieve<this["args"], 5>;
6: Retrieve<this["args"], 6>;
7: Retrieve<this["args"], 7>;
8: Retrieve<this["args"], 8>;
9: Retrieve<this["args"], 9>;
}
Referenced by
interface FnImpl {

Field for arguments within higher-order functions

more
less

@description — This field is used to represent arguments in a higher-order function.

args: unknown;

A field that represents a slot.

more
less

@description — This field is used to represent arguments in a function.

slot: unknown[];

Field for the return value of functions

more
less

@description — This field is used to represent the return value of a function.

data: unknown;
}
Referenced by
export type FromEntries<EntryList extends any[][]> = {
[Key in EntryList[number][0]]: Extract<EntryList[number], [Key, any]>[1];
}
Referenced by
export type Functions = Function | FunctionConstructor | Generator | GeneratorFunction | GeneratorFunctionConstructor | AsyncGenerator | AsyncGeneratorFunction | AsyncGeneratorFunctionConstructor | Promise<any> | PromiseConstructor

Represents the value at a path in an object.

more
less

@template — The type of the object.

@template — The type of the path.

@template — The type of the delimiter.

export type Get<ObjectType extends Dictionary, Path extends Paths<ObjectType, Delimiter> | ArbitraryKey<number>, Fallback extends unknown = never, Delimiter extends string = "."> = Stringify<Path> extends Keys<ObjectType> ? ObjectType[Stringify<Path>] : Path extends `${infer Key}${Delimiter}${infer Rest}` ? ObjectType[Key] extends Dictionary ? Get<ObjectType[Key], Rest, Fallback> : Fallback : Fallback
Referenced by
export type GreaterThan<Left extends number, Right extends number> = GreaterThan$1<Left, Right>
Referenced by
export type GreaterThanOrEqual<Left extends number, Right extends number> = GreaterThanOrEqual$1<Left, Right>
Referenced by
export type Has<ObjectType extends Dictionary, Key extends string | number | symbol, Delimiter extends string = "."> = Key extends Paths<ObjectType, Delimiter> ? 1 : 0
Referenced by
export type Head<List extends unknown[]> = List extends [...infer Head extends List[number][], unknown] ? Head : never
Referenced by
export type If<Condition extends Bit, Positive extends unknown = never, Zero extends unknown = never> = Condition extends 1 ? Positive : Zero
Referenced by
export type IfNot<Condition extends ComparisonResult, Positive extends unknown = never, Zero extends unknown = never> = Condition extends 0 ? Positive : Zero
Referenced by
export type Immutable<T> = T extends infer U[] ? ImmutableArray<U> : T extends Map<infer K, infer V> ? ImmutableMap<K, V> : T extends Set<infer M> ? ImmutableSet<M> : T extends Dictionary ? ImmutableObject<T> : Readonly<T>
Referenced by
Unexported symbols referenced here
type ImmutableArray<T> = ImmutableShallow<readonly Immutable<T>[]>
Referenced by
type ImmutableMap<K, V> = Readonly<ReadonlyMap<Immutable<K>, Immutable<V>>>
Referenced by
type ImmutableSet<T> = Readonly<ReadonlySet<Immutable<T>>>
Referenced by
type ImmutableObject<T> = {
readonly [K in keyof T]: Immutable<T[K]>;
}
Referenced by
type ImmutableShallow<T> = {
readonly [K in keyof T & {}]: T[K];
}
Referenced by
export type IncludeKeys<ObjectType extends Dictionary, PathType extends ArbitraryKey | Paths<ObjectType> = never> = Extract<Keys<ObjectType>, PathType>
Referenced by
export type Includes<List extends any[], Element> = List extends [] ? 0 : List extends [infer Head, ...infer Rest] ? IsExact<Head, Element> extends 1 ? 1 : Includes<Rest, Element> : 0
Referenced by
export type Increment<Number extends number> = Add<Number, 1>
Referenced by
export type Indexable = Arrays | TypedArrays
Referenced by
export type Indices<List extends unknown[], Result extends "Tuple" | "Union" = "Union"> = Exclude<keyof List, keyof unknown[]> extends `${infer Index extends number}` ? Result extends "Tuple" ? UnionToTuple<Index> : Index : never
Referenced by
export type Insert<List extends unknown[], Index extends number, Value extends unknown> = [...SliceTo<List, Index>, Value, ...SliceFrom<List, Index>]
Referenced by
export type Intersect<ObjectType extends unknown> = {
[Key in keyof ObjectType]: ObjectType[Key] extends Dictionary ? Intersect<ObjectType[Key]> : ObjectType[Key];
} & unknown
Referenced by
export type Invoke<Input extends unknown, Callbacks extends Lambda<Input>[], Result extends unknown[] = []> = Callbacks extends [infer Callback extends Fn, ...infer Rest extends Lambda<Input>[]] ? Input extends Arguments<Callback> ? Invoke<Input, Rest, [...Result, Apply<Callback, [Input]>]> : Invoke<Input, Rest, Result> : Result
Referenced by
export type IsAny<Value extends unknown> = 0 extends 1 & Value ? 1 : 0
Referenced by
export type IsArray<Value extends unknown> = Value extends Value ? Value extends unknown[] ? 1 : 0 : never
Referenced by
export type IsBetween<Input extends number, LowerBound extends number, UpperBound extends number> = And<GreaterThanOrEqual<Input, LowerBound>, LessThanOrEqual<Input, UpperBound>>
Referenced by
export type IsDictionary<Value extends unknown> = Value extends Value ? Value extends Dictionary ? 1 : 0 : never
Referenced by

Checks if a number is even.

more
less

@param — The number to check if it is even.

@returns — 1 if the number is even, 0 otherwise.

export type IsEven<Value extends number> = import(Math).IsEven<Value>
Referenced by
export type IsExact<Left, Right> = (<T>() => T extends Left ? 1 : 0) extends <T>() => T extends Right ? 1 : 0 ? 1 : 0
Referenced by
export type IsInteger<Value extends unknown> = Value extends number ? import(Math).IsInteger<Value> : 0
Referenced by
export type IsIntersection<Value> = IsIntersectionHelper<Value, Intersect<Value>>
Referenced by
Unexported symbols referenced here
type IsIntersectionHelper<Left, Right> = (<T>() => T extends Left & T ? 1 : 0) extends <T>() => T extends Right & T ? 1 : 0 ? 0 : 1
Referenced by
export type IsNegative<Value extends number> = import(Math).IsNegative<Value>
Referenced by
export type IsNonInteger<Value extends unknown> = Value extends number ? import(Math).IsNonInteger<Value> : 0
Referenced by
export type IsObject<Value extends unknown> = Value extends Value ? Value extends Record<PropertyKey, any> ? 1 : 0 : never
Referenced by
export type IsOdd<Value extends number> = import(Math).IsOdd<Value>
Referenced by
export type IsPartial<Value> = undefined extends Value ? [Value] extends [undefined] ? 0 : 1 : 0
Referenced by
export type IsPositive<Value extends number> = import(Math).IsPositive<Value>
Referenced by
export type IsReadonly<Value> = Readonly<Value> extends Value ? true : false
Referenced by
export type IsString<Value extends unknown> = Value extends Value ? string extends Value ? 1 : Value extends string ? 1 : 0 : never
Referenced by
export type IsSubtype<Left, Right> = Left extends Right ? 1 : 0
Referenced by
export type IsSupertype<Left, Right> = Right extends Left ? 1 : 0
Referenced by
export type IsUnary<Value extends number> = Value extends 1 ? 1 : 0
Referenced by
export type IsUnion<Value> = [Value] extends UnionToTuple<Value> ? 0 : 1
Referenced by
export type IsVoid<T> = And<UnknownHelper<T>, NeverHelper<T>>
Referenced by
Unexported symbols referenced here
type UnknownHelper<T> = [T] extends [void] ? 1 : 0
Referenced by
type NeverHelper<T> = [void] extends [T] ? 1 : 0
Referenced by
export type IsZero<Value extends number> = Value extends 0 ? 1 : 0
Referenced by
export type Iterables = string | Iterable<any> | AsyncIterable<any> | IterableIterator<any> | AsyncIterableIterator<any> | Sets | Maps
export type Join<List extends any[], Separator extends string = ""> = List extends [infer Head, ...infer Rest] ? Rest extends [] ? Head : `${Stringify<Head>}${Separator}${Join$1<Rest, Separator>}` : ""
Referenced by
export type JoinKeys<RootKey extends string, Key extends string, Delimiter extends string = "."> = RootKey extends "" ? Key : `${RootKey}${Delimiter}${Key}`
Referenced by
export type Json = Member | Record<string, Member>
Referenced by
Unexported symbols referenced here
type Member = Primitive | Record<string, Primitive> | Json[]
Referenced by
type Primitive = string | number | boolean | null
Referenced by
export type Keys<ObjectType extends Dictionary> = keyof ObjectType extends undefined ? never : keyof ObjectType extends infer Keys extends string | number ? `${Keys}` : never
Referenced by
export type LastOfUnion<Union extends unknown> = UnionToIntersection<Union extends any ? () => Union : never> extends () => infer Last ? Last : never
Referenced by
export type Length<Text extends Serializable> = Split<Stringify<Text>>["length"]
Referenced by
export type LessThan<Left extends number, Right extends number> = LessThan$1<Left, Right>
Referenced by
export type LessThanOrEqual<Left extends number, Right extends number> = LessThanOrEqual$1<Left, Right>
Referenced by
export type Locate<List extends unknown, Index extends number> = List extends unknown[] ? LocateHelper<List, Index> : List extends number ? LocateHelper<ArrayOf<List>, Index> : never
Referenced by
Unexported symbols referenced here
type LocateHelper<List extends unknown[], Index extends number> = `${Index}` extends `-${infer Index extends number}` ? Subtract$1<Size<List>, Index> extends infer Index ? Index extends number ? GreaterThanOrEqual<Index, 0> extends 1 ? Index : never : never : never : Indices<List> extends infer Keys ? Index extends Keys ? Index : never : never
Referenced by
export type Map<Callback extends Fn, List extends Arguments<Callback>[]> = List extends [infer Element extends Arguments<Callback>, ...infer Rest extends Arguments<Callback>[]] ? [Apply<Callback, [Element]>, ...Map$1<Callback, Rest>] : []
Referenced by
export type Maps = Map<any, any> | WeakMap<object, any> | ReadonlyMap<any, any>
Referenced by
export namespace Math {
export type Absolute<Number extends number> = Number extends Number ? `${Number}` extends `-${infer Unsigned extends number}` ? Unsigned : Number : never
Referenced by
export type Add<Left extends number, Right extends number> = AnyExtend<[Left, Right], never> extends 1 ? never : Left extends 0 ? Right : Right extends 0 ? Left : number extends Left | Right ? number : AddNumbers<Left, Right>
Referenced by
export type AddCarryDigit<Left extends Digit, Right extends Digit, Carry extends Bit = 0> = AddCarryDigitTable[Carry][Left][Right]
Referenced by
export type AddCarryDigitTable = MakeBinaryTable<MakeTable$1<FirstRow$4, 1>, 1>
Referenced by
Unexported symbols referenced here
type FirstRow$4 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Referenced by
export type AddDigit<Left extends Digit, Right extends Digit, Carry extends Bit = 0> = AddDigitTable[Carry][Left][Right]
Referenced by
export type AddDigitTable = MakeBinaryTable<MakeTable$1<FirstRow$3>>
Referenced by
Unexported symbols referenced here
type FirstRow$3 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Referenced by
export type AddDigits<NormalisedLeft extends Digit[], NormalisedRight extends Digit[]> = AddDigitsHelper<NormalisedLeft, NormalisedRight>
Referenced by
Unexported symbols referenced here
type AddDigitsHelper<NormalisedLeft extends Digit[], NormalisedRight extends Digit[], Carry extends Bit = 0, Result extends Digit[] = []> = NormalisedLeft extends HeadDigitArray<infer NormalisedLeftChunk, infer LastLeftDigit> ? NormalisedRight extends HeadDigitArray<infer NormalisedRightChunk, infer LastRightDigit> ? AddDigitsHelper<NormalisedLeftChunk, NormalisedRightChunk, AddCarryDigit<LastLeftDigit, LastRightDigit, Carry>, [AddDigit<LastLeftDigit, LastRightDigit, Carry>, ...Result]> : AddDigitsHelper<NormalisedLeftChunk, [], AddCarryDigit<LastLeftDigit, 0, Carry>, [AddDigit<LastLeftDigit, 0, Carry>, ...Result]> : NormalisedRight extends HeadDigitArray<infer NormalisedRightChunk, infer LastRightDigit> ? AddDigitsHelper<[], NormalisedRightChunk, AddCarryDigit<0, LastRightDigit, Carry>, [AddDigit<0, LastRightDigit, Carry>, ...Result]> : Carry extends 1 ? [1, ...Result] : Result
Referenced by
export type AddDigitsOperation<Left extends Digit, Right extends Digit> = OperationResult<AddCarryDigit<Left, Right>, AddDigit<Left, Right>>
Referenced by
Unexported symbols referenced here
type OperationResult<Carry extends Digit = Digit, Result extends Digit = Digit> = [Carry, Result]
Referenced by
export type AddNumbers<Left extends number, Right extends number> = SignedFloatToNumber<AddSignedFloats<ToSignedFloat<Left>, ToSignedFloat<Right>>>
Referenced by
export type AddSignedFloats<LeftSignedDigits extends SignedFloat, RightSignedDigits extends SignedFloat> = LeftSignedDigits extends SignedFloat<infer LeftSign, infer LeftUnsignedFloat> ? RightSignedDigits extends SignedFloat<infer RightSign, infer RightUnsignedFloat> ? LeftSign extends "-" ? RightSign extends "-" ? SignedFloat<"-", AddUnsignedFloats<LeftUnsignedFloat, RightUnsignedFloat>> : NegateSignedFloat<SubtractUnsignedFloats<LeftUnsignedFloat, RightUnsignedFloat>> : RightSign extends "-" ? SubtractUnsignedFloats<LeftUnsignedFloat, RightUnsignedFloat> : SignedFloat<"+", AddUnsignedFloats<LeftUnsignedFloat, RightUnsignedFloat>> : never : never
Referenced by
export type AddUnsignedFloats<Left extends UnsignedFloat, Right extends UnsignedFloat> = Normalise<Left, Right> extends [...NumberPair<infer NormalisedLeft, infer NormalisedRight>, infer DecimalPlaces extends number] ? DigitsToUnsignedFloat<AddDigits<NormalisedLeft, NormalisedRight>, DecimalPlaces> : never
Referenced by
export type AddUnsignedIntegers<NormalisedLeft extends Digit[], NormalisedRight extends Digit[]> = NormaliseIntegerParts<NormalisedLeft, NormalisedRight> extends NumberPair<infer NormalisedLeftChunk, infer NormalisedRightChunk> ? AddDigits<NormalisedLeftChunk, NormalisedRightChunk> : never
Referenced by
export type Addition<Numbers extends number[]> = Numbers extends [infer Head extends number, ...infer Rest extends number[]] ? Add<Head, Addition<Rest>> : 0
Referenced by
export type Bigger<Left extends number, Right extends number> = number extends Left | Right ? number : Left extends Right ? Left : Right extends Left ? Right : GreaterThan$1<Left, Right> extends 1 ? Left : Right
Referenced by
export type Branch<Comparison extends ComparisonResult, Positive extends unknown = never, Zero extends unknown = never, Negative extends unknown = never> = Comparison extends 1 ? Positive : Comparison extends 0 ? Zero : Negative
Referenced by
export type Clamp<Value extends number, LowerBound extends number, UpperBound extends number> = Branch$1<Compare$1<LowerBound, Value>, LowerBound, Branch$1<Compare$1<Value, UpperBound>, UpperBound, Value>>
Referenced by
export type Compare<Left extends number, Right extends number> = AnyExtend<[Left, Right], never> extends 1 ? never : number extends Left | Right ? ComparisonResult : Left extends Left ? Right extends Right ? CompareNumbers<Left, Right> : never : never
Referenced by
export type CompareDigitTable = FlipTable$1<MakeTable>
Referenced by
Unexported symbols referenced here
type FlipTable$1<T extends ComparisonResult[][]> = T extends [...infer Head extends ComparisonResult[][], infer Tail extends ComparisonResult[]] ? [Tail, ...FlipTable$1<Head>] : []
Referenced by
type MakeTable<Row extends ComparisonResult[] = FirstRow$2, Addendum extends ComparisonResult = -1> = MakeTableHelper<[Row], Addendum>
Referenced by
type FirstRow$2 = [1, 1, 1, 1, 1, 1, 1, 1, 1, 0]
Referenced by
type MakeTableHelper<Table extends ComparisonResult[][] = [], Addendum extends ComparisonResult = never, Row extends ComparisonResult[] = LastRow<Table>> = Size<Table> extends Size<Row> ? Table : MakeTableHelper<[...Table, RowShift<Row, Addendum>], Addendum>
Referenced by
type LastRow<Table extends ComparisonResult[][]> = Table extends [...ComparisonResult[][], infer LastRow] ? LastRow : never
Referenced by
type RowShift<TableRow extends ComparisonResult[], Addendum extends ComparisonResult = never> = TableRow extends [infer Head extends ComparisonResult, ...infer Rest extends ComparisonResult[]] ? [...Rest, [Addendum] extends [never] ? Head : Addendum] : never
Referenced by
export type CompareDigits<Left extends Digit, Right extends Digit> = CompareDigitTable[Left][Right]
Referenced by
export type CompareFloatMagnitudes<Left extends UnsignedFloat, Right extends UnsignedFloat> = Normalise<Left, Right> extends [...NumberPair<infer NormalisedLeft, infer NormalisedRight>, number] ? CompareMagnitudes<NormalisedLeft, NormalisedRight> : never
Referenced by
export type CompareIntegerMagnitudes<NormalisedLeft extends Digit[], NormalisedRight extends Digit[]> = NormaliseIntegerParts<NormalisedLeft, NormalisedRight> extends NumberPair<infer NormalisedLeftChunk, infer NormalisedRightChunk> ? CompareMagnitudes<NormalisedLeftChunk, NormalisedRightChunk> : never
Referenced by
export type CompareLengths<Left extends unknown[], Right extends unknown[]> = Size<Left> extends Size<Right> ? 0 : Size<Left> extends 0 ? -1 : Size<Right> extends 0 ? 1 : CompareLengths<Head$1<Left>, Head$1<Right>>
Referenced by
export type CompareMagnitudes<NormalisedLeft extends Digit[], NormalisedRight extends Digit[]> = NormalisedLeft extends NormalisedRight ? 0 : [NormalisedLeft, NormalisedRight] extends [TailDigitArray<infer FirstLeftDigit, infer NormalisedLeftChunk>, TailDigitArray<infer FirstRightDigit, infer NormalisedRightChunk>] ? CompareDigits<FirstLeftDigit, FirstRightDigit> extends 0 ? CompareMagnitudes<NormalisedLeftChunk, NormalisedRightChunk> : CompareDigits<FirstLeftDigit, FirstRightDigit> : never
Referenced by
export type CompareNumberMagnitudes<Left extends number, Right extends number> = SplitAndNormalise<Left, Right> extends [...NumberPair<infer NormalisedLeft, infer NormalisedRight>, number] ? CompareMagnitudes<NormalisedLeft, NormalisedRight> : never
Referenced by
export type CompareNumbers<Left extends number, Right extends number> = IsPositive<Left> extends 1 ? IsPositive<Right> extends 1 ? CompareNumberMagnitudes<Left, Right> : 1 : IsPositive<Right> extends 1 ? -1 : CompareNumberMagnitudes<Right, Left>
Referenced by
export type CrossMultiply<Left extends Digit[], Right extends Digit[], Shift extends 0[] = [], PreviousRowResult extends Digit[] = []> = Right extends HeadDigitArray<infer RightHead, infer RightLastDigit> ? CrossMultiply<Left, RightHead, [...Shift, 0], NormaliseIntegerZeros<AddUnsignedIntegers<PreviousRowResult, [...MultiplyRow<Left, RightLastDigit>, ...Shift]>>> : NormaliseIntegerZeros<PreviousRowResult>
Referenced by
export type DecomposeNumber<Number extends string | number> = SeparateSign<`${Number}`> extends [infer TSign extends Sign, infer TValue extends string] ? SplitComponentParts<ScientificNotationAsDecimal<TValue>> extends NumberComponents<never, infer Integer, infer Fraction> ? NumberComponents<TSign, EmptyStringAsZero<TrimLeadingZeros<Integer>>, TrimTrailingZeros<Fraction>> : never : never
Referenced by
export type DigitsToUnsignedFloat<Normalised extends Digit[], DecimalPlaces extends number, FractionalDigits extends Digit[] = []> = Size<FractionalDigits> extends DecimalPlaces ? MakeUnsignedFloat<Normalised, FractionalDigits> : Normalised extends HeadDigitArray<infer NormalisedChunk, infer LastDigit> ? DigitsToUnsignedFloat<NormalisedChunk, DecimalPlaces, Unshift<FractionalDigits, LastDigit>> : never
Referenced by
export type Divide<Numerator extends number, Divisor extends number> = AnyExtend<[Numerator, Divisor], never> extends 1 ? never : Divisor extends 0 ? never : Numerator extends 0 ? 0 : Divisor extends 1 ? Numerator : number extends Numerator | Divisor ? number : Divisor extends -1 ? Negate<Numerator> : DivideNumbers<Numerator, Divisor>
Referenced by
export type DivideMaxDigits = 13
Referenced by
export type DivideNumbers<Numerator extends number, Divisor extends number> = SignedFloatToNumber<DivideSignedFloats<ToSignedFloat<Numerator>, ToSignedFloat<Divisor>>>
Referenced by
export type DivideSignedFloats<Numerator extends SignedFloat, Divisor extends SignedFloat> = Numerator extends SignedFloat<infer NumeratorSign, infer NumeratorUnsignedFloat> ? Divisor extends SignedFloat<infer DivisorSign, infer DivisorUnsignedFloat> ? SignedFloat<MultiplySigns<NumeratorSign, DivisorSign>, DivideUnsignedFloats<NumeratorUnsignedFloat, DivisorUnsignedFloat>[0]> : never : never
Referenced by
export type DivideUnsignedFloats<Numerator extends UnsignedFloat, Divisor extends UnsignedFloat, WithRemainder extends boolean = false> = Normalise<Numerator, Divisor> extends [...NumberPair<infer NumeratorDigits, infer DivisorDigits>, infer DecimalPlaces] ? NumeratorDigits extends TailDigitArray<infer NumeratorHead, infer NumeratorTail> ? [LongDivide<DivisorDigits, [NumeratorHead], NumeratorTail, [], WithRemainder>, DecimalPlaces] : never : never
Referenced by
export type Division<Numbers extends number[]> = Numbers extends [...infer Rest extends number[], infer Tail extends number] ? Rest extends [] ? Tail : Divide<Division<Rest>, Tail> : 1
Referenced by
export type EmptyStringAsZero<Input extends string> = Input extends "" ? "0" : Input
Referenced by
export type Equal<Left extends number, Right extends number> = AnyExtend<[Left, Right], never> extends 1 ? never : number extends Left | Right ? Bit : Left extends Right ? Right extends Left ? 1 : 0 : 0
Referenced by
export type EuclideanDivide<TNumerator extends Digit[], Divisor extends Digit[]> = EuclideanDivideHelper<Divisor, TNumerator, [0]>
Referenced by
Unexported symbols referenced here
type EuclideanDivideHelper<Divisor extends Digit[], Remainder extends Digit[], Quotient extends Digit[]> = CompareIntegerMagnitudes<Remainder, Divisor> extends Bit ? EuclideanDivideHelper<Divisor, SubtractUnsignedIntegers<Remainder, Divisor>, AddUnsignedIntegers<Quotient, [1]>> : MakeModResult<Remainder, Quotient>
Referenced by
export type EuclideanDivideResult<Remainder extends Digit[], Quotient extends Digit> = ModResult<Remainder, [Quotient]>
Referenced by
export type Exponentiate<Base extends number, Exponent extends number> = Exponent extends 0 ? 1 : IsNegative<Exponent> extends 1 ? Exponentiate<Divide<1, Base>, Negate<Exponent>> : IsEven<Exponent> extends 1 ? Exponentiate<Multiply<Base, Base>, Divide<Exponent, 2>> : Exponentiate<Multiply<Base, Base>, Divide<Subtract<Exponent, 1>, 2>> extends infer Result extends number ? Multiply<Base, Result> : never
Referenced by
export type FlipSign<S extends Sign> = SignMap<"+", "-">[S]
Referenced by
export type FlipTable<T extends Digit[][]> = T extends [...infer Head extends Digit[][], infer Tail extends Digit[]] ? [Tail, ...FlipTable<Head>] : []
Referenced by
export type FloatDigitCount<UnsignedDigits extends UnsignedFloat> = Flat<UnsignedDigits> extends infer Digits extends Digit[] ? Size<Digits> : never
Referenced by
export type FloatMaxDigits = 16
Referenced by
export type FloatMaxDigitsAsUnsignedFloat = ToUnsignedFloat<FloatMaxDigits>
Referenced by
export type Floor<Value extends number> = Value extends 0 ? 0 : Value extends number ? LessThan$1<Value, 0> extends 1 ? Subtraction<[Value, Mod<Value, -1>, 1]> : Mod<Value, 1> extends 0 ? Value : Subtract<Value, Mod<Value, 1>> : never
Referenced by
export type GreaterThan<Left extends number, Right extends number> = Compare$1<Left, Right> extends -1 ? 0 : Compare$1<Left, Right> extends 0 ? 0 : 1
Referenced by
export type GreaterThanOrEqual<Left extends number, Right extends number> = Compare$1<Left, Right> extends -1 ? 0 : 1
Referenced by
export type InferNumber<S extends string, TSign extends Sign> = S extends "0" ? 0 : Template<[SignToNumber<TSign>, S]> extends `${infer Number extends number}` ? Number : never
Referenced by
export type IsEven<Number extends number> = number extends Number ? Bit : Number extends Number ? IsUnsignedFloatEven<ToUnsignedFloat<Number>> : never
Referenced by
export type IsEvenDigit<DigitArray extends Digit[]> = DigitArray extends HeadDigitArray<any, infer LastDigit> ? LastDigit extends 0 | 2 | 4 | 6 | 8 ? 1 : 0 : never
Referenced by
export type IsInteger<N extends number> = number extends N ? Bit : N extends N ? Template<N> extends `${string}.${string}` ? 0 : 1 : never
Referenced by
export type IsNegative<N extends number> = Not<IsPositive<N>>
Referenced by
export type IsNonInteger<Number extends number> = Not$1<IsInteger<Number>>
Referenced by
export type IsOdd<Number extends number> = Not$1<IsEven<Number>>
Referenced by
export type IsPositive<Input extends number> = number extends Input ? Bit : Input extends Input ? Sign$1<Input> extends 1 ? 1 : 0 : never
Referenced by
export type IsUnsignedFloatEven<Float extends UnsignedFloat> = Pop<Float> extends [] ? IsEvenDigit<Shift<Float>> : never
Referenced by
export type Join<List extends Serializable[], Delimiter extends string = ""> = List extends [infer Head extends Serializable, ...infer Rest extends Serializable[]] ? Join<Rest, `${Delimiter}${Head}`> : Delimiter
Referenced by
export type LastRow<Table extends Digit[][]> = Table extends [...Digit[][], infer LastRow] ? LastRow : never
Referenced by
export type LessThan<Left extends number, Right extends number> = GreaterThan$1<Right, Left>
Referenced by
export type LessThanOrEqual<Left extends number, Right extends number> = GreaterThanOrEqual$1<Right, Left>
Referenced by
export type LongDivide<Divisor extends Digit[], NumeratorHead extends Digit[], NumeratorTail extends Digit[], Quotient extends Digit[] = [], WithRemainder extends boolean = false> = EuclideanDivide<NumeratorHead, Divisor> extends EuclideanDivideResult<infer Remainder, infer NextQuotientDigit> ? [...Quotient, NextQuotientDigit] extends infer NextQuotient extends Digit[] ? NumeratorTail extends TailDigitArray<infer NextDigit, infer NextTail> ? LongDivide<Divisor, [...Remainder, NextDigit], NextTail, NextQuotient, WithRemainder> : WithRemainder extends false ? MakeUnsignedFloat<NextQuotient, Remainder extends [0] ? [] : LongDivideFraction<Divisor, [...Remainder, 0]>> : MakeModResult<Remainder, NextQuotient> : never : never
Referenced by
export type LongDivideFraction<Divisor extends Digit[], Numerator extends Digit[], Quotient extends Digit[] = []> = CompareNumbers<Size<Quotient>, DivideMaxDigits> extends 1 ? Quotient : EuclideanDivide<Numerator, Divisor> extends EuclideanDivideResult<infer Remainder, infer NextQuotientDigit> ? Remainder extends [0] ? Push<Quotient, NextQuotientDigit> : LongDivideFraction<Divisor, Push<Remainder, 0>, Push<Quotient, NextQuotientDigit>> : never
Referenced by
export type MakeBinaryTable<Table extends Digit[][], Addendum extends Digit = never> = [Table, TableShift<Table, Addendum>]
Referenced by
export type MakeModResult<Remainder extends Digit[], Quotient extends Digit[]> = ModResult<NormaliseIntegerZeros<Remainder>, NormaliseIntegerZeros<Quotient>>
Referenced by
export type MakeMultiplicationRow<Number extends Digit, TableRow extends number[] = [0]> = TableRow["length"] extends 10 ? TableRow : LastOfUnion<TableRow> extends infer Previous extends number ? MakeMultiplicationRow<Number, [...TableRow, Add<Previous, Number>]> : never
Referenced by
export type MakeMultiplicationTable<Table extends unknown[], X extends Digit[]> = Table["length"] extends 10 ? Table : X extends TailDigitArray<infer N, infer XTail> ? MakeMultiplicationTable<[...Table, MapToOperationResult<MakeMultiplicationRow<N>>], XTail> : never
export type MakeSignedFloat<TSign extends Sign, UnsignedDigits extends UnsignedFloat> = MakeUnsignedFloat<Shift<UnsignedDigits>, Pop<UnsignedDigits>> extends infer ActualUnsignedFloat extends UnsignedFloat ? ActualUnsignedFloat extends UnsignedFloatZero ? SignedFloatZero : SignedFloat<TSign, ActualUnsignedFloat> : never
Referenced by
export type MakeTable<Row extends Digit[] = [], Addendum extends Digit = never> = MakeTableHelper$1<[Row], Addendum>
Referenced by
Unexported symbols referenced here
type MakeTableHelper$1<Table extends Digit[][] = [], Addendum extends Digit = never, Row extends Digit[] = LastRow$1<Table>> = Size<Table> extends Size<Row> ? Table : MakeTableHelper$1<[...Table, RowShift$1<Row, Addendum>], Addendum>
Referenced by
export type MakeUnsignedFloat<Integers extends Digit[], Fraction extends Digit[] = []> = UnsignedFloat<NormaliseIntegerZeros<Integers>, NormaliseFractionalZeros<Fraction>>
Referenced by
export type MapToOperationResult<TRow extends number[]> = {
[K in keyof TRow]: OperationResultFromNumber<TRow[K]>;
}
Referenced by
Unexported symbols referenced here
type OperationResultFromNumber<Number extends number> = `${Number}` extends `${infer Carry extends Digit}${infer Result extends Digit}` ? OperationResult<Carry, Result> : `${Number}` extends `${infer Result extends Digit}` ? OperationResult<0, Result> : never
Referenced by
export type Maximum<Numbers extends number[]> = Numbers extends [infer Head extends number, ...infer Rest extends number[]] ? Bigger<Head, Maximum<Rest>> : 0
Referenced by
export type Minimum<Numbers extends number[]> = Numbers extends [...infer Rest extends number[], infer Tail extends number] ? Rest extends [] ? Tail : Smaller<Minimum<Rest>, Tail> : 0
Referenced by
export type Mod<Numerator extends number, Divisor extends number> = AnyExtend<[Numerator, Divisor], never> extends 1 ? never : Divisor extends 0 ? never : Numerator extends 0 ? 0 : number extends Numerator | Divisor ? number : ModNumbers<Numerator, Divisor>
Referenced by
export type ModNumbers<Numerator extends number, Divisor extends number> = SignedFloatToNumber<ModSignedFloats<ToSignedFloat<Numerator>, ToSignedFloat<Divisor>>>
Referenced by
export type ModResult<Remainder extends Digit[], Quotient extends Digit[]> = [Remainder, Quotient]
Referenced by
export type ModSignedFloats<Numerator extends SignedFloat, Divisor extends SignedFloat> = Numerator extends SignedFloat<infer NumeratorSign, infer NumeratorUnsignedFloat> ? Divisor extends SignedFloat<Sign, infer DivisorUnsignedFloat> ? SignedFloat<NumeratorSign, ModUnsignedFloats<NumeratorUnsignedFloat, DivisorUnsignedFloat>> : never : never
Referenced by
export type ModUnsignedFloats<Numerator extends UnsignedFloat, Divisor extends UnsignedFloat> = DivideUnsignedFloats<Numerator, Divisor, true> extends [ModResult<infer Remainder, Digit[]>, infer DecimalPlaces extends number] ? SafeDigitsToUnsignedFloat<Remainder, DecimalPlaces> : never
Referenced by
export type Multiplication<Numbers extends number[]> = Numbers extends [infer Head extends number, ...infer Rest extends number[]] ? Multiply<Head, Multiplication<Rest>> : 1
Referenced by
export type Multiply<Left extends number, Right extends number> = AnyExtend<[Left, Right], never> extends 1 ? never : Left extends 0 ? 0 : Right extends 0 ? 0 : Left extends 1 ? Right : Right extends 1 ? Left : number extends Left | Right ? number : Left extends -1 ? Negate<Right> : Right extends -1 ? Negate<Left> : MultiplyNumbers<Left, Right>
Referenced by
export type MultiplyCarryDigit<Left extends Digit, Right extends Digit> = MultiplyCarryDigitTable[Left][Right]
Referenced by
export type MultiplyCarryDigitTable = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 1, 1, 2, 2, 2], [0, 0, 0, 1, 1, 2, 2, 2, 3, 3], [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], [0, 0, 1, 1, 2, 3, 3, 4, 4, 5], [0, 0, 1, 2, 2, 3, 4, 4, 5, 6], [0, 0, 1, 2, 3, 4, 4, 5, 6, 7], [0, 0, 1, 2, 3, 4, 5, 6, 7, 8]]
Referenced by
export type MultiplyDigit<Left extends Digit, Right extends Digit> = MultiplyDigitTable[Left][Right]
Referenced by
export type MultiplyDigitTable = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 2, 4, 6, 8, 0, 2, 4, 6, 8], [0, 3, 6, 9, 2, 5, 8, 1, 4, 7], [0, 4, 8, 2, 6, 0, 4, 8, 2, 6], [0, 5, 0, 5, 0, 5, 0, 5, 0, 5], [0, 6, 2, 8, 4, 0, 6, 2, 8, 4], [0, 7, 4, 1, 8, 5, 2, 9, 6, 3], [0, 8, 6, 4, 2, 0, 8, 6, 4, 2], [0, 9, 8, 7, 6, 5, 4, 3, 2, 1]]
Referenced by
export type MultiplyDigitsOperation<Left extends Digit, Right extends Digit> = OperationResult<MultiplyCarryDigit<Left, Right>, MultiplyDigit<Left, Right>>
Referenced by
export type MultiplyNumbers<Left extends number, Right extends number> = SignedFloatToNumber<MultiplySignedFloats<ToSignedFloat<Left>, ToSignedFloat<Right>>>
Referenced by
export type MultiplyRow<TableRow extends Digit[], Multiplier extends Digit, CarryIn extends Digit = 0, FinalResult extends Digit[] = []> = TableRow extends HeadDigitArray<infer RowHead, infer LastDigit> ? MultiplyDigitsOperation<LastDigit, Multiplier> extends OperationResult<infer ResultingCarryOut, infer MultiplicationResult> ? AddDigitsOperation<MultiplicationResult, CarryIn> extends OperationResult<infer MultiplierCarryOut, infer TResult> ? AddDigitsOperation<ResultingCarryOut, MultiplierCarryOut> extends OperationResult<0, infer FinalCarryOut> ? MultiplyRow<RowHead, Multiplier, FinalCarryOut, [TResult, ...FinalResult]> : never : never : never : CarryIn extends 0 ? FinalResult : [CarryIn, ...FinalResult]
Referenced by
export type MultiplySignedFloats<Left extends SignedFloat, Right extends SignedFloat> = Left extends SignedFloat<infer LeftSign, infer LeftUnsignedFloat> ? Right extends SignedFloat<infer RightSign, infer RightUnsignedFloat> ? SignedFloat<MultiplySigns<LeftSign, RightSign>, MultiplyUnsignedFloats<LeftUnsignedFloat, RightUnsignedFloat>> : never : never
Referenced by
export type MultiplySigns<Left extends Sign, Right extends Sign> = MultiplySignsHelper[Left][Right]
Referenced by
Unexported symbols referenced here
type MultiplySignsHelper = SignMap<SignMap<"+", "-">, SignMap<"-", "+">>
Referenced by
export type MultiplyUnsignedFloats<Left extends UnsignedFloat, Right extends UnsignedFloat> = NormaliseForCrossMultiply<Left, Right> extends [...NumberPair<infer NormalisedLeft, infer NormalisedRight>, infer DecimalPlaces extends number] ? SafeDigitsToUnsignedFloat<CrossMultiply<NormalisedLeft, NormalisedRight>, DecimalPlaces> : never
Referenced by
export type Negate<Number extends number> = Number extends 0 ? 0 : number extends Number ? number : `${Number}` extends `-${infer Number extends number}` ? Number : `-${Number}` extends `${infer Number extends number}` ? Number : never
Referenced by
export type NegateSignedFloat<SignedDigits extends SignedFloat> = SignedDigits extends SignedFloat<infer Sign, infer UnsignedFloat> ? SignedFloat<FlipSign<Sign>, UnsignedFloat> : never
Referenced by
export type Normalise<Left extends UnsignedFloat, Right extends UnsignedFloat> = NormaliseIntegerParts<Shift<Left>, Shift<Right>> extends NumberPair<infer LeftIntegerPart, infer RightIntegerPart> ? NormaliseFractionalParts<Pop<Left>, Pop<Right>> extends NumberPair<infer LeftFractionalPart, infer RightFractionalPart> ? [Concat<LeftIntegerPart, LeftFractionalPart>, Concat<RightIntegerPart, RightFractionalPart>, Size<RightFractionalPart>] : never : never
Referenced by
export type NormaliseForCrossMultiply<Left extends UnsignedFloat, Right extends UnsignedFloat> = Left extends UnsignedFloat<infer LeftIntegerPart, infer LeftFractionalPart> ? Right extends UnsignedFloat<infer RightIntegerPart, infer RightFractionalPart> ? [NormaliseIntegerZeros<Concat<LeftIntegerPart, LeftFractionalPart>>, NormaliseIntegerZeros<Concat<RightIntegerPart, RightFractionalPart>>, AddNumbers<Size<LeftFractionalPart>, Size<RightFractionalPart>>] : never : never
Referenced by
export type NormaliseFractionalParts<Left extends Digit[], Right extends Digit[]> = NormaliseLengths<Left, Right, "R">
Referenced by
export type NormaliseFractionalZeros<X extends Digit[]> = TrimTail<X, 0>
Referenced by
export type NormaliseIntegerParts<Left extends Digit[], Right extends Digit[]> = NormaliseLengths<Left, Right, "L">
Referenced by
export type NormaliseIntegerZeros<NormalisedIntegers extends Digit[]> = TrimHead<NormalisedIntegers, 0> extends infer Trimmed extends Digit[] ? Trimmed extends [] ? [0] : Trimmed : never
Referenced by
export type NormaliseLengths<Left extends Digit[], Right extends Digit[], Direction extends PadDirection = PadDirection, Value extends Digit = 0> = CompareLengths<Left, Right> extends 0 | -1 ? NumberPair<Pad<Left, Size<Right>, Direction, Value>, Right> : NumberPair<Left, Pad<Right, Size<Left>, Direction, Value>>
Referenced by
export type Not<Number extends number> = Number extends 0 ? 1 : 0
Referenced by

Tuple of digits representing the components of a number.

export type NumberComponents<TSign extends Sign, Integers extends string, Fraction extends string> = [Integers | Fraction extends "" ? "+" : TSign, Integers, Fraction]
Referenced by
export type Pad<List extends Digit[], Length extends number, Direction extends PadDirection = PadDirection, Value extends Digit = 0> = {
L: PadStart<List, Length, Value>;
R: PadEnd<List, Length, Value>;
}[Direction]
Referenced by
export type PadDirection = "L" | "R"
Referenced by
export type PadEnd<List extends Digit[], Length extends number = Size<List>, Value extends Digit = 0> = Size<List> extends Length ? List : PadEnd<[...List, Value], Length, Value>
Referenced by
export type PadStart<List extends Digit[], Length extends number = Size<List>, Value extends Digit = 0> = Size<List> extends Length ? List : PadStart<[Value, ...List], Length, Value>
Referenced by
export type Power<Base extends number, Exponent extends number> = AnyExtend<[Base, Exponent], never> extends 1 ? never : Exponent extends 0 ? 1 : Exponent extends 1 ? Base : Base extends 1 ? 1 : Base extends -1 ? number extends Exponent ? -1 | 1 : PowerRejectingFractionalExponent<Base, Exponent> : Base extends 0 ? IsNegative<Exponent> extends 1 ? never : 0 : number extends Base | Exponent ? number : PowerRejectingFractionalExponent<Base, Exponent>
Referenced by
export type PowerRejectingFractionalExponent<Base extends number, Exponent extends number> = IsInteger<Exponent> extends 0 ? never : Exponentiate<Base, Exponent>
Referenced by
export type Round<Value extends number, MidPointRounding extends "AwayFromZero" | "ToEven" = "ToEven"> = MidPointRounding extends "AwayFromZero" ? Multiply<Signum<Value>, Floor<Add<Absolute<Value>, 0.5>>> : Floor<Subtract<Add<Value, 0.5>, Mod<Floor<Add<Value, 0.5>>, 1>>>
Referenced by
export type RoundFloat<SignedNormalisedDigits extends SignedFloat> = SmallEnoughForScientificNotation<SignedNormalisedDigits[1][1]> extends 1 ? SignedNormalisedDigits : SignedNormalisedDigits extends SignedFloat<infer TSign, infer UnsignedDigits> ? CompareNumbers<FloatDigitCount<UnsignedDigits>, FloatMaxDigits> extends -1 | 0 ? SignedNormalisedDigits : SubtractUnsignedFloats<FloatMaxDigitsAsUnsignedFloat, ToUnsignedFloat<Size<Shift<UnsignedDigits>>>> extends SignedFloat<infer TargetFractionLengthSign, infer TargetFractionLength> ? TargetFractionLengthSign extends "-" ? SignedNormalisedDigits : RoundFractionalDigits<Pop<UnsignedDigits>, RoundingCarryMap[TSign], UnsignedFloatToNumber<TargetFractionLength, "+">> extends TailDigitArray<infer Carry, infer RoundedFraction> ? MakeSignedFloat<TSign, UnsignedFloat<AddUnsignedIntegers<Shift<UnsignedDigits>, [Carry]>, RoundedFraction>> : never : never : never
Referenced by
export type RoundFractionalDigits<Floats extends Digit[], RoundingMap extends Digit[], TargetFractionLength extends number> = Floats extends HeadDigitArray<infer Rest, infer Head> ? Size<Rest> extends TargetFractionLength ? TargetFractionLength extends 0 ? [RoundingMap[Head]] : AddUnsignedIntegers<Rest, [RoundingMap[Head]]> : RoundFractionalDigits<Rest, RoundingMap, TargetFractionLength> : never
Referenced by
export type RoundingCarryMap = SignMap<[0, 0, 0, 0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]>
Referenced by
export type RowShift<TableRow extends Digit[], Addendum extends Digit = never> = TableRow extends [infer Head extends Digit, ...infer Rest extends Digit[]] ? [...Rest, [Addendum] extends [never] ? Head : Addendum] : never
Referenced by
export type SafeDigitsToUnsignedFloat<Digits extends Digit[], DecimalPlaces extends number> = CompareNumbers<Size<Digits>, DecimalPlaces> extends -1 ? DigitsToUnsignedFloat<PadStart<Digits, DecimalPlaces, 0>, DecimalPlaces> : DigitsToUnsignedFloat<Digits, DecimalPlaces>
Referenced by
export type ScientificNotationAsDecimal<Input extends string | number> = Template<Input> extends `${infer Significand extends number}e-${infer Exponent extends number}` ? SplitComponentParts<Significand> extends NumberComponents<never, infer Integer, infer Fraction> ? ArrayOf<Exponent, 0> extends [infer TIntZero extends 0, ...infer TFractionZeros extends 0[]] ? Join$1<[TIntZero, ".", ...TFractionZeros, Integer, Fraction]> : never : never : Template<Input>
Referenced by
export type SeparateSign<Input extends string> = Input extends `${infer TSign extends Sign}${infer Number}` ? [TSign, Number] : ["+", Input]
Referenced by
export type SignMap<Negative = unknown, Positive = unknown> = {
"-": Negative;
"+": Positive;
}
Referenced by
export type SignToNumber<TSign extends Sign> = TSign extends "+" ? "" : TSign
Referenced by
export type SignedFloatToNumber<SignedDigits extends SignedFloat> = RoundFloat<SignedDigits> extends SignedFloat<infer TSign, infer UnsignedDigits> ? UnsignedFloatToNumber<UnsignedDigits, TSign> : never
Referenced by
export type Signum<Number extends number> = Number extends Number ? `${Number}` extends `-${number}` ? -1 : Number extends 0 ? 0 : 1 : never
Referenced by
export type SmallEnoughForScientificNotation<TFractionalDigits extends Digit[]> = TFractionalDigits extends [0, 0, 0, 0, 0, 0, ...Digit[]] ? 1 : 0
Referenced by
export type Smaller<Left extends number, Right extends number> = number extends Left | Right ? number : Left extends Right ? Left : Right extends Left ? Right : LessThan$1<Left, Right> extends 1 ? Left : Right
Referenced by
export type SplitAndNormalise<Left extends number, Right extends number> = Normalise<Pop<ToSignedFloat<Left>>, Pop<ToSignedFloat<Right>>>
Referenced by
export type SplitComponentParts<Input extends string | number> = Template<Input> extends `${infer Integer}.${infer Fraction}` ? NumberComponents<never, Integer, Fraction> : NumberComponents<never, Template<Input>, "">
Referenced by
export type SplitIntoDigits<Number extends string> = Number extends "" ? [] : Number extends `${infer Head extends Digit}${infer Rest}` ? [Head, ...SplitIntoDigits<Rest>] : never
Referenced by
export type SplitLeadingElements<List extends Digit[], Element, Last extends Digit[] = []> = List extends [infer Head extends Digit, ...infer Rest extends Digit[]] ? [Head] extends [Element] ? SplitLeadingElements<Rest, Element, [...Last, Head]> : [Last, List] : [Last, []]
Referenced by

SquareRoot takes a number and returns the square root of that number.

more
less

@description — This algorithm is based on the Heron's method for finding the square root of a number. Also known as the Babylonian method, it is an ancient algorithm that is still used today.

@param — A number to find the square root of.

@returns — The square root of the number.

@example — type Result = SquareRoot<16>; // ^? type Result = 4

@since — 0.1.0

export type SquareRoot<Number extends number> = SquareRootHelper<Number>
Referenced by
Unexported symbols referenced here
type SquareRootHelper<Value extends number, Guess extends number = Divide<Value, 2>, Quotient extends number = Estimate<Value, Guess>, Delta extends number = Difference<Quotient, Guess>> = GreaterThan$1<Delta, Tolerance> extends 1 ? SquareRootHelper<Value, Quotient> : Quotient
Referenced by
type Estimate<Value extends number, Guess extends number> = Divide<Add<Guess, Divide<Value, Guess>>, 2>
Referenced by
type Difference<Estimate extends number, Guess extends number> = Absolute<Subtract<Estimate, Guess>>
Referenced by
type Tolerance = 1e-8
Referenced by
export type Subtract<Left extends number, Right extends number> = AnyExtend<[Left, Right], never> extends 1 ? never : number extends Left | Right ? number : Left extends 0 ? Negate$1<Right> : Right extends 0 ? Left : SubtractNumbers<Left, Right>
Referenced by
export type SubtractCarryDigit<Left extends Digit, Right extends Digit, Carry extends Bit = 0> = SubtractCarryDigitTable[Carry][Left][Right]
Referenced by
export type SubtractCarryDigitTable = MakeBinaryTable<FlipTable<MakeTable$1<FirstRow$1, 1>>, 1>
Referenced by
Unexported symbols referenced here
type FirstRow$1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Referenced by
export type SubtractDigit<Left extends Digit, Right extends Digit, Carry extends Bit = 0> = SubtractDigitTable[Carry][Left][Right]
Referenced by
export type SubtractDigitTable = MakeBinaryTable<FlipTable<MakeTable$1<FirstRow>>>
Referenced by
Unexported symbols referenced here
type FirstRow = [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
Referenced by
export type SubtractDigits<NormalisedLeft extends Digit[], NormalisedRight extends Digit[], Carry extends Bit = 0, Result extends Digit[] = []> = NormalisedLeft extends HeadDigitArray<infer NormalisedLeftChunk, infer LastLeftDigit> ? NormalisedRight extends HeadDigitArray<infer NormalisedRightChunk, infer LastRightDigit> ? SubtractDigits<NormalisedLeftChunk, NormalisedRightChunk, SubtractCarryDigit<LastLeftDigit, LastRightDigit, Carry>, [SubtractDigit<LastLeftDigit, LastRightDigit, Carry>, ...Result]> : SubtractDigits<NormalisedLeftChunk, [], SubtractCarryDigit<LastLeftDigit, 0, Carry>, [SubtractDigit<LastLeftDigit, 0, Carry>, ...Result]> : NormalisedRight extends HeadDigitArray<infer NormalisedRightChunk, infer LastRightDigit> ? SubtractDigits<[], NormalisedRightChunk, SubtractCarryDigit<0, LastRightDigit, Carry>, [SubtractDigit<0, LastRightDigit, Carry>, ...Result]> : Carry extends 1 ? [...Result, 9] : Result
Referenced by
export type SubtractNumbers<Left extends number, Right extends number> = SignedFloatToNumber<SubtractSignedFloats<ToSignedFloat<Left>, ToSignedFloat<Right>>>
Referenced by
export type SubtractSignedFloats<Left extends SignedFloat, Right extends SignedFloat> = Left extends SignedFloat<infer LeftSign, infer LeftUnsignedFloat> ? Right extends SignedFloat<infer RightSign, infer RightUnsignedFloat> ? LeftSign extends "-" ? RightSign extends "-" ? NegateSignedFloat<SubtractUnsignedFloats<LeftUnsignedFloat, RightUnsignedFloat>> : SignedFloat<"-", AddUnsignedFloats<LeftUnsignedFloat, RightUnsignedFloat>> : RightSign extends "-" ? SignedFloat<"+", AddUnsignedFloats<LeftUnsignedFloat, RightUnsignedFloat>> : SubtractUnsignedFloats<LeftUnsignedFloat, RightUnsignedFloat> : never : never
Referenced by
export type SubtractUnsignedFloats<X extends UnsignedFloat, Y extends UnsignedFloat> = CompareFloatMagnitudes<X, Y> extends 1 ? SignedFloat<"+", SubtractUnsignedFloatsHelper<X, Y>> : CompareFloatMagnitudes<X, Y> extends 0 ? SignedFloatZero : SignedFloat<"-", SubtractUnsignedFloatsHelper<Y, X>>
Referenced by
Unexported symbols referenced here
type SubtractUnsignedFloatsHelper<X extends UnsignedFloat, Y extends UnsignedFloat> = Normalise<X, Y> extends [...NumberPair<infer TNormalisedX, infer TNormalisedY>, infer TDecimalPlaces extends number] ? DigitsToUnsignedFloat<SubtractDigits<TNormalisedX, TNormalisedY>, TDecimalPlaces> : never
Referenced by
export type SubtractUnsignedIntegers<NormalisedLeft extends Digit[], NormalisedRight extends Digit[]> = NormaliseIntegerParts<NormalisedLeft, NormalisedRight> extends NumberPair<infer NormalisedLeftChunk, infer NormalisedRightChunk> ? SubtractDigits<NormalisedLeftChunk, NormalisedRightChunk> : never
Referenced by
export type Subtraction<Numbers extends number[]> = Numbers extends [...infer Rest extends number[], infer Tail extends number] ? Rest extends [] ? Tail : Subtract<Subtraction<Rest>, Tail> : 1
Referenced by
export type TableShift<Table extends Digit[][], Addendum extends Digit = never> = Table extends [infer Head extends Digit[], ...infer Tail extends Digit[][]] ? [RowShift$1<Head, Addendum>, ...TableShift<Tail, Addendum>] : []
Referenced by
export type TailDigitArray<First extends Digit, Tail extends Digit[]> = [First, ...Tail]
Referenced by
export type ToDecimalString<IntegerDigits extends Digit[], FractionalDigits extends Digit[]> = FractionalDigits extends [] ? Join<IntegerDigits> : `${Join<IntegerDigits>}.${Join<FractionalDigits>}`
Referenced by
export type ToFixed<Value extends number, Digits extends number> = MultiplyByTenPower<Value, Digits> extends infer Multiplied ? Multiplied extends number ? DivideByTenPower<Round<Multiplied>, Digits> : never : never
Referenced by
Unexported symbols referenced here
type MultiplyByTenPower<Value extends number, Power extends number> = Power extends 0 ? Value : MultiplyByTenPower<Multiply<Value, 10>, Subtract<Power, 1>>
Referenced by
type DivideByTenPower<Value extends number, Power extends number> = Power extends 0 ? Value : DivideByTenPower<Divide<Value, 10>, Subtract<Power, 1>>
Referenced by
export type ToSignedFloat<N extends number> = DecomposeNumber<N> extends NumberComponents<infer TSign, infer Integer, infer Float> ? SignedFloat<TSign, UnsignedFloat<SplitIntoDigits<Integer>, SplitIntoDigits<Float>>> : never
Referenced by
export type ToSmallFractionString<FractionalDigits extends Digit[]> = SmallEnoughForScientificNotation<FractionalDigits> extends 1 ? SplitLeadingElements<FractionalDigits, 0> extends [infer FractionalZeros extends 0[], infer Significand extends Digit[]] ? Significand extends TailDigitArray<infer SignificandInteger, infer SignificandFraction> ? Size<[0, ...FractionalZeros]> extends infer Exponent extends number ? `${SignedFloatToNumber<RoundFloat<SignedFloat<"+", [[SignificandInteger], SignificandFraction]>>>}e-${Exponent}` : never : never : never : ToDecimalString<[0], FractionalDigits>
Referenced by
export type ToUnsignedFloat<Number extends number> = DecomposeNumber<Number> extends [Sign, infer Integer extends string, infer Float extends string] ? UnsignedFloat<SplitIntoDigits<Integer>, SplitIntoDigits<Float>> : never
Referenced by
export type TrimLeadingZeros<Input extends string> = Input extends `0${infer Rest}` ? TrimLeadingZeros<Rest> : Input
Referenced by
export type TrimTrailingZeros<Input extends string> = Input extends `${infer Rest}0` ? TrimTrailingZeros<Rest> : Input
Referenced by
export type UnsignedFloatToNumber<UnsignedNormalisedDigits extends UnsignedFloat, TSign extends Sign> = UnsignedNormalisedDigits extends UnsignedFloat<infer IntegerDigits, infer FractionalDigits> ? IntegerDigits extends [0] ? InferNumber<ToSmallFractionString<FractionalDigits>, TSign> : InferNumber<ToDecimalString<IntegerDigits, FractionalDigits>, TSign> : never
Referenced by
export type UnsignedFloatZero = MakeUnsignedFloat<[0]>
Referenced by
}
export type Max<Left extends number, Right extends number> = Bigger<Left, Right>
export type Maximum<Numbers extends number[]> = import(Math).Maximum<Numbers>
export type Merge<Source extends Dictionary, Target extends Dictionary> = Intersect<{
[Key in keyof Source as Key extends keyof Target ? never : Key]: Source[Key];
} & {
[Key in keyof Target as Key extends keyof Source ? never : Key]: Target[Key];
} & {
[Key in keyof Source & keyof Target]: Source[Key] extends Dictionary ? Target[Key] extends Dictionary ? Merge<Source[Key], Target[Key]> : Target[Key] : Target[Key];
}>
Referenced by
export type Min<Left extends number, Right extends number> = Smaller<Left, Right>
export type Minimum<Numbers extends number[]> = import(Math).Minimum<Numbers>

Returns the remainder of the division of Dividend by Divisor.

more
less

@description — - If both dividend and divisor are positive, then all three definitions agree.

  • If the dividend is positive and the divisor is negative, then the truncating and Euclidean definitions agree.
  • If the dividend is negative and the divisor is positive, then the flooring and Euclidean definitions agree.
  • If both dividend and divisor are negative, then the truncating and flooring definitions agree.
export type Modulo<Dividend extends number, Divisor extends number, Type extends "Euclidean" | "Knuthian" | "Truncating" | "Floored" = "Truncating"> = Type extends "Euclidean" ? EuclideanMod<Dividend, Divisor> : Type extends "Knuthian" ? KnuthianMod<Dividend, Divisor> : Type extends "Truncating" ? TruncatingMod<Dividend, Divisor> : Type extends "Floored" ? FlooredMod<Dividend, Divisor> : never
Referenced by
Unexported symbols referenced here
type EuclideanMod<Dividend extends number, Divisor extends number> = Absolute<Divisor> extends infer R extends number ? Mod<Add<Mod<Dividend, R>, R>, R> : never
Referenced by

@description — - It is no different from the Floored Modulo operator, except that it uses a different approach.

type KnuthianMod<Dividend extends number, Divisor extends number> = Subtract<Dividend, Multiply<Floor$1<Divide<Dividend, Divisor>>, Divisor>>
Referenced by
type TruncatingMod<Dividend extends number, Divisor extends number> = Mod<Dividend, Divisor>
Referenced by
type FlooredMod<Dividend extends number, Divisor extends number> = Mod<Add<Mod<Dividend, Divisor>, Divisor>, Divisor>
Referenced by
export type Multiplication<Numbers extends number[]> = import(Math).Multiplication<Numbers>
Referenced by
export type Multiply<Multiplicand extends number, Multiplier extends number> = import(Math).Multiply<Multiplicand, Multiplier>
Referenced by
export type Mutable<ObjectType extends Dictionary> = ObjectType extends Primitives | Indexable | Structures | Derivatives ? ObjectType : Intersect<{
-readonly [K in keyof ObjectType]: ObjectType[K] extends Record<string, any> ? Mutable<ObjectType[K]> : ObjectType[K];
}>
Referenced by
export type Nand<Left extends Bit, Right extends Bit> = Not<And<Left, Right>>
Referenced by
export type Negate<Predicate extends number> = import(Math).Negate<Predicate>
Referenced by
export type NoNumber<Value extends string> = NoNumberHelper<Value, "">
Referenced by
Unexported symbols referenced here
type NoNumberHelper<Value extends string, Result extends string> = Value extends `${infer Slice}${infer Substring}` ? `${Slice}` extends `${number}` ? NoNumberHelper<Substring, Result> : NoNumberHelper<Substring, `${Result}${Slice}`> : Result
Referenced by
export type NonEmptyArray<T> = [T, ...T[]]
Referenced by

A type representing the result of a logical NOT operation.

more
less

@param — - The proposition to NOT.

@returns — The result of the NOT operation.

@example — ```ts import { Not } from "@ibnlanre/types";

type Test = Not<0>; // ^? 1

export type Not<Proposition extends Bit> = Proposition extends 0 ? 1 : 0
Referenced by
export type Nullable<T = unset> = Exclude<T, unset> | null
export type Nullish<T = unset> = Exclude<T, unset> | null | undefined
export type ObjectFromPath<Path extends string, Value extends any, Delimiter extends string = "."> = Path extends `${infer Head}${Delimiter}${infer Rest}` ? {
[K in Head]: ObjectFromPath<Rest, Value>;
} : {
[K in Path]: Value;
}
Referenced by
export type Occurrence<Input extends string, Substring extends string> = OccurrenceHelper<Input, Substring>
Referenced by
Unexported symbols referenced here
type OccurrenceHelper<Input extends string, Substring extends string, Count extends Substring[] = []> = Input extends `${string}${Substring}${infer Slice}` ? OccurrenceHelper<Slice, Substring, [...Count, Substring]> : Size<Count>
Referenced by
export type OmitOptionalValues<ObjectType extends Dictionary> = ObjectType extends Dictionary ? Intersect<{
[K in RequiredKeys<ObjectType>]: ObjectType[K] extends infer T ? T extends Dictionary ? OmitOptionalValues<T> : T : never;
}> : ObjectType
Referenced by
export type OmitPath<ObjectType extends Dictionary, PathType extends Paths<ObjectType> | ArbitraryKey = ""> = ObjectType extends Dictionary ? Intersect<{
[Key in Exclude<RequiredKeys<ObjectType>, PathType>]: OmitPathHelper<ObjectType, PathType, Key>;
} & {
[Key in Exclude<OptionalKeys<ObjectType>, PathType>]?: OmitPathHelper<ObjectType, PathType, Key>;
}> : ObjectType
Referenced by
Unexported symbols referenced here
type OmitPathHelper<ObjectType extends Dictionary, PathType extends string, Key extends string> = ObjectType[Key] extends Dictionary ? PathType extends `${Key}.${infer Rest}` ? OmitPath<ObjectType[Key], Rest> : OmitPath<ObjectType[Key]> : ObjectType[Key]
Referenced by
export type OmitRequiredValues<ObjectType extends Dictionary> = ObjectType extends Dictionary ? Intersect<{
[K in OptionalKeys<ObjectType>]: ObjectType[K] extends infer T ? T extends Dictionary ? OmitRequiredValues<T> : T : never;
}> : ObjectType
Referenced by

Used in filtering out the optional keys in a dictionary.

more
less

@params — ObjectType The type of the store.

@params — Key The type of the key.

@return — The keys that are optional in the dictionary.

@example — { [Key in keyof ObjectType as OptionalKeyMap<ObjectType, Key>]: ObjectType[Key] }

export type OptionalKeyMap<ObjectType extends Dictionary, Key extends keyof ObjectType> = ObjectType[Key] extends Required<ObjectType>[Key] ? never : Key
export type OptionalKeys<ObjectType extends Dictionary> = {
[Key in Keys<ObjectType>]: IsPartial<ObjectType[Key]> extends 1 ? Key : never;
}[Keys<ObjectType>]
Referenced by
export type OptionalKeysDeep<ObjectType extends Dictionary> = OptionalKeysDeepHelper<ObjectType>
Referenced by
Unexported symbols referenced here
type OptionalKeysDeepHelper<ObjectType extends Dictionary, Root extends string = ""> = Elements<UnionToTuple<{
[Key in Keys<ObjectType>]: IsPartial<ObjectType[Key]> extends 1 ? ObjectType[Key] extends Dictionary ? Key | OptionalKeysDeepHelper<ObjectType[Key], Key> : JoinKeys<Root, Key> : never;
}[Keys<ObjectType>]>>
Referenced by

A type representing the result of a bitwise OR operation.

more
less

@param — - The first bit to OR.

@param — - The second bit to OR.

@returns — The result of the OR operation.

@example — ```ts import { Or } from "@ibnlanre/types";

type Test = Or<0, 1>; // ^? 1

export type Or<Left extends Bit, Right extends Bit> = OrHelper[Left][Right]
Referenced by
Unexported symbols referenced here
type OrHelper = FourBitSquareMatrix<[0, 1, 1, 1]>
Referenced by
export type Ordinal<Value extends number> = OrdinalHelper<Value>
Referenced by
Unexported symbols referenced here
type OrdinalHelper<NumberToOrdinal extends number, TensDigit extends number = Mod<Absolute<NumberToOrdinal>, 100>, UnitsDigit extends number = GreaterThan<TensDigit, 10> extends 1 ? Mod<Subtract<TensDigit, 20>, 10> : TensDigit> = Stringify<NumberToOrdinal> extends infer Value ? Value extends string ? Includes<Suffixes, Coordinate<UnitsDigit>> extends 1 ? Append<Value, Coordinate<UnitsDigit>> : Includes<Suffixes, Coordinate<TensDigit>> extends 1 ? Append<Value, Coordinate<TensDigit>> : Append<Value, Retrieve<Suffixes>> : never : never
Referenced by
type Suffixes = ["th", "st", "nd", "rd"]
Referenced by
type Coordinate<Digit extends number, WithinRange extends Bit = LessThan<Digit, Size<Suffixes>>, NotNegative extends Bit = IsPositive$1<Digit>> = And<WithinRange, NotNegative> extends 1 ? Retrieve<Suffixes, Digit> : Retrieve<Suffixes>
Referenced by
export type PadEnd<Text extends string, Size extends number, Suffix extends string = "0"> = Length<Text> extends Size ? Text : PadEnd$1<Append<Text, Suffix>, Size, Suffix>
Referenced by
export type PadStart<Text extends string, Size extends number, Prefix extends string = "0"> = Length<Text> extends Size ? Text : PadStart$1<Prepend<Text, Prefix>, Size, Prefix>
Referenced by
export type ParseInt<Input extends Primitives, Outlook extends "Signed" | "Unsigned" = "Unsigned", Output extends "Integer" | "Float" = "Float"> = Input extends number ? Output extends "Float" ? Input : Int<Input> : Input extends string ? ParseIntHelper<Input, Outlook> extends infer Value extends number ? Output extends "Float" ? Value : Int<Value> : 0 : Input extends true | symbol ? 1 : Input extends false | null | undefined ? 0 : Input
Referenced by
Unexported symbols referenced here
type Int<Input extends number> = `${Input}` extends `${infer R extends number}.${string}` ? R : Input
Referenced by
type ParseIntHelper<Input extends string, Outlook extends "Signed" | "Unsigned", Accumulator extends string = "", Decimal extends number = 0, Sign extends "-" | "" = ""> = Input extends `${infer Significand extends number}e-${infer Exponential extends number}` ? Float<Significand, Exponential> : Input extends `${infer Head}${infer Input}` ? Head extends Digit$1 ? ParseIntHelper<Input, Outlook, `${Accumulator}${Head}`, Decimal, Sign> : Every<TIsExact<1>, [IsSubtype<Outlook, "Signed">, IsSubtype<Head, "-">, IsSubtype<Accumulator, "">]> extends 1 ? ParseIntHelper<Input, Outlook, Accumulator, Decimal, "-"> : Head extends "." ? ParseIntHelper<Input, Outlook, Accumulator, Length<Accumulator>, Sign> : ParseIntHelper<Input, Outlook, Accumulator, Decimal, Sign> : `${Sign}${TrimStart<Accumulator>}` extends `${infer Input extends number}` ? Decimal extends 0 ? Input : Float<Input, Subtract$1<Length<Accumulator>, Decimal>> : Input
Referenced by
type Float<Value extends number, Decimal extends number> = Pow<10, Decimal> extends infer Divisor extends number ? Divide$1<Value, Divisor> : never
Referenced by
type Digit$1 = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
Referenced by

Get all the possible paths of an object

more
less

@param — - The object to get the paths from

@param — - The delimiter to use to separate the keys

@param — - The level to stop the recursion

export type Paths<ObjectType extends Dictionary, Delimiter extends string = ".", Level extends number = -1> = ObjectType extends Dictionary ? {
[Key in Keys<ObjectType>]: Key extends string | number ? ObjectType[Key] extends infer ObjectType ? ObjectType extends Dictionary ? PathsHelper<ObjectType, Key, Delimiter, Level> : `${Key}` : never : never;
}[Keys<ObjectType>] : never
Referenced by
Unexported symbols referenced here
type PathsHelper<ObjectType extends Dictionary, Key extends string | number, Delimiter extends string, Level extends number> = Level extends 0 ? `${Key}` : Level extends -1 ? `${Key}` | `${Key}${Delimiter}${Paths<ObjectType, Delimiter>}` : `${Key}` | `${Key}${Delimiter}${Paths<ObjectType, Delimiter, Subtract$1<Level, 1>>}`
Referenced by
export type Pattern<Text extends Serializable, StartsWith extends Serializable = "", EndsWith extends Serializable = ""> = `${StartsWith}${Text}${EndsWith}`
Referenced by
export type Permutation<List extends unknown[]> = Size<List> extends 1 ? Reduce<[[List]]> : PermutationHelper<List>
Referenced by
Unexported symbols referenced here
type PermutationHelper<List extends unknown[], Result extends unknown[][] = []> = Size<Result> extends Size<List> ? Reduce<Result> : PermutationHelper<RotateLeft<List>, [...Result, Anchor<List>]>
Referenced by
export type Pipe<Item extends unknown, Callbacks extends Fn[]> = ComposeLeft<Item, Callbacks> extends infer Composed ? IsNever<Composed> extends 1 ? PipeHelper<Item, Callbacks> : Composed : never
Referenced by
Unexported symbols referenced here
type PipeHelper<Item extends unknown, Callbacks extends Fn[]> = Callbacks extends [infer Callback extends Fn, ...infer Rest extends Fn[]] ? Item extends Arguments<Callback> ? PipeHelper<Apply<Callback, [Item]>, Rest> : never : Item
Referenced by
export type Pivot<List extends unknown[], Axis extends number = 0> = Locate<List, Axis> extends infer Index ? Index extends number ? PivotHelper<Drop<List, Index>, Retrieve<List, Index>> : never : never
Referenced by
Unexported symbols referenced here
type PivotHelper<List extends unknown[], Value extends unknown, Result extends unknown[][] = []> = Size<Result> extends Size<List> ? [...Result, Insert<List, Size<Result>, Value>] : PivotHelper<List, Value, [...Result, Insert<List, Size<Result>, Value>]>
Referenced by
export type Place<Text extends string, Segment extends string, Index extends number> = LastOfUnion<Index> extends infer L ? IsNever<L> extends 1 ? Text : L extends number ? Place<PlaceHelper<Text, Segment, Locate<Length<Text>, L>>, Segment, Exclude<Index, L>> : Text : never
Referenced by
Unexported symbols referenced here
type PlaceHelper<Text extends string, Segment extends string, Index extends number> = `${Substring<Text, 0, Index>}${Segment}${Substring<Text, Index, Length<Text>>}`
Referenced by
export type Pop<List extends unknown[]> = List extends [...unknown[], infer Element extends List[number]] ? Element : never
Referenced by
export type Pow<Base extends number, Exponent extends number> = Power<Base, Exponent>
Referenced by
export type Prepend<Text extends string, Segment extends string> = `${Segment}${Text}`
Referenced by
export type Primitives = Serializable | symbol
Referenced by
export type Push<List extends any[], Element> = [...List, Element]
Referenced by
export type Range<From extends number, To extends number> = From extends To ? [From] : [From, ...Range<Add$1<From, 1>, To>]
Referenced by
export type Reduce<List extends unknown[]> = {
[K in Indices<List>]: List[K];
}
Referenced by
export type Reject<List extends unknown[], Element> = List extends [infer Head, ...infer Rest] ? [Head] extends [Element] ? Reject<Rest, Element> : [Head, ...Reject<Rest, Element>] : []
Referenced by
export type Replace<Text extends string, Search extends string, Replacement extends string> = LastOfUnion<Search> extends infer L ? IsNever<L> extends 1 ? Text : L extends string ? Replace<ReplaceHelper<Text, L, Replacement>, Exclude<Search, L>, Replacement> : Text : never
Referenced by
Unexported symbols referenced here
type ReplaceHelper<Text extends string, Search extends string, Replacement extends string> = Text extends `${infer X}${Search}${infer U}` ? `${X}${Replacement}${ReplaceHelper<U, Search, Replacement>}` : Text
Referenced by
export type RequireValue<Value> = Exclude<Value, undefined> extends infer Required ? IsNever<Required> extends 1 ? undefined : Required : never
Referenced by

Used in filtering out the required keys in a dictionary.

more
less

@params — ObjectType The type of the store.

@params — Key The type of the key.

@return — The keys that are required in the dictionary.

@example — { [Key in keyof ObjectType as RequiredKeyMap<ObjectType, Key>]: ObjectType[Key] }

export type RequiredKeyMap<ObjectType extends Dictionary, Key extends keyof ObjectType> = ObjectType[Key] extends Required<ObjectType>[Key] ? Key : never
export type RequiredKeys<ObjectType extends Dictionary> = {
[Key in Keys<ObjectType>]: IsPartial<ObjectType[Key]> extends 1 ? never : Key;
}[Keys<ObjectType>]
Referenced by
export type RequiredKeysDeep<ObjectType extends Dictionary> = RequiredKeysDeepHelper<ObjectType>
Referenced by
Unexported symbols referenced here
type RequiredKeysDeepHelper<ObjectType extends Dictionary, Root extends string = ""> = Elements<UnionToTuple<{
[Key in Keys<ObjectType>]: IsPartial<ObjectType[Key]> extends 0 ? ObjectType[Key] extends Dictionary ? Key | RequiredKeysDeepHelper<ObjectType[Key], Key> : JoinKeys<Root, Key> : never;
}[Keys<ObjectType>]>>
Referenced by
export type Retrieve<List extends unknown, Index extends number = 0> = Locate<List, Index> extends infer Position ? Position extends number ? RetrieveHelper<List, Position> : never : never
Referenced by
Unexported symbols referenced here
type RetrieveHelper<List extends unknown, Index extends number> = List extends {
[K in Index]: infer Head;
} ? Head : never
Referenced by
export type Reverse<List extends any[]> = List extends [infer Head, ...infer Rest] ? [...Reverse<Rest>, Head] : []
Referenced by
export type RotateLeft<List extends unknown[], Pivot extends number = 0> = RotateLeftHelper<List, Locate<List, Pivot>>
Referenced by
Unexported symbols referenced here
type RotateLeftHelper<List extends unknown[], Pivot extends number = 0> = IsNever<Pivot> extends 0 ? Retrieve<List, Pivot> extends infer Element ? IsNever<Element> extends 1 ? List : Push<Concat<SliceTo<List, Pivot>, SliceFrom<List, Add$1<Pivot, 1>>>, Retrieve<List, Pivot>> : never : List
Referenced by
export type RotateRight<List extends unknown[], Addendum extends unknown = never> = List extends [...infer Rest extends unknown[], infer Tail extends unknown] ? [[Addendum] extends [never] ? Tail : Addendum, ...Rest] : never
Referenced by
export type Round<Value extends number, MidPointRounding extends "AwayFromZero" | "ToEven" = "ToEven"> = import(Math).Round<Value, MidPointRounding>
Referenced by
export type Serializable = string | number | bigint | boolean | null | undefined
Referenced by
export type Sets = Set<any> | WeakSet<object> | ReadonlySet<any>
Referenced by
export type Shift<List extends unknown[]> = List extends [infer Element extends List[number], ...unknown[]] ? Element : never
Referenced by
export type Shuffle<List extends unknown[]> = List extends ShuffleStructure<infer Head, infer Rest> ? Circle<Rest> extends CircleStructure<infer Revolution> ? Size<Revolution> extends 0 ? [List] : ShuffleHelper<Revolution, Head> : never : []
Referenced by
Unexported symbols referenced here
type ShuffleStructure<Head extends unknown, Rest extends unknown[]> = [Head, ...Rest]
Referenced by
type CircleStructure<List extends unknown[][]> = [...List]
Referenced by
type ShuffleHelper<List extends unknown[][], Head extends unknown, Result extends unknown[] = []> = Size<List> extends Size<Result> ? Result : List extends AnchorStructure<infer First, infer Rest> ? ShuffleHelper<Rest, Head, [...Result, ...Pivot<Unshift<First, Head>, 0>]> : Result
Referenced by

Signum representation of a number.

more
less

@description — The signum function of a number is a mathematical function that extracts the sign of a real number.

@summary — - If the number is negative, the signum is -1.

  • If the number is positive, the signum is 1.
  • If the number is zero, the signum is 0.

@param — The number to get the signum of.

@returns — The signum of the number.

export type Sign<Number extends number> = Signum<Number>
Referenced by
export type Slice<List extends unknown[], Start extends number = 0, End extends number = Size<List>> = Clamp$1<Start, 0, Size<List>> extends infer Starting ? Starting extends number ? Clamp$1<End, 0, Size<List>> extends infer Ending ? Ending extends number ? SliceTo<SliceFrom<List, Starting>, Subtract$1<Ending, Starting>> : never : never : never : never
Referenced by
export type SliceFrom<List extends unknown[], Start extends number> = GreaterThan<Start, Size<List>> extends 1 ? SliceFromHelper<List, Size<List>> : LessThan<Start, 0> extends 1 ? SliceFromHelper<List, 0> : SliceFromHelper<List, Start>
Referenced by
Unexported symbols referenced here
type SliceFromHelper<List extends unknown[], Start extends number> = List extends [...ArrayOf<Start>, ...infer Rest] ? Rest : never
Referenced by
export type SliceTo<List extends unknown[], End extends number = Size<List>> = GreaterThan<End, Size<List>> extends 1 ? SliceToHelper<List, Size<List>> : LessThan<End, 0> extends 1 ? [] : SliceToHelper<List, End>
Referenced by
Unexported symbols referenced here
type SliceToHelper<List extends unknown[], End extends number> = List extends [...infer Rest, ...ArrayOf<Subtract$1<Size<List>, End>>] ? Rest : never
Referenced by
export type Some<Callback extends Fn, List extends Arguments<Callback>[]> = List extends [] ? 0 : List extends [infer Element extends Arguments<Callback>, ...infer Rest extends Arguments<Callback>[]] ? Apply<Callback, [Element]> extends 1 ? 1 : Some<Callback, Rest> : 0
Referenced by
export type Sort<Callback extends Fn, List extends Signature<Callback>[]> = List extends SortOperation<Callback, infer First, infer Rest> ? SortHelper<Callback, First, Sort<Callback, Rest>> : List
Referenced by
Unexported symbols referenced here
type SortOperation<Callback extends Fn, Head extends Signature<Callback>, Rest extends Signature<Callback>[]> = [Head, ...Rest]
Referenced by
type SortHelper<Callback extends Fn, Check extends Signature<Callback>, List extends Signature<Callback>[]> = List extends SortOperation<Callback, infer Head, infer Tail> ? Apply<Callback, [Head, Check]> extends 1 ? Unshift<SortHelper<Callback, Check, Tail>, Head> : Unshift<List, Check> : [Check]
Referenced by
export type Split<Text extends string, Delimiter extends string = "", Options extends {
treatConsecutiveDelimitersAsOne: boolean;
removeEmptyEntries: boolean;
} = DefaultOptions> = LastOfUnion<Delimiter> extends infer L ? IsNever<L> extends 1 ? Options["treatConsecutiveDelimitersAsOne"] extends true ? FinalSplit<Replace<Text, "<><>", "<>">> : FinalSplit<Text> : L extends string ? Split<Join$1<SplitHelper<Text, L>, "<>">, Exclude<Delimiter, L>, Options> : never : never
Referenced by
Unexported symbols referenced here
type DefaultOptions = {
treatConsecutiveDelimitersAsOne: false;
removeEmptyEntries: true;
}
Referenced by
type FinalSplit<Text extends string, Delimiter extends string = "<>"> = SplitHelper<Text, Delimiter>
Referenced by
type SplitHelper<Text extends string, Delimiter extends string> = Text extends `${infer T}${Delimiter}${infer U}` ? [T, ...SplitHelper<U, Delimiter>] : [Text]
Referenced by
export type SquareRoot<Number extends number> = import(Math).SquareRoot<Number>
Referenced by
export type StartsWith<Text extends string, Segment extends Serializable> = Text extends `${Segment}${string}` ? 1 : 0
Referenced by
export type Stringify<Input> = Input extends string ? Input : Input extends Serializable$1 ? `${Input}` : Input extends any[] ? ArrayToString<Input> : Input extends Record<string, any> ? ObjectToString<Input> : never
Referenced by
Unexported symbols referenced here
type Serializable$1 = string | number | boolean | null
Referenced by
type ArrayToString<Input extends any[]> = `[${Join$1<Input>}]`
Referenced by
type ObjectToString<Input extends Record<string, any>> = Join$1<UnionToTuple<{
[K in keyof Input]: `${Stringify<K>}: ${Stringify<Input[K]>}`;
}[keyof Input]>, ", ">
Referenced by
export type Structures = Maps | Sets
Referenced by
export type Substring<Text extends string, Start extends number, End extends number> = Join$1<Slice<Split<Text>, Start, End>>
Referenced by
export type Subtract<Left extends number, Right extends number> = import(Math).Subtract<Left, Right>
Referenced by
export type Subtraction<Numbers extends number[]> = import(Math).Subtraction<Numbers>
Referenced by
export type Symbols = "~" | "!" | "@" | "#" | "$" | "%" | "^" | "&" | "*" | "(" | ")" | "-" | "_" | "=" | "+" | "[" | "{" | "]" | "}" | "\" | "/" | "|" | ";" | ":" | "'" | """ | "," | "<" | "." | ">" | "?" | "`"

Returns the absolute value of a number.

more
less

@param — - The number to get the absolute value of.

@returns — The absolute value of the number.

@examples — ```ts import { Apply, TAbsolute } from "@ibnlanre/types";

type Test = Apply<TAbsolute, [-5]>; // ^? 5

export interface TAbsolute<Number extends number | void = void> extends Fn<{
0: number;
}> {
slot: [Number];
data: Absolute$1<this[0]>;
}

Adds two numbers.

more
less

@param — - The number to add.

@param — - The number to add to.

@returns — The sum of the two numbers.

@example — type Test = Call<TAdd<5, 5>>; // 10 type Test = Apply<Add<6>, [4]>; // 10

export interface TAdd<Addend extends number | void = void, Augend extends number | void = void> extends Fn<{
0: number;
1: number;
}> {
slot: [Addend, Augend];
data: Add$1<this[1], this[0]>;
}
export interface TAddition<Numbers extends number[] | void = void> extends Fn<{
0: number[];
}> {
slot: [Numbers];
data: Addition$1<this[0]>;
}
export interface TAnchor<List extends unknown[] | void = void> extends Fn<{
0: unknown[];
}> {
slot: [List];
data: Anchor<this[0]>;
}

Performs a bitwise AND operation on two numbers.

more
less

@param — - The first number to AND.

@param — - The second number to AND.

@returns — The result of the AND operation.

@example — ```ts import { Apply, TAnd } from "@ibnlanre/types";

type Test = Apply<TAnd, [0, 1]>; // ^? 0

export interface TAnd<Left extends Bit | void = void, Right extends Bit | void = void> extends Fn<{
0: Bit;
1: Bit;
}> {
slot: [Left, Right];
data: And<this[0], this[1]>;
}
export interface TAnyExtend<Element extends unknown, List extends unknown[]> extends Fn<{
0: unknown;
1: unknown[];
}> {
slot: [Element, List];
data: AnyExtend<this[1], this[0]>;
}
export interface TAppend<Segment extends string | void = void, Text extends string | void = void> extends Fn<{
0: string;
1: string;
}> {
slot: [Segment, Text];
data: Append<this[1], this[0]>;
}
export interface TApply<Callback extends Fn, List extends NonEmptyArray<Arguments<Callback>> | void = void> extends Fn<{
0: Fn;
1: NonEmptyArray<Arguments<Callback>>;
}> {
slot: [Callback, List];
data: Apply<this[0], this[1]>;
}
export interface TArrayOf<Length extends number | void = void, Element extends unknown | void = void> extends Fn<{
0: number;
1: unknown;
}> {
slot: [Length, Element];
data: ArrayOf<this[0], this[1]>;
}
export interface TAssign<PathType extends Paths<Exclude<ObjectType, void>> | ArbitraryKey | void = void, ValueType extends unknown = never, ObjectType extends Dictionary | void = void> extends Fn<{
0: Paths<Exclude<ObjectType, void>> | ArbitraryKey;
1: unknown;
}> {
slot: [PathType, ValueType, ObjectType];
data: Assign<this[2], this[0], this[1]>;
}
export interface TBranch<Positive extends number | void = never, Zero extends number | void = never, Negative extends number | void = never, Comparison extends ComparisonResult | void = void> extends Fn<{
0: number;
1: number;
2: number;
}> {
slot: [Positive, Zero, Negative, Comparison];
data: Branch<this[3], this[0], this[1], this[2]>;
}
export interface TCall<Callback extends Fn> extends Fn<{
0: Fn;
}> {
slot: [Callback];
data: Call<this[0]>;
}
export interface TCeil<Value extends number | void = void> extends Fn<{
0: number;
}> {
slot: [Value];
data: Ceil<this[0]>;
}
export interface TCircle<List extends unknown[] | void = void> extends Fn<{
0: unknown;
}> {
slot: [List];
data: Circle<this[0]>;
}
export interface TCollect<PickType extends Dictionary<string, Paths<Exclude<ObjectType, void>>> | Paths<Exclude<ObjectType, void>>[] | Paths<Exclude<ObjectType, void>> | void = void, ObjectType extends Dictionary | void = void> extends Fn<{
0: Dictionary<string, Paths<Exclude<ObjectType, void>>> | Paths<Exclude<ObjectType, void>>[] | Paths<Exclude<ObjectType, void>>;
}> {
slot: [PickType, ObjectType];
data: Collect$1<this[1], this[0]>;
}
export interface TCombine<Source extends Dictionary[] | void = void> extends Fn<{ }> {
slot: [Source];
data: Combine<this[0]>;
}

Compares two numbers.

more
less

@description — The result of the comparison is:

  • 0 if the two numbers are equal.
  • 1 if the first number is greater than the second number.
  • -1 if the first number is less than the second number.

@param — - The right side of the comparison.

@param — - The left side of the comparison.

@returns — The result of the comparison.

export interface TCompare<Right extends number | void = void, Left extends number | void = void> extends Fn<{
0: number;
1: number;
}> {
slot: [Right, Left];
data: Compare<this[1], this[0]>;
}
export interface TConcat<Right extends unknown[] | void = void, Left extends unknown[] | void = void> extends Fn<{
0: unknown[];
1: unknown[];
}> {
slot: [Right, Left];
data: Concat<this[1], this[0]>;
}
export interface TContains<Segment extends Serializable | void = void, Text extends string | void = void> extends Fn<{
1: string;
}> {
slot: [Segment, Text];
data: Contains<this[1], this[0]>;
}
export interface TCount<Value extends unknown | void = void, List extends unknown[] | void = void> extends Fn<{
0: unknown;
1: unknown[];
}> {
slot: [Value, List];
data: Count<this[1], this[0]>;
}
export interface TDecrement<Number extends number | void = void> extends Fn<{
0: number;
}> {
slot: [Number];
data: Decrement<this[0]>;
}
export interface TDeepPartial<PathType extends ArbitraryKey | Paths<Exclude<ObjectType, void>> | void = void, ObjectType extends Dictionary | void = void> extends Fn<{
0: ArbitraryKey | Paths<Exclude<ObjectType, void>>;
}> {
slot: [PathType, ObjectType];
data: DeepPartial<this[1], this[0]>;
}
export interface TDeepRequired<PathType extends ArbitraryKey | Paths<Exclude<ObjectType, void>> | void = void, ObjectType extends Dictionary | void = void> extends Fn<{
0: ArbitraryKey | Paths<Exclude<ObjectType, void>>;
}> {
slot: [PathType, ObjectType];
data: DeepRequired<this[1], this[0]>;
}
export interface TDiff<Right extends Dictionary, Left extends Dictionary> extends Fn<{ }> {
slot: [Right, Left];
data: Diff<this[1], this[0]>;
}
export interface TDivide<Divisor extends number | void = void, Type extends TypeOptions | void = "Integer", Dividend extends number | void = void> extends Fn<{
0: number;
2: number;
}> {
slot: [Divisor, Type, Dividend];
data: Divide$1<this[2], this[0], this[1]>;
}
export interface TDivision<Numbers extends number[] | void = void> extends Fn<{
0: number[];
}> {
slot: [Numbers];
data: Division$1<this[0]>;
}
export interface TDrop<Index extends number | void = void, List extends unknown[] | void = void> extends Fn<{
0: unknown;
1: unknown[];
}> {
slot: [Index, List];
data: Drop<this[1], this[0]>;
}
export interface TElements<List extends unknown[]> extends Fn<{
0: unknown[];
}> {
slot: [List];
data: Elements<this[0]>;
}
export interface TElseIf<Positive extends unknown | void = never, Zero extends unknown | void = never, Comparison extends Bit | void = void> extends Fn<{
0: unknown;
1: unknown;
2: Bit;
}> {
slot: [Positive, Zero, Comparison];
data: ElseIf<this[2], this[0], this[1]>;
}
export interface TEndsWith<Segment extends Serializable | void = void, Text extends string | void = void> extends Fn<{
1: string;
}> {
slot: [Segment, Text];
data: EndsWith<this[1], this[0]>;
}
export interface TEntries<List extends unknown[]> extends Fn<{
0: unknown[];
}> {
slot: [List];
data: Entries<this[0]>;
}
export interface TEqual<Right extends number | void = void, Left extends number | void = void> extends Fn<{
0: number;
1: number;
}> {
slot: [Right, Left];
data: Equal<this[1], this[0]>;
}
export interface TEvery<Callback extends Fn, List extends Arguments<Callback>[] | void = void> extends Fn<{
0: Fn;
1: Arguments<Callback>[];
}> {
slot: [Callback, List];
data: Every<this[0], this[1]>;
}
export interface TExcludeKeys<PathType extends ArbitraryKey | Paths<Exclude<ObjectType, void>> | void = void, ObjectType extends Dictionary | void = void> extends Fn<{
0: ArbitraryKey | Paths<Exclude<ObjectType, void>>;
}> {
slot: [PathType, ObjectType];
data: ExcludeKeys<this[1], this[0]>;
}
export interface TExpand<List extends unknown[] | void = void> extends Fn<{
0: unknown[];
}> {
slot: [List];
data: Expand<this[0]>;
}
export interface TExtractNestedKeys<Delimiter extends string | void = ".", Text extends string | void = void> extends Fn<{
0: string;
1: string;
}> {
slot: [Delimiter, Text];
data: ExtractNestedKeys<this[1], this[0]>;
}
export interface TExtractRootKey<Delimiter extends string | void = ".", Text extends string | void = void> extends Fn<{
0: string;
1: string;
}> {
slot: [Delimiter, Text];
data: ExtractRootKey<this[1], this[0]>;
}
export interface TFallbackTo<FallbackValue extends unknown | void = void, PreventableValue extends unknown | undefined = undefined, ActualValue extends unknown | void = void> extends Fn<{
0: unknown;
1: unknown | undefined;
2: unknown;
}> {
slot: [FallbackValue, PreventableValue, ActualValue];
data: FallbackTo<this[2], this[0], this[1]>;
}
export interface TFilter<Callback extends Fn, List extends Arguments<Callback> | void = void> extends Fn<{
0: Fn;
1: Arguments<Callback>;
}> {
slot: [Callback, List];
data: Filter<this[0], this[1]>;
}
export interface TFirstOfUnion<Union extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Union];
data: FirstOfUnion<this[0]>;
}
export interface TFlat<Depth extends number | void = -1, List extends unknown[] | void = void> extends Fn<{
0: number;
1: unknown[];
}> {
slot: [Depth, List];
data: Flat<this[1], this[0]>;
}
export interface TFlip<Pair extends [unknown, unknown] | void = void> extends Fn<{
0: unknown;
1: unknown;
}> {
slot: [Pair];
data: Flip<this[0]>;
}
export interface TFloor<Value extends number | void = void> extends Fn<{
0: number;
}> {
slot: [Value];
data: Floor$1<this[0]>;
}
export interface TFromEntries<EntryList extends unknown[][] | void = void> extends Fn<{
0: unknown[][];
}> {
slot: [EntryList];
data: FromEntries<this[0]>;
}
export interface TGet<Path extends Paths<Exclude<ObjectType, void>, Exclude<Delimiter, void>> | ArbitraryKey<number> | void = void, Fallback extends unknown = never, Delimiter extends string | void = ".", ObjectType extends Dictionary | void = void> extends Fn<{
0: Paths<Exclude<ObjectType, void>, Exclude<Delimiter, void>> | ArbitraryKey<number>;
1: unknown;
2: string;
}> {
slot: [Path, Fallback, Delimiter, ObjectType];
data: Get<this[3], this[0], this[1], this[2]>;
}
export interface TGreaterThan<Right extends number | void = void, Left extends number | void = void> extends Fn<{
0: number;
1: number;
}> {
slot: [Right, Left];
data: GreaterThan<this[1], this[0]>;
}
export interface TGreaterThanOrEqual<Right extends number | void = void, Left extends number | void = void> extends Fn<{
0: number;
1: number;
}> {
slot: [Right, Left];
data: GreaterThanOrEqual<this[1], this[0]>;
}
export interface THas<Key extends string | number | symbol | void = void, Delimiter extends string | void = ".", ObjectType extends Dictionary | void = void> extends Fn<{
0: string | number | symbol;
1: string;
}> {
slot: [Key, Delimiter, ObjectType];
data: Has<this[2], this[0], this[1]>;
}
export interface THead<List extends unknown[] | void = void> extends Fn<{
0: unknown[];
}> {
slot: [List];
data: Head$1<this[0]>;
}
export interface TIf<Positive extends unknown | void = never, Zero extends unknown | void = never, Condition extends Bit | void = void> extends Fn<{
0: unknown;
1: unknown;
2: Bit;
}> {
slot: [Positive, Zero, Condition];
data: If<this[2], this[0], this[1]>;
}
export interface TIfNot<Positive extends unknown | void = never, Zero extends unknown | void = never, Condition extends ComparisonResult | void = void> extends Fn<{
0: unknown;
1: unknown;
2: unknown;
}> {
slot: [Positive, Zero, Condition];
data: IfNot<this[2], this[0], this[1]>;
}
export interface TImmutable<T extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [T];
data: Immutable<this[0]>;
}
export interface TIncludeKeys<PathType extends ArbitraryKey | Paths<Exclude<ObjectType, void>> | void = void, ObjectType extends Dictionary | void = void> extends Fn<{
0: ArbitraryKey | Paths<Exclude<ObjectType, void>>;
}> {
slot: [PathType, ObjectType];
data: IncludeKeys<this[1], this[0]>;
}
export interface TIncludes<Element extends unknown | void = void, List extends unknown[] | void = void> extends Fn<{
0: unknown;
1: unknown[];
}> {
slot: [Element, List];
data: Includes<this[1], this[0]>;
}
export interface TIncrement<Number extends number | void = void> extends Fn<{
0: number;
}> {
slot: [Number];
data: Increment<this[0]>;
}
export interface TIndices<Result extends "Tuple" | "Union" | void = "Union", List extends unknown[] | void = void> extends Fn<{
0: "Tuple" | "Union";
1: unknown[];
}> {
slot: [Result, List];
data: Indices<this[1], this[0]>;
}
export interface TInsert<Index extends number | void = 0, Value extends unknown | void = void, List extends unknown[] | void = void> extends Fn<{
0: number;
1: unknown;
2: unknown[];
}> {
slot: [Index, Value, List];
data: Insert<this[2], this[0], this[1]>;
}
export interface TIntersect<ObjectType extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [ObjectType];
data: Intersect<this[0]>;
}
export interface TInvoke<Callbacks extends Lambda<Input>[] | void = void, Input extends unknown | void = void> extends Fn<{
0: Lambda<Input>[];
1: unknown;
}> {
slot: [Callbacks, Input];
data: Invoke<this[1], this[0]>;
}
export interface TIsAny<Value extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Value];
data: IsAny<this[0]>;
}
export interface TIsArray<Value extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Value];
data: IsArray<this[0]>;
}
export interface TIsBetween<LowerBound extends number | void = void, UpperBound extends number | void = void, Input extends number | void = void> extends Fn<{
0: number;
1: number;
2: number;
}> {
slot: [LowerBound, UpperBound, Input];
data: IsBetween<this[2], this[0], this[1]>;
}
export interface TIsDictionary<Value extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Value];
data: IsDictionary<this[0]>;
}

Checks if a number is even.

more
less

@param — The number to check if it is even.

@returns — 1 if the number is even, 0 otherwise.

export interface TIsEven<Value extends number | void = void> extends Fn<{
0: number;
}> {
slot: [Value];
data: IsEven$1<this[0]>;
}
export interface TIsExact<Left extends unknown | void = void, Right extends unknown | void = void> extends Fn<{
0: unknown;
1: unknown;
}> {
slot: [Left, Right];
data: IsExact<this[0], this[1]>;
}
Referenced by
export interface TIsInteger<Value extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Value];
data: IsInteger$1<this[0]>;
}
export interface TIsIntersection<Value extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Value];
data: IsIntersection<this[0]>;
}
export interface TIsNegative<Value extends number | void = void> extends Fn<{
0: number;
}> {
slot: [Value];
data: IsNegative$1<this[0]>;
}
export interface TIsNever<Value extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Value];
data: IsNever<this[0]>;
}
export interface TIsNonInteger<Value extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Value];
data: IsNonInteger$1<this[0]>;
}
export interface TIsObject<Value extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Value];
data: IsObject<this[0]>;
}
export interface TIsOdd<Value extends number | void = void> extends Fn<{
0: number;
}> {
slot: [Value];
data: IsOdd$1<this[0]>;
}
export interface TIsPartial<Value extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Value];
data: IsPartial<this[0]>;
}
export interface TIsPositive<Value extends number | void = void> extends Fn<{
0: number;
}> {
slot: [Value];
data: IsPositive$1<this[0]>;
}
export interface TIsReadonly<Value extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Value];
data: IsReadonly<this[0]>;
}
export interface TIsString<Value extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Value];
data: IsString<this[0]>;
}
export interface TIsSubtype<Right extends unknown | void = void, Left extends unknown | void = void> extends Fn<{
0: unknown;
1: unknown;
}> {
slot: [Right, Left];
data: IsSubtype<this[1], this[0]>;
}
export interface TIsSupertype<Right extends unknown | void = void, Left extends unknown | void = void> extends Fn<{
0: unknown;
1: unknown;
}> {
slot: [Right, Left];
data: IsSupertype<this[1], this[0]>;
}
export interface TIsUnary<Value extends number | void> extends Fn<{
0: number;
}> {
slot: [Value];
data: IsUnary<this[0]>;
}
export interface TIsUnion<Value extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Value];
data: IsUnion<this[0]>;
}
export interface TIsVoid<T extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [T];
data: IsVoid<this[0]>;
}
export interface TIsZero<Value extends number | void = void> extends Fn<{
0: number;
}> {
slot: [Value];
data: IsZero<this[0]>;
}
export interface TJoin<Separator extends string | void = void, List extends unknown[] | void = void> extends Fn<{
0: string;
1: unknown[];
}> {
slot: [Separator, List];
data: Join$1<this[1], this[0]>;
}
export interface TJoinKeys<Key extends string | void = void, Delimiter extends string | void = ".", RootKey extends string | void = void> extends Fn<{
0: string;
1: string;
2: string;
}> {
slot: [Key, Delimiter, RootKey];
data: JoinKeys<this[2], this[0], this[1]>;
}
export interface TKeys<ObjectType extends Dictionary | void = void> extends Fn {
slot: [ObjectType];
data: Keys<this[0]>;
}
export interface TKeysAsTuple<ObjectType extends Dictionary | void = void> extends Fn<{ }> {
slot: [ObjectType];
data: KeysAsTuple<this[0]>;
}
Unexported symbols referenced here
type KeysAsTuple<ObjectType extends Dictionary> = KeysAsTupleHelper<ObjectType>
Referenced by
type KeysAsTupleHelper<ObjectType extends Dictionary, Keys extends any[] = []> = LastOfUnion<keyof ObjectType> extends infer Key ? [Key] extends [never] ? Keys : Key extends keyof ObjectType ? KeysAsTupleHelper<Omit<ObjectType, Key>, [Key, ...Keys]> : never : Keys
Referenced by
export interface TLastOfUnion<Union extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Union];
data: LastOfUnion<this[0]>;
}
export interface TLength<Text extends Serializable | void = void> extends Fn<{ }> {
slot: [Text];
data: Length<this[0]>;
}
export interface TLessThan<Right extends number | void = void, Left extends number | void = void> extends Fn<{
0: number;
1: number;
}> {
slot: [Right, Left];
data: LessThan<this[1], this[0]>;
}
export interface TLessThanOrEqual<Right extends number | void = void, Left extends number | void = void> extends Fn<{
0: number;
1: number;
}> {
slot: [Right, Left];
data: LessThanOrEqual<this[1], this[0]>;
}
export interface TLocate<Index extends number | void = void, List extends unknown[] | number | void = void> extends Fn<{
0: number;
1: unknown[] | number;
}> {
slot: [Index, List];
data: Locate<this[1], this[0]>;
}
export interface TMap<Callback extends Fn, List extends Arguments<Callback>[] | void = void> extends Fn<{
0: Fn;
1: Arguments<Callback>[];
}> {
slot: [Callback, List];
data: Map$1<this[0], this[1]>;
}
export interface TMerge<Target extends Dictionary | void = void, Source extends Dictionary | void = void> extends Fn<{ }> {
slot: [Target, Source];
data: Merge<this[1], this[0]>;
}
export interface TModulo<Divisor extends number | void = void, Type extends "Euclidean" | "Knuthian" | "Truncating" | "Floored" | void = "Truncating", Dividend extends number | void = void> extends Fn<{
0: number;
1: "Euclidean" | "Knuthian" | "Truncating" | "Floored";
2: number;
}> {
slot: [Divisor, Type, Dividend];
data: Modulo<this[2], this[0], this[1]>;
}
export interface TMultiplication<Numbers extends number[] | void = void> extends Fn<{
0: number[];
}> {
slot: [Numbers];
data: Multiplication$1<this[0]>;
}
export interface TMultiply<Multiplier extends number | void = void, Multiplicand extends number | void = void> extends Fn<{
0: number;
1: number;
}> {
slot: [Multiplier, Multiplicand];
data: Multiply$1<this[1], this[0]>;
}
export interface TMutable<ObjectType extends Dictionary | void = void> extends Fn<{ }> {
slot: [ObjectType];
data: Mutable<this[0]>;
}
export interface TNand<Right extends Bit | void = void, Left extends Bit | void = void> extends Fn<{
0: Bit;
}> {
slot: [Right, Left];
data: Nand<this[1], this[0]>;
}
export interface TNegate<Predicate extends number | void = void> extends Fn<{
0: number;
}> {
slot: [Predicate];
data: Negate$1<this[0]>;
}
export interface TNoNumber<Value extends string | void = void> extends Fn<{
0: string;
}> {
slot: [Value];
data: NoNumber<this[0]>;
}

Performs a logical NOT operation on a proposition.

more
less

@param — - The proposition to NOT.

@returns — The result of the NOT operation.

@example — ```ts import { Apply, TNot } from "@ibnlanre/types";

type Test = Apply<TNot, [0]>; // ^? 1

export interface TNot<Proposition extends Bit | void = void> extends Fn<{
0: Bit;
}> {
slot: [Proposition];
data: Not<this[0]>;
}
export interface TObjectFromPath<Value extends unknown = void, Delimiter extends string | void = ".", Path extends string | void = void> extends Fn<{
0: string;
1: unknown;
2: string;
}> {
slot: [Value, Delimiter, Path];
data: ObjectFromPath<this[2], this[0], this[1]>;
}
export interface TOccurrence<Substring extends string | void = void, Input extends string | void = void> extends Fn<{
0: Substring;
1: Input;
}> {
slot: [Substring, Input];
data: Occurrence<this[1], this[0]>;
}
export interface TOmitOptionalValues<ObjectType extends Dictionary | void = void> extends Fn<{ }> {
slot: [ObjectType];
data: OmitOptionalValues<this[0]>;
}
export interface TOmitPath<PathType extends Paths<Exclude<ObjectType, void>> | void = void, ObjectType extends Dictionary | void = void> extends Fn<{
0: Paths<Exclude<ObjectType, void>>;
}> {
slot: [PathType, ObjectType];
data: OmitPath<this[1], this[0]>;
}
export interface TOmitRequiredValues<ObjectType extends Dictionary | void = void> extends Fn<{ }> {
slot: [ObjectType];
data: OmitRequiredValues<this[0]>;
}
export interface TOptionalKeys<ObjectType extends Dictionary | void = void> extends Fn<{ }> {
slot: [ObjectType];
data: OptionalKeys<this[0]>;
}
export interface TOptionalKeysDeep<ObjectType extends Dictionary | void = void> extends Fn<{ }> {
slot: [ObjectType];
data: OptionalKeysDeep<this[0]>;
}

Performs a bitwise OR operation on two numbers.

more
less

@param — - The first number to OR.

@param — - The second number to OR.

@returns — The result of the OR operation.

@example — ```ts import { Apply, TOr } from "@ibnlanre/types";

type Test = Apply<TOr, [0, 1]>; // ^? 1

export interface TOr<Right extends Bit | void = void, Left extends Bit | void = void> extends Fn<{
Right: Bit;
Left: Bit;
}> {
slot: [Right, Left];
data: Or<this[1], this[0]>;
}
export interface TOrdinal<Value extends number | void = void> extends Fn<{
0: number;
}> {
slot: [Value];
data: Ordinal<this[0]>;
}
export interface TPadEnd<Size extends number | void = void, Suffix extends string | void = "0", Text extends string | void = void> extends Fn<{
0: number;
1: string;
2: string;
}> {
slot: [Size, Suffix, Text];
data: PadEnd$1<this[2], this[0], this[1]>;
}
export interface TPadStart<Size extends number | void = void, Prefix extends string | void = "0", Text extends string | void = void> extends Fn<{
0: number;
1: string;
2: string;
}> {
slot: [Size, Prefix, Text];
data: PadStart$1<this[2], this[0], this[1]>;
}
export interface TParseInt<Outlook extends "Signed" | "Unsigned" | void = "Unsigned", Output extends "Integer" | "Float" | void = "Float", Input extends string | number | boolean | void = void> extends Fn<{
0: "Signed" | "Unsigned";
1: "Integer" | "Float";
2: string | number | boolean;
}> {
slot: [Outlook, Output, Input];
data: ParseInt<this[2], this[0], this[1]>;
}
export interface TPaths<Delimiter extends string | void = ".", Level extends number | void = -1, ObjectType extends Dictionary | void = void> extends Fn<{
0: string;
1: number;
}> {
slot: [Delimiter, Level, ObjectType];
data: Paths<this[2], this[0], this[1]>;
}
export interface TPattern<StartsWith extends Serializable | void = "", EndsWith extends Serializable | void = "", Text extends Serializable | void = void> extends Fn<{ }> {
slot: [StartsWith, EndsWith, Text];
data: Pattern<this[2], this[0], this[1]>;
}
export interface TPermutation<List extends unknown[] | void = void> extends Fn<{
0: unknown[];
}> {
slot: [List];
data: Permutation<this[0]>;
}
export interface TPipe<Callbacks extends Fn[] | void = void, Item extends unknown | void = void> extends Fn<{
0: Fn[];
1: unknown;
}> {
slot: [Callbacks, Item];
data: Pipe<this[1], this[0]>;
}
export interface TPivot<Head extends unknown | void = void, List extends unknown[] | void = void> extends Fn<{
0: unknown;
1: unknown[];
}> {
slot: [Head, List];
data: Pivot<this[1], this[0]>;
}
export interface TPlace<Segment extends string | void = void, Index extends number | void = void, Text extends string | void = void> extends Fn<{
0: string;
1: number;
2: string;
}> {
slot: [Segment, Index, Text];
data: Place<this[2], this[0], this[1]>;
}
export interface TPop<List extends unknown[] | void = void> extends Fn<{
0: unknown[];
}> {
slot: [List];
data: Pop<this[0]>;
}
export interface TPow<Exponent extends number | void = void, Base extends number | void = void> extends Fn<{
0: number;
1: number;
}> {
slot: [Exponent, Base];
data: Pow<this[1], this[0]>;
}
export interface TPrepend<Segment extends string | void = void, Text extends string | void = void> extends Fn<{
0: string;
1: string;
}> {
slot: [Segment, Text];
data: Prepend<this[1], this[0]>;
}
export interface TPush<Element extends unknown | void = void, List extends unknown[] | void = void> extends Fn<{
0: unknown;
1: unknown[];
}> {
slot: [Element, List];
data: Push<this[1], this[0]>;
}
export interface TRange<From extends number | void = void, To extends number | void = void> extends Fn<{
0: number;
1: number;
}> {
slot: [From, To];
data: Range<this[0], this[1]>;
}
export interface TReduce<List extends unknown[] | void = void> extends Fn<{
0: unknown[];
}> {
slot: [List];
data: Reduce<this[0]>;
}
export interface TReject<Element extends unknown | void = void, List extends unknown[] | void = void> extends Fn<{
0: unknown;
1: unknown[];
}> {
slot: [Element, List];
data: Reject<this[1], this[0]>;
}
export interface TReplace<Search extends string | void = void, Replacement extends string | void = void, Text extends string | void = void> extends Fn<{
0: string;
1: string;
2: string;
}> {
slot: [Search, Replacement, Text];
data: Replace<this[2], this[0], this[1]>;
}
export interface TRequireValue<Value extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Value];
data: RequireValue<this[0]>;
}
export interface TRequiredKeys<ObjectType extends Dictionary | void = void> extends Fn<{ }> {
slot: [ObjectType];
data: RequiredKeys<this[0]>;
}
export interface TRequiredKeysDeep<ObjectType extends Dictionary | void = void> extends Fn<{ }> {
slot: [ObjectType];
data: RequiredKeysDeep<this[0]>;
}
export interface TRetrieve<Index extends number | void = 0, List extends unknown | void = void> extends Fn<{
0: number;
1: unknown;
}> {
slot: [Index, List];
data: Retrieve<this[1], this[0]>;
}
export interface TReverse<List extends unknown[] | void = void> extends Fn<{
0: unknown[];
}> {
slot: [List];
data: Reverse<this[0]>;
}
export interface TRotateLeft<Pivot extends number | void = 0, List extends unknown[] | void = void> extends Fn<{
0: unknown;
1: unknown[];
}> {
slot: [Pivot, List];
data: RotateLeft<this[1], this[0]>;
}
export interface TRotateRight<Addendum extends unknown | void = never, List extends unknown[] | void = void> extends Fn<{
0: unknown;
1: unknown[];
}> {
slot: [Addendum, List];
data: RotateRight<this[1], this[0]>;
}
export interface TRound<MidPointRounding extends "AwayFromZero" | "ToEven" | void = "ToEven", Value extends number | void = void> extends Fn<{
0: "AwayFromZero" | "ToEven";
1: number;
}> {
slot: [MidPointRounding, Value];
data: Round$1<this[1], this[0]>;
}
export interface TShift<List extends unknown[] | void = void> extends Fn<{
0: unknown[];
}> {
slot: [List];
data: Shift<this[0]>;
}
export interface TShuffle<List extends unknown[] | void = void> extends Fn<{
0: unknown[];
}> {
slot: [List];
data: Shuffle<this[0]>;
}
export interface TSign<Value extends number | void = void> extends Fn<{
0: number;
}> {
slot: [Value];
data: Sign$1<this[0]>;
}
export interface TSize<List extends unknown[] | void = void> extends Fn<{
0: unknown[];
}> {
slot: [List];
data: Size<this[0]>;
}
export interface TSlice<Start extends number | void = void, End extends number | void = void, List extends unknown[] | void = void> extends Fn<{
0: number;
1: number;
2: unknown[];
}> {
slot: [Start, End, List];
data: Slice<this[2], this[0], this[1]>;
}
export interface TSliceFrom<Start extends number | void = void, List extends unknown[] | void = void> extends Fn<{
0: number;
1: unknown[];
}> {
slot: [Start, List];
data: SliceFrom<this[1], this[0]>;
}
export interface TSliceTo<To extends number | void = void, List extends unknown[] | void = void> extends Fn<{
0: number;
1: unknown[];
}> {
slot: [To, List];
data: SliceTo<this[1], this[0]>;
}
export interface TSome<Callback extends Fn, List extends Arguments<Callback> | void = void> extends Fn<{
0: Fn;
1: Arguments<Callback>;
}> {
slot: [Callback, List];
data: Some<this[0], this[1]>;
}
export interface TSort<Callback extends Fn, List extends Signature<Callback>[] | void = void> extends Fn<{
0: Fn;
1: Signature<Callback>[];
}> {
slot: [Callback, List];
data: Sort<this[0], this[1]>;
}
export interface TSplit<Delimiter extends string | void = void, Options extends {
treatConsecutiveDelimitersAsOne: boolean;
} | void = DefaultOptions, Text extends string | void = void> extends Fn<{
0: string;
1: {
treatConsecutiveDelimitersAsOne: boolean;
removeEmptyEntries: boolean;
};
2: string;
}> {
slot: [Delimiter, Options, Text];
data: Split<this[2], this[0], this[1]>;
}
export interface TSquareRoot<Number extends number | void = void> extends Fn<{
0: number;
}> {
slot: [Number];
data: SquareRoot$1<this[0]>;
}
export interface TStartsWith<Segment extends Serializable | void = void, Text extends string | void = void> extends Fn<{
1: string;
}> {
slot: [Segment, Text];
data: StartsWith<this[1], this[0]>;
}
export interface TStringify<Input extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Input];
data: Stringify<this[0]>;
}
export interface TSubstring<Start extends number | void = void, End extends number | void = void, Text extends string | void = void> extends Fn<{
0: number;
1: number;
2: string;
}> {
slot: [Start, End, Text];
data: Substring<this[2], this[0], this[1]>;
}
export interface TSubtract<Right extends number | void = void, Left extends number | void = void> extends Fn<{
0: number;
1: number;
}> {
slot: [Right, Left];
data: Subtract$1<this[1], this[0]>;
}
export interface TSubtraction<Numbers extends number[] | void = void> extends Fn<{
0: number[];
}> {
slot: [Numbers];
data: Subtraction$1<this[0]>;
}
export interface TTail<List extends unknown[] | void = void> extends Fn<{
0: unknown[];
}> {
slot: [List];
data: Tail<this[0]>;
}
export interface TTake<Value extends unknown | void = never, Collection extends unknown | void = void> extends Fn<{
0: unknown;
1: unknown;
}> {
slot: [Value, Collection];
data: Take<this[1], this[0]>;
}
export interface TTakeFromArray<Value extends unknown | void = never, List extends unknown[] | void = void> extends Fn<{
0: unknown;
1: unknown[];
}> {
slot: [Value, List];
data: TakeFromArray<this[1], this[0]>;
}
export interface TTakeFromDictionary<Path extends PropertyKey | void = never, ObjectType extends Dictionary | void = void> extends Fn<{
0: PropertyKey;
}> {
slot: [Path, ObjectType];
data: TakeFromDictionary<this[1], this[0]>;
}
export interface TTemplate<Stream extends Serializable> extends Fn<{
0: Template<Stream>;
}> {
slot: [Stream];
data: Template<this[0]>;
}
export interface TToEntries<ObjectType extends Dictionary | void = void> extends Fn<{ }> {
slot: [ObjectType];
data: ToEntries<this[0]>;
}
export interface TToFixed<Digits extends number | void = void, Value extends number | void = void> extends Fn<{
0: number;
1: number;
}> {
slot: [Digits, Value];
data: ToFixed$1<this[1], this[0]>;
}
export interface TTrim<Letter extends string | void = "0", Count extends number | void = -1, Text extends string | void = void> extends Fn<{
0: string;
1: number;
2: string;
}> {
slot: [Letter, Count, Text];
data: Trim<this[2], this[0], this[1]>;
}
export interface TTrimEnd<Letter extends string | void = "0", Count extends number | void = -1, Text extends string | void = void> extends Fn {
slot: [Letter, Count, Text];
data: TrimEnd<this[2], this[0], this[1]>;
}
export interface TTrimHead<Element extends unknown | void = void, List extends unknown[] | void = void> extends Fn<{
0: unknown;
1: unknown[];
}> {
slot: [Element, List];
data: TrimHead<this[1], this[0]>;
}
export interface TTrimStart<Letter extends string | void = "0", Count extends number | void = -1, Text extends string | void = void> extends Fn<{
0: string;
1: number;
2: string;
}> {
slot: [Letter, Count, Text];
data: TrimStart<this[2], this[0], this[1]>;
}
export interface TTrimTail<Element extends unknown | void = void, List extends unknown[] | void = void> extends Fn<{
0: unknown;
1: unknown[];
}> {
slot: [Element, List];
data: TrimTail<this[1], this[0]>;
}
export interface TTrunc<Value extends number | void = void> extends Fn<{
0: number;
}> {
slot: [Value];
data: Trunc<this[0]>;
}
export interface TUnionToIntersection<Union extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Union];
data: UnionToIntersection<this[0]>;
}
export interface TUnionToTuple<Union extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Union];
data: UnionToTuple<this[0]>;
}
export interface TUnionize<Intersection extends unknown | void = void> extends Fn<{
0: unknown;
}> {
slot: [Intersection];
data: Unionize<this[0]>;
}
export interface TUnshift<Element extends unknown | void = void, List extends unknown[] | void = void> extends Fn<{
0: unknown;
1: unknown[];
}> {
slot: [Element, List];
data: Unshift<this[1], this[0]>;
}
export interface TValueAt<Index extends number | void = void, List extends unknown[] | void = void> extends Fn<{
0: number;
1: unknown[];
}> {
slot: [Index, List];
data: ValueAt<this[1], this[0]>;
}
export interface TValues<ObjectType extends Dictionary | void = void> extends Fn<{ }> {
slot: [ObjectType];
data: Values<this[0]>;
}
export interface TWiden<Options extends {
flattenArrays?: boolean;
widenReturnType?: boolean;
} | void = DefaultWidenOptions, Value extends unknown | void = void> extends Fn<{
0: {
flattenArrays?: boolean;
widenReturnType?: boolean;
};
1: unknown;
}> {
slot: [Options, Value];
data: Widen<this[1], this[0]>;
}
Unexported symbols referenced here
type DefaultWidenOptions = {
flattenArrays: true;
widenReturnType: true;
}
Referenced by
export interface TWith<Index extends number | void = void, Element extends unknown | Fn | void = void, List extends unknown[] | void = void> extends Fn<{
0: number;
1: unknown | Fn;
2: unknown[];
}> {
slot: [Index, Element, List];
data: With<this[2], this[0], this[1]>;
}

Performs a bitwise XOR operation on two numbers.

more
less

@param — - The first number to XOR.

@param — - The second number to XOR.

@returns — The result of the XOR operation.

@example — ```ts import { Apply, TXor } from "@ibnlanre/types";

type Test = Apply<TXor, [0, 1]>; // ^? 1

export interface TXor<Right extends Bit | void = void, Left extends Bit | void = void> extends Fn<{
0: Bit;
1: Bit;
}> {
slot: [Right, Left];
data: Xor<this[1], this[0]>;
}
export interface TZip<Left extends unknown[] | void = void, Right extends unknown[] | void = void> extends Fn<{
0: unknown[];
1: unknown[];
}> {
slot: [Left, Right];
data: Zip<this[0], this[1]>;
}
export type Tail<List extends unknown[]> = List extends [unknown, ...infer Tail extends List[number][]] ? Tail : never
Referenced by
export type Take<Collection extends unknown, Value extends unknown = never> = IsNever<Value> extends 1 ? Collection : Value extends Collection ? Extract<Collection, Value> : Value
Referenced by
export type TakeFromArray<List extends unknown[], Value extends unknown = never> = IsNever<Value> extends 1 ? List : List extends [infer Head, ...infer Rest] ? [Value] extends [Head] ? TakeFromArray<Rest, Value> extends infer Rest ? Rest extends unknown[] ? [Head, ...Rest] : [Head, Rest] : never : TakeFromArray<Rest, Value> : List
Referenced by
export type TakeFromDictionary<ObjectType extends Dictionary, Path extends unknown = never> = IsNever<Path> extends 1 ? ObjectType : Path extends PropertyKey ? Has<ObjectType, Path> extends 1 ? Get<ObjectType, Exclude<Path, symbol>> : never : ObjectType
Referenced by
export type Template<Stream extends Serializable | Serializable[]> = Stream extends Serializable ? `${Stream}` : Stream extends Serializable[] ? Join$1<Stream> : never
Referenced by
export type ToEntries<ObjectType extends Dictionary> = UnionToTuple<{
[Key in keyof ObjectType]: [Key, ObjectType[Key]];
}[keyof ObjectType]>
Referenced by
export type ToFixed<Value extends number, Digits extends number> = import(Math).ToFixed<Value, Digits>
Referenced by
export type Trim<Text extends string, Letter extends string = "0", Count extends number = -1> = TrimStart<TrimEnd<Text, Letter, Count>, Letter, Count>
Referenced by
export type TrimEnd<Text extends string, Letter extends string = "0", Count extends number = -1> = Count extends -1 ? Text extends `${infer U}${Letter}` ? TrimEndHelper<U, Letter, Count> : Text : Count extends 0 ? Text : TrimEndHelper<Text, Letter, Count>
Referenced by
Unexported symbols referenced here
type TrimEndHelper<Text extends string, Letter extends string, Count extends number> = Text extends `${infer U}${Letter}` ? TrimEnd<U, Letter, Subtract$1<Count, 1>> : Text
Referenced by
export type TrimHead<List extends unknown[], Element> = List extends [infer Head, ...infer Rest] ? [Head] extends [Element] ? TrimHead<Rest, Element> : List : List
Referenced by
export type TrimStart<Text extends string, Letter extends string = "0", Count extends number = -1> = Count extends -1 ? Text extends `${Letter}${infer U}` ? TrimStartHelper<U, Letter, Count> : Text : Count extends 0 ? Text : TrimStartHelper<Text, Letter, Count>
Referenced by
Unexported symbols referenced here
type TrimStartHelper<Text extends string, Letter extends string, Count extends number> = Text extends `${Letter}${infer U}` ? TrimStart<U, Letter, Subtract$1<Count, 1>> : Text
Referenced by
export type TrimTail<List extends unknown[], Element> = List extends [...infer Rest, infer Tail] ? [Tail] extends [Element] ? TrimTail<Rest, Element> : List : List
Referenced by
export type Trunc<Value extends number> = Subtract<Value, Mod<Value, 1>>
Referenced by
export type TypedArrays = ArrayBuffer | DataView | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array
Referenced by
export type UnionToIntersection<Union> = (Union extends any ? (k: Union) => void : never) extends (k: infer Intersection) => void ? Intersection : never
Referenced by
export type UnionToTuple<Union> = UnionToTupleHelper<Union>
Referenced by
Unexported symbols referenced here
type UnionToTupleHelper<Union, Tail = LastOfUnion<Union>, Rest = Exclude<Union, Tail>> = [Tail] extends [never] ? [] : [...UnionToTupleHelper<Rest>, Tail]
Referenced by
export type Unionize<Intersection> = Intersect<UnionToIntersection<Intersection>>
Referenced by
export type Unshift<List extends unknown[], Element> = [Element, ...List]
Referenced by
export type ValueAt<List extends any[], Index extends number> = Locate<List, Index> extends infer Position ? Position extends number ? List[Position] : never : never
Referenced by
export type Values<ObjectType extends Dictionary> = ValuesHelper<ObjectType>
Referenced by
Unexported symbols referenced here
type ValuesHelper<ObjectType extends Dictionary, Values extends any[] = []> = LastOfUnion<keyof ObjectType> extends infer Key ? [Key] extends [never] ? Values : Key extends keyof ObjectType ? ValuesHelper<Omit<ObjectType, Key>, [ObjectType[Key], ...Values]> : never : Values
Referenced by
export type Widen<Value, Options extends {
flattenArrays?: boolean;
widenReturnType?: boolean;
} = DefaultWidenOptions> = Value extends string ? string : Value extends number ? number : Value extends bigint ? bigint : Value extends boolean ? boolean : Value extends any[] ? [Options["flattenArrays"]] extends [true] ? Flatten<Value> : Value extends [infer Head, ...infer Rest] ? [Widen<Head, Options>, ...Widen<Rest, Options>] : Value : Value extends Dictionary ? {
[K in keyof Value]: Widen<Value[K], Options>;
} : Value extends (...args: any[]) => any ? [Options["widenReturnType"]] extends [true] ? (...args: Parameters<Value>) => Widen<ReturnType<Value>, Options> : Value : Value
Referenced by
Unexported symbols referenced here
type Flatten<Value extends any[]> = Value extends (infer X)[] ? Widen<X>[] : Value
Referenced by
export type With<List extends any[], Index extends number, Element extends unknown | Fn> = Locate<List, Index> extends infer Position ? IsNever<Position> extends 1 ? List : Position extends number ? WithHelper<List, Position, Element> : never : never
Referenced by
Unexported symbols referenced here
type WithHelper<List extends any[], Index extends number, Element extends unknown | Fn> = [...SliceTo<List, Index>, Element extends Fn ? Apply<Element, [List[Index]]> : Element, ...SliceFrom<List, Add$1<Index, 1>>]
Referenced by

A type representing the result of a bitwise XOR operation.

more
less

@param — - The first bit to XOR.

@param — - The second bit to XOR.

@returns — The result of the XOR operation.

@example — ```ts import { Xor } from "@ibnlanre/types";

type Test = Xor<0, 1>; // ^? 1

export type Xor<Left extends Bit, Right extends Bit> = XorHelper[Left][Right]
Referenced by
Unexported symbols referenced here
type XorHelper = FourBitSquareMatrix<[0, 1, 1, 0]>
Referenced by
export type Zip<Left extends unknown[], Right extends unknown[]> = Left extends [infer HeadA, ...infer RestA] ? Right extends [infer HeadB, ...infer RestB] ? [[HeadA, HeadB], ...Zip<RestA, RestB>] : [] : []
Referenced by

Placeholder for unset values

more
less

@description — This symbol is used to represent void values.

export const unset: unique symbol = ...
export type unset = typeof unset
Referenced by
}