Copy Typescript type definitions to glitch-soc
This commit is contained in:
		@@ -2,7 +2,7 @@ import * as React from 'react';
 | 
				
			|||||||
import classNames from 'classnames';
 | 
					import classNames from 'classnames';
 | 
				
			||||||
import { autoPlayGif } from 'flavours/glitch/initial_state';
 | 
					import { autoPlayGif } from 'flavours/glitch/initial_state';
 | 
				
			||||||
import { useHovering } from 'hooks/useHovering';
 | 
					import { useHovering } from 'hooks/useHovering';
 | 
				
			||||||
import type { Account } from 'types/resources';
 | 
					import type { Account } from 'flavours/glitch/types/resources';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type Props = {
 | 
					type Props = {
 | 
				
			||||||
  account: Account | undefined;
 | 
					  account: Account | undefined;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										13
									
								
								app/javascript/flavours/glitch/types/resources.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								app/javascript/flavours/glitch/types/resources.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
				
			|||||||
 | 
					interface MastodonMap<T> {
 | 
				
			||||||
 | 
					  get<K extends keyof T>(key: K): T[K];
 | 
				
			||||||
 | 
					  has<K extends keyof T>(key: K): boolean;
 | 
				
			||||||
 | 
					  set<K extends keyof T>(key: K, value: T[K]): this;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type AccountValues = {
 | 
				
			||||||
 | 
					  id: number;
 | 
				
			||||||
 | 
					  avatar: string;
 | 
				
			||||||
 | 
					  avatar_static: string;
 | 
				
			||||||
 | 
					  [key: string]: any;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					export type Account = MastodonMap<AccountValues>
 | 
				
			||||||
		Reference in New Issue
	
	Block a user