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)
		}).catch((reason)=>{
            console.log('catch:', reason);
        })

    }

    petInteractionKuwo(petId,type){
        return new Promise((resolve,reject)=>{
            NetManager.ins.petInteractionKuwo((success)=>{
                if(!success){
                    reject(success)
                }
                resolve(success)
            },petId,type,window["signId"])
        }).catch((reason)=>{
            console.log('catch:', reason);
        })

    }
}