NotificationCategory.ts 925 Bytes
Newer Older
1
export class NotificationCategory {
2 3 4
  identifier: string
  actions: [NotificationAction?];

5 6 7 8 9
  constructor(identifier: string, actions: [NotificationAction?]) {
    this.identifier = identifier;
    this.actions = actions;
  }
}
10 11 12 13 14 15

export interface NotificationTextInput {
  buttonTitle: string;
  placeholder: string;
}

16
export class NotificationAction {
17 18 19 20
  identifier: string;
  activationMode: 'foreground' | 'authenticationRequired' | 'destructive';
  title: string;
  authenticationRequired: boolean;
21 22 23 24 25 26 27 28 29
  textInput: NotificationTextInput;

  constructor(identifier: string, activationMode: 'foreground' | 'authenticationRequired' | 'destructive', title: string, authenticationRequired: boolean, textInput: NotificationTextInput) {
    this.identifier = identifier;
    this.activationMode = activationMode;
    this.title = title;
    this.authenticationRequired = authenticationRequired;
    this.textInput = textInput;
  }
30
}