[Glitch] Require specific subtype of `formatMessage` in `timeAgoString`
Port 6b1ea8dd2c to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
			
			
This commit is contained in:
		
							parent
							
								
									00f410a089
								
							
						
					
					
						commit
						0270bd2ee5
					
				| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
import { Component } from 'react';
 | 
					import { Component } from 'react';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import type { IntlShape } from 'react-intl';
 | 
					import type { MessageDescriptor, PrimitiveType, IntlShape } from 'react-intl';
 | 
				
			||||||
import { injectIntl, defineMessages } from 'react-intl';
 | 
					import { injectIntl, defineMessages } from 'react-intl';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const messages = defineMessages({
 | 
					const messages = defineMessages({
 | 
				
			||||||
| 
						 | 
					@ -102,7 +102,13 @@ const getUnitDelay = (units: string) => {
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const timeAgoString = (
 | 
					export const timeAgoString = (
 | 
				
			||||||
  intl: Pick<IntlShape, 'formatDate' | 'formatMessage'>,
 | 
					  intl: {
 | 
				
			||||||
 | 
					    formatDate: IntlShape['formatDate'];
 | 
				
			||||||
 | 
					    formatMessage: (
 | 
				
			||||||
 | 
					      { id, defaultMessage }: MessageDescriptor,
 | 
				
			||||||
 | 
					      values?: Record<string, PrimitiveType>,
 | 
				
			||||||
 | 
					    ) => string;
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
  date: Date,
 | 
					  date: Date,
 | 
				
			||||||
  now: number,
 | 
					  now: number,
 | 
				
			||||||
  year: number,
 | 
					  year: number,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue