-1

I have the following typescript interface:

UserInfo: {
     user: {
        options: ReadonlyArray<{
            values: ReadonlyArray<{
                value: string | null;
            }
        }
    }

I want to access the options how do I get it. I tried like below but it doesn't work for me

type options = ScreenQuery["UserInfo"]["user"]["options"];

1 Answers1

0

I don't know what ScreenQuery is in your snippet but if UserInfo is indeed an interface this works (Playground link):

interface UserInfo {
  user: {
    options: ReadonlyArray<{
      values: ReadonlyArray<{
        value: string | null;
      }>
    }>
  }
}

type options = UserInfo['user']['options'];