PackwizJS/docs/parser/classes/IndexFileEntry.md
2025-02-09 10:24:15 -06:00

2.2 KiB

packwizjs


packwizjs / parser / IndexFileEntry

Class: IndexFileEntry

Defined in: parser.ts:29

Represents a file entry in the Packwiz index.

Constructors

new IndexFileEntry()

new IndexFileEntry(file, hash, hashFormat, alias?, metafile?, preserve?): IndexFileEntry

Defined in: parser.ts:39

Creates a new IndexFileEntry instance.

Parameters

file

Resource

The Resource instance representing the file.

hash

string

The hash of the file.

hashFormat

HashFormat

The format of the hash.

alias?

string

An optional alias for the file that will be downloaded by this file.

metafile?

boolean = false

Whether the file is a metafile.

preserve?

boolean = false

Whether to preserve the file downloaded by this file if it is modified by an end user.

Returns

IndexFileEntry

Properties

alias?

readonly optional alias: string

Defined in: parser.ts:43

An optional alias for the file that will be downloaded by this file.


file

readonly file: Resource

Defined in: parser.ts:40

The Resource instance representing the file.


hash

readonly hash: string

Defined in: parser.ts:41

The hash of the file.


hashFormat

readonly hashFormat: HashFormat

Defined in: parser.ts:42

The format of the hash.


metafile

readonly metafile: boolean = false

Defined in: parser.ts:44

Whether the file is a metafile.


preserve

readonly preserve: boolean = false

Defined in: parser.ts:45

Whether to preserve the file downloaded by this file if it is modified by an end user.

Methods

parse()

parse(): Promise<Metafile>

Defined in: parser.ts:59

Parses the TOML file and returns its contents.

Returns

Promise<Metafile>

The parsed file as a structured object.