TypeScript 4.9 introduces satisfies operator. It makes such that an expression satisfy an interface.

Example

In the following code, the compiler makes sure that myConfigSettings satisfies ConfigSettings, even though the actual type of myConfigSettings is the same.

interface CompilerOptions {
    strict?: boolean;
    outDir?: string;
    // ...
}
 
interface ConfigSettings {
    compilerOptions?: CompilerOptions;
    extends?: string | string[];
    // ...
}
 
let myConfigSettings = {
    compilerOptions: {
        strict: true,
        outDir: "../lib",
        // ...
    },
 
    extends: [
        "@tsconfig/strictest/tsconfig.json",
        "../../../tsconfig.base.json"
    ],
 
} satisfies ConfigSettings;

References