cspell-lib 6.14.2 → 6.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Cache/cspell.cache.d.ts +5 -5
- package/dist/FeatureFlags/FeatureFlags.d.ts +1 -1
- package/dist/LanguageIds.d.ts +5 -5
- package/dist/Models/CSpellSettingsInternalDef.d.ts +1 -1
- package/dist/Models/TextDocument.d.ts +2 -2
- package/dist/Settings/CSpellSettingsServer.d.ts +3 -3
- package/dist/Settings/Controller/configLoader/configLoader.d.ts +3 -3
- package/dist/Settings/Controller/configLoader/normalizeRawSettings.d.ts +5 -5
- package/dist/Settings/Controller/pnpLoader.d.ts +1 -1
- package/dist/Settings/DictionarySettings.d.ts +1 -1
- package/dist/Settings/InDocSettings.d.ts +1 -1
- package/dist/Settings/LanguageSettings.d.ts +1 -1
- package/dist/SpellingDictionary/DictionaryController/DictionaryLoader.d.ts +1 -1
- package/dist/SpellingDictionary/SpellingDictionary.d.ts +1 -1
- package/dist/SpellingDictionary/SuggestExperimental/entities.d.ts +1 -1
- package/dist/SpellingDictionary/SuggestExperimental/suggest.d.ts +1 -1
- package/dist/exclusionHelper.d.ts +2 -2
- package/dist/spellCheckFile.d.ts +1 -1
- package/dist/textValidation/ValidationTypes.d.ts +4 -4
- package/dist/textValidation/parsedText.d.ts +2 -2
- package/dist/util/Comparable.d.ts +6 -6
- package/dist/util/Memorizer.d.ts +2 -2
- package/dist/util/PairingHeap.d.ts +1 -1
- package/dist/util/logger.d.ts +1 -1
- package/dist/util/repMap.d.ts +1 -1
- package/dist/util/timer.d.ts +2 -2
- package/dist/util/types.d.ts +11 -11
- package/dist/util/wordSplitter.d.ts +3 -3
- package/dist/wordListHelper.d.ts +1 -1
- package/package.json +14 -14
|
@@ -7,12 +7,12 @@ export interface CSpellCache {
|
|
|
7
7
|
signature: Hash;
|
|
8
8
|
files: CachedFile[];
|
|
9
9
|
}
|
|
10
|
-
export
|
|
10
|
+
export type Version = '0.1';
|
|
11
11
|
/**
|
|
12
12
|
* Hash used. Starts with hash id. i.e. `sha1-` or `sha512-`.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
15
|
-
export
|
|
14
|
+
export type Hash = string;
|
|
15
|
+
export type UriRelPath = string;
|
|
16
16
|
export declare enum IssueCode {
|
|
17
17
|
UnknownWord = 1,
|
|
18
18
|
ForbiddenWord = 2,
|
|
@@ -24,7 +24,7 @@ export interface CachedFile {
|
|
|
24
24
|
path: UriRelPath;
|
|
25
25
|
issues: Issue[];
|
|
26
26
|
}
|
|
27
|
-
export
|
|
27
|
+
export type Issue = IssueEntry | IssueLine;
|
|
28
28
|
export interface IssueEntry {
|
|
29
29
|
line: number;
|
|
30
30
|
character: number;
|
|
@@ -32,7 +32,7 @@ export interface IssueEntry {
|
|
|
32
32
|
text: string;
|
|
33
33
|
len: number;
|
|
34
34
|
}
|
|
35
|
-
export
|
|
35
|
+
export type IssueLine = [
|
|
36
36
|
line: IssueEntry['line'],
|
|
37
37
|
character: IssueEntry['character'],
|
|
38
38
|
code: IssueEntry['code'],
|
|
@@ -2,7 +2,7 @@ export interface FeatureFlag {
|
|
|
2
2
|
name: string;
|
|
3
3
|
description: string;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
type FlagTypes = string | boolean;
|
|
6
6
|
/**
|
|
7
7
|
* Feature Flags are used to turn on/off features.
|
|
8
8
|
* These are primarily used before a feature has been fully released.
|
package/dist/LanguageIds.d.ts
CHANGED
|
@@ -12,12 +12,12 @@ export interface LanguageExtensionDefinition {
|
|
|
12
12
|
/** Filenames that do not have an extension or have a different type than their implied extension */
|
|
13
13
|
filenames?: string[];
|
|
14
14
|
}
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
15
|
+
export type LanguageDefinition = LanguageExtensionDefinition;
|
|
16
|
+
export type LanguageDefinitions = LanguageDefinition[];
|
|
17
|
+
export type ExtensionToLanguageIdMapSet = Map<string, Set<string>>;
|
|
18
|
+
export type ExtensionToLanguageIdMap = Map<string, string[]>;
|
|
19
19
|
export declare const languageExtensionDefinitions: LanguageDefinitions;
|
|
20
|
-
export
|
|
20
|
+
export type LanguageId = string;
|
|
21
21
|
export declare const binaryLanguages: Set<string>;
|
|
22
22
|
export declare const generatedFiles: Set<string>;
|
|
23
23
|
export declare const languageIds: LanguageId[];
|
|
@@ -12,7 +12,7 @@ export interface CSpellSettingsInternalFinalized extends CSpellSettingsInternal
|
|
|
12
12
|
ignoreRegExpList: RegExp[];
|
|
13
13
|
includeRegExpList: RegExp[];
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
type DictionaryDefinitionCustomUniqueFields = Omit<DictionaryDefinitionCustom, keyof DictionaryDefinitionPreferred>;
|
|
16
16
|
export interface DictionaryDefinitionInternal extends Readonly<DictionaryDefinitionPreferred>, Readonly<Partial<DictionaryDefinitionCustomUniqueFields>>, Readonly<DictionaryDefinitionAugmented> {
|
|
17
17
|
/**
|
|
18
18
|
* Optional weight map used to improve suggestions.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Uri from './Uri';
|
|
2
|
-
export
|
|
2
|
+
export type DocumentUri = Uri.Uri;
|
|
3
3
|
export interface Position {
|
|
4
4
|
line: number;
|
|
5
5
|
character: number;
|
|
@@ -7,7 +7,7 @@ export interface Position {
|
|
|
7
7
|
/**
|
|
8
8
|
* Range offset tuple.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type SimpleRange = [start: number, end: number];
|
|
11
11
|
export interface TextDocumentLine {
|
|
12
12
|
readonly text: string;
|
|
13
13
|
readonly offset: number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AdvancedCSpellSettingsWithSourceTrace, Glob, ImportFileRef } from '@cspell/cspell-types';
|
|
2
2
|
import { CSpellSettingsInternal, CSpellSettingsInternalFinalized } from '../Models/CSpellSettingsInternalDef';
|
|
3
3
|
import { OptionalOrUndefined } from '../util/types';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
type CSpellSettingsWST = AdvancedCSpellSettingsWithSourceTrace;
|
|
5
|
+
type CSpellSettingsWSTO = OptionalOrUndefined<AdvancedCSpellSettingsWithSourceTrace>;
|
|
6
|
+
type CSpellSettingsI = CSpellSettingsInternal;
|
|
7
7
|
declare function mergeObjects(left: undefined, right: undefined): undefined;
|
|
8
8
|
declare function mergeObjects<T>(left: T, right: undefined): T;
|
|
9
9
|
declare function mergeObjects<T>(left: T, right: T): T;
|
|
@@ -5,9 +5,9 @@ import { CSpellSettingsInternal } from '../../../Models/CSpellSettingsInternalDe
|
|
|
5
5
|
import { OptionalOrUndefined } from '../../../util/types';
|
|
6
6
|
import { LoaderResult } from '../pnpLoader';
|
|
7
7
|
import { normalizeCacheSettings } from './normalizeRawSettings';
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
|
|
8
|
+
export type CSpellSettingsWST = CSpellSettingsWithSourceTrace;
|
|
9
|
+
export type CSpellSettingsI = CSpellSettingsInternal;
|
|
10
|
+
type PnPSettings = OptionalOrUndefined<PnPSettingsStrict>;
|
|
11
11
|
export declare const sectionCSpell = "cSpell";
|
|
12
12
|
export declare const defaultFileName = "cspell.json";
|
|
13
13
|
export declare const defaultConfigFilenames: readonly string[];
|
|
@@ -4,7 +4,7 @@ interface NormalizableFields {
|
|
|
4
4
|
version?: string | number;
|
|
5
5
|
}
|
|
6
6
|
export declare function normalizeRawConfig(config: CSpellUserSettings | NormalizableFields): void;
|
|
7
|
-
|
|
7
|
+
type NormalizeDictionaryDefsParams = OptionalOrUndefined<Pick<CSpellUserSettings, 'dictionaryDefinitions' | 'languageSettings'>>;
|
|
8
8
|
export declare function normalizeDictionaryDefs(settings: NormalizeDictionaryDefsParams, pathToSettingsFile: string): import("../../../util/types").RemoveUndefined<{
|
|
9
9
|
dictionaryDefinitions: import("../../../Models/CSpellSettingsInternalDef").DictionaryDefinitionInternalWithSource[] | undefined;
|
|
10
10
|
languageSettings: import("../../../util/types").RemoveUndefined<{
|
|
@@ -29,13 +29,13 @@ export declare function normalizeDictionaryDefs(settings: NormalizeDictionaryDef
|
|
|
29
29
|
parser?: string;
|
|
30
30
|
}>[] | undefined;
|
|
31
31
|
}>;
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
type NormalizeOverrides = Pick<CSpellUserSettings, 'globRoot' | 'overrides'>;
|
|
33
|
+
type NormalizeOverridesResult = Pick<CSpellUserSettings, 'overrides'>;
|
|
34
34
|
export declare function normalizeOverrides(settings: NormalizeOverrides, pathToSettingsFile: string): NormalizeOverridesResult;
|
|
35
|
-
|
|
35
|
+
type NormalizeReporters = Pick<CSpellUserSettings, 'reporters'>;
|
|
36
36
|
export declare function normalizeReporters(settings: NormalizeReporters, pathToSettingsFile: string): NormalizeReporters;
|
|
37
37
|
export declare function normalizeLanguageSettings(languageSettings: LanguageSetting[] | undefined): LanguageSetting[] | undefined;
|
|
38
|
-
|
|
38
|
+
type NormalizeGitignoreRoot = Pick<CSpellUserSettings, 'gitignoreRoot'>;
|
|
39
39
|
export declare function normalizeGitignoreRoot(settings: NormalizeGitignoreRoot, pathToSettingsFile: string): NormalizeGitignoreRoot;
|
|
40
40
|
interface NormalizeSettingsGlobs {
|
|
41
41
|
globRoot?: CSpellUserSettings['globRoot'];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Handles loading of `.pnp.js` and `.pnp.js` files.
|
|
3
3
|
*/
|
|
4
4
|
import { URI } from 'vscode-uri';
|
|
5
|
-
export
|
|
5
|
+
export type LoaderResult = URI | undefined;
|
|
6
6
|
export declare class PnpLoader {
|
|
7
7
|
readonly pnpFiles: string[];
|
|
8
8
|
private cacheKeySuffix;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DictionaryDefinition } from '@cspell/cspell-types';
|
|
2
2
|
import { CSpellSettingsInternal, DictionaryDefinitionInternal, DictionaryDefinitionInternalWithSource } from '../Models/CSpellSettingsInternalDef';
|
|
3
3
|
import { DictionaryReferenceCollection } from './DictionaryReferenceCollection';
|
|
4
|
-
export
|
|
4
|
+
export type DefMapArrayItem = [string, DictionaryDefinitionInternal];
|
|
5
5
|
/**
|
|
6
6
|
* Combines the list of desired dictionaries with the list of dictionary
|
|
7
7
|
* definitions. Order does not matter, but the number of leading `!` does.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSpellUserSettings } from '@cspell/cspell-types';
|
|
2
2
|
import { Sequence } from 'gensequence';
|
|
3
|
-
export
|
|
3
|
+
export type CSpellUserSettingsKeys = keyof CSpellUserSettings;
|
|
4
4
|
export interface DirectiveIssue {
|
|
5
5
|
/**
|
|
6
6
|
* the start and end offsets within the document of the issue.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BaseSetting, CSpellUserSettings, LanguageId, LanguageSetting, LocaleId } from '@cspell/cspell-types';
|
|
2
|
-
export
|
|
2
|
+
export type LanguageSettings = LanguageSetting[];
|
|
3
3
|
export declare function getDefaultLanguageSettings(): LanguageSettings;
|
|
4
4
|
export declare function normalizeLanguageId(langId: LanguageId | LanguageId[]): Set<LanguageId>;
|
|
5
5
|
export declare function normalizeLocale(locale: LocaleId | LocaleId[]): Set<LocaleId>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SpellingDictionary } from 'cspell-dictionary';
|
|
2
2
|
import { CSpellIO } from 'cspell-io';
|
|
3
3
|
import { DictionaryDefinitionInternal } from '../../Models/CSpellSettingsInternalDef';
|
|
4
|
-
export
|
|
4
|
+
export type LoadOptions = DictionaryDefinitionInternal;
|
|
5
5
|
export declare class DictionaryLoader {
|
|
6
6
|
private cspellIO;
|
|
7
7
|
private dictionaryCache;
|
|
@@ -7,7 +7,7 @@ declare const SpellingDictionaryModule: {
|
|
|
7
7
|
readonly createIgnoreWordsDictionary: typeof cspellDictModule.createIgnoreWordsDictionary;
|
|
8
8
|
readonly createSpellingDictionaryFromTrieFile: typeof cspellDictModule.createSpellingDictionaryFromTrieFile;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type SpellDictInterface = typeof SpellingDictionaryModule;
|
|
11
11
|
export type { FindOptions, FindResult, HasOptions, SearchOptions, SpellingDictionary, SpellingDictionaryCollection, SpellingDictionaryOptions, SuggestionCollector, SuggestionResult, SuggestOptions, } from 'cspell-dictionary';
|
|
12
12
|
export declare function getSpellDictInterface(): SpellDictInterface;
|
|
13
13
|
export declare const createSpellingDictionary: typeof cspellDictModule.createSpellingDictionary;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Trie, WalkerIterator } from 'cspell-trie-lib';
|
|
2
2
|
import { SuggestionResult } from './entities';
|
|
3
|
-
export
|
|
3
|
+
export type SuggestionIterator = Generator<SuggestionResult, void, number | undefined>;
|
|
4
4
|
export declare function suggest(trie: Trie, word: string, minScore?: number): SuggestionIterator;
|
|
5
5
|
export declare function suggestIteration(i: WalkerIterator, word: string, minScore?: number): SuggestionIterator;
|
|
6
6
|
//# sourceMappingURL=suggest.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Glob } from '@cspell/cspell-types';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type ExclusionFunction = (fileUri: string) => boolean;
|
|
3
|
+
export type FileExclusionFunction = (file: string) => boolean;
|
|
4
4
|
/** The structure of the VS Code search.exclude settings */
|
|
5
5
|
export interface ExcludeFilesGlobMap {
|
|
6
6
|
[glob: string]: boolean;
|
package/dist/spellCheckFile.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MappedText, TextOffset as TextOffsetRW, Issue } from '@cspell/cspell-types';
|
|
2
|
-
export
|
|
2
|
+
export type TextOffsetRO = Readonly<TextOffsetRW>;
|
|
3
3
|
export interface ValidationOptions extends IncludeExcludeOptions {
|
|
4
4
|
maxNumberOfProblems?: number;
|
|
5
5
|
maxDuplicateProblems?: number;
|
|
@@ -27,8 +27,8 @@ export interface ValidationResult extends TextOffsetRW, Pick<Issue, 'message' |
|
|
|
27
27
|
isFlagged?: boolean | undefined;
|
|
28
28
|
isFound?: boolean | undefined;
|
|
29
29
|
}
|
|
30
|
-
export
|
|
31
|
-
export
|
|
30
|
+
export type ValidationResultRO = Readonly<ValidationResult>;
|
|
31
|
+
export type LineValidatorFn = (line: LineSegment) => Iterable<ValidationResult>;
|
|
32
32
|
export interface LineSegment {
|
|
33
33
|
line: TextOffsetRO;
|
|
34
34
|
segment: TextOffsetRO;
|
|
@@ -37,5 +37,5 @@ export interface MappedTextValidationResult extends MappedText {
|
|
|
37
37
|
isFlagged?: boolean | undefined;
|
|
38
38
|
isFound?: boolean | undefined;
|
|
39
39
|
}
|
|
40
|
-
export
|
|
40
|
+
export type TextValidatorFn = (text: MappedText) => Iterable<MappedTextValidationResult>;
|
|
41
41
|
//# sourceMappingURL=ValidationTypes.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MappedText } from '@cspell/cspell-types';
|
|
2
2
|
import { ValidationIssue } from './validator';
|
|
3
3
|
import * as TextRange from '../util/TextRange';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type Offset = number;
|
|
5
|
+
export type SimpleRange = readonly [Offset, Offset];
|
|
6
6
|
export declare function mapIssueBackToOriginalPos(mappedText: MappedText, issue: ValidationIssue): ValidationIssue;
|
|
7
7
|
export declare function mapRangeBackToOriginalPos(offRange: SimpleRange, map: number[] | undefined): SimpleRange;
|
|
8
8
|
export declare function mapRangeToLocal(rangeOrig: SimpleRange, map: number[] | undefined): SimpleRange;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export type Comparable = number | string | boolean | undefined | null | Date;
|
|
2
|
+
export type ComparableFilter<T> = T extends Comparable ? T : never;
|
|
3
|
+
export type ComparablePropertyNames<T> = {
|
|
4
4
|
[K in keyof T]: T[K] extends Comparable ? K : never;
|
|
5
5
|
}[keyof T];
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
6
|
+
export type ComparableProperties<T> = Pick<T, ComparablePropertyNames<T>>;
|
|
7
|
+
export type CompareArg<T> = ComparablePropertyNames<T> | ((t: T) => Comparable);
|
|
8
|
+
export type CompareFn<T> = (a: T, b: T) => number;
|
|
9
9
|
export declare function compareBy<T>(extract: CompareArg<T>, ...extractors: CompareArg<T>[]): CompareFn<T>;
|
|
10
10
|
export declare function compareBy<T>(extract: CompareArg<T>): CompareFn<T>;
|
|
11
11
|
export declare function compareBy<T>(extract1: CompareArg<T>, extract2: CompareArg<T>): CompareFn<T>;
|
package/dist/util/Memorizer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Only types that can be easily turned into strings */
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type P0 = string | number | boolean | RegExp | undefined;
|
|
3
|
+
type Primitive = P0 | P0[];
|
|
4
4
|
/**
|
|
5
5
|
* Memorize the result of a function call to be returned on later calls with the same parameters.
|
|
6
6
|
*
|
|
@@ -6,7 +6,7 @@ export interface PairHeapNode<T> {
|
|
|
6
6
|
/** Children */
|
|
7
7
|
c: PairHeapNode<T> | undefined;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type CompareFn<T> = (a: T, b: T) => number;
|
|
10
10
|
export declare class PairingHeap<T> implements IterableIterator<T> {
|
|
11
11
|
readonly compare: CompareFn<T>;
|
|
12
12
|
private _heap;
|
package/dist/util/logger.d.ts
CHANGED
package/dist/util/repMap.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ReplaceMap } from '@cspell/cspell-types';
|
|
2
|
-
export
|
|
2
|
+
export type ReplaceMapper = (src: string) => string;
|
|
3
3
|
export declare function createMapper(repMap: ReplaceMap): ReplaceMapper;
|
|
4
4
|
//# sourceMappingURL=repMap.d.ts.map
|
package/dist/util/timer.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ export interface Timer {
|
|
|
13
13
|
lap(): number;
|
|
14
14
|
}
|
|
15
15
|
export declare function createTimer(hrTimeFn?: HRTimeFn): Timer;
|
|
16
|
-
export
|
|
17
|
-
export
|
|
16
|
+
export type HRTimeFn = (time?: HRTime) => HRTime;
|
|
17
|
+
export type HRTime = [number, number];
|
|
18
18
|
export declare function toMilliseconds(t: HRTime): number;
|
|
19
19
|
export declare function polyHrTime(time?: HRTime): HRTime;
|
|
20
20
|
export interface LapRecorder {
|
package/dist/util/types.d.ts
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Make all optional fields required.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type RequireOptional<T> = {
|
|
5
5
|
[K in keyof Required<T>]: T[K];
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* Make all properties in T optional and Possibly undefined
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type PartialWithUndefined<T> = {
|
|
11
11
|
[P in keyof T]?: T[P] | undefined;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Make all fields mandatory
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export type Mandatory<T> = {
|
|
17
17
|
[P in keyof T]-?: Exclude<T[P], undefined>;
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
20
|
* Union the fields
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export type UnionFields<T, U> = {
|
|
23
23
|
[K in keyof T | keyof U]: (K extends keyof T ? T[K] : undefined) | (K extends keyof U ? U[K] : undefined);
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
26
|
* The keys of an object where the values cannot be undefined.
|
|
27
27
|
*/
|
|
28
|
-
export
|
|
28
|
+
export type RequiredKeys<T> = Exclude<{
|
|
29
29
|
[P in keyof T]: T[P] extends Exclude<T[P], undefined> ? P : never;
|
|
30
30
|
}[keyof T], undefined>;
|
|
31
31
|
/**
|
|
32
32
|
* The keys of an object where the values cannot be undefined.
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
34
|
+
export type OptionalKeys<T> = Exclude<{
|
|
35
35
|
[P in keyof T]: T[P] extends Exclude<T[P], undefined> ? never : P;
|
|
36
36
|
}[keyof T], undefined>;
|
|
37
37
|
/**
|
|
38
38
|
* Extract the fields that cannot be `undefined`
|
|
39
39
|
*/
|
|
40
|
-
export
|
|
40
|
+
export type OnlyRequired<T> = {
|
|
41
41
|
[P in RequiredKeys<T>]: T[P];
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
44
|
* Extract the fields that can be `undefined`
|
|
45
45
|
*/
|
|
46
|
-
export
|
|
46
|
+
export type OnlyOptional<T> = {
|
|
47
47
|
[P in keyof T as P extends OptionalKeys<T> ? P : never]: T[P];
|
|
48
48
|
};
|
|
49
|
-
export
|
|
49
|
+
export type MakeOptional<T> = OnlyRequired<T> & Partial<OnlyOptional<T>>;
|
|
50
50
|
/**
|
|
51
51
|
* Like Required, but keeps the Optional.
|
|
52
52
|
*/
|
|
53
|
-
export
|
|
53
|
+
export type RemoveUndefined<T> = {
|
|
54
54
|
[P in keyof T]: Exclude<T[P], undefined>;
|
|
55
55
|
};
|
|
56
56
|
/**
|
|
57
57
|
* Allow undefined in optional fields
|
|
58
58
|
*/
|
|
59
|
-
export
|
|
59
|
+
export type OptionalOrUndefined<T> = {
|
|
60
60
|
[P in keyof T]: P extends OptionalKeys<T> ? T[P] | undefined : T[P];
|
|
61
61
|
};
|
|
62
62
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TextOffset } from '@cspell/cspell-types';
|
|
2
|
-
export
|
|
2
|
+
export type IsValidWordFn = (word: TextOffset) => boolean;
|
|
3
3
|
export interface SplitResult {
|
|
4
4
|
/** Original line passed to the split function */
|
|
5
5
|
line: TextOffset;
|
|
@@ -23,7 +23,7 @@ export interface TextOffsetWithValid extends TextOffset {
|
|
|
23
23
|
export interface SplitOptions extends WordBreakOptions {
|
|
24
24
|
}
|
|
25
25
|
export declare function split(line: TextOffset, offset: number, isValidWord: IsValidWordFn, options?: SplitOptions): SplitResult;
|
|
26
|
-
|
|
26
|
+
type BreakPairs = readonly number[];
|
|
27
27
|
interface PossibleWordBreak {
|
|
28
28
|
/** offset from the start of the string */
|
|
29
29
|
offset: number;
|
|
@@ -34,7 +34,7 @@ interface PossibleWordBreak {
|
|
|
34
34
|
*/
|
|
35
35
|
breaks: BreakPairs[];
|
|
36
36
|
}
|
|
37
|
-
export
|
|
37
|
+
export type SortedBreaks = PossibleWordBreak[];
|
|
38
38
|
interface WordBreakOptions {
|
|
39
39
|
optionalWordBreakCharacters?: string;
|
|
40
40
|
}
|
package/dist/wordListHelper.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cspell-lib",
|
|
3
|
-
"version": "6.14.
|
|
3
|
+
"version": "6.14.3",
|
|
4
4
|
"description": "A library of useful functions used across various cspell tools.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -48,19 +48,19 @@
|
|
|
48
48
|
},
|
|
49
49
|
"homepage": "https://github.com/streetsidesoftware/cspell#readme",
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@cspell/cspell-bundled-dicts": "6.14.
|
|
52
|
-
"@cspell/cspell-pipe": "6.14.
|
|
53
|
-
"@cspell/cspell-types": "6.14.
|
|
54
|
-
"@cspell/strong-weak-map": "6.14.
|
|
51
|
+
"@cspell/cspell-bundled-dicts": "6.14.3",
|
|
52
|
+
"@cspell/cspell-pipe": "6.14.3",
|
|
53
|
+
"@cspell/cspell-types": "6.14.3",
|
|
54
|
+
"@cspell/strong-weak-map": "6.14.3",
|
|
55
55
|
"clear-module": "^4.1.2",
|
|
56
56
|
"comment-json": "^4.2.3",
|
|
57
57
|
"configstore": "^5.0.1",
|
|
58
|
-
"cosmiconfig": "^7.0
|
|
59
|
-
"cspell-dictionary": "6.14.
|
|
60
|
-
"cspell-glob": "6.14.
|
|
61
|
-
"cspell-grammar": "6.14.
|
|
62
|
-
"cspell-io": "6.14.
|
|
63
|
-
"cspell-trie-lib": "6.14.
|
|
58
|
+
"cosmiconfig": "^7.1.0",
|
|
59
|
+
"cspell-dictionary": "6.14.3",
|
|
60
|
+
"cspell-glob": "6.14.3",
|
|
61
|
+
"cspell-grammar": "6.14.3",
|
|
62
|
+
"cspell-io": "6.14.3",
|
|
63
|
+
"cspell-trie-lib": "6.14.3",
|
|
64
64
|
"fast-equals": "^4.0.3",
|
|
65
65
|
"find-up": "^5.0.0",
|
|
66
66
|
"fs-extra": "^10.1.0",
|
|
@@ -85,15 +85,15 @@
|
|
|
85
85
|
"@cspell/dict-python": "^4.0.0",
|
|
86
86
|
"@types/configstore": "^5.0.1",
|
|
87
87
|
"@types/fs-extra": "^9.0.13",
|
|
88
|
-
"@types/jest": "^29.2.
|
|
88
|
+
"@types/jest": "^29.2.3",
|
|
89
89
|
"@types/node": "^18.11.9",
|
|
90
90
|
"cspell-dict-nl-nl": "^1.1.2",
|
|
91
91
|
"jest": "^29.3.1",
|
|
92
92
|
"lorem-ipsum": "^2.0.8",
|
|
93
93
|
"rimraf": "^3.0.2",
|
|
94
|
-
"rollup": "^3.
|
|
94
|
+
"rollup": "^3.3.0",
|
|
95
95
|
"rollup-plugin-dts": "^5.0.0",
|
|
96
96
|
"ts-jest": "^29.0.3"
|
|
97
97
|
},
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "df0efdbb0dc7b084579130ba5fe97441c0ab67ca"
|
|
99
99
|
}
|