supporters full integrated exept sponsors item

This commit is contained in:
MathieuG-P
2022-09-09 02:11:15 +02:00
parent 2600785a10
commit bbff1c6934
16 changed files with 283 additions and 42 deletions
+2
View File
@@ -0,0 +1,2 @@
export { SupporterType } from "./supporter.type";
export { Supporter } from "./supporter.interface";
@@ -0,0 +1,8 @@
import { SupporterType } from "./supporter.type";
export interface Supporter {
username: string,
type?: SupporterType,
link?: string,
image?: string,
}
@@ -0,0 +1,19 @@
import { SupporterType } from "./supporter.type";
import { SupporterInterface } from "./supporter.interface";
export class SupporterModel{
constructor(private args: SupporterInterface){}
public get username(): string{ return this.args.username; }
public get type(): SupporterType{ return this.args.type; }
public get link(): string{
if(this.type === "basic"){ return null; }
return this.args.link;
}
public get image(): string{
if(this.type !== "sponsor"){ return null; }
return this.args.image;
}
}
@@ -0,0 +1 @@
export type SupporterType = "gold"|"diamond"|"sponsor"