2025-02-09 10:00:02 -06:00
|
|
|
[**packwizjs**](../../README.md)
|
|
|
|
|
|
|
|
***
|
|
|
|
|
|
|
|
[packwizjs](../../modules.md) / [parser](../README.md) / IndexFileEntry
|
|
|
|
|
|
|
|
# Class: IndexFileEntry
|
|
|
|
|
2025-02-09 10:24:15 -06:00
|
|
|
Defined in: parser.ts:29
|
2025-02-09 10:00:02 -06:00
|
|
|
|
|
|
|
Represents a file entry in the Packwiz index.
|
|
|
|
|
|
|
|
## Constructors
|
|
|
|
|
|
|
|
### new IndexFileEntry()
|
|
|
|
|
|
|
|
> **new IndexFileEntry**(`file`, `hash`, `hashFormat`, `alias`?, `metafile`?, `preserve`?): [`IndexFileEntry`](IndexFileEntry.md)
|
|
|
|
|
2025-02-09 10:24:15 -06:00
|
|
|
Defined in: parser.ts:39
|
|
|
|
|
|
|
|
Creates a new IndexFileEntry instance.
|
2025-02-09 10:00:02 -06:00
|
|
|
|
|
|
|
#### Parameters
|
|
|
|
|
|
|
|
##### file
|
|
|
|
|
|
|
|
[`Resource`](../../resource/classes/Resource.md)
|
|
|
|
|
2025-02-09 10:24:15 -06:00
|
|
|
The Resource instance representing the file.
|
|
|
|
|
2025-02-09 10:00:02 -06:00
|
|
|
##### hash
|
|
|
|
|
|
|
|
`string`
|
|
|
|
|
2025-02-09 10:24:15 -06:00
|
|
|
The hash of the file.
|
|
|
|
|
2025-02-09 10:00:02 -06:00
|
|
|
##### hashFormat
|
|
|
|
|
|
|
|
[`HashFormat`](../../enums/hash-format/enumerations/HashFormat.md)
|
|
|
|
|
2025-02-09 10:24:15 -06:00
|
|
|
The format of the hash.
|
|
|
|
|
2025-02-09 10:00:02 -06:00
|
|
|
##### alias?
|
|
|
|
|
|
|
|
`string`
|
|
|
|
|
2025-02-09 10:24:15 -06:00
|
|
|
An optional alias for the file that will be downloaded by this file.
|
|
|
|
|
2025-02-09 10:00:02 -06:00
|
|
|
##### metafile?
|
|
|
|
|
|
|
|
`boolean` = `false`
|
|
|
|
|
2025-02-09 10:24:15 -06:00
|
|
|
Whether the file is a metafile.
|
|
|
|
|
2025-02-09 10:00:02 -06:00
|
|
|
##### preserve?
|
|
|
|
|
|
|
|
`boolean` = `false`
|
|
|
|
|
2025-02-09 10:24:15 -06:00
|
|
|
Whether to preserve the file downloaded by this file if it is modified by an end user.
|
|
|
|
|
2025-02-09 10:00:02 -06:00
|
|
|
#### Returns
|
|
|
|
|
|
|
|
[`IndexFileEntry`](IndexFileEntry.md)
|
|
|
|
|
|
|
|
## Properties
|
|
|
|
|
|
|
|
### alias?
|
|
|
|
|
|
|
|
> `readonly` `optional` **alias**: `string`
|
|
|
|
|
2025-02-09 10:24:15 -06:00
|
|
|
Defined in: parser.ts:43
|
|
|
|
|
|
|
|
An optional alias for the file that will be downloaded by this file.
|
2025-02-09 10:00:02 -06:00
|
|
|
|
|
|
|
***
|
|
|
|
|
|
|
|
### file
|
|
|
|
|
|
|
|
> `readonly` **file**: [`Resource`](../../resource/classes/Resource.md)
|
|
|
|
|
2025-02-09 10:24:15 -06:00
|
|
|
Defined in: parser.ts:40
|
|
|
|
|
|
|
|
The Resource instance representing the file.
|
2025-02-09 10:00:02 -06:00
|
|
|
|
|
|
|
***
|
|
|
|
|
|
|
|
### hash
|
|
|
|
|
|
|
|
> `readonly` **hash**: `string`
|
|
|
|
|
2025-02-09 10:24:15 -06:00
|
|
|
Defined in: parser.ts:41
|
|
|
|
|
|
|
|
The hash of the file.
|
2025-02-09 10:00:02 -06:00
|
|
|
|
|
|
|
***
|
|
|
|
|
|
|
|
### hashFormat
|
|
|
|
|
|
|
|
> `readonly` **hashFormat**: [`HashFormat`](../../enums/hash-format/enumerations/HashFormat.md)
|
|
|
|
|
2025-02-09 10:24:15 -06:00
|
|
|
Defined in: parser.ts:42
|
|
|
|
|
|
|
|
The format of the hash.
|
2025-02-09 10:00:02 -06:00
|
|
|
|
|
|
|
***
|
|
|
|
|
|
|
|
### metafile
|
|
|
|
|
|
|
|
> `readonly` **metafile**: `boolean` = `false`
|
|
|
|
|
2025-02-09 10:24:15 -06:00
|
|
|
Defined in: parser.ts:44
|
|
|
|
|
|
|
|
Whether the file is a metafile.
|
2025-02-09 10:00:02 -06:00
|
|
|
|
|
|
|
***
|
|
|
|
|
|
|
|
### preserve
|
|
|
|
|
|
|
|
> `readonly` **preserve**: `boolean` = `false`
|
|
|
|
|
2025-02-09 10:24:15 -06:00
|
|
|
Defined in: parser.ts:45
|
|
|
|
|
|
|
|
Whether to preserve the file downloaded by this file if it is modified by an end user.
|
2025-02-09 10:00:02 -06:00
|
|
|
|
|
|
|
## Methods
|
|
|
|
|
|
|
|
### parse()
|
|
|
|
|
|
|
|
> **parse**(): `Promise`\<[`Metafile`](../interfaces/Metafile.md)\>
|
|
|
|
|
2025-02-09 10:24:15 -06:00
|
|
|
Defined in: parser.ts:59
|
|
|
|
|
|
|
|
Parses the TOML file and returns its contents.
|
2025-02-09 10:00:02 -06:00
|
|
|
|
|
|
|
#### Returns
|
|
|
|
|
|
|
|
`Promise`\<[`Metafile`](../interfaces/Metafile.md)\>
|
2025-02-09 10:24:15 -06:00
|
|
|
|
|
|
|
The parsed file as a structured object.
|