1 | import { PackMeta, ResourcePack, Resource, ResourceLocation } from "@xmcl/resourcepack";
|
2 | interface ResourceSourceWrapper {
|
3 | source: ResourcePack;
|
4 | info: PackMeta.Pack;
|
5 | domains: string[];
|
6 | }
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | export declare class ResourceManager {
|
12 | private list;
|
13 | get allResourcePacks(): PackMeta.Pack[];
|
14 | private cache;
|
15 | constructor(list?: Array<ResourceSourceWrapper>);
|
16 | /**
|
17 | * Add a new resource source to the end of the resource list.
|
18 | */
|
19 | addResourcePack(resourcePack: ResourcePack): Promise<void>;
|
20 | /**
|
21 | * Clear all cache
|
22 | */
|
23 | clearCache(): void;
|
24 | /**
|
25 | * Clear all resource source and cache
|
26 | */
|
27 | clearAll(): void;
|
28 | /**
|
29 | * Swap the resource source priority.
|
30 | */
|
31 | swap(first: number, second: number): void;
|
32 | /**
|
33 | * Invalidate the resource cache
|
34 | */
|
35 | invalidate(location: ResourceLocation): void;
|
36 | load(location: ResourceLocation): Promise<Resource | undefined>;
|
37 | load(location: ResourceLocation, urlOnly: false): Promise<Resource | undefined>;
|
38 | load(location: ResourceLocation, urlOnly: true): Promise<Resource | undefined>;
|
39 | private putCache;
|
40 | }
|
41 | export * from "./model-loader";
|