UNPKG

2.7 kBSource Map (JSON)View Raw
1{
2 "version": 3,
3 "sources": ["../../../../../packages/language-service/api.ts"],
4 "sourcesContent": ["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the language service package.\n */\n\nimport ts from 'typescript';\n\nexport interface PluginConfig {\n /**\n * If true, return only Angular results. Otherwise, return Angular + TypeScript\n * results.\n */\n angularOnly: boolean;\n /**\n * If true, enable `strictTemplates` in Angular compiler options regardless\n * of its value in tsconfig.json.\n */\n forceStrictTemplates?: true;\n\n /**\n * If false, disables parsing control flow blocks in the compiler. Should be used only when older\n * versions of Angular that do not support blocks (pre-v17) used with the language service.\n */\n enableBlockSyntax?: false;\n}\n\nexport type GetTcbResponse = {\n /**\n * The filename of the SourceFile this typecheck block belongs to.\n * The filename is entirely opaque and unstable, useful only for debugging\n * purposes.\n */\n fileName: string,\n /** The content of the SourceFile this typecheck block belongs to. */\n content: string,\n /**\n * Spans over node(s) in the typecheck block corresponding to the\n * TS code generated for template node under the current cursor position.\n *\n * When the cursor position is over a source for which there is no generated\n * code, `selections` is empty.\n */\n selections: ts.TextSpan[],\n};\n\nexport type GetComponentLocationsForTemplateResponse = ts.DocumentSpan[];\nexport type GetTemplateLocationForComponentResponse = ts.DocumentSpan|undefined;\n\n/**\n * `NgLanguageService` describes an instance of an Angular language service,\n * whose API surface is a strict superset of TypeScript's language service.\n */\nexport interface NgLanguageService extends ts.LanguageService {\n getTcb(fileName: string, position: number): GetTcbResponse|undefined;\n getComponentLocationsForTemplate(fileName: string): GetComponentLocationsForTemplateResponse;\n getTemplateLocationForComponent(fileName: string, position: number):\n GetTemplateLocationForComponentResponse;\n getTypescriptLanguageService(): ts.LanguageService;\n}\n\nexport function isNgLanguageService(ls: ts.LanguageService|\n NgLanguageService): ls is NgLanguageService {\n return 'getTcb' in ls;\n}\n"],
5 "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;AAqEM,SAAU,oBAAoB,IACiB;AACnD,SAAO,YAAY;AACrB;",
6 "names": []
7}