#Can you pass a generic parameter from an interface to its component?

4 messages · Page 1 of 1 (latest)

old zealotBOT
#
Bawdy Ink Slinger#9429

Preview:```ts
export interface ConfigMoment<V extends Version> {
title: string
variables: TwineVariables<V>
pull?: number
}

export interface ConfigState<T extends Version> {
history: ConfigMoment<T>[]
index: number
expired?: string[]
seed?: string
}
...```

abstract crystal
#

Here's what I'm trying to achieve: I want the TwineConfigSave.version to dictate the ConfigMoment.variables interface

#

I don't think it'll work the way I want, especially because there are many warnings in interface TwineVariables<T extends Version>.

#

Is there a way of pulling this off? Please let me know if I'm not being clear