Skip to content

Create some sort of sub types to force the presence of important keys #780

@adan-ea

Description

@adan-ea

Hi there, I'm currently implementing this library into my project and I really enjoy using it.
But there is still something I feel is missing
My project is a discord bot so I usually have the same structure in the i18n file i.e.:

{
  "embed": {
    "fields": {
      "message": {
        "name": "",
        "value": ""
      },
      "votes": {
        "name": "",
        "value": ""
      },
      "origin": {
        "name": "",
        "value": ""
      }
    }
  }
}

And so, it would be a very nice addition if I could somehow create a type for this part of the object when the key is embed that would look like this:

interface EmbedField {
    name: string;
    value: string;
}

interface Embed {
    title: string,
    description: string,
    fields: {
        [key: string]: EmbedField;
    };
}

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