import { resources, SpriteFrame } from "cc";

export const loadSpriteFrames = (dir: string): Promise<SpriteFrame[]> => {
    return new Promise((resolve, reject) => {
      resources.loadDir(dir, SpriteFrame, (err, frames) => {
        if (err) {
          reject(err);
          return;
        }
        resolve(frames);
      });
    });
  }