Skip to content

Commit

Permalink
fix: Explicitly import types (#2343)
Browse files Browse the repository at this point in the history
fix: #2341
  • Loading branch information
Jason3S authored Jan 26, 2022
1 parent 5554ecb commit 7131001
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions packages/cspell-trie-lib/src/lib/TrieNode.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { PartialWithUndefined } from './types';

export const FLAG_WORD = 1;

export class ChildMap extends Map<string, TrieNode> {}
Expand Down
5 changes: 3 additions & 2 deletions packages/cspell-trie-lib/src/lib/find.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { TrieNode, FLAG_WORD } from './TrieNode';
import { CASE_INSENSITIVE_PREFIX, COMPOUND_FIX, FORBID_PREFIX } from './constants';
import { mergeDefaults } from './trie-util';
import { FORBID_PREFIX, COMPOUND_FIX, CASE_INSENSITIVE_PREFIX } from './constants';
import { FLAG_WORD, TrieNode } from './TrieNode';
import type { PartialWithUndefined } from './types';

/**
* No compounding allowed.
Expand Down
7 changes: 4 additions & 3 deletions packages/cspell-trie-lib/src/lib/trie-util.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Sequence, genSequence } from 'gensequence';
import { TrieNode, FLAG_WORD, ChildMap, TrieRoot, PartialTrieOptions, TrieOptions } from './TrieNode';
import { YieldResult, walker } from './walker';
import { genSequence, Sequence } from 'gensequence';
import { defaultTrieOptions } from './constants';
import { ChildMap, FLAG_WORD, PartialTrieOptions, TrieNode, TrieOptions, TrieRoot } from './TrieNode';
import type { Mandatory, PartialWithUndefined } from './types';
import { walker, YieldResult } from './walker';

export function insert(text: string, node: TrieNode = {}): TrieNode {
if (text.length) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Make all properties in T optional and Possibly undefined
*/
type PartialWithUndefined<T> = {
export type PartialWithUndefined<T> = {
[P in keyof T]?: T[P] | undefined;
};

type Mandatory<T> = {
export type Mandatory<T> = {
[P in keyof T]-?: Exclude<T[P], undefined>;
};

0 comments on commit 7131001

Please sign in to comment.