TypeScript Type Annotation Excluding Primitives
问题 The question: Is there any way to write a type annotation in TypeScript that allows any object literal, but doesn't allow built-in types number , string , boolean , Function or Array ? Why? I have been working on improving some type definitions on DefinitelyTyped for some libraries I am using on my projects at work. A common pattern I have noticed in many JS libraries is to pass an 'options' object used to configure the library or plugin. In these cases, you will often you will see type