This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Helper type-level function to expand a given type to show all of its inferred fields when hovered. | |
* | |
* @see {@link https://stackoverflow.com/a/57683652} | |
* @see {@link https://gist.github.com/trevor-atlas/b277496d0379d574cadd3cf8af0de34c} | |
*/ | |
type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never | |
/** | |
* Represents an argument. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
analyze reserved properties from bundled dts for terser | |
$ pnpm tsm analyze.ts src/*.{ts, tsx} -i src/index.ts | |
{ | |
"reservedProperties": [ | |
"result", | |
"value", | |
"pubTypeKey", | |
"ikey", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { ComponentType, LazyExoticComponent } from "react"; | |
type Transformer = <T>(name: keyof T) => (module: T) => { default: T[keyof T] }; | |
const transformer: Transformer = ( | |
(name) => (module) => ({ default: module[name] }) | |
); | |
OlderNewer