type SomeType => type 선언부의 Generic 을 "A" 타입으로 사용하겠다. type SomeType = T extends "A" ? string : never; => SomeType 에 받은 Generic 이, "A" 라는 조건을 만족하면 string type, 아니라면 에러를 반환하겠다. 이 두가지와 Enum 을 활용해서 아래와 같이 Enum에 따라서 타입 추론이 되는 함수를 만들어 활용할 수 있다. 케이스가 좀 더 필요하다면 아래의 글도 참조하시라 https://velog.io/@bang9dev/Typescript-generic-with-function-logic