Files
flipper/flow-typed/electron-menu.js
Daniel Büchele 1891e2c869 moving tables to react-window
Summary:
Tables were using a custom virtualization, which wasn't as performant as other solutions out there. In this diff, the table component is reworked for performance.
- removes `Table` component, because it was never used standalone, `ManagedTable` is what all plugins used
- uses `react-window` for `ManagedTable`
- reworks table highlighting and arrow-navigation to work with the new virtualization
- moves actual filtering out of `ManagedTable` into `Searchable` component for a better separation of concerns.

Reviewed By: jknoxville

Differential Revision: D9447721

fbshipit-source-id: 15eb2eb55eed9f49a0cb1ccfb2d748b3672fa898
2018-08-23 04:57:28 -07:00

86 lines
1.9 KiB
JavaScript

/**
* Copyright 2018-present Facebook.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @format
*/
type Electron$BrowserWindow = any;
type Electron$NativeImage = any;
type Electron$MenuRoles =
| 'undo'
| 'redo'
| 'cut'
| 'copy'
| 'paste'
| 'pasteandmatchstyle'
| 'selectall'
| 'delete'
| 'minimize'
| 'close'
| 'quit'
| 'togglefullscreen' // macOS-only
| 'about'
| 'hide'
| 'hideothers'
| 'unhide'
| 'front'
| 'zoom'
| 'window'
| 'help'
| 'services';
type Electron$MenuType =
| 'normal'
| 'separator'
| 'submenu'
| 'checkbox'
| 'radio';
type Electron$MenuItemOptions = {
click?: (
menuItem: Electron$MenuItem,
browserWindow: Object,
event: Object,
) => mixed,
role?: Electron$MenuRoles,
type?: Electron$MenuType,
label?: string,
sublabel?: string,
accelerator?: string,
icon?: Object,
enabled?: boolean,
visible?: boolean,
checked?: boolean,
submenu?: Electron$MenuItem | Electron$MenuItemOptions,
id?: string,
position?: string,
};
declare class Electron$MenuItem {
constructor: (options: Electron$MenuItemOptions) => void;
enabled: boolean;
visible: boolean;
checked: boolean;
}
declare class Electron$Menu {
static setApplicationMenu: (menu: Electron$Menu) => void;
static getApplicationMenu: () => ?Electron$Menu;
static sendActionToFirstResponder: (action: string) => void;
static buildFromTemplate: (
templates: Array<Electron$MenuItemOptions>,
) => Electron$Menu;
popup: (
browserWindow: Object,
x?: number,
y?: number,
positioningItem?: number,
) => void;
popup: (x?: number, y?: number, positioningItem?: number) => void;
append: (menuItem: Electron$MenuItem) => void;
insert: (pos: number, menuItem: Electron$MenuItem) => void;
items: Array<Electron$MenuItem>;
}