signal-desktop/ts/util/Zone.ts

28 lines
672 B
TypeScript
Raw Normal View History

2021-05-19 21:25:56 +00:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export type ZoneOptions = {
readonly pendingSenderKeys?: boolean;
2021-05-19 21:25:56 +00:00
readonly pendingSessions?: boolean;
readonly pendingUnprocessed?: boolean;
};
export class Zone {
constructor(
public readonly name: string,
private readonly options: ZoneOptions = {}
) {}
public supportsPendingSenderKeys(): boolean {
return this.options.pendingSenderKeys === true;
}
2021-05-19 21:25:56 +00:00
public supportsPendingSessions(): boolean {
return this.options.pendingSessions === true;
}
public supportsPendingUnprocessed(): boolean {
return this.options.pendingUnprocessed === true;
}
}