RecipesChapter 8: Helper Types

Remapping Types

Recipe 8.3 from The TypeScript Cookbook

type SettingsRemapped = DeepRemap<Settings>;

// results in

type SettingsRemapped = {
    mode: "light" | "dark";
    playbackSpeed: number;
    subtitles: {
        active: boolean;
        color: string;
    };
};
Open in TypeScript Playground →