MC_survival/loader.d.ts

74 lines
1.8 KiB
TypeScript
Raw Normal View History

2025-01-14 12:27:52 +08:00
/**
*
*/
interface Loader {
/**
*
* @param dir
* @param names
* @param toSave
* @param callback
*/
loadImages(
dir: string,
names: string[],
toSave: Record<string, HTMLImageElement>,
callback?: () => void
): void;
/**
*
* @param dir
* @param imgName
* @param callback
*/
loadImage(
dir: string,
imgName: string,
callback?: (name: string, img: HTMLImageElement) => void
): void;
/**
* zip中加载一系列图片
* @param url
* @param names
*/
loadImagesFromZip(
url: string,
names: string,
toSave: Record<string, HTMLImageElement>,
onprogress?: (loaded: number, total: number) => void,
onfinished?: () => void
): void;
/**
*
* @param name
*/
loadOneMusic(name: BgmIds): void;
/**
*
* @param name
*/
loadOneSound(name: SoundIds): void;
/**
* bgm
* @param name bgm的id或名称
*/
loadBgm(name: BgmIds | NameMapIn<BgmIds>): void;
/**
* bgm的缓存
* @param name bgm的id或名称
*/
freeBgm(name: BgmIds | NameMapIn<BgmIds>): void;
_loadMaterials_afterLoad(): void;
_loadAnimate(data: string): Animate;
}
declare const loader: new () => Loader;