@matter/general
Advanced tools
Comparing version 0.11.0-alpha.0-20241015-ae8e54af2 to 0.11.0-alpha.0-20241016-a33385682
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
import { ServerAddressIp } from "#net/ServerAddress.js"; | ||
export declare enum ChannelType { | ||
@@ -25,2 +26,6 @@ UDP = "udp", | ||
} | ||
export interface IpNetworkChannel<T> extends Channel<T> { | ||
networkAddress: ServerAddressIp; | ||
} | ||
export declare function isIpNetworkChannel<T>(channel: Channel<T>): channel is IpNetworkChannel<T>; | ||
//# sourceMappingURL=Channel.d.ts.map |
@@ -21,5 +21,7 @@ "use strict"; | ||
__export(Channel_exports, { | ||
ChannelType: () => ChannelType | ||
ChannelType: () => ChannelType, | ||
isIpNetworkChannel: () => isIpNetworkChannel | ||
}); | ||
module.exports = __toCommonJS(Channel_exports); | ||
var import_Type = require("#util/Type.js"); | ||
/** | ||
@@ -36,2 +38,5 @@ * @license | ||
})(ChannelType || {}); | ||
function isIpNetworkChannel(channel) { | ||
return (0, import_Type.isObject)(channel.networkAddress); | ||
} | ||
//# sourceMappingURL=Channel.js.map |
@@ -6,6 +6,6 @@ /** | ||
*/ | ||
import { Channel, ChannelType } from "./Channel.js"; | ||
import { Channel, ChannelType, IpNetworkChannel } from "./Channel.js"; | ||
import { NetInterface } from "./NetInterface.js"; | ||
import { Network } from "./Network.js"; | ||
import { ServerAddress } from "./ServerAddress.js"; | ||
import { ServerAddress, ServerAddressIp } from "./ServerAddress.js"; | ||
import { TransportInterface } from "./TransportInterface.js"; | ||
@@ -23,3 +23,3 @@ import { UdpChannel } from "./UdpChannel.js"; | ||
} | ||
declare class UdpConnection implements Channel<Uint8Array> { | ||
declare class UdpConnection implements IpNetworkChannel<Uint8Array> { | ||
private readonly server; | ||
@@ -34,2 +34,3 @@ private readonly peerAddress; | ||
get name(): string; | ||
get networkAddress(): ServerAddressIp; | ||
close(): Promise<void>; | ||
@@ -36,0 +37,0 @@ } |
@@ -79,2 +79,5 @@ "use strict"; | ||
} | ||
get networkAddress() { | ||
return { type: "udp", ip: this.peerAddress, port: this.peerPort }; | ||
} | ||
async close() { | ||
@@ -81,0 +84,0 @@ } |
@@ -19,2 +19,3 @@ /** | ||
clear(): void; | ||
get data(): any; | ||
get<T extends SupportedStorageTypes>(contexts: string[], key: string): T | undefined; | ||
@@ -21,0 +22,0 @@ set(contexts: string[], keyOrValues: string | Record<string, SupportedStorageTypes>, value?: SupportedStorageTypes): void; |
@@ -60,2 +60,5 @@ "use strict"; | ||
} | ||
get data() { | ||
return this.store; | ||
} | ||
get(contexts, key) { | ||
@@ -62,0 +65,0 @@ if (!this.initialized) throw new import_Storage.StorageError("Storage is not initialized"); |
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
import { ServerAddressIp } from "#net/ServerAddress.js"; | ||
export declare enum ChannelType { | ||
@@ -25,2 +26,6 @@ UDP = "udp", | ||
} | ||
export interface IpNetworkChannel<T> extends Channel<T> { | ||
networkAddress: ServerAddressIp; | ||
} | ||
export declare function isIpNetworkChannel<T>(channel: Channel<T>): channel is IpNetworkChannel<T>; | ||
//# sourceMappingURL=Channel.d.ts.map |
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
import { isObject } from "#util/Type.js"; | ||
var ChannelType = /* @__PURE__ */ ((ChannelType2) => { | ||
@@ -13,5 +14,9 @@ ChannelType2["UDP"] = "udp"; | ||
})(ChannelType || {}); | ||
function isIpNetworkChannel(channel) { | ||
return isObject(channel.networkAddress); | ||
} | ||
export { | ||
ChannelType | ||
ChannelType, | ||
isIpNetworkChannel | ||
}; | ||
//# sourceMappingURL=Channel.js.map |
@@ -6,6 +6,6 @@ /** | ||
*/ | ||
import { Channel, ChannelType } from "./Channel.js"; | ||
import { Channel, ChannelType, IpNetworkChannel } from "./Channel.js"; | ||
import { NetInterface } from "./NetInterface.js"; | ||
import { Network } from "./Network.js"; | ||
import { ServerAddress } from "./ServerAddress.js"; | ||
import { ServerAddress, ServerAddressIp } from "./ServerAddress.js"; | ||
import { TransportInterface } from "./TransportInterface.js"; | ||
@@ -23,3 +23,3 @@ import { UdpChannel } from "./UdpChannel.js"; | ||
} | ||
declare class UdpConnection implements Channel<Uint8Array> { | ||
declare class UdpConnection implements IpNetworkChannel<Uint8Array> { | ||
private readonly server; | ||
@@ -34,2 +34,3 @@ private readonly peerAddress; | ||
get name(): string; | ||
get networkAddress(): ServerAddressIp; | ||
close(): Promise<void>; | ||
@@ -36,0 +37,0 @@ } |
@@ -56,2 +56,5 @@ /** | ||
} | ||
get networkAddress() { | ||
return { type: "udp", ip: this.peerAddress, port: this.peerPort }; | ||
} | ||
async close() { | ||
@@ -58,0 +61,0 @@ } |
@@ -19,2 +19,3 @@ /** | ||
clear(): void; | ||
get data(): any; | ||
get<T extends SupportedStorageTypes>(contexts: string[], key: string): T | undefined; | ||
@@ -21,0 +22,0 @@ set(contexts: string[], keyOrValues: string | Record<string, SupportedStorageTypes>, value?: SupportedStorageTypes): void; |
@@ -37,2 +37,5 @@ /** | ||
} | ||
get data() { | ||
return this.store; | ||
} | ||
get(contexts, key) { | ||
@@ -39,0 +42,0 @@ if (!this.initialized) throw new StorageError("Storage is not initialized"); |
{ | ||
"name": "@matter/general", | ||
"version": "0.11.0-alpha.0-20241015-ae8e54af2", | ||
"version": "0.11.0-alpha.0-20241016-a33385682", | ||
"description": "Non-Matter support for Matter.js", | ||
@@ -39,3 +39,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@matter/tools": "0.11.0-alpha.0-20241015-ae8e54af2" | ||
"@matter/tools": "0.11.0-alpha.0-20241016-a33385682" | ||
}, | ||
@@ -42,0 +42,0 @@ "files": [ |
@@ -6,2 +6,4 @@ /** | ||
*/ | ||
import { ServerAddressIp } from "#net/ServerAddress.js"; | ||
import { isObject } from "#util/Type.js"; | ||
@@ -32,1 +34,9 @@ export enum ChannelType { | ||
} | ||
export interface IpNetworkChannel<T> extends Channel<T> { | ||
networkAddress: ServerAddressIp; | ||
} | ||
export function isIpNetworkChannel<T>(channel: Channel<T>): channel is IpNetworkChannel<T> { | ||
return isObject((channel as IpNetworkChannel<T>).networkAddress); | ||
} |
@@ -7,6 +7,6 @@ /** | ||
import { Channel, ChannelType } from "./Channel.js"; | ||
import { Channel, ChannelType, IpNetworkChannel } from "./Channel.js"; | ||
import { NetInterface } from "./NetInterface.js"; | ||
import { Network, NetworkError } from "./Network.js"; | ||
import { ServerAddress } from "./ServerAddress.js"; | ||
import { ServerAddress, ServerAddressIp } from "./ServerAddress.js"; | ||
import { TransportInterface } from "./TransportInterface.js"; | ||
@@ -51,3 +51,3 @@ import { UdpChannel } from "./UdpChannel.js"; | ||
class UdpConnection implements Channel<Uint8Array> { | ||
class UdpConnection implements IpNetworkChannel<Uint8Array> { | ||
readonly isReliable = false; | ||
@@ -74,2 +74,6 @@ readonly type = ChannelType.UDP; | ||
get networkAddress(): ServerAddressIp { | ||
return { type: "udp", ip: this.peerAddress, port: this.peerPort }; | ||
} | ||
async close() { | ||
@@ -76,0 +80,0 @@ // UDP is connectionless, so nothing to do here |
@@ -49,2 +49,6 @@ /** | ||
get data() { | ||
return this.store; | ||
} | ||
get<T extends SupportedStorageTypes>(contexts: string[], key: string): T | undefined { | ||
@@ -51,0 +55,0 @@ if (!this.initialized) throw new StorageError("Storage is not initialized"); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1558371
31476