Port 22d33244ee63b310f4572952cd2cc8a1bc3c573b to glitch-soc Co-authored-by: Echo <ChaosExAnima@users.noreply.github.com> Signed-off-by: Claire <claire.github-309c@sitedethib.com>
25 lines
448 B
TypeScript
25 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;
|