HumanBreak/src/types/loader.d.ts

74 lines
1.7 KiB
TypeScript
Raw Normal View History

/**
*
*/
interface Loader {
/**
*
* @param dir
* @param names
* @param toSave
* @param callback
*/
loadImages(
dir: string,
names: string[],
toSave: Record<string, HTMLImageElement>,
callback?: () => void
): void;
2022-11-13 18:02:05 +08:00
/**
*
* @param dir
* @param imgName
* @param callback
*/
2023-06-21 17:10:06 +08:00
loadImage(
dir: string,
imgName: string,
callback?: (name: string, img: HTMLImageElement) => void
): void;
2022-11-13 18:02:05 +08:00
/**
* zip中加载一系列图片
* @param url
* @param names
*/
2022-11-13 18:02:05 +08:00
loadImagesFromZip(
url: string,
names: string,
toSave: Record<string, HTMLImageElement>,
onprogress?: (loaded: number, total: number) => void,
onfinished?: () => void
): void;
2022-11-13 18:02:05 +08:00
/**
*
* @param name
*/
loadOneMusic(name: BgmIds): void;
2022-11-13 18:02:05 +08:00
/**
*
* @param name
*/
loadOneSound(name: SoundIds): void;
2022-11-13 18:02:05 +08:00
/**
* bgm
* @param name bgm的id或名称
*/
loadBgm(name: BgmIds | NameMapIn<BgmIds>): void;
2022-11-13 18:02:05 +08:00
/**
* bgm的缓存
* @param name bgm的id或名称
*/
freeBgm(name: BgmIds | NameMapIn<BgmIds>): void;
2023-06-28 22:48:15 +08:00
_loadMaterials_afterLoad(): void;
2023-06-29 20:24:21 +08:00
_loadAnimate(data: string): Animate;
2022-11-13 18:02:05 +08:00
}
declare const loader: new () => Loader;