This file contains 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
// This will list all the readonly properties of MyInterface | |
const readonlyProperties = propertiesOf<MyInterface>({ readonly: true }); | |
// This will list all the optional properties of MyInterface | |
const optionalProperties = propertiesOf<MyInterface>({ optional: true }); | |
// This will list all the required properties of MyInterface | |
const requiredProperties = propertiesOf<MyInterface>({ optional: false }); | |
// But feel free to ask for private readonly OR public optional properties | |
const verySpecificProperties = propertiesOf<MyInterface>( | |
{ private: true, readonly: true } | |
{ public: true, optional: true } | |
); | |
// Or maybe a combination of required non-public properties | |
// and protected optional ones? I mean why not | |
const evenMoreSpecificProperties = propertiesOf<MyInterface>( | |
{ public: false, optional: false } | |
{ protected: true, optional: true } | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment