UNPKG

cspell-lib

Version:

A library of useful functions used across various cspell tools.

45 lines 3.22 kB
import type { AdvancedCSpellSettingsWithSourceTrace, CSpellSettingsWithSourceTrace, DictionaryDefinition, DictionaryDefinitionAugmented, DictionaryDefinitionCustom, DictionaryDefinitionInline, DictionaryDefinitionPreferred, DictionaryDefinitionSimple, Parser } from '@cspell/cspell-types'; import type { WeightMap } from 'cspell-trie-lib'; import type { OptionalOrUndefined } from '../util/types.js'; export declare const SymbolCSpellSettingsInternal: unique symbol; export interface CSpellSettingsInternal extends Omit<AdvancedCSpellSettingsWithSourceTrace, 'dictionaryDefinitions'> { [SymbolCSpellSettingsInternal]: true; dictionaryDefinitions?: DictionaryDefinitionInternal[]; } export interface CSpellSettingsInternalFinalized extends CSpellSettingsInternal { parserFn: Parser | undefined; finalized: true; ignoreRegExpList: RegExp[]; includeRegExpList: RegExp[]; } type DictionaryDefinitionCustomUniqueFields = Omit<DictionaryDefinitionCustom, keyof DictionaryDefinitionPreferred>; export type DictionaryDefinitionInternal = DictionaryFileDefinitionInternal | DictionaryDefinitionInlineInternal | DictionaryDefinitionSimpleInternal; export type DictionaryDefinitionInlineInternal = DictionaryDefinitionInline & { /** The path to the config file that contains this dictionary definition */ readonly __source?: string | undefined; }; export type DictionaryDefinitionSimpleInternal = DictionaryDefinitionSimple & { /** The path to the config file that contains this dictionary definition */ readonly __source?: string | undefined; }; export interface DictionaryFileDefinitionInternal extends Readonly<DictionaryDefinitionPreferred>, Readonly<Partial<DictionaryDefinitionCustomUniqueFields>>, Readonly<DictionaryDefinitionAugmented> { /** * 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; } export interface DictionaryFileDefinitionInternalWithSource extends DictionaryFileDefinitionInternal { readonly __source: string; } export type DictionaryDefinitionInternalWithSource = DictionaryDefinitionInternal & { readonly __source: string; }; export declare function cleanCSpellSettingsInternal(parts?: OptionalOrUndefined<Partial<CSpellSettingsInternal>>): CSpellSettingsInternal; export declare function createCSpellSettingsInternal(parts?: OptionalOrUndefined<Partial<CSpellSettingsInternal>>): CSpellSettingsInternal; export declare function isCSpellSettingsInternal(cs: CSpellSettingsInternal | CSpellSettingsWithSourceTrace | OptionalOrUndefined<CSpellSettingsInternal | CSpellSettingsWithSourceTrace>): cs is CSpellSettingsInternal; export declare function isDictionaryDefinitionInlineInternal(def: DictionaryDefinitionInternal | DictionaryDefinitionInline | DictionaryDefinition): def is DictionaryDefinitionInlineInternal; export declare function isDictionaryFileDefinitionInternal(def: DictionaryDefinitionInternal | DictionaryDefinitionInline | DictionaryDefinition): def is DictionaryFileDefinitionInternal; export {}; //# sourceMappingURL=CSpellSettingsInternalDef.d.ts.map