From c6c45135c2229d89e9545f83ced3695762e44a59 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 2 Oct 2018 07:19:43 +0100 Subject: [PATCH] definition and docs --- src/monaco.contribution.ts | 2 +- src/monaco.d.ts | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/monaco.contribution.ts b/src/monaco.contribution.ts index e5373f72..9700c5a7 100644 --- a/src/monaco.contribution.ts +++ b/src/monaco.contribution.ts @@ -61,7 +61,7 @@ export class LanguageServiceDefaultsImpl implements monaco.languages.typescript. }; } - setExtraLibs(libs: Array<{ content: string; filePath?: string }> = []): IDisposable { + setExtraLibs(libs: Array<{ content: string; filePath?: string }>): IDisposable { const paths = []; if (libs && libs.length > 0) { diff --git a/src/monaco.d.ts b/src/monaco.d.ts index 35806f17..145efe61 100644 --- a/src/monaco.d.ts +++ b/src/monaco.d.ts @@ -135,11 +135,23 @@ declare module monaco.languages.typescript { * * @param content The file content * @param filePath An optional file path - * @returns A disposabled which will remove the file from the - * language service upon disposal. + * @returns A disposable which will remove the file from the + * language service upon cleanup. */ addExtraLib(content: string, filePath?: string): IDisposable; + /** + * Add multiple source files to the language service. + * Use this for multiple typescript (definition) files that won't be loaded + * as editor document, like `jquery.d.ts`. + * This method is optimised for performance and raises change events only once + * for the whole list. + * @param libs An array of entries to register. + * @returns A disposable which will remove the file from the + * language service upon cleanup. + */ + setExtraLibs(libs: Array<{ content: string; filePath?: string }>): IDisposable; + /** * Set TypeScript compiler options. */