22 lines
959 B
TypeScript
22 lines
959 B
TypeScript
export default class NotificationMessage {
|
|
constructor() {
|
|
this.title = '';
|
|
this.body = '';
|
|
this.footer = null;
|
|
this.isError = false;
|
|
this.isImportant = false;
|
|
this.color = 0xFF9A00;
|
|
}
|
|
setTitle(title: string) { this.title = title; return this; }
|
|
setBody(body: string) { this.body = body; return this; }
|
|
setFooter(footer: string | null) { this.footer = footer; return this; }
|
|
setColor(color?: string | number | null) { this.color = color == null ? 0xFF9A00 : color; return this; }
|
|
error(isError?: boolean | null) { this.isError = isError == null ? true : isError; return this; }
|
|
important(isImportant?: boolean | null) { this.isImportant = isImportant == null ? true : isImportant; return this; }
|
|
public title: string;
|
|
public body: string;
|
|
public footer: string | null;
|
|
public isError: boolean;
|
|
public isImportant: boolean;
|
|
public color: string | number;
|
|
} |