@@ -274,38 +274,18 @@ declare namespace text_d {
274
274
} ;
275
275
}
276
276
277
- interface FeatureFlag {
278
- name : string ;
279
- description : string ;
280
- }
281
- type FlagTypes = string | boolean ;
282
- /**
283
- * Feature Flags are used to turn on/off features.
284
- * These are primarily used before a feature has been fully released.
285
- */
286
- declare class FeatureFlags {
287
- private flags ;
288
- private flagValues ;
289
- constructor ( flags ?: FeatureFlag [ ] ) ;
290
- register ( flag : FeatureFlag ) : this;
291
- register ( name : string , description : string ) : this;
292
- getFlag ( flag : string ) : FlagTypes | undefined ;
293
- getFlagBool ( flag : string ) : boolean | undefined ;
294
- setFlag ( flag : string , value ?: FlagTypes ) : this;
295
- getFlagInfo ( flag : string ) : FeatureFlag | undefined ;
296
- getFlags ( ) : FeatureFlag [ ] ;
297
- getFlagValues ( ) : Map < string , FlagTypes > ;
298
- reset ( ) : this;
277
+ interface Document {
278
+ uri : UriString ;
279
+ text ?: string ;
280
+ languageId ?: string ;
281
+ locale ?: string ;
299
282
}
300
- declare class UnknownFeatureFlagError extends Error {
301
- readonly flag : string ;
302
- constructor ( flag : string ) ;
283
+ type UriString = string ;
284
+ interface DocumentWithText extends Document {
285
+ text : string ;
303
286
}
304
- declare function getSystemFeatureFlags ( ) : FeatureFlags ;
305
287
306
- type LanguageId = string ;
307
- declare function getLanguagesForExt ( ext : string ) : string [ ] ;
308
- declare function getLanguagesForBasename ( basename : string ) : string [ ] ;
288
+ declare function isBinaryFile ( filenameUri : URI , languageId ?: string | string [ ] ) : boolean ;
309
289
310
290
type DocumentUri = URI ;
311
291
interface Position {
@@ -369,13 +349,52 @@ interface TextDocumentContentChangeEvent {
369
349
declare function createTextDocument ( { uri, content, languageId, locale, version, } : CreateTextDocumentParams ) : TextDocument ;
370
350
declare function updateTextDocument ( doc : TextDocument , edits : TextDocumentContentChangeEvent [ ] , version ?: number ) : TextDocument ;
371
351
352
+ declare function fileToDocument ( file : string ) : Document ;
353
+ declare function fileToDocument ( file : string , text : string , languageId ?: string , locale ?: string ) : DocumentWithText ;
354
+ declare function fileToDocument ( file : string , text ?: string , languageId ?: string , locale ?: string ) : Document | DocumentWithText ;
355
+ declare function fileToTextDocument ( file : string ) : Promise < TextDocument > ;
356
+
357
+ interface FeatureFlag {
358
+ name : string ;
359
+ description : string ;
360
+ }
361
+ type FlagTypes = string | boolean ;
362
+ /**
363
+ * Feature Flags are used to turn on/off features.
364
+ * These are primarily used before a feature has been fully released.
365
+ */
366
+ declare class FeatureFlags {
367
+ private flags ;
368
+ private flagValues ;
369
+ constructor ( flags ?: FeatureFlag [ ] ) ;
370
+ register ( flag : FeatureFlag ) : this;
371
+ register ( name : string , description : string ) : this;
372
+ getFlag ( flag : string ) : FlagTypes | undefined ;
373
+ getFlagBool ( flag : string ) : boolean | undefined ;
374
+ setFlag ( flag : string , value ?: FlagTypes ) : this;
375
+ getFlagInfo ( flag : string ) : FeatureFlag | undefined ;
376
+ getFlags ( ) : FeatureFlag [ ] ;
377
+ getFlagValues ( ) : Map < string , FlagTypes > ;
378
+ reset ( ) : this;
379
+ }
380
+ declare class UnknownFeatureFlagError extends Error {
381
+ readonly flag : string ;
382
+ constructor ( flag : string ) ;
383
+ }
384
+ declare function getSystemFeatureFlags ( ) : FeatureFlags ;
385
+
386
+ type LanguageId = string ;
387
+ declare function getLanguagesForExt ( ext : string ) : string [ ] ;
388
+ declare function getLanguagesForBasename ( basename : string ) : string [ ] ;
389
+
372
390
declare const currentSettingsFileVersion = "0.2" ;
373
391
declare const ENV_CSPELL_GLOB_ROOT = "CSPELL_GLOB_ROOT" ;
374
392
375
393
type LoaderResult = URI | undefined ;
376
394
377
395
type CSpellSettingsWST$1 = CSpellSettingsWithSourceTrace ;
378
396
type CSpellSettingsI$1 = CSpellSettingsInternal ;
397
+
379
398
type PnPSettings = OptionalOrUndefined < PnPSettings$1 > ;
380
399
declare const sectionCSpell = "cSpell" ;
381
400
declare const defaultFileName = "cspell.json" ;
@@ -391,13 +410,6 @@ declare function loadConfig(file: string, pnpSettings?: PnPSettings): Promise<CS
391
410
declare function loadPnP ( pnpSettings : PnPSettings , searchFrom : URI ) : Promise < LoaderResult > ;
392
411
declare function loadPnPSync ( pnpSettings : PnPSettings , searchFrom : URI ) : LoaderResult ;
393
412
declare function readRawSettings ( filename : string , relativeTo ?: string ) : CSpellSettingsWST$1 ;
394
- /**
395
- *
396
- * @param filenames - settings files to read
397
- * @returns combined configuration
398
- * @deprecated true
399
- */
400
- declare function readSettingsFiles ( filenames : string [ ] ) : CSpellSettingsI$1 ;
401
413
declare function getGlobalSettings ( ) : CSpellSettingsI$1 ;
402
414
declare function getCachedFileSize ( ) : number ;
403
415
declare function clearCachedSettingsFiles ( ) : void ;
@@ -429,6 +441,14 @@ declare function readSettings(filename: string, defaultValues: CSpellSettingsWST
429
441
declare function readSettings ( filename : string , relativeTo : string ) : CSpellSettingsI$1 ;
430
442
declare function readSettings ( filename : string , relativeTo : string , defaultValues : CSpellSettingsWST$1 ) : CSpellSettingsI$1 ;
431
443
444
+ /**
445
+ *
446
+ * @param filenames - settings files to read
447
+ * @returns combined configuration
448
+ * @deprecated true
449
+ */
450
+ declare function readSettingsFiles ( filenames : string [ ] ) : CSpellSettingsI$1 ;
451
+
432
452
declare class ImportError extends Error {
433
453
readonly cause : Error | undefined ;
434
454
constructor ( msg : string , cause ?: Error | unknown ) ;
@@ -713,16 +733,6 @@ interface SpellCheckFileResult {
713
733
checked : boolean ;
714
734
errors : Error [ ] | undefined ;
715
735
}
716
- type UriString = string ;
717
- interface DocumentWithText extends Document {
718
- text : string ;
719
- }
720
- interface Document {
721
- uri : UriString ;
722
- text ?: string ;
723
- languageId ?: string ;
724
- locale ?: string ;
725
- }
726
736
/**
727
737
* Spell Check a file
728
738
* @param file - absolute path to file to read and check.
@@ -754,11 +764,6 @@ interface DetermineFinalDocumentSettingsResult {
754
764
* @param settings - The near final settings. Should already be the combination of all configuration files.
755
765
*/
756
766
declare function determineFinalDocumentSettings ( document : DocumentWithText , settings : CSpellUserSettings ) : DetermineFinalDocumentSettingsResult ;
757
- declare function isBinaryFile ( filenameUri : URI , languageId ?: string | string [ ] ) : boolean ;
758
- declare function fileToDocument ( file : string ) : Document ;
759
- declare function fileToDocument ( file : string , text : string , languageId ?: string , locale ?: string ) : DocumentWithText ;
760
- declare function fileToDocument ( file : string , text ?: string , languageId ?: string , locale ?: string ) : Document | DocumentWithText ;
761
- declare function fileToTextDocument ( file : string ) : Promise < TextDocument > ;
762
767
763
768
interface SuggestedWordBase extends SuggestionResult {
764
769
dictionaries : string [ ] ;
0 commit comments