Add type annotation for some js files (#24787)
This commit is contained in:
parent
9b8cb947a7
commit
e38b391940
11 changed files with 36 additions and 49 deletions
|
@ -1,8 +1,4 @@
|
|||
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;
|
||||
}
|
||||
import type { MastodonMap } from './util';
|
||||
|
||||
type AccountValues = {
|
||||
id: number;
|
||||
|
|
7
app/javascript/types/util.ts
Normal file
7
app/javascript/types/util.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
export 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;
|
||||
}
|
||||
|
||||
export type ValueOf<T> = T[keyof T];
|
Loading…
Add table
Add a link
Reference in a new issue