Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Typings for Parameters #12

Open
28 tasks
lukeed opened this issue Apr 30, 2019 · 1 comment
Open
28 tasks

Missing Typings for Parameters #12

lukeed opened this issue Apr 30, 2019 · 1 comment

Comments

@lukeed
Copy link
Owner

lukeed commented Apr 30, 2019

All of these are missing because they involve a large amount of variation & I'm not sure how to do this without redefining all 200 variants 😬 I'm sure (well, I hope 🤞) there's a clever way to do this without so much repetition.

Missing Parameters

All items can be found on this page

  • pr<productIndex>id
  • pr<productIndex>nm
  • pr<productIndex>br
  • pr<productIndex>ca
  • pr<productIndex>va
  • pr<productIndex>pr
  • pr<productIndex>qt
  • pr<productIndex>cc
  • pr<productIndex>ps
  • pr<productIndex>cd<dimensionIndex>
  • pr<productIndex>cm<metricIndex>
  • il<listIndex>nm
  • il<listIndex>pi<productIndex>id
  • il<listIndex>pi<productIndex>nm
  • il<listIndex>pi<productIndex>br
  • il<listIndex>pi<productIndex>ca
  • il<listIndex>pi<productIndex>va
  • il<listIndex>pi<productIndex>ps
  • il<listIndex>pi<productIndex>pr
  • il<listIndex>pi<productIndex>cd<dimensionIndex>
  • il<listIndex>pi<productIndex>cm<metricIndex>
  • promo<promoIndex>id
  • promo<promoIndex>nm
  • promo<promoIndex>cr
  • promo<promoIndex>ps
  • promoa
  • cd<dimensionIndex>
  • cm<metricIndex>
@jamiebuilds
Copy link

jamiebuilds commented Jul 19, 2022

Maybe something like

type productIndex = number
type dimensionIndex = number
type metricIndex = number
type promoIndex = number
type listIndex = number

type F = {
  [K in `pr${productIndex}id`]?: string
} & {
  [K in `pr${productIndex}nm`]?: string
} & {
  [K in `pr${productIndex}br`]?: string
} & {
  [K in `pr${productIndex}ca`]?: string
} & {
  [K in `pr${productIndex}va`]?: string
} & {
  [K in `pr${productIndex}pr`]?: string
} & {
  [K in `pr${productIndex}qt`]?: string
} & {
  [K in `pr${productIndex}cc`]?: string
} & {
  [K in `pr${productIndex}ps`]?: string
} & {
  [K in `pr${productIndex}cd${dimensionIndex}`]?: string
} & {
  [K in `pr${productIndex}cm${metricIndex}`]?: string
} & {
  [K in `il${listIndex}nm`]?: string
} & {
  [K in `il${listIndex}pi${productIndex}id`]?: string
} & {
  [K in `il${listIndex}pi${productIndex}nm`]?: string
} & {
  [K in `il${listIndex}pi${productIndex}br`]?: string
} & {
  [K in `il${listIndex}pi${productIndex}ca`]?: string
} & {
  [K in `il${listIndex}pi${productIndex}va`]?: string
} & {
  [K in `il${listIndex}pi${productIndex}ps`]?: string
} & {
  [K in `il${listIndex}pi${productIndex}pr`]?: string
} & {
  [K in `il${listIndex}pi${productIndex}cd${dimensionIndex}`]?: string
} & {
  [K in `il${listIndex}pi${productIndex}cm${metricIndex}`]?: string
} & {
  [K in `promo${promoIndex}id`]?: string
} & {
  [K in `promo${promoIndex}nm`]?: string
} & {
  [K in `promo${promoIndex}cr`]?: string
} & {
  [K in `promo${promoIndex}ps`]?: string
} & {
  [K in `promoa`]?: string
} & {
  [K in `cd${dimensionIndex}`]?: string
} & {
  [K in `cm${metricIndex}`]?: string
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants