문자열 리터럴 형식 인수를 기반으로 하는 변수 반환 형식 TypeScript 1.8 또는 2.0에서 문자열 리터럴 형식 인수 값을 기반으로 한 변수 반환 형식을 가질 수 있습니까? type Fruit = "apple" | "orange" function doSomething(foo : Fruit) : string | string[] { if (foo == "apple") return "hello"; else return ["hello","world"]; } var test : string[] = doSomething("orange"); 오류: TS2322: 'string | string[]' 유형은 'string[]' 유형에 할당할 수 없습니다. 예, 오버로드 서명을 사용하여 원하는 작업을 정확히 수행할..