feat: add type to exporter generic param
parent
1f16903aa1
commit
ec1e56e945
|
|
@ -85,6 +85,7 @@ class BattleFetcher {
|
|||
|
||||
if (!group) {
|
||||
return {
|
||||
type: "VsBattle",
|
||||
challengeProgress: null,
|
||||
bankaraMatchChallenge: null,
|
||||
listNode: null,
|
||||
|
|
@ -112,6 +113,7 @@ class BattleFetcher {
|
|||
}
|
||||
|
||||
return {
|
||||
type: "VsBattle",
|
||||
bankaraMatchChallenge,
|
||||
listNode,
|
||||
challengeProgress,
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ export type ChallengeProgress = {
|
|||
};
|
||||
// With challenge info
|
||||
export type VsBattle = {
|
||||
type: "VsBattle";
|
||||
listNode: null | BattleListNode;
|
||||
bankaraMatchChallenge: null | BankaraMatchChallenge;
|
||||
challengeProgress: null | ChallengeProgress;
|
||||
|
|
@ -138,7 +139,12 @@ export type VsHistoryDetail = {
|
|||
duration: number;
|
||||
};
|
||||
|
||||
export type BattleExporter<D> = {
|
||||
export type BattleExporter<
|
||||
D extends {
|
||||
// type is seful when you implement more than one BattleExporter on the same class
|
||||
type: string;
|
||||
},
|
||||
> = {
|
||||
name: string;
|
||||
notExported: (list: string[]) => Promise<string[]>;
|
||||
exportBattle: (detail: D) => Promise<void>;
|
||||
|
|
|
|||
Loading…
Reference in New Issue