Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shian15810/type-expand
Utilities to expand TypeScript types shown by IntelliSense in Visual Studio Code.
https://github.com/shian15810/type-expand
expand expanddeep hover intellisense type typescript utility vscode
Last synced: about 2 months ago
JSON representation
Utilities to expand TypeScript types shown by IntelliSense in Visual Studio Code.
- Host: GitHub
- URL: https://github.com/shian15810/type-expand
- Owner: shian15810
- License: mit
- Created: 2020-11-16T18:58:13.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-14T06:29:47.000Z (about 4 years ago)
- Last Synced: 2024-12-03T01:12:51.785Z (about 2 months ago)
- Topics: expand, expanddeep, hover, intellisense, type, typescript, utility, vscode
- Homepage: https://www.npmjs.com/package/type-expand
- Size: 60.5 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# type-expand
Utilities to expand TypeScript types shown by IntelliSense in Visual Studio Code.
Inspired by https://stackoverflow.com/a/57683652.
## Installation
```shell
npm install --save-dev type-expand
```## Usage
Commented lines are the results shown in hover info when your cursor hovers over the types.
```typescript
import type { Expand, ExpandDeep } from "type-expand";type FooError = { foo: Error };
type BarError = { bar: Error };type FooBarError = FooError & BarError;
// type FooBarError = FooError & BarError;type ExpandedFooBarError = Expand;
// type ExpandedFooBarError = {
// foo: Error;
// bar: Error;
// };type DeepExpandedFooBarError = ExpandDeep;
// type DeepExpandedFooBarError = {
// foo: {
// name: string;
// message: string;
// stack?: string;
// };
// bar: {
// name: string;
// message: string;
// stack?: string;
// };
// };
```Unlike other utility types, `Expand` and `ExpandDeep` do not transform type in any way.
## See Also
- [`typesafeconfig`](https://github.com/shian15810/typesafeconfig)