Files
Desktop/ts/types/Address.std.ts
Fedor Indutny 44076ece79 Rename files
2025-10-16 23:45:44 -07:00

22 lines
565 B
TypeScript

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { ServiceIdString } from './ServiceId.std.js';
export type AddressStringType = `${ServiceIdString}.${number}`;
export class Address {
constructor(
public readonly serviceId: ServiceIdString,
public readonly deviceId: number
) {}
public toString(): AddressStringType {
return `${this.serviceId}.${this.deviceId}`;
}
public static create(serviceId: ServiceIdString, deviceId: number): Address {
return new Address(serviceId, deviceId);
}
}