A function that decodes the contents of a file from a bundle. The path is provided to enable filtering, so that only files related to this extension are decoded. Developers are strongly encouraged to immediately reject any files that are not related to this extension. Additionally, developers MUST use the provided decode function when decoding the file contents.
This method is used to do smart filtering when decoding bundle contents, to avoid decompressing/parsing unused files.
A generator function that yields the files that should be written to the bundle. File contents MUST be JSON-serializable.
The name of the extension.
The schema of the extension.
OptionalintegrityA function that performs an integrity check on the data. This should not be used to validate the shape of the data, but rather check for things like referential integrity, or other potential problems that cannot be detected purely from schema validation.
OptionalreferencesA list of reference schemas that are required for your extension to function properly. The general rule here is that if: a. The schema is defined within this extension, and b. The schema is referenced using Type.Ref, then the schema should be listed here. You SHOULD NOT list schemas that are not used by and do not belong to this extension.
A type that describes an extension for an MVF bundle.
The generic types for the extension should be defined as follows:
Tshould be the schema definition for how you expect the data to be made available once the MVF is loaded.Dependsshould be an array of the schemas of any extensions you may depend on. For example, if your data is organized per floor, you likely want to depend on FloorSchema. This helps to inform the types available to you when writing the integrityCheck function.Errorshould be the type of error that the integrity check may throw. It's recommended to base this on IntegrityError. These are what are returned by the integrityCheck function on failure.