Skip to content

More specific type for acceptedFiles param #100

Description

@luukvhoudt

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions