Types

potence provides a number of utility types and type guards for TypeScript users. This page lists them all.

isEquatable()

Type guard that checks whether a value is an Equatable.

isIterable()

Type guard that checks whether a value is an Iterable.

isPrimitive()

Type guard that checks whether a value is a primitive.

ArrayType

Utility type that extracts the element type from an array type.

Callback

Represents a function with one parameter and a generic return value.

Constructor

Represents a constructible type (like a class).

Equatable

An interface representing an object that has an equals() method and can be equated to another.

ExcludeProps

Excludes from T the properties whose values are assignable to U.

Falsy

Attempts to extract all falsy values from a type.

HexChar

Represents a single character in the hexadecimal range (0-9, A-F/a-f).

Instantiable

Represents an instantiable (“newable”) type.

Iterable

An interface representing an object that can be iterated over.

Nullable

Represents a type that may be null or undefined.

ObjectLiteral

Represents an object with an index signature keyed to a string, number, or symbol.

Predicate

Represents a function with one parameter and a boolean return value.

Structure

Represents an object structure that can be used in Objects.structure().

Truthy

Attempts to remove all falsy types from another type.

Typeof

Utility type that transforms a TypeofResult into the type it represents.

TypeofResult

Represents the result of the typeof keyword.

primitive

Represents a primitive.