Skip to main content

@skyleague/axioms

Index

Algorithm

Arbitrary

Array

Async

Classes

Combinators

Crypto

Either

Filesystem

Functions

Generators

Guards

Interfaces

Iterators

Maybe

Object

Random

Sets

Type Aliases

Types

Variables

Arbitrary

UnknownGenerator

UnknownGenerator: PrimitiveGenerator & { array: boolean; maxDepth: number; object: boolean; size: ArbitrarySize }

Describes how unknown values are allowed to be generated.

Either

Either

Either<L, R>: Left<L> | Right<R>

Type parameters

  • L
  • R

Type Aliases

Add

Add<A, B>: [...BuildTuple<A>, ...BuildTuple<B>][length]
@deprecated

Type parameters

  • A: number
  • B: number

ArbitrarySize

ArbitrarySize: RelativeSize | AbsoluteSize | max | undefined

AsyncMappable

AsyncMappable<T, R>: AsyncTraversable<T, R> | AsyncTraverser<T, R> | Mappable<T, R> | () => AsyncGenerator<T, R, void>

Type parameters

  • T
  • R = unknown

AsyncTraversable

AsyncTraversable<T, R>: Traversable<Promise<T>, R> | Traversable<T, R> | { [asyncIterator]: any }

Type parameters

  • T
  • R = unknown

AsyncTraverser

AsyncTraverser<T, R>: AsyncIterator<T, R, void> | Traverser<T, R>

Type parameters

  • T
  • R = unknown

BiasedArbitraryContext

BiasedArbitraryContext: ArbitraryContext & { bias: number }

BuildTuple

BuildTuple<L, S, T>: T extends { length: L } ? T : BuildTuple<L, S, [...T, S]>
@deprecated

Type parameters

  • L: number
  • S = unknown
  • T: unknown[] = []

ComparablePrimitive

ComparablePrimitive: bigint | number | string

Curried

Curried<A, R>: <L>(...args: L) => 0 extends L[length] ? never : 0 extends UnconsArgs<A, L[length]>[tail][length] ? R : Curried<UnconsArgs<A, L[length]>[tail], R>

Type parameters

  • A: unknown[]
  • R

Type declaration

    • <L>(...args: L): 0 extends L[length] ? never : 0 extends UnconsArgs<A, L[length]>[tail][length] ? R : Curried<UnconsArgs<A, L[length]>[tail], R>
    • Type parameters

      • L: UnconsArgs<A, number>[init]

      Parameters

      • rest...args: L

      Returns 0 extends L[length] ? never : 0 extends UnconsArgs<A, L[length]>[tail][length] ? R : Curried<UnconsArgs<A, L[length]>[tail], R>

DeepMutable

DeepMutable<T>: { -readonly [ P in keyof T ]: DeepMutable<T[P]> }
@deprecated

Use Writable from @skyleague/axioms/types instead


Type parameters

  • T

DeepPartial

DeepPartial<T>: T extends UnknownRecord ? { [ K in keyof T ]?: DeepPartial<T[K]> } : T extends infer I[] ? DeepPartial<I>[] : T | undefined
@deprecated

Use PartialDeep instead from '@skyleague/axioms/types'.


Type parameters

  • T

DefinedKeys

DefinedKeys<T, K>: NoUndefinedFields<Pick<T, K>> & Omit<T, K>
@deprecated

Type parameters

  • T
  • K: keyof T

Dict

Dict<T>: Record<PropertyKey, T>
@deprecated

Use Record<PropertyKey, T> instead.


Type parameters

  • T = unknown

Failure

Failure: Error

IsUnion

IsUnion<T>: [T] extends [UnionToIntersection<T>] ? false : true
@deprecated

Type should not be used


Type parameters

  • T

Item

Item<T>: T extends infer I[] ? I : T extends [...infer I] ? I : never
@deprecated

Use ArrayValues from @skyleague/axioms/types instead


Type parameters

  • T

Json

Json: Json[] | boolean | number | string | {} | null | undefined
@deprecated

Use JsonValue from @skyleague/axioms/types instead

Just

Just<T>: Exclude<T, Nothing>

Type parameters

  • T

KeyOf

KeyOf<T>: T extends unknown ? keyof T : never
@deprecated

Use KeysOfUnion from @skyleague/axioms/types instead


Type parameters

  • T

KeysOfType

KeysOfType<T, U>: { [ K in keyof T ]: T[K] extends U ? K : never }[keyof T]
@deprecated

Type parameters

  • T
  • U

Mappable

Mappable<T, R>: Traversable<T, R> | Traverser<T, R> | () => Generator<T, R, void>

Type parameters

  • T
  • R = unknown

Maybe

Maybe<T>: Nothing | T

Type parameters

  • T

MaybePartial

MaybePartial<T>: { [ P in keyof T ]?: T[P] }

Type parameters

  • T

MemoizeAttributes

MemoizeAttributes<T>: { [ K in keyof T ]: Memoized<T[K]> }
@deprecated

Type parameters

  • T: Record<PropertyKey, () => unknown>

Memoized

