let pako = require('pako')
const simba_cc_resutils_1 = require("simba-cc-resutils");

const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    @property(cc.Label)
    label: cc.Label = null;

    @property
    text: string = 'hello';

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

    start () {

    }

    async callback(){
        // cc.resources.load('/plots/46',(err,resdata)=>{
        //     if(err) return console.error('err');
        //     console.log('resdata',resdata);
        //     console.log('pako',pako);
        //     let data = resdata['_$nativeAsset']
        //     let jsonObj = JSON.parse(pako.inflate(data, { to: 'string' }))
        //     console.log('jsonObj',jsonObj);
        // })

        let  res = await simba_cc_resutils_1.ResUtils.loadManifestResToJson(`/plots/46`);
        console.log('res',res);
        
    }
    //  "pako": "^2.0.3"
    // update (dt) {}
}
