const names = ["иван", "антон"]
const fn = (name) => name
const names = ["иван", "антон"] as const
const fn = (name: typeof names[0]) => name
const names = [ 'иван', 'антон' ] as const;
type Name = typeof names[number];
const fn = (name: Name) => name;