homebridge 2.0.0-beta.30 → 2.0.0-beta.32
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.
- package/dist/api.d.ts +267 -3
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +92 -0
- package/dist/api.js.map +1 -1
- package/dist/bridgeService.d.ts +4 -2
- package/dist/bridgeService.d.ts.map +1 -1
- package/dist/bridgeService.js +1 -3
- package/dist/bridgeService.js.map +1 -1
- package/dist/childBridgeFork.d.ts +29 -2
- package/dist/childBridgeFork.d.ts.map +1 -1
- package/dist/childBridgeFork.js +294 -4
- package/dist/childBridgeFork.js.map +1 -1
- package/dist/childBridgeService.d.ts +19 -0
- package/dist/childBridgeService.d.ts.map +1 -1
- package/dist/childBridgeService.js +38 -3
- package/dist/childBridgeService.js.map +1 -1
- package/dist/externalPortService.d.ts +27 -6
- package/dist/externalPortService.d.ts.map +1 -1
- package/dist/externalPortService.js +73 -7
- package/dist/externalPortService.js.map +1 -1
- package/dist/index.d.ts +47 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/ipcService.d.ts +20 -0
- package/dist/ipcService.d.ts.map +1 -1
- package/dist/ipcService.js.map +1 -1
- package/dist/logger.d.ts +6 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +8 -0
- package/dist/logger.js.map +1 -1
- package/dist/matter/index.d.ts +123 -0
- package/dist/matter/index.d.ts.map +1 -0
- package/dist/matter/index.js +19 -0
- package/dist/matter/index.js.map +1 -0
- package/dist/matter/matterAccessoryCache.d.ts +96 -0
- package/dist/matter/matterAccessoryCache.d.ts.map +1 -0
- package/dist/matter/matterAccessoryCache.js +192 -0
- package/dist/matter/matterAccessoryCache.js.map +1 -0
- package/dist/matter/matterBehaviors.d.ts +194 -0
- package/dist/matter/matterBehaviors.d.ts.map +1 -0
- package/dist/matter/matterBehaviors.js +665 -0
- package/dist/matter/matterBehaviors.js.map +1 -0
- package/dist/matter/matterConfigValidator.d.ts +81 -0
- package/dist/matter/matterConfigValidator.d.ts.map +1 -0
- package/dist/matter/matterConfigValidator.js +240 -0
- package/dist/matter/matterConfigValidator.js.map +1 -0
- package/dist/matter/matterErrorHandler.d.ts +106 -0
- package/dist/matter/matterErrorHandler.d.ts.map +1 -0
- package/dist/matter/matterErrorHandler.js +495 -0
- package/dist/matter/matterErrorHandler.js.map +1 -0
- package/dist/matter/matterLogFormatter.d.ts +19 -0
- package/dist/matter/matterLogFormatter.d.ts.map +1 -0
- package/dist/matter/matterLogFormatter.js +144 -0
- package/dist/matter/matterLogFormatter.js.map +1 -0
- package/dist/matter/matterNetworkMonitor.d.ts +68 -0
- package/dist/matter/matterNetworkMonitor.d.ts.map +1 -0
- package/dist/matter/matterNetworkMonitor.js +249 -0
- package/dist/matter/matterNetworkMonitor.js.map +1 -0
- package/dist/matter/matterServer.d.ts +656 -0
- package/dist/matter/matterServer.d.ts.map +1 -0
- package/dist/matter/matterServer.js +1692 -0
- package/dist/matter/matterServer.js.map +1 -0
- package/dist/matter/matterServerHelpers.d.ts +81 -0
- package/dist/matter/matterServerHelpers.d.ts.map +1 -0
- package/dist/matter/matterServerHelpers.js +323 -0
- package/dist/matter/matterServerHelpers.js.map +1 -0
- package/dist/matter/matterSharedTypes.d.ts +170 -0
- package/dist/matter/matterSharedTypes.d.ts.map +1 -0
- package/dist/matter/matterSharedTypes.js +52 -0
- package/dist/matter/matterSharedTypes.js.map +1 -0
- package/dist/matter/matterStorage.d.ts +128 -0
- package/dist/matter/matterStorage.d.ts.map +1 -0
- package/dist/matter/matterStorage.js +415 -0
- package/dist/matter/matterStorage.js.map +1 -0
- package/dist/matter/matterTypes.d.ts +843 -0
- package/dist/matter/matterTypes.d.ts.map +1 -0
- package/dist/matter/matterTypes.js +222 -0
- package/dist/matter/matterTypes.js.map +1 -0
- package/dist/server.d.ts +23 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +392 -7
- package/dist/server.js.map +1 -1
- package/dist/user.d.ts +1 -0
- package/dist/user.d.ts.map +1 -1
- package/dist/user.js +3 -0
- package/dist/user.js.map +1 -1
- package/package.json +16 -15
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Matter Types
|
|
3
|
+
*
|
|
4
|
+
* These types are used by both the homebridge core and the UI
|
|
5
|
+
* to ensure consistency across the Matter implementation.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Matter bridge status states
|
|
9
|
+
*/
|
|
10
|
+
export declare enum MatterBridgeStatus {
|
|
11
|
+
/**
|
|
12
|
+
* When the Matter bridge is loading or restarting
|
|
13
|
+
*/
|
|
14
|
+
PENDING = "pending",
|
|
15
|
+
/**
|
|
16
|
+
* The Matter bridge is online and ready for commissioning
|
|
17
|
+
*/
|
|
18
|
+
OK = "ok",
|
|
19
|
+
/**
|
|
20
|
+
* The bridge is shutting down or stopped
|
|
21
|
+
*/
|
|
22
|
+
DOWN = "down"
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Metadata for a Matter bridge instance
|
|
26
|
+
*/
|
|
27
|
+
export interface MatterBridgeMetadata {
|
|
28
|
+
/** Bridge type identifier (always 'matter') */
|
|
29
|
+
type: 'matter';
|
|
30
|
+
/** Current operational status */
|
|
31
|
+
status: MatterBridgeStatus;
|
|
32
|
+
/** Bridge username/identifier */
|
|
33
|
+
username?: string;
|
|
34
|
+
/** Bridge port number */
|
|
35
|
+
port?: number;
|
|
36
|
+
/** Display name of the bridge */
|
|
37
|
+
name: string;
|
|
38
|
+
/** Plugin identifier that owns this bridge */
|
|
39
|
+
plugin: string;
|
|
40
|
+
/** Unique identifier for this bridge instance */
|
|
41
|
+
identifier: string;
|
|
42
|
+
/** Whether the bridge was manually stopped */
|
|
43
|
+
manuallyStopped?: boolean;
|
|
44
|
+
/** Process ID of the bridge if running as child process */
|
|
45
|
+
pid?: number;
|
|
46
|
+
/** QR code payload for commissioning */
|
|
47
|
+
qrCode?: string;
|
|
48
|
+
/** Manual pairing code for commissioning */
|
|
49
|
+
manualPairingCode?: string;
|
|
50
|
+
/** Device serial number */
|
|
51
|
+
serialNumber?: string;
|
|
52
|
+
/** Number of devices exposed by this bridge */
|
|
53
|
+
deviceCount: number;
|
|
54
|
+
/** Whether the bridge has been commissioned */
|
|
55
|
+
commissioned?: boolean;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Matter commissioning information
|
|
59
|
+
*/
|
|
60
|
+
export interface MatterCommissioningInfo {
|
|
61
|
+
/** Bridge type (always 'matter') */
|
|
62
|
+
type?: 'matter';
|
|
63
|
+
/** Setup URI/QR code for pairing */
|
|
64
|
+
setupUri?: string | null;
|
|
65
|
+
/** PIN/pairing code */
|
|
66
|
+
pin?: string | null;
|
|
67
|
+
/** QR code payload for commissioning */
|
|
68
|
+
qrCode?: string;
|
|
69
|
+
/** Manual pairing code for commissioning */
|
|
70
|
+
manualPairingCode?: string;
|
|
71
|
+
/** Device serial number */
|
|
72
|
+
serialNumber?: string;
|
|
73
|
+
/** Whether the device is commissioned */
|
|
74
|
+
commissioned: boolean;
|
|
75
|
+
/** Port number if applicable */
|
|
76
|
+
port?: number;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Matter accessory information
|
|
80
|
+
*/
|
|
81
|
+
export interface MatterAccessoryInfo {
|
|
82
|
+
/** Unique identifier */
|
|
83
|
+
uuid: string;
|
|
84
|
+
/** Display name */
|
|
85
|
+
displayName: string;
|
|
86
|
+
/** HAP category */
|
|
87
|
+
category: number;
|
|
88
|
+
/** Matter device information */
|
|
89
|
+
matterInfo?: {
|
|
90
|
+
/** Whether this is a bridged device */
|
|
91
|
+
bridged: boolean;
|
|
92
|
+
/** Child bridge identifier if bridged */
|
|
93
|
+
childBridge?: string;
|
|
94
|
+
/** Matter device type */
|
|
95
|
+
deviceType?: string;
|
|
96
|
+
};
|
|
97
|
+
/** HAP services */
|
|
98
|
+
services?: Array<{
|
|
99
|
+
type: string;
|
|
100
|
+
subtype?: string;
|
|
101
|
+
displayName?: string;
|
|
102
|
+
characteristics: Array<{
|
|
103
|
+
type: string;
|
|
104
|
+
value: any;
|
|
105
|
+
props: any;
|
|
106
|
+
}>;
|
|
107
|
+
}>;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Matter server configuration
|
|
111
|
+
* Used internally by MatterServer class
|
|
112
|
+
*/
|
|
113
|
+
export interface MatterServerConfig {
|
|
114
|
+
/** Server port */
|
|
115
|
+
port?: number;
|
|
116
|
+
/** Unique identifier (REQUIRED - must be unique for each Matter bridge instance) */
|
|
117
|
+
uniqueId: string;
|
|
118
|
+
/** Storage path */
|
|
119
|
+
storagePath?: string;
|
|
120
|
+
/** Manufacturer name (inherited from bridge config) */
|
|
121
|
+
manufacturer?: string;
|
|
122
|
+
/** Model name (inherited from bridge config) */
|
|
123
|
+
model?: string;
|
|
124
|
+
/** Firmware revision (inherited from bridge config) */
|
|
125
|
+
firmwareRevision?: string;
|
|
126
|
+
/** Serial number (inherited from bridge config) */
|
|
127
|
+
serialNumber?: string;
|
|
128
|
+
/** Enable debug mode for verbose logging */
|
|
129
|
+
debugModeEnabled?: boolean;
|
|
130
|
+
/** External accessory mode - device is not bridged and so added before server starts */
|
|
131
|
+
externalAccessory?: boolean;
|
|
132
|
+
/** Network interfaces to bind to (inherited from `bridge.bind` config) */
|
|
133
|
+
networkInterfaces?: string[];
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Matter accessories collection
|
|
137
|
+
*/
|
|
138
|
+
export interface MatterAccessoriesResponse {
|
|
139
|
+
/** Child bridge accessories indexed by bridge ID */
|
|
140
|
+
children: {
|
|
141
|
+
[bridgeId: string]: MatterAccessoryInfo[];
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* IPC message types for Matter child bridges
|
|
146
|
+
* These message types coordinate communication between the main process and Matter child bridge processes
|
|
147
|
+
*/
|
|
148
|
+
export declare enum ChildMatterMessageType {
|
|
149
|
+
/** Sent from child process when ready to accept configuration */
|
|
150
|
+
READY = "ready",
|
|
151
|
+
/** Sent to child process with bridge configuration */
|
|
152
|
+
LOAD = "load",
|
|
153
|
+
/** Sent from child process when configuration has been loaded */
|
|
154
|
+
LOADED = "loaded",
|
|
155
|
+
/** Sent to child process to start the Matter bridge */
|
|
156
|
+
START = "start",
|
|
157
|
+
/** Sent from child process when Matter bridge is online and advertising */
|
|
158
|
+
ONLINE = "online",
|
|
159
|
+
/** Sent to/from child process to add a Matter accessory */
|
|
160
|
+
ADD_ACCESSORY = "addAccessory",
|
|
161
|
+
/** Sent to/from child process to remove a Matter accessory */
|
|
162
|
+
REMOVE_ACCESSORY = "removeAccessory",
|
|
163
|
+
/** Sent from child process with commissioning and operational status updates */
|
|
164
|
+
STATUS_UPDATE = "statusUpdate",
|
|
165
|
+
/** Sent from child process when an error occurs */
|
|
166
|
+
ERROR = "error",
|
|
167
|
+
/** Sent to child process to initiate graceful shutdown */
|
|
168
|
+
SHUTDOWN = "shutdown"
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=matterSharedTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matterSharedTypes.d.ts","sourceRoot":"","sources":["../../src/matter/matterSharedTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,oBAAY,kBAAkB;IAC5B;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,EAAE,OAAO;IAET;;OAEG;IACH,IAAI,SAAS;CACd;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,+CAA+C;IAC/C,IAAI,EAAE,QAAQ,CAAA;IACd,iCAAiC;IACjC,MAAM,EAAE,kBAAkB,CAAA;IAC1B,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,iCAAi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,WAAW;IACjB,uDAAuD;IACvD,KAAK,UAAU;IACf,2EAA2E;IAC3E,MAAM,WAAW;IACjB,2DAA2D;IAC3D,aAAa,iBAAiB;IAC9B,8DAA8D;IAC9D,gBAAgB,oBAAoB;IACpC,gFAAgF;IAChF,aAAa,iBAAiB;IAC9B,mDAAmD;IACnD,KAAK,UAAU;IACf,0DAA0D;IAC1D,QAAQ,aAAa;CACtB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Matter Types
|
|
3
|
+
*
|
|
4
|
+
* These types are used by both the homebridge core and the UI
|
|
5
|
+
* to ensure consistency across the Matter implementation.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Matter bridge status states
|
|
9
|
+
*/
|
|
10
|
+
export var MatterBridgeStatus;
|
|
11
|
+
(function (MatterBridgeStatus) {
|
|
12
|
+
/**
|
|
13
|
+
* When the Matter bridge is loading or restarting
|
|
14
|
+
*/
|
|
15
|
+
MatterBridgeStatus["PENDING"] = "pending";
|
|
16
|
+
/**
|
|
17
|
+
* The Matter bridge is online and ready for commissioning
|
|
18
|
+
*/
|
|
19
|
+
MatterBridgeStatus["OK"] = "ok";
|
|
20
|
+
/**
|
|
21
|
+
* The bridge is shutting down or stopped
|
|
22
|
+
*/
|
|
23
|
+
MatterBridgeStatus["DOWN"] = "down";
|
|
24
|
+
})(MatterBridgeStatus || (MatterBridgeStatus = {}));
|
|
25
|
+
/**
|
|
26
|
+
* IPC message types for Matter child bridges
|
|
27
|
+
* These message types coordinate communication between the main process and Matter child bridge processes
|
|
28
|
+
*/
|
|
29
|
+
export var ChildMatterMessageType;
|
|
30
|
+
(function (ChildMatterMessageType) {
|
|
31
|
+
/** Sent from child process when ready to accept configuration */
|
|
32
|
+
ChildMatterMessageType["READY"] = "ready";
|
|
33
|
+
/** Sent to child process with bridge configuration */
|
|
34
|
+
ChildMatterMessageType["LOAD"] = "load";
|
|
35
|
+
/** Sent from child process when configuration has been loaded */
|
|
36
|
+
ChildMatterMessageType["LOADED"] = "loaded";
|
|
37
|
+
/** Sent to child process to start the Matter bridge */
|
|
38
|
+
ChildMatterMessageType["START"] = "start";
|
|
39
|
+
/** Sent from child process when Matter bridge is online and advertising */
|
|
40
|
+
ChildMatterMessageType["ONLINE"] = "online";
|
|
41
|
+
/** Sent to/from child process to add a Matter accessory */
|
|
42
|
+
ChildMatterMessageType["ADD_ACCESSORY"] = "addAccessory";
|
|
43
|
+
/** Sent to/from child process to remove a Matter accessory */
|
|
44
|
+
ChildMatterMessageType["REMOVE_ACCESSORY"] = "removeAccessory";
|
|
45
|
+
/** Sent from child process with commissioning and operational status updates */
|
|
46
|
+
ChildMatterMessageType["STATUS_UPDATE"] = "statusUpdate";
|
|
47
|
+
/** Sent from child process when an error occurs */
|
|
48
|
+
ChildMatterMessageType["ERROR"] = "error";
|
|
49
|
+
/** Sent to child process to initiate graceful shutdown */
|
|
50
|
+
ChildMatterMessageType["SHUTDOWN"] = "shutdown";
|
|
51
|
+
})(ChildMatterMessageType || (ChildMatterMessageType = {}));
|
|
52
|
+
//# sourceMappingURL=matterSharedTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matterSharedTypes.js","sourceRoot":"","sources":["../../src/matter/matterSharedTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,kBAeX;AAfD,WAAY,kBAAkB;IAC5B;;OAEG;IACH,yCAAmB,CAAA;IAEnB;;OAEG;IACH,+BAAS,CAAA;IAET;;OAEG;IACH,mCAAa,CAAA;AACf,CAAC,EAfW,kBAAkB,KAAlB,kBAAkB,QAe7B;AA6HD;;;GAGG;AACH,MAAM,CAAN,IAAY,sBAqBX;AArBD,WAAY,sBAAsB;IAChC,iEAAiE;IACjE,yCAAe,CAAA;IACf,sDAAsD;IACtD,uCAAa,CAAA;IACb,iEAAiE;IACjE,2CAAiB,CAAA;IACjB,uDAAuD;IACvD,yCAAe,CAAA;IACf,2EAA2E;IAC3E,2CAAiB,CAAA;IACjB,2DAA2D;IAC3D,wDAA8B,CAAA;IAC9B,8DAA8D;IAC9D,8DAAoC,CAAA;IACpC,gFAAgF;IAChF,wDAA8B,CAAA;IAC9B,mDAAmD;IACnD,yCAAe,CAAA;IACf,0DAA0D;IAC1D,+CAAqB,CAAA;AACvB,CAAC,EArBW,sBAAsB,KAAtB,sBAAsB,QAqBjC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom Matter.js StorageContext implementation for Homebridge
|
|
3
|
+
* Provides persistent storage for fabric data and device configuration
|
|
4
|
+
*/
|
|
5
|
+
export declare class HomebridgeMatterStorage {
|
|
6
|
+
private namespace;
|
|
7
|
+
private storage;
|
|
8
|
+
private readonly filePath;
|
|
9
|
+
private isInitialized;
|
|
10
|
+
private writeTimer;
|
|
11
|
+
private pendingWrite;
|
|
12
|
+
private persistLock;
|
|
13
|
+
constructor(namespace: string, storagePath: string);
|
|
14
|
+
/**
|
|
15
|
+
* Synchronously initialize storage by loading existing data
|
|
16
|
+
* This is called in the constructor to ensure storage is ready immediately
|
|
17
|
+
*/
|
|
18
|
+
private initializeSync;
|
|
19
|
+
/**
|
|
20
|
+
* Initialize storage and load existing data (async for compatibility)
|
|
21
|
+
* Note: Storage is now initialized synchronously in constructor
|
|
22
|
+
*/
|
|
23
|
+
initialize(): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Build a context key from an array of contexts
|
|
26
|
+
*/
|
|
27
|
+
private buildContextKey;
|
|
28
|
+
/**
|
|
29
|
+
* Recursively convert special serialized types back to their original types
|
|
30
|
+
*
|
|
31
|
+
* This is necessary because JSON.parse() doesn't automatically reconstruct:
|
|
32
|
+
* - BigInt values (serialized as {__type: 'bigint', value: string})
|
|
33
|
+
* - Uint8Array values (serialized as {__type: 'Uint8Array', value: number[]})
|
|
34
|
+
* - Buffer values (Node.js format: {type: 'Buffer', data: number[]})
|
|
35
|
+
*
|
|
36
|
+
* Matter.js fabric data contains these types which must be properly restored
|
|
37
|
+
* for commissioning to work across restarts.
|
|
38
|
+
*
|
|
39
|
+
* @param value - The value to deserialize (might be nested object/array)
|
|
40
|
+
* @returns The deserialized value with proper types restored
|
|
41
|
+
*/
|
|
42
|
+
private deserializeValue;
|
|
43
|
+
/**
|
|
44
|
+
* Get a value from storage (Matter.js interface)
|
|
45
|
+
* Values are already deserialized during load, so no additional deserialization needed
|
|
46
|
+
*/
|
|
47
|
+
get(contexts: string[], key: string): unknown | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Set a value in storage (Matter.js interface)
|
|
50
|
+
*/
|
|
51
|
+
set(contexts: string[], key: string, value: unknown): void;
|
|
52
|
+
set(contexts: string[], values: Record<string, unknown>): void;
|
|
53
|
+
/**
|
|
54
|
+
* Delete a key from storage (Matter.js interface)
|
|
55
|
+
*/
|
|
56
|
+
delete(contexts: string[], key: string): void;
|
|
57
|
+
/**
|
|
58
|
+
* Clear all storage in a context (Matter.js interface)
|
|
59
|
+
*/
|
|
60
|
+
clearAll(contexts: string[]): void;
|
|
61
|
+
/**
|
|
62
|
+
* Get all keys in a context (Matter.js interface)
|
|
63
|
+
*/
|
|
64
|
+
keys(contexts: string[]): string[];
|
|
65
|
+
/**
|
|
66
|
+
* Get all child context names (Matter.js interface)
|
|
67
|
+
*/
|
|
68
|
+
contexts(contexts: string[]): string[];
|
|
69
|
+
/**
|
|
70
|
+
* Check if a key exists (Matter.js interface)
|
|
71
|
+
*/
|
|
72
|
+
has(contexts: string[], key: string): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Get all values in a context
|
|
75
|
+
* Returns direct children only (does not include nested contexts)
|
|
76
|
+
*/
|
|
77
|
+
values(contexts: string[]): Promise<Record<string, unknown>>;
|
|
78
|
+
/**
|
|
79
|
+
* Schedule a persist operation (debounced)
|
|
80
|
+
*/
|
|
81
|
+
private schedulePersist;
|
|
82
|
+
/**
|
|
83
|
+
* Persist storage to disk with atomic write
|
|
84
|
+
*/
|
|
85
|
+
private persist;
|
|
86
|
+
/**
|
|
87
|
+
* Force immediate persist (for shutdown)
|
|
88
|
+
*/
|
|
89
|
+
forcePersist(): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Close and cleanup storage
|
|
92
|
+
*/
|
|
93
|
+
close(): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Get storage statistics
|
|
96
|
+
*/
|
|
97
|
+
getStats(): {
|
|
98
|
+
entries: number;
|
|
99
|
+
namespace: string;
|
|
100
|
+
path: string;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Storage Manager for Matter.js
|
|
105
|
+
* Manages multiple storage contexts for different namespaces
|
|
106
|
+
*/
|
|
107
|
+
export declare class MatterStorageManager {
|
|
108
|
+
private storagePath;
|
|
109
|
+
private storages;
|
|
110
|
+
constructor(storagePath: string);
|
|
111
|
+
/**
|
|
112
|
+
* Get or create a storage context for a namespace
|
|
113
|
+
*/
|
|
114
|
+
getStorage(namespace: string): HomebridgeMatterStorage;
|
|
115
|
+
/**
|
|
116
|
+
* Close all storage contexts
|
|
117
|
+
*/
|
|
118
|
+
closeAll(): Promise<void>;
|
|
119
|
+
/**
|
|
120
|
+
* Get statistics for all storage contexts
|
|
121
|
+
*/
|
|
122
|
+
getAllStats(): Array<{
|
|
123
|
+
entries: number;
|
|
124
|
+
namespace: string;
|
|
125
|
+
path: string;
|
|
126
|
+
}>;
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=matterStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matterStorage.d.ts","sourceRoot":"","sources":["../../src/matter/matterStorage.ts"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,qBAAa,uBAAuB;IAShC,OAAO,CAAC,SAAS;IARnB,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CA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