Defined a form schema type example:
type FormSchema = { username: string; settings: { theme: string; language: string } }
Now, trying to define the Form Input type like this:
type FormInput = { id: keyof FormSchema | `${keyof FormSchema}.${string}` }
Encountering an error when setting the template literal part:
Type 'symbol' is not assignable to type 'string'
UPDATE:
Made a syntax error in my initial post apologies for that. Here is the actual code with the issue:
export type FormSection<
FormSchema = { [key: string]: any | { [key: string]: any } }
> = {
id: string;
elements: FormElementGeneric<
keyof FormSchema | `${keyof FormSchema}.${string}`,
FormInputTypes,
FormInputTypesProps
>[];
};
https://i.sstatic.net/Gneoy.png
Running Typescript version 5.2.2