Interfaces/Addons
IAddonFileHandlerService
Provides utility methods for file handling within addons.
Methods
LoadFile
Loads the content of the given file within the current addon.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | The path of the file. Should match with any of the specified items in the "Files" property of the addon metadata file. |
Returns
| Name | Type |
|---|---|
| string | The string content of the file. |
LoadFile
!! IT CAN ONLY DESERIALIZE FROM JSON AND YAML !! Reads the given file within the current addon. If empty, returns T with its default values. Otherwise returns the data deserialized to the given type. Note that the deserialized data will be cached. Type upon retrieval must match the type used when first deserializing.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | The path of the file. Should match with any of the specified items in the "Files" property of the addon metadata file. |
Returns
| Name | Type |
|---|---|
| T | The data converted to T. |