no more const enum, remove unused field

This commit is contained in:
Florian Dold 2020-09-02 11:21:42 +05:30
parent baaa11c37f
commit 0ffea74ad5
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
7 changed files with 23 additions and 35 deletions

View File

@ -37,7 +37,7 @@ import {
} from "./talerTypes";
import { Timestamp, codecForTimestamp } from "../util/time";
export const enum ReserveTransactionType {
export enum ReserveTransactionType {
Withdraw = "WITHDRAW",
Credit = "CREDIT",
Recoup = "RECOUP",

View File

@ -151,7 +151,7 @@ export function initRetryInfo(
return info;
}
export const enum WalletReserveHistoryItemType {
export enum WalletReserveHistoryItemType {
Credit = "credit",
Withdraw = "withdraw",
Closing = "closing",
@ -541,7 +541,7 @@ export interface ExchangeDetails {
lastUpdateTime: Timestamp;
}
export const enum ExchangeUpdateStatus {
export enum ExchangeUpdateStatus {
FetchKeys = "fetch-keys",
FetchWire = "fetch-wire",
FetchTerms = "fetch-terms",
@ -558,15 +558,7 @@ export interface ExchangeWireInfo {
accounts: ExchangeBankAccount[];
}
/**
* Summary of updates to the exchange.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface ExchangeUpdateDiff {
// FIXME: implement!
}
export const enum ExchangeUpdateReason {
export enum ExchangeUpdateReason {
Initial = "initial",
Forced = "forced",
Scheduled = "scheduled",
@ -644,14 +636,10 @@ export interface ExchangeRecord {
updateReason?: ExchangeUpdateReason;
/**
* Update diff, will be incorporated when the update is finalized.
*/
updateDiff: ExchangeUpdateDiff | undefined;
lastError?: TalerErrorDetails;
}
/**
* A coin that isn't yet signed by an exchange.
*/
@ -721,7 +709,7 @@ export interface RefreshPlanchetRecord {
/**
* Status of a coin.
*/
export const enum CoinStatus {
export enum CoinStatus {
/**
* Withdrawn and never shown to anybody.
*/
@ -732,7 +720,7 @@ export const enum CoinStatus {
Dormant = "dormant",
}
export const enum CoinSourceType {
export enum CoinSourceType {
Withdraw = "withdraw",
Refresh = "refresh",
Tip = "tip",
@ -827,7 +815,7 @@ export interface CoinRecord {
status: CoinStatus;
}
export const enum ProposalStatus {
export enum ProposalStatus {
/**
* Not downloaded yet.
*/
@ -1170,7 +1158,7 @@ export interface RefundEventRecord {
proposalId: string;
}
export const enum RefundState {
export enum RefundState {
Failed = "failed",
Applied = "applied",
Pending = "pending",
@ -1222,7 +1210,7 @@ export interface WalletRefundAppliedItem extends WalletRefundItemCommon {
type: RefundState.Applied;
}
export const enum RefundReason {
export enum RefundReason {
/**
* Normal refund given by the merchant.
*/
@ -1464,7 +1452,7 @@ export interface CoinsReturnRecord {
wire: any;
}
export const enum WithdrawalSourceType {
export enum WithdrawalSourceType {
Tip = "tip",
Reserve = "reserve",
}
@ -1613,7 +1601,7 @@ export interface RecoupGroupRecord {
lastError: TalerErrorDetails | undefined;
}
export const enum ImportPayloadType {
export enum ImportPayloadType {
CoreSchema = "core-schema",
}

View File

@ -25,7 +25,7 @@
import { TalerErrorDetails } from "./walletTypes";
import { WithdrawalSource } from "./dbTypes";
export const enum NotificationType {
export enum NotificationType {
CoinWithdrawn = "coin-withdrawn",
ProposalAccepted = "proposal-accepted",
ProposalDownloaded = "proposal-downloaded",

View File

@ -25,7 +25,7 @@ import { TalerErrorDetails, BalancesResponse } from "./walletTypes";
import { WithdrawalSource, RetryInfo, ReserveRecordStatus } from "./dbTypes";
import { Timestamp, Duration } from "../util/time";
export const enum PendingOperationType {
export enum PendingOperationType {
Bug = "bug",
ExchangeUpdate = "exchange-update",
Pay = "pay",
@ -84,13 +84,13 @@ export interface PendingBugOperation {
/**
* Current state of an exchange update operation.
*/
export const enum ExchangeUpdateOperationStage {
export enum ExchangeUpdateOperationStage {
FetchKeys = "fetch-keys",
FetchWire = "fetch-wire",
FinalizeUpdate = "finalize-update",
}
export const enum ReserveType {
export enum ReserveType {
/**
* Manually created.
*/

View File

@ -96,7 +96,7 @@ export type Transaction =
| TransactionTip
| TransactionRefresh;
export const enum TransactionType {
export enum TransactionType {
Withdrawal = "withdrawal",
Payment = "payment",
Refund = "refund",
@ -104,7 +104,7 @@ export const enum TransactionType {
Tip = "tip",
}
export const enum WithdrawalType {
export enum WithdrawalType {
TalerBankIntegrationApi = "taler-bank-integration-api",
ManualTransfer = "manual-transfer",
}
@ -164,7 +164,7 @@ interface TransactionWithdrawal extends TransactionCommon {
withdrawalDetails: WithdrawalDetails;
}
export const enum PaymentStatus {
export enum PaymentStatus {
/**
* Explicitly aborted after timeout / failure
*/

View File

@ -202,7 +202,7 @@ export function mkAmount(
return { value, fraction, currency };
}
export const enum ConfirmPayResultType {
export enum ConfirmPayResultType {
Done = "done",
Pending = "pending",
}
@ -370,7 +370,7 @@ export interface BenchmarkResult {
repetitions: number;
}
export const enum PreparePayResultType {
export enum PreparePayResultType {
PaymentPossible = "payment-possible",
InsufficientBalance = "insufficient-balance",
AlreadyConfirmed = "already-confirmed",
@ -529,7 +529,7 @@ export interface PlanchetCreationRequest {
/**
* Reasons for why a coin is being refreshed.
*/
export const enum RefreshReason {
export enum RefreshReason {
Manual = "manual",
Pay = "pay",
Refund = "refund",

View File

@ -64,7 +64,7 @@ export function parseWithdrawUri(s: string): WithdrawUriResult | undefined {
};
}
export const enum TalerUriType {
export enum TalerUriType {
TalerPay = "taler-pay",
TalerWithdraw = "taler-withdraw",
TalerTip = "taler-tip",