Closed lukasoppermann closed 5 months ago
Hmm I think I should consider exporting all types inside our types directory instead of only the main interfaces.
PRs very welcome to adjust https://github.com/amzn/style-dictionary/blob/v4/types/index.d.ts and export all from all sibling .d.ts files (Volume.d.ts is new, should be added as well)
Cool trick you can do as well:
import type { Format } from 'style-dictionary/types';
type FormatterArguments = Parameters<Format['formatter']>;
Somehow for me using this "trick" I don't get ts autocomplete or suggestions.
PR is up: https://github.com/amzn/style-dictionary/pull/1137
Hope this is what you meant.
Works for me. Since style-dictionary uses package entrypoints your tsconfig compilerOptions needs "module": "nodenext"
and "moduleResolution": "nodenext"
or "moduleResolution": "bundler"
if you need it e.g. extensionless imports, otherwise it won't be able to find the declarations
Hey @jorenbroekema,
I have no idea how to access some types, like
FormatterArguments
.They are not exported from
style-dictionary/types
and also not available through something likeFormat['FormatterArguments']
.The way you use it in here, seems to not be typical typescript, so can you help me find out how I can access those types? Thanks.
One of the places where I have this issue is here: https://github.com/lukasoppermann/style-dictionary-utils/pull/65/files#diff-4c8b203eb592cb0973b6227b4be99616520e7b0351981b54dfbd320fd0aa117aR3