I have the following two interfaces:
export interface TestSchema<S> {
data: S;
description: string;
}
export type someType = 'option1' | 'option2';
export interface AnotherInterface {
primary: string;
secondary: someType;
tertiary: string;
}
These are then referenced in a different file as
valuesList: TestSchema<AnotherInterface>[] = [
{ data: { primary: 'example', secondary: 'selection', tertiary: 'item' }, description: 'Available' },
{ data: { primary: 'sample', secondary: 'choice', tertiary: 'element' }, description: 'Not Available' }
];
Is there an alternative method for utilizing the generic type without explicitly using <S>
in the TestSchema<S>
definition?