I have an interface in my application:
interface Asset {
id: string;
internal_id: string;
usage: number;
}
that is part of a post int
In addition to David Sherret answer just a few lines from my side how it can be implemented directly without Partial type for better understanding of the subject.
interface IAsset {
id: string;
internal_id: string;
usage: number;
}
interface IPost {
asset: IAsset;
}
interface IPostDraft {
asset: { [K in keyof IAsset]?: IAsset[K] };
}
const postDraft: IPostDraft = {
asset: {
usage: 123
}
};