-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds the SearchResults type which contains the type of search results found when searching for a string in a Trie
- Loading branch information
Showing
5 changed files
with
31 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export * from "./greet.js"; | ||
export * from "./types.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,28 @@ | ||
export interface GreetOptions { | ||
logger?: (message: string) => void; | ||
message: string; | ||
times?: number; | ||
} | ||
/** | ||
* Represents a search for a string that | ||
* successfully ends at a leaf node. | ||
*/ | ||
export type PERFECT_MATCH = { | ||
matchType: "PERFECT_MATCH"; | ||
}; | ||
|
||
/** | ||
* Represents a search for a string that | ||
* successfully ends at a non-leaf node. | ||
*/ | ||
export type PURE_PREFIX = { | ||
matchType: "PURE_PREFIX"; | ||
}; | ||
/** | ||
* Represents a search for a string that | ||
* is successful. Not strictly necessary | ||
* but useful as the disjunction of | ||
* PERFECT_MATCH and PURE_PREFIX. | ||
*/ | ||
export type PREFIX = { | ||
matchType: "PREFIX"; | ||
}; | ||
/** | ||
* Union type of all possible values of Trie SearchResult | ||
*/ | ||
export type SearchResult = PERFECT_MATCH | PURE_PREFIX | PREFIX | undefined; |