You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					34 lines
				
				621 B
			
		
		
			
		
	
	
					34 lines
				
				621 B
			| 
								 
											3 years ago
										 
									 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * Mnemonist SymSpell Typings
							 | 
						||
| 
								 | 
							
								 * ===========================
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								type SymSpellVerbosity = 0 | 1 | 2;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								type SymSpellOptions = {
							 | 
						||
| 
								 | 
							
								  maxDistance?: number;
							 | 
						||
| 
								 | 
							
								  verbosity?: SymSpellVerbosity
							 | 
						||
| 
								 | 
							
								};
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								type SymSpellMatch = {
							 | 
						||
| 
								 | 
							
								  term: string;
							 | 
						||
| 
								 | 
							
								  distance: number;
							 | 
						||
| 
								 | 
							
								  count: number;
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								export default class SymSpell {
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  // Members
							 | 
						||
| 
								 | 
							
								  size: number;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  // Constructor
							 | 
						||
| 
								 | 
							
								  constructor(options?: SymSpellOptions);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  // Methods
							 | 
						||
| 
								 | 
							
								  clear(): void;
							 | 
						||
| 
								 | 
							
								  add(string: string): this;
							 | 
						||
| 
								 | 
							
								  search(query: string): Array<SymSpellMatch>;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  // Statics
							 | 
						||
| 
								 | 
							
								  static from(strings: Iterable<string> | {[key: string]: string}, options?: SymSpellOptions): SymSpell;
							 | 
						||
| 
								 | 
							
								} 
							 |