This article covers the following platforms
MSFS 2024
MSFS 2020
ATS
FSX
Prepar3D
Each widget can save its own data and restore it in future sessions.
export()
Persist a serializable object for the current widget.
SignatureTypeScript contract
export(data: Record<string, unknown>): voidParameters
| Name | Type | Required | Description |
|---|---|---|---|
data | Record<string, unknown> | Yes | Object to persist. Flow stringifies it before storage. |
ExampleJavaScript
this.$api.datastore.export({ preferredView: "compact" });Returns
voidNo direct return value is documented.import()
Merge stored widget data into a supplied default object.
SignatureTypeScript contract
import(store: Record<string, unknown>): Record<string, unknown>Parameters
| Name | Type | Required | Description |
|---|---|---|---|
store | Record<string, unknown> | Yes | Default object to merge with the stored data. |
ExampleJavaScript
const settings = this.$api.datastore.import({ preferredView: "expanded" });
console.log(settings);Returns
Record<string, unknown>A copy of the supplied object merged with the stored widget data.