mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
- PluginContext: scoped API with crash-safe command wrappers - PluginRegistry: lifecycle management with graceful init failure - SettingsStore: plugin-scoped key/value via IPC backend - Export hooks: pre/post hooks on registry for cross-plugin integration Amit Haridas
24 lines
500 B
JavaScript
24 lines
500 B
JavaScript
class SettingsStore {
|
|
/**
|
|
* @param {object} backend - { get(key), set(key, value) } backed by main process store
|
|
*/
|
|
constructor(backend) {
|
|
this.backend = backend;
|
|
}
|
|
|
|
get(key) {
|
|
return this.backend.get(key);
|
|
}
|
|
|
|
set(key, value) {
|
|
this.backend.set(key, value);
|
|
}
|
|
|
|
onChanged(key, callback) {
|
|
// Deferred: plugins read settings on init/activate for MVP.
|
|
// Full change notification requires IPC watcher in main process.
|
|
}
|
|
}
|
|
|
|
module.exports = { SettingsStore };
|