import { NetManager } from "../libs/tw/manager/NetManager";


export class NetPromise {
    private static instance: NetPromise;

    public static get ins(): NetPromise {
        if (!this.instance) {
            this.instance = new NetPromise();
        }
        return this.instance;
    }

    constructor() {}

    getPetInfoKuwo(){
		return new Promise((resolve,reject)=>{
			NetManager.ins.getPetInfoKuwo((success)=>{
				if(!success){
                    reject(success)
				}
				resolve(success)
			},window["CFG"].activityId)
		})
    }

    petInteractionKuwo(petId,type){
        return new Promise((resolve,reject)=>{
            NetManager.ins.petInteractionKuwo((success)=>{
                if(!success){
                    reject(success)
                }
                resolve(success)
            },petId,type,window["signId"])
        })
    }

    getSignInfo(signActivityId){
        return new Promise((resolve,reject)=>{
            NetManager.ins.getSignInfo((success)=>{
                if(!success){
                    reject(success)
                }
                resolve(success)
            },signActivityId)
        })
    }

    doSign(signActivityId){
        return new Promise((resolve,reject)=>{
            NetManager.ins.doSign((success)=>{
                if(!success){
                    reject(success)
                }
                resolve(success)
            },signActivityId)
        })
    }
}