mirror of
				https://github.com/monkeytypegame/monkeytype.git
				synced 2025-10-31 11:16:08 +08:00 
			
		
		
		
	moved config values to global types
This commit is contained in:
		
							parent
							
								
									053ca05d00
								
							
						
					
					
						commit
						256e674256
					
				
					 2 changed files with 15 additions and 15 deletions
				
			
		|  | @ -1,19 +1,8 @@ | |||
| type ConfigValues = | ||||
|   | string | ||||
|   | number | ||||
|   | boolean | ||||
|   | string[] | ||||
|   | MonkeyTypes.QuoteLength[] | ||||
|   | MonkeyTypes.ResultFilters | ||||
|   | MonkeyTypes.CustomBackgroundFilter | ||||
|   | null | ||||
|   | undefined; | ||||
| 
 | ||||
| type SubscribeFunction = ( | ||||
|   key: string, | ||||
|   newValue?: ConfigValues, | ||||
|   newValue?: MonkeyTypes.ConfigValues, | ||||
|   nosave?: boolean, | ||||
|   previousValue?: ConfigValues, | ||||
|   previousValue?: MonkeyTypes.ConfigValues, | ||||
|   fullConfig?: MonkeyTypes.Config | ||||
| ) => void; | ||||
| 
 | ||||
|  | @ -25,9 +14,9 @@ export function subscribe(fn: SubscribeFunction): void { | |||
| 
 | ||||
| export function dispatch( | ||||
|   key: string, | ||||
|   newValue?: ConfigValues, | ||||
|   newValue?: MonkeyTypes.ConfigValues, | ||||
|   nosave?: boolean, | ||||
|   previousValue?: ConfigValues, | ||||
|   previousValue?: MonkeyTypes.ConfigValues, | ||||
|   fullConfig?: MonkeyTypes.Config | ||||
| ): void { | ||||
|   subscribers.forEach((fn) => { | ||||
|  |  | |||
							
								
								
									
										11
									
								
								frontend/src/scripts/types/types.d.ts
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								frontend/src/scripts/types/types.d.ts
									
										
									
									
										vendored
									
									
								
							|  | @ -330,6 +330,17 @@ declare namespace MonkeyTypes { | |||
|     showAvg: boolean; | ||||
|   } | ||||
| 
 | ||||
|   type ConfigValues = | ||||
|     | string | ||||
|     | number | ||||
|     | boolean | ||||
|     | string[] | ||||
|     | MonkeyTypes.QuoteLength[] | ||||
|     | MonkeyTypes.ResultFilters | ||||
|     | MonkeyTypes.CustomBackgroundFilter | ||||
|     | null | ||||
|     | undefined; | ||||
| 
 | ||||
|   interface ConfigChanges extends Partial<MonkeyTypes.Config> { | ||||
|     tags?: string[]; | ||||
|   } | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue