homebridge 2.0.0-alpha.4 → 2.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/bin/homebridge +1 -1
  2. package/dist/api.d.ts +193 -0
  3. package/dist/api.d.ts.map +1 -0
  4. package/dist/api.js +129 -0
  5. package/dist/api.js.map +1 -0
  6. package/dist/bridgeService.d.ts +106 -0
  7. package/dist/bridgeService.d.ts.map +1 -0
  8. package/dist/bridgeService.js +390 -0
  9. package/dist/bridgeService.js.map +1 -0
  10. package/dist/childBridgeFork.d.ts +38 -0
  11. package/dist/childBridgeFork.d.ts.map +1 -0
  12. package/dist/childBridgeFork.js +241 -2
  13. package/dist/childBridgeFork.js.map +1 -7
  14. package/dist/childBridgeService.d.ts +200 -0
  15. package/dist/childBridgeService.d.ts.map +1 -0
  16. package/dist/childBridgeService.js +427 -0
  17. package/dist/childBridgeService.js.map +1 -0
  18. package/dist/cli.d.ts +3 -0
  19. package/dist/cli.d.ts.map +1 -0
  20. package/dist/cli.js +89 -2
  21. package/dist/cli.js.map +1 -7
  22. package/dist/externalPortService.d.ts +33 -0
  23. package/dist/externalPortService.d.ts.map +1 -0
  24. package/dist/externalPortService.js +59 -0
  25. package/dist/externalPortService.js.map +1 -0
  26. package/dist/index.d.ts +76 -1099
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +19 -2
  29. package/dist/index.js.map +1 -7
  30. package/dist/ipcService.d.ts +30 -0
  31. package/dist/ipcService.d.ts.map +1 -0
  32. package/dist/ipcService.js +49 -0
  33. package/dist/ipcService.js.map +1 -0
  34. package/dist/logger.d.ts +78 -0
  35. package/dist/logger.d.ts.map +1 -0
  36. package/dist/logger.js +138 -0
  37. package/dist/logger.js.map +1 -0
  38. package/dist/platformAccessory.d.ts +55 -0
  39. package/dist/platformAccessory.d.ts.map +1 -0
  40. package/dist/platformAccessory.js +98 -0
  41. package/dist/platformAccessory.js.map +1 -0
  42. package/dist/plugin.d.ts +31 -0
  43. package/dist/plugin.d.ts.map +1 -0
  44. package/dist/plugin.js +185 -0
  45. package/dist/plugin.js.map +1 -0
  46. package/dist/pluginManager.d.ts +77 -0
  47. package/dist/pluginManager.d.ts.map +1 -0
  48. package/dist/pluginManager.js +374 -0
  49. package/dist/pluginManager.js.map +1 -0
  50. package/dist/server.d.ts +58 -0
  51. package/dist/server.d.ts.map +1 -0
  52. package/dist/server.js +430 -0
  53. package/dist/server.js.map +1 -0
  54. package/dist/storageService.d.ts +13 -0
  55. package/dist/storageService.d.ts.map +1 -0
  56. package/dist/storageService.js +41 -0
  57. package/dist/storageService.js.map +1 -0
  58. package/dist/user.d.ts +13 -0
  59. package/dist/user.d.ts.map +1 -0
  60. package/dist/user.js +29 -0
  61. package/dist/user.js.map +1 -0
  62. package/dist/util/mac.d.ts +5 -0
  63. package/dist/util/mac.d.ts.map +1 -0
  64. package/dist/util/mac.js +14 -0
  65. package/dist/util/mac.js.map +1 -0
  66. package/dist/version.d.ts +3 -0
  67. package/dist/version.d.ts.map +1 -0
  68. package/dist/version.js +16 -0
  69. package/dist/version.js.map +1 -0
  70. package/package.json +7 -10
