我有接口IObfuscatorOptions
,它描述了包自定义选项对象(对于用户)。
export interface IObfuscatorOptions {
compact?: boolean;
debugProtection?: boolean;
debugProtectionInterval?: boolean;
disableConsoleOutput?: boolean;
encodeUnicodeLiterals?: boolean;
reservedNames?: string[];
rotateUnicodeArray?: boolean;
selfDefending?: boolean;
sourceMap?: boolean;
sourceMapMode?: TSourceMapMode;
unicodeArray?: boolean;
unicodeArrayThreshold?: number;
wrapUnicodeArrayCalls?: boolean;
[key: string]: any;
}
现在我想创建一个包含成员的内部类Options
- 来自IObfuscatorOptions
的所有选项。 此类将实现接口IOptions
。
我希望该界面IOptions
包含IObfuscatorOptions
的所有选项,但不包含optional
修饰符和readonly
修饰符。
如果不像我现在那样重新声明所有IObfuscatorOptions
属性,可以这样做吗?
// bad bad bad
export interface IOptions {
readonly compact: boolean;
readonly debugProtection: boolean;
readonly debugProtectionInterval: boolean;
readonly disableConsoleOutput: boolean;
readonly encodeUnicodeLiterals: boolean;
readonly reservedNames: string[];
readonly rotateUnicodeArray: boolean;
readonly selfDefending: boolean;
readonly sourceMap: boolean;
readonly sourceMapMode: TSourceMapMode;
readonly unicodeArray: boolean;
readonly unicodeArrayThreshold: number;
readonly wrapUnicodeArrayCalls: boolean;
}