mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-18 23:49:20 +01:00
Init payments message types
This commit is contained in:
34
ts/types/Payment.ts
Normal file
34
ts/types/Payment.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export enum PaymentEventKind {
|
||||
Notification = 1,
|
||||
ActivationRequest = 2,
|
||||
Activation = 3,
|
||||
// Request = 4, -- disabled
|
||||
// Cancellation = 5, -- disabled
|
||||
}
|
||||
|
||||
export type PaymentNotificationEvent = {
|
||||
kind: PaymentEventKind.Notification;
|
||||
note: string | null;
|
||||
};
|
||||
|
||||
export type PaymentActivationRequestEvent = {
|
||||
kind: PaymentEventKind.ActivationRequest;
|
||||
};
|
||||
|
||||
export type PaymentActivatedEvent = {
|
||||
kind: PaymentEventKind.Activation;
|
||||
};
|
||||
|
||||
export type AnyPaymentEvent =
|
||||
| PaymentNotificationEvent
|
||||
| PaymentActivationRequestEvent
|
||||
| PaymentActivatedEvent;
|
||||
|
||||
export function isPaymentNotificationEvent(
|
||||
event: AnyPaymentEvent
|
||||
): event is PaymentNotificationEvent {
|
||||
return event.kind === PaymentEventKind.Notification;
|
||||
}
|
||||
Reference in New Issue
Block a user