I am trying to create a method which parameter has fixed string value types but at the same time i want user to also provide value other than fixed string values.
function create(options: "A" | "B" ){
}
create("C");
Here when user is passing "C" value, typescript is throwing error. This can be fixed by casting "C" to any, but i don't want user to do anything but my method should take care of it.
Consider the options contains 100 of string values, so it is helping users to get those value in intillisense which will help users to don't remember it and use it.
Can i do anything from methods ?


function create(options: string)because when you say function should accept"A"and"B"and any other string value, you want any string value as the parameter type because that will include "A" and "B" as well.