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: 11 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 (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-14T06:29:47.000Z (over 5 years ago)
- Last Synced: 2025-05-19T17:44:07.797Z (about 1 year ago)
- Topics: expand, expanddeep, hover, intellisense, type, typescript, utility, vscode
- Homepage: https://www.npmjs.com/package/type-expand
- Size: 60.5 KB
- Stars: 10
- 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)