2022-08-26 05:00:14 +02:00
|
|
|
import {
|
|
|
|
flagEnabled as baseFlagEnabled,
|
|
|
|
devFlagEnabled as baseDevFlagEnabled,
|
|
|
|
devFlagValue as baseDevFlagValue,
|
|
|
|
SharedFlags,
|
|
|
|
SharedDevFlags,
|
|
|
|
} from "@bitwarden/common/misc/flags";
|
|
|
|
|
|
|
|
// required to avoid linting errors when there are no flags
|
|
|
|
/* eslint-disable-next-line @typescript-eslint/ban-types */
|
2022-07-13 18:22:58 +02:00
|
|
|
export type Flags = {
|
2022-12-09 11:21:07 +01:00
|
|
|
secretsManager?: boolean;
|
2022-09-27 00:26:10 +02:00
|
|
|
showPasswordless?: boolean;
|
2022-08-26 05:00:14 +02:00
|
|
|
} & SharedFlags;
|
2022-07-13 18:22:58 +02:00
|
|
|
|
2022-08-26 05:00:14 +02:00
|
|
|
// required to avoid linting errors when there are no flags
|
|
|
|
/* eslint-disable-next-line @typescript-eslint/ban-types */
|
|
|
|
export type DevFlags = {} & SharedDevFlags;
|
2022-07-13 18:22:58 +02:00
|
|
|
|
2022-08-26 05:00:14 +02:00
|
|
|
export function flagEnabled(flag: keyof Flags): boolean {
|
|
|
|
return baseFlagEnabled<Flags>(flag);
|
2022-07-13 18:22:58 +02:00
|
|
|
}
|
|
|
|
|
2022-08-26 05:00:14 +02:00
|
|
|
export function devFlagEnabled(flag: keyof DevFlags) {
|
|
|
|
return baseDevFlagEnabled<DevFlags>(flag);
|
|
|
|
}
|
2022-07-13 18:22:58 +02:00
|
|
|
|
2022-08-26 05:00:14 +02:00
|
|
|
export function devFlagValue(flag: keyof DevFlags) {
|
|
|
|
return baseDevFlagValue(flag);
|
2022-07-13 18:22:58 +02:00
|
|
|
}
|