2.1.0 • Published 9 months ago

@suns-echoes/ts-types v2.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

README

About project

The collection of useful TypeScript type definitions and utility types.

Installation

npm i --save-dev @suns-echoes/ts-types

Usage

It might be necessary to add this module to types in tsconfig.json:

{
	// ...
	"compilerOptions": {
		// ...
		"types": ["@suns-echoes/ts-types", ...]
	},
	// ...
}

or to add reference in your project:

/// <reference types="@suns-echoes/ts-types" />

Module Contents

Types

Type nameDescription
AnyArrayAny type of object that have enumerable items.
AnyClassAny type of class.
AnyFunctionAny type of function.
AnyObjectAny type of object.
ObjectLikeAny type that behave similarly to object.
TypedArrayAny of typed arrays.

Alias Types

Type nameDescription
PathKeyA strings representing single keys in nested object path.
PathKeysAn array of strings representing path consecutive keys in nested object.
StringPathA string representing path in nested object.
ObjectKeyThe valid types for object keys.

Utility Types

Type nameDescription
Cast<Target, NewType>Cast object type to another object type.
Immutable<Target>Shallow type cast into immutable type.
ImmutableDeep<Target>Deep type cast into immutable type.
Mutable<Target>Shallow type cast into mutable type.
MutableDeep<Target>Deep type cast into mutable type.
PartialDeep<Target>Make all properties in Target and nested objects optional.

License

Licensed under MIT

Copyright (c) 2022-2024 Aneta Suns

2.1.0

9 months ago

2.0.1

9 months ago

1.0.0

9 months ago

2.0.0

9 months ago

0.1.0

2 years ago

0.0.1

3 years ago