Skip to main content
Module

x/scaffold/src/deps/types.ts

scaffold your next project with style and 💗
Latest
import * as mod from "https://deno.land/x/scaffold@0.3.0/src/deps/types.ts";

Interfaces

Matches a value that is like an Observable.

Type for TypeScript's tsconfig.json file (TypeScript 3.7).

Type Aliases

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.

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.

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.

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.

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.

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.

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.

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>.