Styledictionary/4/Type

/icons/calendar.svg

Last update

Sep 9, 2024

What Changed

This codemod introduces strict typing across Style Dictionary, with .d.ts files published alongside each file. Importing from Style Dictionary’s entrypoints now automatically provides implicit types, offering significant improvements for TypeScript users with more accurate and fewer any types. Specific type interfaces can still be imported separately from the style-dictionary/types entrypoint if needed.

Before

import StyleDictionary from 'style-dictionary';
declare type DesignToken = StyleDictionary.DesignToken;
declare type Transform = StyleDictionary.Transform;

After

import type { DesignToken, Transform } from 'style-dictionary/types';

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now