mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-28 04:13:18 +01:00
Rename files
This commit is contained in:
21
ts/types/Address.std.ts
Normal file
21
ts/types/Address.std.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user