Skip to content

Interface Resource

The resource in the resource pack on a ResourceLocation

🏷️ Properties

location readonly

ts
location: ResourceLocation

The absolute location of the resource

Defined in: packages/resourcepack/resourcePack.ts:97

url readonly

ts
url: string

The real resource url which is used for reading the content of it.

Defined in: packages/resourcepack/resourcePack.ts:101

🔧 Methods

read

ts
read(): Promise<Uint8Array>

Read the resource content

Return Type

  • Promise<Uint8Array>
ts
read(encoding: undefined): Promise<Uint8Array>

Parameters

  • encoding: undefined

Return Type

  • Promise<Uint8Array>
ts
read(encoding: "utf-8" | "base64"): Promise<string>

Parameters

  • encoding: "utf-8" | "base64"

Return Type

  • Promise<string>
ts
read(encoding: "utf-8" | "base64"): Promise<string | Uint8Array>

Parameters

  • encoding: "utf-8" | "base64"

Return Type

  • Promise<string | Uint8Array>

Defined in: packages/resourcepack/resourcePack.ts:105, packages/resourcepack/resourcePack.ts:106, packages/resourcepack/resourcePack.ts:107, packages/resourcepack/resourcePack.ts:108

readMetadata

ts
readMetadata(): Promise<PackMeta>

Read the metadata of the resource

Return Type

  • Promise<PackMeta>

Defined in: packages/resourcepack/resourcePack.ts:112