import type {RequiredDeep} from 'type-fest';
type Settings = {
textEditor?: {
fontSize?: number | undefined;
fontColor?: string | undefined;
fontWeight?: number | undefined;
}
autocomplete?: boolean | undefined;
autosave?: boolean | undefined;
};
type RequiredSettings = RequiredDeep<Settings>;
// type RequiredSettings = {
// textEditor: {
// fontSize: number;
// fontColor: string;
// fontWeight: number;
// }
// autocomplete: boolean;
// autosave: boolean;
// }
Note that types containing overloaded functions are not made deeply required due to a TypeScript limitation.
Create a type from another type with all keys and nested keys set to required.
Use-cases: