Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

empty object typescript

type EmptyObject = {
    [K in any] : never
}

const one: EmptyObject = {}; // yes ok
const two: EmptyObject = {a: 1}; // error
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #empty #object #typescript
ADD COMMENT
Topic
Name
5+8 =