Typeseedcordv0.10.6
Except
Create a type from an object type without certain keys.
We recommend setting the requireExactPropsrequireExactProps option to truetrue.
This type is a stricter version of OmitOmit. The OmitOmit type does not restrict the omitted keys to be keys present on the given type, while ExceptExcept does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types (microsoft/TypeScript#30825).
type Except<
ObjectType,
KeysType extends keyof ObjectType,
Options extends ExceptOptions = {}
> = _Except<
ObjectType,
KeysType,
ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>
>;type Except<
ObjectType,
KeysType extends keyof ObjectType,
Options extends ExceptOptions = {}
> = _Except<
ObjectType,
KeysType,
ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>
>;ObjectType
ObjectTypeObjectTypeKeysType
KeysType extends keyof ObjectTypeKeysType extends keyof ObjectTypeOptions
Options extends ExceptOptions = {}Options extends ExceptOptions = {}