Improve Your Frontend Experience With Strapi Types And TypeScript

@Paul_Brats Hi Paul, thanks for your in depth tutorial. But I’m running into a problem… inside the types file saw the MediaValue type that should return a ResponseCollection whenever a media field accepts multiple files:

type MediaValue<TAttribute extends Attribute.Attribute> =
  TAttribute extends Attribute.Media<infer _TKind, infer TMultiple>
    ? Utils.Expression.If<
        TMultiple,
        APIResponseCollection<"plugin::upload.file">,
        APIResponse<"plugin::upload.file"> | null
      >
    : never;

But when I look inside my components.d.ts file, I have a section that contains a media field with that allows for multiple files:

export interface SectionsLanguage extends Schema.Component {
  collectionName: 'components_sections_languages';
  info: {
    displayName: 'Language';
    description: '';
  };
  attributes: {
    title: Attribute.String & Attribute.Required;
    description: Attribute.Text;
    logo: Attribute.Media;
    link: Attribute.String;
  };
}

However, I don’t see anything that indicates that this is a “collection” of media files.

Is this a bug in strapi? Do you have any idea on how I could fix this?