[Assets] Move to use Indexable type

This commit is contained in:
Beef 2023-01-07 23:06:36 +00:00
parent 4104d637f1
commit de3d422754
2 changed files with 3 additions and 7 deletions

6
src/def.d.ts vendored
View file

@ -33,10 +33,6 @@ interface Asset {
id: number; id: number;
} }
interface Assets {
[id: string]: Asset;
}
interface PluginAuthor { interface PluginAuthor {
name: string; name: string;
id: string; id: string;
@ -109,7 +105,7 @@ interface VendettaObject {
showToast: (content: string, asset: number) => void; showToast: (content: string, asset: number) => void;
}; };
assets: { assets: {
all: Assets; all: Indexable<Asset>;
find: (filter: (a: any) => void) => Asset | null | undefined; find: (filter: (a: any) => void) => Asset | null | undefined;
getAssetByName: (name: string) => Asset; getAssetByName: (name: string) => Asset;
getAssetByID: (id: number) => Asset; getAssetByID: (id: number) => Asset;

View file

@ -1,8 +1,8 @@
import { Asset, Assets } from "@types"; import { Asset, Indexable, } from "@types";
import { after } from "@lib/patcher"; import { after } from "@lib/patcher";
import { assets } from "@metro/common"; import { assets } from "@metro/common";
export const all: Assets = {}; export const all: Indexable<Asset> = {};
export default function patchAssets() { export default function patchAssets() {
try { try {