21

type-fest - a collection of essential TypeScript types

 5 years ago
source link: https://www.tuicool.com/articles/hit/V3Ufaie
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
u2UVbau.png!webA collection of essential TypeScript types

Many of the types here should have been built-in.

Either add this package as a dependency or copy-paste the needed types. No credit required.

PR welcome for additional commonly needed types and docs improvements.

Install

$ npm install type-fest

Usage

import {Omit} from 'type-fest';

type Foo = {
	unicorn: string;
	rainbow: boolean;
};

type FooWithoutRainbow = Omit<Foo, 'rainbow'>;
//=> {unicorn: string}

API

See the types file .

License

(MIT OR CC0-1.0)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK