refactor(language-service): Clean up getTcb interface (#40954)

`GetTcbResponse` should not be a union type with `undefined`.

PR Close #40954
This commit is contained in:
Keen Yee Liau 2021-02-22 14:13:43 -08:00 committed by atscott
parent 06d3267824
commit 3d8ac06e4b

View File

@ -31,7 +31,7 @@ export type GetTcbResponse = {
* code, `selections` is empty. * code, `selections` is empty.
*/ */
selections: ts.TextSpan[], selections: ts.TextSpan[],
}|undefined; };
export type GetComponentLocationsForTemplateResponse = ts.DocumentSpan[]; export type GetComponentLocationsForTemplateResponse = ts.DocumentSpan[];
@ -40,6 +40,6 @@ export type GetComponentLocationsForTemplateResponse = ts.DocumentSpan[];
* whose API surface is a strict superset of TypeScript's language service. * whose API surface is a strict superset of TypeScript's language service.
*/ */
export interface NgLanguageService extends ts.LanguageService { export interface NgLanguageService extends ts.LanguageService {
getTcb(fileName: string, position: number): GetTcbResponse; getTcb(fileName: string, position: number): GetTcbResponse|undefined;
getComponentLocationsForTemplate(fileName: string): GetComponentLocationsForTemplateResponse; getComponentLocationsForTemplate(fileName: string): GetComponentLocationsForTemplateResponse;
} }