To make it simple, I have an issue with Typescript's "Excess Property Checks" behavior. I would like to be sure that an object with extra properties is not be accepted by TypeScript.

In my example of a simple interface I could simply pick the available data, but I have a lot of properties and I would like to avoid filtering them on runtime, is there a way?

Here you can find an example code I made for this topic :

[TypeScript Playground](https://www.typescriptlang.org/play/#code/C4TwDgpgBAMghiA9gV2AFXNA3gKCvqAWzgCcBzASwDsAuKK5QgIwhIG4cBfHHAY0SoBnYFCZwAJgBE4wOFAC8UXASKlKtKACYAzABo8BMBPHUydHfu44AZsiq9gFAVFv2AFEZJxCdeElQYkACUSgb4-EKIADYQAHRRiGQepN5BHCoA9BlQABKs0ACSUADucFQiwIhQyILQYCSIkCSgohCmUILIJHUphFACUSBQEbLUgrAIKOiYUPWNrKBcPFlQAPIA0jZ2vG5YquTUdAAsmlCcQTgrG1B0RuImVGRQFOPiEMAQDhDiUHDjdqVyt9Zg0motXDs9sQDhoTrpZsZTHRtKdzpdsutVjdRBIoOIZHJBAALFBRcRUADkImsFGAW3cYikBIulwAVFAAMoAQQAsgBRKCsjLLbLXW6Ix7PV7vT4fH5-apUQFykHzZogPgCYRQD7CACMvkmARmiihakOUDhCPuSKgKLOHBWmOxjLxBI6JOQZMp1NpmqEFQgwk0hv800gChxTNkbCAA)

```
type LayoutType {
    margin: number;
}

const badData = {
    margin: 23,
    padding: 23,
}

function func(param: LayoutType) {
    console.log(param);
    // Here I want to use property being sure param only contains LayoutType property
}

// OK
func({ margin: 42 })
// OK : padding is detected as unwanted property
func({ margin: 42, padding: 32 })
// KO : bad data shouldn't fit
func(badData)

/* SAME */

// OK : padding is detected as unwanted property
const test1: LayoutType = { margin: 42, padding: 32 };
// KO : bad data shouldn't fit
const test2: LayoutType = badData;

```