UNPKG

cspell

Version:

A Spelling Checker for Code!

116 lines (115 loc) 4.48 kB
import { a as SuggestionOptions, i as LinterCliOptions, n as DictionariesOptions, o as TraceOptions, r as LegacyOptions, t as BaseOptions } from "./options-BeJCICDB.js"; import { CheckTextInfo, FeatureFlags, IncludeExcludeFlag, SuggestionsForWordResult, TraceResult, TraceWordResult } from "cspell-lib"; import { CSpellReporter, RunResult } from "@cspell/cspell-types"; //#region src/config/options.d.ts interface BaseConfigOptions { /** * The path to the configuration file to create / update. * If not provided, a default file name will be used based on the format. */ config?: string; /** * The list of configuration files or dictionary packages to import. * This can be a list of file paths, package names, or URLs. */ import?: string[]; /** * The locale to use when spell checking (e.g., en, en-US, de). */ locale?: string; /** * Whether to add comments to the configuration file. * - `true` - comments will be added to the configuration file. * - `false` - no comments will be added. * - `undefined` - the default behavior will be used based on the format. */ comments?: boolean; /** * Whether to remove all comments from the configuration file. * - `true` - all comments will be removed. * - `false` | `undefined` - no comments will be removed. * @implies `comments: false` */ removeComments?: boolean; /** * Whether to add the schema reference to the configuration file. * - `true` - the schema reference will be added / updated. * - `false` - no schema reference will be added. */ schema?: boolean; /** * The list of dictionaries to enable in the configuration file. * These are added to an existing configuration file or a new one. * Existing dictionaries will not be removed. */ dictionary?: string[]; /** * Whether to write the configuration to stdout instead of a file. */ stdout?: boolean; } interface InitOptions extends BaseConfigOptions { /** * The path where the configuration file will be written, it can be a file path or a URL. * If not provided, a default file name will be used based on the format. * The default will be `cspell.config.yaml` or `cspell.json` based on the format. * @conflicts `config` - If `config` is provided, it will be used instead of `output`. */ output?: string; /** * The format of the configuration file. * @conflicts `config` - If `config` is provided, the format will be inferred from the file extension. */ format?: "yaml" | "yml" | "json" | "jsonc"; } //#endregion //#region src/emitters/suggestionsEmitter.d.ts interface TimedSuggestionsForWordResult extends SuggestionsForWordResult { elapsedTimeMs?: number; } //#endregion //#region src/dictionaries/listDictionaries.d.ts interface ListDictionariesResult { /** * The name of the dictionary. */ name: string; /** * The description of the dictionary. */ description?: string | undefined; /** * The path to the dictionary file. */ path?: string | undefined; /** * True if the dictionary is enabled. */ enabled: boolean; /** * The inline dictionaries supported by the dictionary. */ inline?: string[] | undefined; /** * the languages locales supported by the dictionary. */ locales?: string[] | undefined; /** * The file types supported by the dictionary. */ fileTypes?: string[] | undefined; } declare function listDictionaries(options: DictionariesOptions): Promise<ListDictionariesResult[]>; //#endregion //#region src/application.d.mts type AppError = NodeJS.ErrnoException; declare function lint(fileGlobs: string[], options: LinterCliOptions, reporter?: CSpellReporter): Promise<RunResult>; declare function trace(words: string[], options: TraceOptions): AsyncIterableIterator<TraceWordResult>; type CheckTextResult = CheckTextInfo; declare function checkText(filename: string, options: BaseOptions & LegacyOptions): Promise<CheckTextResult>; declare function suggestions(words: string[], options: SuggestionOptions): AsyncIterable<TimedSuggestionsForWordResult>; declare function createInit(options: InitOptions): Promise<void>; declare function parseApplicationFeatureFlags(flags: string[] | undefined): FeatureFlags; //#endregion export { checkText as a, parseApplicationFeatureFlags as c, listDictionaries as d, TraceResult as i, suggestions as l, CheckTextResult as n, createInit as o, IncludeExcludeFlag as r, lint as s, AppError as t, trace as u }; //# sourceMappingURL=application-B84gvlDU.d.ts.map