diff --git a/packages/cspell-lib/api/api.d.ts b/packages/cspell-lib/api/api.d.ts index 29f0061b222..223e00d229e 100644 --- a/packages/cspell-lib/api/api.d.ts +++ b/packages/cspell-lib/api/api.d.ts @@ -1,7 +1,7 @@ /// -import { Glob, CSpellSettingsWithSourceTrace, ReplaceMap, DictionaryInformation, DictionaryDefinitionPreferred, DictionaryDefinitionAugmented, DictionaryDefinitionCustom, TextOffset, TextDocumentOffset, PnPSettings as PnPSettings$1, ImportFileRef, CSpellUserSettings, LocaleId, CSpellSettings } from '@cspell/cspell-types'; +import { Glob, CSpellSettingsWithSourceTrace, TextOffset, TextDocumentOffset, ImportFileRef, CSpellUserSettings, LocaleId, CSpellSettings } from '@cspell/cspell-types'; export * from '@cspell/cspell-types'; -import { CompoundWordsMethod, SuggestionResult, SuggestionCollector, WeightMap } from 'cspell-trie-lib'; +import { CompoundWordsMethod, SuggestionResult, SuggestionCollector } from 'cspell-trie-lib'; export { CompoundWordsMethod, SuggestionCollector, SuggestionResult } from 'cspell-trie-lib'; export * from 'cspell-io'; import { URI } from 'vscode-uri'; @@ -208,20 +208,6 @@ declare class SpellingDictionaryCollection implements SpellingDictionary { private _isNoSuggestWord; } -/** - * The keys of an object where the values cannot be undefined. - */ -declare type OptionalKeys = Exclude<{ - [P in keyof T]: T[P] extends Exclude ? never : P; -}[keyof T], undefined>; -/** - * Allow undefined in optional fields - */ -declare type OptionalOrUndefined = { - [P in keyof T]: P extends OptionalKeys ? T[P] | undefined : T[P]; -}; - -declare const SymbolCSpellSettingsInternal: unique symbol; interface CSpellSettingsInternal extends Omit { [SymbolCSpellSettingsInternal]: true; dictionaryDefinitions?: DictionaryDefinitionInternal[]; @@ -231,15 +217,6 @@ interface CSpellSettingsInternalFinalized extends CSpellSettingsInternal { ignoreRegExpList: RegExp[]; includeRegExpList: RegExp[]; } -declare type DictionaryDefinitionCustomUniqueFields = Omit; -interface DictionaryDefinitionInternal extends Readonly, Readonly>, Readonly { - /** - * Optional weight map used to improve suggestions. - */ - readonly weightMap?: WeightMap | undefined; - /** The path to the config file that contains this dictionary definition */ - readonly __source?: string | undefined; -} declare function refreshDictionaryCache(maxAge?: number): Promise; @@ -371,15 +348,11 @@ declare namespace text_d { declare type LanguageId = string; declare function getLanguagesForExt(ext: string): string[]; -declare type DocumentUri = URI; +declare type DocumentUri = Uri.Uri; interface Position { line: number; character: number; } -/** - * Range offset tuple. - */ -declare type SimpleRange$1 = [start: number, end: number]; interface TextDocumentLine { readonly text: string; readonly offset: number; @@ -425,7 +398,7 @@ interface CreateTextDocumentParams { version?: number | undefined; } interface TextDocumentContentChangeEvent { - range?: SimpleRange$1; + range?: SimpleRange; text: string; } declare function createTextDocument({ uri, content, languageId, locale, version, }: CreateTextDocumentParams): TextDocument; @@ -439,7 +412,7 @@ declare type LoaderResult = URI | undefined; declare type CSpellSettingsWST$1 = CSpellSettingsWithSourceTrace; declare type CSpellSettingsI$1 = CSpellSettingsInternal; -declare type PnPSettings = OptionalOrUndefined; +declare type PnPSettings = OptionalOrUndefined; declare const sectionCSpell = "cSpell"; declare const defaultFileName = "cspell.json"; declare const defaultConfigFilenames: readonly string[]; @@ -523,8 +496,8 @@ interface IncludeExcludeOptions { ignoreRegExpList?: RegExp[]; includeRegExpList?: RegExp[]; } -interface ValidationResult extends TextOffset { - line: TextOffset; +interface ValidationResult extends TextOffsetRW { + line: TextOffsetRW; isFlagged?: boolean; isFound?: boolean; } @@ -605,7 +578,6 @@ declare class DocumentValidator { private suggest; private genSuggestions; } -declare type Offset = number; declare type SimpleRange = readonly [Offset, Offset]; interface SpellCheckFileOptions extends ValidateTextOptions {