1
一种给定一个模块是这样的:生成模块自身的出口键
export const a: string;
export const b: string;
从外面就可以产生这样的类型"a" | "b"
:
import * as stuff from "./stuff";
type StuffKeys = keyof typeof stuff; // "a" | "b"
但我想生成和出口这种类型从模块内的。类似于:
export type MyKeys = keyof typeof this;
但这并不奏效。
有没有办法做到这一点?