@@ -0,0 +1,98 @@
1
+ import { EventEmitter } from 'node:events';
2
+ import { Accessory, } from 'hap-nodejs';
3
+ // eslint-disable-next-line no-restricted-syntax
4
+ export var PlatformAccessoryEvent;
5
+ (function (PlatformAccessoryEvent) {
6
+ PlatformAccessoryEvent["IDENTIFY"] = "identify";
7
+ })(PlatformAccessoryEvent || (PlatformAccessoryEvent = {}));
8
+ // eslint-disable-next-line ts/no-unsafe-declaration-merging
9
+ export class PlatformAccessory extends EventEmitter {
10
+ // somewhat ugly way to inject custom Accessory object, while not changing the publicly exposed constructor signature
11
+ static injectedAccessory;
12
+ _associatedPlugin; // present as soon as it is registered
13
+ _associatedPlatform; // not present for external accessories
14
+ _associatedHAPAccessory;
15
+ // ---------------- HAP Accessory mirror ----------------
16
+ displayName;
17
+ UUID;
18
+ category;
19
+ services = [];
20
+ // ------------------------------------------------------
21
+ /**
22
+ * This is a way for Plugin developers to store custom data with their accessory
23
+ */
24
+ context = {}; // providing something to store
25
+ constructor(displayName, uuid, category) {
26
+ super();
27
+ this._associatedHAPAccessory = PlatformAccessory.injectedAccessory
28
+ ? PlatformAccessory.injectedAccessory
29
+ : new Accessory(displayName, uuid);
30
+ if (category) {
31
+ this._associatedHAPAccessory.category = category;
32
+ }
33
+ this.displayName = this._associatedHAPAccessory.displayName;
34
+ this.UUID = this._associatedHAPAccessory.UUID;
35
+ this.category = category || 1 /* Categories.OTHER */;
36
+ this.services = this._associatedHAPAccessory.services;
37
+ // forward identify event
38
+ this._associatedHAPAccessory.on("identify" /* AccessoryEventTypes.IDENTIFY */, (paired, callback) => {
39
+ // @ts-expect-error: empty callback for backwards compatibility
40
+ this.emit("identify" /* PlatformAccessoryEvent.IDENTIFY */, paired, () => { });
41
+ callback();
42
+ });
43
+ }
44
+ addService(service, ...constructorArgs) {
45
+ // @ts-expect-error: while the HAP-NodeJS interface was refined, the underlying implementation
46
+ // still only operates on an any[] array. Therefore, do not require any additional checks here
47
+ // we force the parameter unpack with expecting a ts-error.
48
+ return this._associatedHAPAccessory.addService(service, ...constructorArgs);
49
+ }
50
+ removeService(service) {
51
+ this._associatedHAPAccessory.removeService(service);
52
+ }
53
+ getService(name) {
54
+ return this._associatedHAPAccessory.getService(name);
55
+ }
56
+ getServiceById(uuid, subType) {
57
+ return this._associatedHAPAccessory.getServiceById(uuid, subType);
58
+ }
59
+ /**
60
+ * Configures a new controller for the given accessory.
61
+ * See {@link https://developers.homebridge.io/HAP-NodeJS/classes/accessory.html#configurecontroller | Accessory.configureController}.
62
+ *
63
+ * @param controller
64
+ */
65
+ configureController(controller) {
66
+ this._associatedHAPAccessory.configureController(controller);
67
+ }
68
+ /**
69
+ * Removes a configured controller from the given accessory.
70
+ * See {@link https://developers.homebridge.io/HAP-NodeJS/classes/accessory.html#removecontroller | Accessory.removeController}.
71
+ *
72
+ * @param controller
73
+ */
74
+ removeController(controller) {
75
+ this._associatedHAPAccessory.removeController(controller);
76
+ }
77
+ // private
78
+ static serialize(accessory) {
79
+ return {
80
+ plugin: accessory._associatedPlugin,
81
+ platform: accessory._associatedPlatform,
82
+ context: accessory.context,
83
+ ...Accessory.serialize(accessory._associatedHAPAccessory),
84
+ };
85
+ }
86
+ static deserialize(json) {
87
+ const accessory = Accessory.deserialize(json);
88
+ PlatformAccessory.injectedAccessory = accessory;
89
+ const platformAccessory = new PlatformAccessory(accessory.displayName, accessory.UUID);
90
+ PlatformAccessory.injectedAccessory = undefined;
91
+ platformAccessory._associatedPlugin = json.plugin;
92
+ platformAccessory._associatedPlatform = json.platform;
93
+ platformAccessory.context = json.context;
94
+ platformAccessory.category = json.category;
95
+ return platformAccessory;
96
+ }
97
+ }
98
+ //# sourceMappingURL=platformAccessory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platformAccessory.js","sourceRoot":"","sources":["../src/platformAccessory.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,EACL,SAAS,GAGV,MAAM,YAAY,CAAA;AAYnB,gDAAgD;AAChD,MAAM,CAAN,IAAkB,sBAEjB;AAFD,WAAkB,sBAAsB;IACtC,+CAAqB,CAAA;AACvB,CAAC,EAFiB,sBAAsB,KAAtB,sBAAsB,QAEvC;AAWD,4DAA4D;AAC5D,MAAM,OAAO,iBAA6D,SAAQ,YAAY;IAC5F,qHAAqH;IAC7G,MAAM,CAAC,iBAAiB,CAAY;IAE5C,iBAAiB,CAAmB,CAAC,sCAAsC;IAC3E,mBAAmB,CAAe,CAAC,uCAAuC;IAE1E,uBAAuB,CAAW;IAElC,yDAAyD;IACzD,WAAW,CAAQ;IACnB,IAAI,CAAQ;IACZ,QAAQ,CAAY;IACpB,QAAQ,GAAc,EAAE,CAAA;IACxB,yDAAyD;IAEzD;;OAEG;IACI,OAAO,GAAM,EAAO,CAAA,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;IAC1B,CAAC;CACF"}
@@ -0,0 +1,31 @@
1
+ import type { AccessoryIdentifier, AccessoryName, AccessoryPluginConstructor, API, DynamicPlatformPlugin, PlatformIdentifier, PlatformName, PlatformPluginConstructor, PluginIdentifier, PluginName } from './api.js';
2
+ import type { PackageJSON } from './pluginManager.js';
3
+ /**
4
+ * Represents a loaded Homebridge plugin.
5
+ */
6
+ export declare class Plugin {
7
+ private readonly pluginName;
8
+ private readonly scope?;
9
+ private readonly pluginPath;
10
+ private readonly isESM;
11
+ disabled: boolean;
12
+ readonly version: string;
13
+ private readonly main;
14
+ private loadContext?;
15
+ private pluginInitializer?;
16
+ private readonly registeredAccessories;
17
+ private readonly registeredPlatforms;
18
+ private readonly activeDynamicPlatforms;
19
+ constructor(name: PluginName, path: string, packageJSON: PackageJSON, scope?: string);
20
+ getPluginIdentifier(): PluginIdentifier;
21
+ getPluginPath(): string;
22
+ registerAccessory(name: AccessoryName, constructor: AccessoryPluginConstructor): void;
23
+ registerPlatform(name: PlatformName, constructor: PlatformPluginConstructor): void;
24
+ getAccessoryConstructor(accessoryIdentifier: AccessoryIdentifier | AccessoryName): AccessoryPluginConstructor;
25
+ getPlatformConstructor(platformIdentifier: PlatformIdentifier | PlatformName): PlatformPluginConstructor;
26
+ assignDynamicPlatform(platformIdentifier: PlatformIdentifier | PlatformName, platformPlugin: DynamicPlatformPlugin): void;
27
+ getActiveDynamicPlatform(platformName: PlatformName): DynamicPlatformPlugin | undefined;
28
+ load(): Promise<void>;
29
+ initialize(api: API): void | Promise<void>;
30
+ }
31
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,aAAa,EACb,0BAA0B,EAC1B,GAAG,EACH,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACZ,yBAAyB,EACzB,gBAAgB,EAEhB,UAAU,E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GAAG,SAAS;IAMjF,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAmD3B,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAOlD"}
package/dist/plugin.js ADDED
@@ -0,0 +1,185 @@
1
+ import assert from 'node:assert';
2
+ import path from 'node:path';
3
+ import process from 'node:process';
4
+ import { pathToFileURL } from 'node:url';
5
+ import { satisfies } from 'semver';
6
+ import { Logger } from './logger.js';
7
+ import { PluginManager } from './pluginManager.js';
8
+ import getVersion from './version.js';
9
+ const log = Logger.internal;
10
+ /**
11
+ * Represents a loaded Homebridge plugin.
12
+ */
13
+ export class Plugin {
14
+ pluginName;
15
+ scope; // npm package scope
16
+ pluginPath; // like "/usr/local/lib/node_modules/homebridge-lockitron"
17
+ isESM;
18
+ disabled = false; // mark the plugin as disabled
19
+ // ------------------ package.json content ------------------
20
+ version;
21
+ main;
22
+ loadContext;
23
+ // ----------------------------------------------------------
24
+ pluginInitializer; // default exported function from the plugin that initializes it
25
+ registeredAccessories = new Map();
26
+ registeredPlatforms = new Map();
27
+ activeDynamicPlatforms = new Map();
28
+ constructor(name, path, packageJSON, scope) {
29
+ this.pluginName = name;
30
+ this.scope = scope;
31
+ this.pluginPath = path;
32
+ this.version = packageJSON.version || '0.0.0';
33
+ this.main = '';
34
+ // figure out the main module
35
+ // exports is available - https://nodejs.org/dist/latest-v14.x/docs/api/packages.html#packages_package_entry_points
36
+ if (packageJSON.exports) {
37
+ // main entrypoint - https://nodejs.org/dist/latest-v14.x/docs/api/packages.html#packages_main_entry_point_export
38
+ if (typeof packageJSON.exports === 'string') {
39
+ this.main = packageJSON.exports;
40
+ }
41
+ else { // subpath export - https://nodejs.org/dist/latest-v14.x/docs/api/packages.html#packages_subpath_exports
42
+ // conditional exports - https://nodejs.org/dist/latest-v14.x/docs/api/packages.html#packages_conditional_exports
43
+ const exports = packageJSON.exports.import || packageJSON.exports.require || packageJSON.exports.node || packageJSON.exports.default || packageJSON.exports['.'];
44
+ // check if conditional export is nested
45
+ if (typeof exports !== 'string') {
46
+ if (exports.import) {
47
+ this.main = exports.import;
48
+ }
49
+ else {
50
+ this.main = exports.require || exports.node || exports.default;
51
+ }
52
+ }
53
+ else {
54
+ this.main = exports;
55
+ }
56
+ }
57
+ }
58
+ // exports search was not successful, fallback to package.main, using index.js as fallback
59
+ if (!this.main) {
60
+ this.main = packageJSON.main || './index.js';
61
+ }
62
+ // check if it is an ESM module
63
+ this.isESM = this.main.endsWith('.mjs') || (this.main.endsWith('.js') && packageJSON.type === 'module');
64
+ // very temporary fix for first wave of plugins
65
+ if (packageJSON.peerDependencies && (!packageJSON.engines || !packageJSON.engines.homebridge)) {
66
+ packageJSON.engines = packageJSON.engines || {};
67
+ packageJSON.engines.homebridge = packageJSON.peerDependencies.homebridge;
68
+ }
69
+ this.loadContext = {
70
+ engines: packageJSON.engines,
71
+ dependencies: packageJSON.dependencies,
72
+ };
73
+ }
74
+ getPluginIdentifier() {
75
+ return (this.scope ? `${this.scope}/` : '') + this.pluginName;
76
+ }
77
+ getPluginPath() {
78
+ return this.pluginPath;
79
+ }
80
+ registerAccessory(name, constructor) {
81
+ if (this.registeredAccessories.has(name)) {
82
+ throw new Error(`Plugin '${this.getPluginIdentifier()}' tried to register an accessory '${name}' which has already been registered!`);
83
+ }
84
+ if (!this.disabled) {
85
+ log.info('Registering accessory \'%s\'', `${this.getPluginIdentifier()}.${name}`);
86
+ }
87
+ this.registeredAccessories.set(name, constructor);
88
+ }
89
+ registerPlatform(name, constructor) {
90
+ if (this.registeredPlatforms.has(name)) {
91
+ throw new Error(`Plugin '${this.getPluginIdentifier()}' tried to register a platform '${name}' which has already been registered!`);
92
+ }
93
+ if (!this.disabled) {
94
+ log.info('Registering platform \'%s\'', `${this.getPluginIdentifier()}.${name}`);
95
+ }
96
+ this.registeredPlatforms.set(name, constructor);
97
+ }
98
+ getAccessoryConstructor(accessoryIdentifier) {
99
+ const name = PluginManager.getAccessoryName(accessoryIdentifier);
100
+ const constructor = this.registeredAccessories.get(name);
101
+ if (!constructor) {
102
+ throw new Error(`The requested accessory '${name}' was not registered by the plugin '${this.getPluginIdentifier()}'.`);
103
+ }
104
+ return constructor;
105
+ }
106
+ getPlatformConstructor(platformIdentifier) {
107
+ const name = PluginManager.getPlatformName(platformIdentifier);
108
+ const constructor = this.registeredPlatforms.get(name);
109
+ if (!constructor) {
110
+ throw new Error(`The requested platform '${name}' was not registered by the plugin '${this.getPluginIdentifier()}'.`);
111
+ }
112
+ // If it's a dynamic platform plugin, ensure it's not enabled multiple times.
113
+ if (this.activeDynamicPlatforms.has(name)) {
114
+ throw new Error(`The dynamic platform ${name} from the plugin ${this.getPluginIdentifier()} is configured `
115
+ + `times in your config.json.`);
116
+ }
117
+ return constructor;
118
+ }
119
+ assignDynamicPlatform(platformIdentifier, platformPlugin) {
120
+ const name = PluginManager.getPlatformName(platformIdentifier);
121
+ let platforms = this.activeDynamicPlatforms.get(name);
122
+ if (!platforms) {
123
+ platforms = [];
124
+ this.activeDynamicPlatforms.set(name, platforms);
125
+ }
126
+ // the last platform published should be at the first position for easy access
127
+ // we just try to mimic pre 1.0.0 behavior
128
+ platforms.unshift(platformPlugin);
129
+ }
130
+ getActiveDynamicPlatform(platformName) {
131
+ const platforms = this.activeDynamicPlatforms.get(platformName);
132
+ // we always use the last registered
133
+ return platforms && platforms[0];
134
+ }
135
+ async load() {
136
+ const context = this.loadContext;
137
+ assert(context, 'Reached illegal state. Plugin state is undefined!');
138
+ this.loadContext = undefined; // free up memory
139
+ // pluck out the HomeBridge version requirement
140
+ if (!context.engines || !context.engines.homebridge) {
141
+ throw new Error(`Plugin ${this.pluginPath} does not contain the 'homebridge' package in 'engines'.`);
142
+ }
143
+ const versionRequired = context.engines.homebridge;
144
+ const nodeVersionRequired = context.engines.node;
145
+ // make sure the version is satisfied by the currently running version of HomeBridge
146
+ if (!satisfies(getVersion(), versionRequired, { includePrerelease: true })) {
147
+ // TODO - change this back to an error
148
+ log.error(`The plugin "${this.pluginName}" requires a Homebridge version of ${versionRequired} which does \
149
+ not satisfy the current Homebridge version of ${getVersion()}. You may need to update this plugin (or Homebridge) to a newer version. \
150
+ You may face unexpected issues or stability problems running this plugin.`);
151
+ }
152
+ // make sure the version is satisfied by the currently running version of Node
153
+ if (nodeVersionRequired && !satisfies(process.version, nodeVersionRequired)) {
154
+ log.warn(`The plugin "${this.pluginName}" requires Node.js version of ${nodeVersionRequired} which does \
155
+ not satisfy the current Node.js version of ${process.version}. You may need to upgrade your installation of Node.js - see https://homebridge.io/w/JTKEF`);
156
+ }
157
+ const dependencies = context.dependencies || {};
158
+ if (dependencies.homebridge || dependencies['hap-nodejs']) {
159
+ log.error(`The plugin "${this.pluginName}" defines 'homebridge' and/or 'hap-nodejs' in their 'dependencies' section, \
160
+ meaning they carry an additional copy of homebridge and hap-nodejs. This not only wastes disk space, but also can cause \
161
+ major incompatibility issues and thus is considered bad practice. Please inform the developer to update their plugin!`);
162
+ }
163
+ const mainPath = path.join(this.pluginPath, this.main);
164
+ // try to import it and grab the exported initialization hook
165
+ // pathToFileURL(specifier).href to turn a path into a "file url"
166
+ // see https://github.com/nodejs/node/issues/31710
167
+ const pluginModules = await import(pathToFileURL(mainPath).href);
168
+ if (typeof pluginModules === 'function') {
169
+ this.pluginInitializer = pluginModules;
170
+ }
171
+ else if (pluginModules && typeof pluginModules.default === 'function') {
172
+ this.pluginInitializer = pluginModules.default;
173
+ }
174
+ else {
175
+ throw new Error(`Plugin ${this.pluginPath} does not export a initializer function from main.`);
176
+ }
177
+ }
178
+ initialize(api) {
179
+ if (!this.pluginInitializer) {
180
+ throw new Error('Tried to initialize a plugin which hasn\'t been loaded yet!');
181
+ }
182
+ return this.pluginInitializer(api);
183
+ }
184
+ }
185
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAeA,OAAO,MAAM,MA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,iBAAiB,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAA;QAChF,CAAC;QAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAA;IACpC,CAAC;CACF"}
@@ -0,0 +1,77 @@
1
+ import type { AccessoryIdentifier, AccessoryName, HomebridgeAPI, PlatformIdentifier, PlatformName, PluginIdentifier, PluginName } from './api.js';
2
+ import { Plugin } from './plugin.js';
3
+ export interface PackageJSON {
4
+ name: string;
5
+ version: string;
6
+ keywords?: string[];
7
+ exports?: string | Record<string, string | Record<string, string>>;
8
+ main?: string;
9
+ /**
10
+ * When set as module, it marks .js file to be treated as ESM.
11
+ * See https://nodejs.org/dist/latest-v14.x/docs/api/esm.html#esm_enabling
12
+ */
13
+ type?: 'module' | 'commonjs';
14
+ engines?: Record<string, string>;
15
+ dependencies?: Record<string, string>;
16
+ devDependencies?: Record<string, string>;
17
+ peerDependencies?: Record<string, string>;
18
+ }
19
+ export interface PluginManagerOptions {
20
+ /**
21
+ * Additional path to search for plugins in. Specified relative to the current working directory.
22
+ */
23
+ customPluginPath?: string;
24
+ /**
25
+ * If set, only load plugins from the customPluginPath, if set, otherwise only from the primary global node_modules.
26
+ */
27
+ strictPluginResolution?: boolean;
28
+ /**
29
+ * When defined, only plugins specified here will be initialized.
30
+ */
31
+ activePlugins?: PluginIdentifier[];
32
+ /**
33
+ * Plugins that are marked as disabled and whose corresponding config blocks should be ignored
34
+ */
35
+ disabledPlugins?: PluginIdentifier[];
36
+ }
37
+ /**
38
+ * Utility which exposes methods to search for installed Homebridge plugins
39
+ */
40
+ export declare class PluginManager {
41
+ private static readonly PLUGIN_IDENTIFIER_PATTERN;
42
+ private readonly api;
43
+ private readonly searchPaths;
44
+ private readonly strictPluginResolution;
45
+ private readonly activePlugins?;
46
+ private readonly disabledPlugins?;
47
+ private readonly plugins;
48
+ private readonly pluginIdentifierTranslation;
49
+ private readonly accessoryToPluginMap;
50
+ private readonly platformToPluginMap;
51
+ private currentInitializingPlugin?;
52
+ constructor(api: HomebridgeAPI, options?: PluginManagerOptions);
53
+ static isQualifiedPluginIdentifier(identifier: string): boolean;
54
+ static extractPluginName(name: string): PluginName;
55
+ static extractPluginScope(name: string): string;
56
+ static getAccessoryName(identifier: AccessoryIdentifier): AccessoryName;
57
+ static getPlatformName(identifier: PlatformIdentifier): PlatformIdentifier;
58
+ static getPluginIdentifier(identifier: AccessoryIdentifier | PlatformIdentifier): PluginIdentifier;
59
+ initializeInstalledPlugins(): Promise<void>;
60
+ initializePlugin(plugin: Plugin, identifier: string): Promise<void>;
61
+ private handleRegisterAccessory;
62
+ private handleRegisterPlatform;
63
+ getPluginForAccessory(accessoryIdentifier: AccessoryIdentifier | AccessoryName): Plugin;
64
+ getPluginForPlatform(platformIdentifier: PlatformIdentifier | PlatformName): Plugin;
65
+ hasPluginRegistered(pluginIdentifier: PluginIdentifier): boolean;
66
+ getPlugin(pluginIdentifier: PluginIdentifier): Plugin | undefined;
67
+ getPluginByActiveDynamicPlatform(platformName: PlatformName): Plugin | undefined;
68
+ /**
69
+ * Gets all plugins installed on the local system
70
+ */
71
+ private loadInstalledPlugins;
72
+ loadPlugin(absolutePath: string): Plugin;
73
+ private static loadPackageJSON;
74
+ private loadDefaultPaths;
75
+ private addNpmPrefixToSearchPaths;
76
+ }
77
+ //# sourceMappingURL=pluginManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManager.d.ts","sourceRoot":"","sources":["../src/pluginManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,aAAa,EAEb,aAAa,EACb,kBAAkB,EAClB,YAAY,EAEZ,gBAAgB,EAChB,UAAU,EACX,MAAM,UAAU,CAAA;AAYjB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAMpC,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,QAA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