Refactor <Header>
into TypeScript (#33956)
This commit is contained in:
parent
20531d1e07
commit
ebde60ca82
13 changed files with 1121 additions and 859 deletions
24
app/javascript/mastodon/models/dropdown_menu.ts
Normal file
24
app/javascript/mastodon/models/dropdown_menu.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
interface BaseMenuItem {
|
||||
text: string;
|
||||
dangerous?: boolean;
|
||||
}
|
||||
|
||||
interface ActionMenuItem extends BaseMenuItem {
|
||||
action: () => void;
|
||||
}
|
||||
|
||||
interface LinkMenuItem extends BaseMenuItem {
|
||||
to: string;
|
||||
}
|
||||
|
||||
interface ExternalLinkMenuItem extends BaseMenuItem {
|
||||
href: string;
|
||||
}
|
||||
|
||||
export type MenuItem =
|
||||
| ActionMenuItem
|
||||
| LinkMenuItem
|
||||
| ExternalLinkMenuItem
|
||||
| null;
|
||||
|
||||
export type DropdownMenu = MenuItem[];
|
Loading…
Add table
Add a link
Reference in a new issue