nas/app/javascript/mastodon/models/dropdown_menu.ts
Eugen Rochko 22d33244ee
Refactor <Dropdown> into TypeScript (#34357)
Co-authored-by: Echo <ChaosExAnima@users.noreply.github.com>
2025-04-08 19:22:19 +00:00

24 lines
448 B
TypeScript

interface BaseMenuItem {
text: string;
dangerous?: boolean;
}
export interface ActionMenuItem extends BaseMenuItem {
action: () => void;
}
export interface LinkMenuItem extends BaseMenuItem {
to: string;
}
export interface ExternalLinkMenuItem extends BaseMenuItem {
href: string;
target?: string;
method?: 'post' | 'put' | 'delete';
}
export type MenuItem =
| ActionMenuItem
| LinkMenuItem
| ExternalLinkMenuItem
| null;