{"id":26481926,"url":"https://github.com/electron-utils/electron-selection","last_synced_at":"2026-04-17T15:06:43.650Z","repository":{"id":57221890,"uuid":"89308065","full_name":"electron-utils/electron-selection","owner":"electron-utils","description":"Global Selection","archived":false,"fork":false,"pushed_at":"2017-04-25T10:10:23.000Z","size":53,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-22T02:02:37.106Z","etag":null,"topics":["electron","selection","ui"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/electron-utils.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-25T02:24:16.000Z","updated_at":"2017-04-25T02:36:17.000Z","dependencies_parsed_at":"2022-08-31T08:51:56.501Z","dependency_job_id":null,"html_url":"https://github.com/electron-utils/electron-selection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electron-utils%2Felectron-selection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electron-utils%2Felectron-selection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electron-utils%2Felectron-selection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electron-utils%2Felectron-selection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/electron-utils","download_url":"https://codeload.github.com/electron-utils/electron-selection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244545294,"owners_count":20469830,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["electron","selection","ui"],"created_at":"2025-03-20T03:36:17.378Z","updated_at":"2026-04-17T15:06:38.609Z","avatar_url":"https://github.com/electron-utils.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# electron-selection\n\n[![Linux Build Status](https://travis-ci.org/electron-utils/electron-selection.svg?branch=master)](https://travis-ci.org/electron-utils/electron-selection)\n[![Windows Build status](https://ci.appveyor.com/api/projects/status/6yf7w89hhcby7mcl?svg=true)](https://ci.appveyor.com/project/jwu/electron-selection)\n[![Dependency Status](https://david-dm.org/electron-utils/electron-selection.svg)](https://david-dm.org/electron-utils/electron-selection)\n[![devDependency Status](https://david-dm.org/electron-utils/electron-selection/dev-status.svg)](https://david-dm.org/electron-utils/electron-selection#info=devDependencies)\n\nGlobal Selection\n\n## Why?\n\n  - Sync selection in multiple windows\n\n## Install\n\n```bash\nnpm install --save electron-selection\n```\n\n## Run Examples:\n\n```bash\nnpm start examples/${name}\n```\n\n## Usage\n\n```javascript\nconst selection = require('electron-selection');\n\nselection.register('normal');\nselection.select('normal', ['a', 'b', 'c', 'd']);\n\n// ['a', 'b', 'c', 'd']\nconsole.log(selection.curSelection('normal'));\n```\n\n## API Reference\n\n### Methods\n\n#### selection.register (type)\n\n  - `type` string\n\n#### selection.reset ()\n\n#### selection.local ()\n\nReturns a `selection.ConfirmableSelectionHelper` instance.\n\n#### selection.confirm ()\n\nConfirms all current selecting objects, no matter which type they are.\nThis operation may trigger deactivated and activated events.\n\n#### selection.cancel ()\n\nCancels all current selecting objects, no matter which type they are.\nThis operation may trigger selected and unselected events.\n\n#### selection.confirmed (type)\n\n  - `type` string\n\nCheck if selection is confirmed.\n\n#### selection.select (type, id[, unselectOthers, confirm])\n\n  - `type` string\n  - `id` string\n  - `unselectOthers` boolean\n  - `confirm` boolean\n\nSelect item with its id.\n\n#### selection.unselect (type, id[, confirm])\n\n  - `type` string\n  - `id` string\n  - `confirm` boolean\n\nUnselect item with its id.\n\n#### selection.hover (type, id)\n\n  - `type` string\n  - `id` string\n\nHover item with its id. If id is null, it means hover out.\n\n#### selection.setContext (type, id)\n\n  - `type` string\n  - `id` string\n\n#### selection.patch (type, srcID, destID)\n\n  - `type` string\n  - `srcID` string\n  - `destID` string\n\n#### selection.clear (type)\n\n  - `type` string\n\n#### selection.hovering (type)\n\n  - `type` string\n\n#### selection.contexts (type)\n\n  - `type` string\n\n#### selection.curActivate (type)\n\n  - `type` string\n\n#### selection.curGlobalActivate (type)\n\n  - `type` string\n\n#### selection.curSelection (type)\n\n  - `type` string\n\n#### selection.filter (items, mode, func)\n\n  - `items` array(string)\n  - `mode` string - 'top-level', 'deep' and 'name'\n  - `func` function\n\n## License\n\nMIT © 2017 Johnny Wu\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectron-utils%2Felectron-selection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felectron-utils%2Felectron-selection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectron-utils%2Felectron-selection/lists"}