attr-accept icon indicating copy to clipboard operation
attr-accept copied to clipboard

More specific type for acceptedFiles param

Open luukvhoudt opened this issue 7 months ago • 0 comments

Small suggestion to improve the type of the acceptedFiles param.

In my project I use:

type NonEmptyArray<T = unknown> = [T, ...T[]];
type UniqueFileTypeSpecifier = `${string}/${string}` | `.${string}`;
type AcceptedFiles = UniqueFileTypeSpecifier | NonEmptyArray<UniqueFileTypeSpecifier>

Not perfect but it does at least give some indicator. I don't use the comma-separated feature but my type should also allow that.

luukvhoudt avatar Jul 03 '25 21:07 luukvhoudt