Socket
Book a DemoInstallSign in
Socket

@advanced-rest-client/arc-electron-sources-manager

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@advanced-rest-client/arc-electron-sources-manager

A package to handle ARC preferences state in both rendered and main process

latest
npmnpm
Version
0.1.0-rc8
Version published
Maintainers
1
Created
Source

ARC Electron sources manager

Resolves paths to application source files and themes based on theme.

Usage

$ npm i @advanced-rest-client/electron-drive

In the main process:

const {SourcesManager} = require('@advanced-rest-client/arc-electron-sources-manager/main');
const {ArcPreferences} = require('@advanced-rest-client/arc-electron-preferences');
const startupOptions = {}; // Application start up options.
const prefs = new ArcPreferences();
const manager = new SourcesManager(prefs, startupOptions);
manager.listen();

To get paths configuration for the renderer window

prefs.getAppConfig()
.then((config) => {
  console.log(config);
  // {
  //  "appComponents": "Location to app component main directory",
  //  "importFile": "Location of the app sources import file"
  //  "themeFile": "Location of theme definition"
  // }
});

Renderer process

const {ThemeManager} = require('@advanced-rest-client/arc-electron-sources-manager/renderer');
const mgr = new ThemeManager();
mgr.listen();

The manager gives access to:

  • listThemes() - lists all installed themes
  • readActiveThemeInfo() - reads activated theme info
  • activate(themeId) - Activates new theme
  • loadTheme(themeLocation) - Loads theme file and activates it.

It listens for the following web custom events:

  • themes-list - calls listThemes(), adds call result to detail.result
  • theme-active-info - calls readActiveThemeInfo(), adds call result to detail.result
  • theme-activate - calls activate(event.detail.theme), adds call result to detail.result

FAQs

Package last updated on 20 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts