Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/actionify/src/deps/types.ts

Create and manage your GitHub workflows with TypeScript and Deno.
Latest
import * as actionify from "https://deno.land/x/actionify@0.3.0/src/deps/types.ts";

Functions

A generic function that, when given some branded type, can take a value with the base type of the branded type, and cast that value to the branded type. It fulfills the contract of a Brander.

Produces a Brander<B>, given a brand type B. This simply returns identity but relies on type inference to give the return type the correct type.

Type Aliases

An AnyBrand is a branded type based on any base type branded with any branding type. By itself it is not useful, but it can act as type constraint when manipulating branded types in general.

Create an async version of the given function type, by boxing the return type in Promise while keeping the same parameter types.

Unwrap the return type of a function that returns a Promise.

BaseOf is a type that takes any branded type B and yields its base type.

A Brand is a type that takes at minimum two type parameters. Given a base type Base and some unique and arbitrary branding type Branding, it produces a type based on but distinct from Base. The resulting branded type is not directly assignable from the base type, and not mutually assignable with another branded type derived from the same base type.

A Brander is a function that takes a value of some base type and casts that value to a branded type derived from said base type. It can be thought of as the type of a "constructor", in the functional programming sense of the word.

Convert a string literal to camel-case.

Convert object properties to camel case but not recursively.

Convert object properties to camel case recursively.

Matches a class.

Exclude keys from a shape that matches the given Condition.

Extract the keys from a type where the value type of the key extends the given Condition.

Pick keys from the shape that matches the given Condition.

Matches a class constructor.

Convert a string literal to a custom string delimiter casing.

Convert object properties to delimiter case but not recursively.

Convert object properties to delimiter case recursively.

Many collections have an entries method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The Entries type will return the type of that collection's entries.

Many collections have an entries method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The Entry type will return the type of that collection's entry.

Create a type that does not allow extra properties, meaning it only allows properties that are explicitly declared.

Create a type from an object type without certain keys.

A finite number. You can't pass a bigint as they are already guaranteed to be finite.

Create a type that represents an array of the given type and length. The array's length and the Array prototype methods that manipulate its length are excluded in the resulting type.

A number that is not an integer. You can't pass a bigint as they are already guaranteed to be integers.

Get a deeply-nested property from an object using a key path, like Lodash's .get() function.

Creates a type that represents true or false depending on whether the given type has any optional fields.

Creates a type that represents true or false depending on whether the given type has any required fields.

Returns a boolean for whether the given array includes the given item.

A number that is an integer. You can't pass a bigint as they are already guaranteed to be integers.

Create an invariant type, which is a type that does not accept supertypes and subtypes.

Get the element type of an Iterable/AsyncIterable. For example, an array or a generator.

Join an array of strings and/or numbers using the given string as a delimiter.

Matches a JSON array.

Matches a JSON object.

Matches any valid JSON primitive value.

Matches any valid JSON value.

Convert a string literal to kebab-case.

Convert object properties to kebab case but not recursively.

Convert object properties to kebab case recursively.

Extracts the type of the last element of an array.

Given a literal type return the Primitive | primitive type it belongs to, or never if it's not a primitive.

Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.

Merge two types into a new type. Keys of the second type overrides keys of the first type.

Create a type that has mutually exclusive keys.

Creates a type that represents a multidimensional array of the given type and dimension.

Creates a type that represents a multidimensional readonly array that of the given type and dimension.

T
Mutable
deprecated

A negative number/bigint (-∞ < x < 0)

A negative (-∞ < x < 0) number that is not an integer. Equivalent to Negative<Float<T>>.

Matches the hidden -Infinity type.

A negative (-∞ < x < 0) number that is an integer. Equivalent to Negative<Integer<T>>.

A non-negative number/bigint (0 <= x < ∞).

A non-negative (0 <= x < ∞) number that is an integer. Equivalent to NonNegative<Integer<T>>.

Create an opaque type, which hides its internal details from the public, and can only be created by being used explicitly.

Extract all optional keys from the given type.

Type for npm's package.json file. Also includes types for fields used by other popular projects, like TypeScript and Yarn.

Create a type from another type with all keys and nested keys set to optional.

Create a deep version of another type where all keys accepting undefined type are set to optional.

Converts a string literal to pascal-case.

Convert object properties to pascal case but not recursively.

Convert object properties to pascal case recursively.

Matches the hidden Infinity type.

Matches any primitive value.

Create a type that represents either the value or the value wrapped in PromiseLike.

T
PromiseValue
deprecated

Convert objects, Maps, Sets, and Arrays and all of their keys/elements into immutable structures recursively.

Create a type that represents a read-only tuple of the given type and length.

Remove any index signatures from the given object type, so that only explicitly defined properties remain.

Represents a string with some or all matches replaced by a replacement.

Create a type that requires all of the given keys or none of the given keys. The remaining keys are kept as is.

Create a type that requires at least one of the given keys. The remaining keys are kept as is.

Extract all required keys from the given type.

Create a type that requires exactly one of the given keys and disallows more. The remaining keys are kept as is.

Create a deep version of another object type where property values are recursively replaced into a given value type.

Convert a string literal to screaming-snake-case.

Create a type that makes the given keys optional. The remaining keys are kept as is. The sister of the SetRequired type.

Create a type that makes the given keys required. The remaining keys are kept as is. The sister of the SetOptional type.

Create a function type with a return type of your choice and the same parameters as the given function type.

Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.

Convert a string literal to snake-case.

Convert object properties to snake case but not recursively.

Convert object properties to snake case recursively.

Represents an array of strings split using a given character or character set.

Mimic the type inferred by TypeScript when merging two objects using the spread operator.

Create a type with the keys of the given type changed to string type.

Get keys of the given type as strings.

Remove leading and trailing spaces from a string.

Matches any typed array, like Uint8Array or Float64Array.

Convert a union type to an intersection type using distributive conditional types.

Revert an opaque type back to its original type by removing the readonly [tag].

Create a union of the given object's values, and optionally specify which keys to get the values from.

Create a type that strips readonly from all or some of an object's keys. Inverse of Readonly<T>.