Global Selection
- Sync selection in multiple windows
npm install --save electron-selection
npm start examples/${name}
const selection = require('electron-selection');
selection.register('normal');
selection.select('normal', ['a', 'b', 'c', 'd']);
// ['a', 'b', 'c', 'd']
console.log(selection.curSelection('normal'));
type
string
Returns a selection.ConfirmableSelectionHelper
instance.
Confirms all current selecting objects, no matter which type they are. This operation may trigger deactivated and activated events.
Cancels all current selecting objects, no matter which type they are. This operation may trigger selected and unselected events.
type
string
Check if selection is confirmed.
type
stringid
stringunselectOthers
booleanconfirm
boolean
Select item with its id.
type
stringid
stringconfirm
boolean
Unselect item with its id.
type
stringid
string
Hover item with its id. If id is null, it means hover out.
type
stringid
string
type
stringsrcID
stringdestID
string
type
string
type
string
type
string
type
string
type
string
type
string
items
array(string)mode
string - 'top-level', 'deep' and 'name'func
function
MIT © 2017 Johnny Wu