-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Description
We use objects often as a way to pass many parameters to remoting functions.
We'd like to very strictly typecheck these objects, but it appears we're unable to properly seal the objects in the type definitions. For example, we want the following code to fail:
type GetTableParams = {table: string, optionalProperty?: number};
db.getTable = (params: GetTableParams): Promise<Array<Object>> {
...
}
// This should throw an error
db.getTable({table: 'foo', anInvalidProperty: 'bar'});Is there a way to signify that an object type should have only the properties in the typedef and nothing more?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels