import {JustProps} from 'type-fest';
interface Foo {
a: string;
b: number;
c(): string;
d(x: string): string;
}
const foo: JustProps<Foo> = {a: 'a', b: 1};
Idea from https://github.com/sindresorhus/type-fest/pull/4/files, original code from https://zirkelc.dev/posts/extract-class-methods
Note: Exclude<..., never> is used to force TypeScript to report final type as an object, not a type helper call
Create a new type from an object type extracting just properties, not methods.