Rename locks to zones

This commit is contained in:
Fedor Indutny 2021-05-19 14:25:56 -07:00 committed by Scott Nonnenberg
parent 8f0731d498
commit 7418a5c663
6 changed files with 317 additions and 321 deletions

22
ts/util/Zone.ts Normal file
View file

@ -0,0 +1,22 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export type ZoneOptions = {
readonly pendingSessions?: boolean;
readonly pendingUnprocessed?: boolean;
};
export class Zone {
constructor(
public readonly name: string,
private readonly options: ZoneOptions = {}
) {}
public supportsPendingSessions(): boolean {
return this.options.pendingSessions === true;
}
public supportsPendingUnprocessed(): boolean {
return this.options.pendingUnprocessed === true;
}
}