Memoized<Fn>: Fn & { clear: () => void }

A memoized function.


Type parameters

  • Fn: Function

Mutable

Mutable<T>: { -readonly [ P in keyof T ]: T[P] }
@deprecated

Use Writable from @skyleague/axioms/types instead


Type parameters

  • T

NoNullableFields

NoNullableFields<T>: { [ P in keyof T ]-?: Exclude<T[P], null> }
@deprecated

Use SetNonNullable from @skyleague/axioms/types instead


Type parameters

  • T

NoUndefinedFields

NoUndefinedFields<T>: { [ P in keyof T ]-?: Exclude<T[P], undefined> }
@deprecated

Use SetNonNullable from @skyleague/axioms/types instead


Type parameters

  • T

Nothing

Nothing: typeof Nothing

NullableFields

NullableFields<T>: { [ P in keyof T ]?: T[P] | null }
@deprecated

Type parameters

  • T

OptionalKeys

OptionalKeys<T>: Exclude<keyof T, RequiredKeys<T>>
@deprecated

Use OptionalKeysOf from @skyleague/axioms/types instead


Type parameters

  • T

Promisable

Promisable<T>: Promise<T> | T

Type parameters

  • T

RecurrentGenerator

RecurrentGenerator<R>: readonly [R, () => RecurrentGenerator<R> | undefined]

Type parameters

  • R

RelaxedPartial

RelaxedPartial<T>: { [ P in keyof T ]?: T[P] }
@deprecated

Use MaybePartial


Type parameters

  • T

RequireKeys

RequireKeys<T, K>: T extends infer S ? Simplify<Omit<S, K> & Required<Pick<S, K & keyof S>>> extends infer U ? U extends Record<K, unknown> ? Simplify<DefinedKeys<U, K>> : never : never : never
@deprecated

Use SetRequired from @skyleague/axioms/types instead


Type parameters

  • T
  • K: PropertyKey

RequiredKeys

RequiredKeys<T>: Exclude<KeysOfType<T, Exclude<T[keyof T], undefined>>, undefined>
@deprecated

Use RequiredKeysOf from @skyleague/axioms/types instead


Type parameters

  • T

Simplify

Simplify<T>: T extends BuiltinType ? T : T extends infer I[] ? T extends [any, ...infer Rest] ? [Simplify<T[0]>, ...SimplifyTuple<Rest>] : Simplify<I>[] : { [ K in keyof T ]: Simplify<T[K]> }
@deprecated

Deep simplify is fairly complicated and shouldn't be used in most cases.


Type parameters

  • T

SimplifyOnce

SimplifyOnce<T>: T extends BuiltinType ? T : T extends any[] ? T : { [ K in keyof T ]: T[K] }
@deprecated

Use Simplify instead from '@skyleague/axioms/types`.


Type parameters

  • T

Subtract

Subtract<A, B>: BuildTuple<A> extends [...infer R, ...BuildTuple<B>] ? R[length] : 0
@deprecated

Type parameters

  • A: number
  • B: number

Success

Success<T>: Exclude<T, Failure>

Type parameters

  • T

Tail

Tail<T>: T extends [head: unknown, tail: infer U] ? U : never

Type parameters

  • T: readonly unknown[]

TraversableItem

TraversableItem<T>: T extends Traversable<infer I> ? I : T

Type parameters

  • T

Traverser

Traverser<T, R>: Iterator<T, R, void>

Type parameters

  • T
  • R = unknown

Try

Try<T>: Failure | T

Type parameters

  • T

UndefinedFields

UndefinedFields<T>: { [ P in keyof T ]?: T[P] }
@deprecated

Type parameters

  • T

UnionToIntersection

UnionToIntersection<U>: (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never
@deprecated

Use UnionToIntersection from @skyleague/axioms/types instead


Type parameters

  • U

ValueOf

ValueOf<T>: T[keyof T]

Type parameters

  • T

Types

AsyncConstExpr

AsyncConstExpr<T>: Promise<T> | T | () => Promise<T> | () => T

A type that represents either a constant or a constant function.


Type parameters

  • T = unknown

    The constant type.

ConstExpr

ConstExpr<T>: T | () => T

A type that represents either a constant or a constant function.


Type parameters

  • T = unknown

    The constant type.

Variables

constNothing

Nothing: typeof Nothing = ...

constThrown

Thrown: typeof Thrown = ...

constdeterministic

deterministic: { boolean: (...seed: unknown[]) => boolean; float: (...seed: unknown[]) => number; integer: (...seed: unknown[]) => number } = ...

Type declaration

  • boolean: (...seed: unknown[]) => boolean
      • (...seed: unknown[]): boolean
      • Parameters

        • rest...seed: unknown[]

        Returns boolean

  • float: (...seed: unknown[]) => number
      • (...seed: unknown[]): number
      • Parameters

        • rest...seed: unknown[]

        Returns number

  • integer: (...seed: unknown[]) => number
      • (...seed: unknown[]): number
      • Parameters

        • rest...seed: unknown[]

        Returns number

constobjectHasher

objectHasher: Hasher<unknown> = ...