@sassoftware/mobile-investigator - v4.5.2

Mobile Investigator API

The SAS Mobile Investigator API provides a set of methods and HTML elements that enable developers to create customized solutions within the application.

For documentation and examples, see Solution Extension GitHub.

The SMI API is available through the JavaScript window object:

window.sas.smi.about.getAppVersion().then((version) => {
console.log(version);
});

The control API can be accessed through the controlApi property on control elements:

this.controlApi.control.state;

The following HTML elements are exposed in the package:

<smi-control-label></smi-control-label>
<smi-relate-create-step id="relate-create"></smi-relate-create-step>
<smi-relate-to-step id="relate-to"></smi-relate-to-step>
<smi-relate-search-results-step id="relate-search-results"></smi-relate-search-results-step>
<smi-relate-view-step id="relate-view"></smi-relate-view-step>
<smi-relate-properties-step id="relate-properties"></smi-relate-properties-step>
<smi-wizard #wizard>
<template>
<smi-relate-to-step id="relate-to"></smi-relate-to-step>
<smi-relate-create-step id="relate-create"></smi-relate-create-step>
<smi-relate-search-results-step id="relate-search-results"></smi-relate-search-results-step>
<smi-relate-view-step id="relate-view"></smi-relate-view-step>
<smi-relate-properties-step id="relate-properties"></smi-relate-properties-step>
</template>
</smi-wizard>

To complement the API, solution developers can download the API typings package. Run the following command in your project:

npm install @sassoftware/mobile-investigator

Use types to help with the autocompletion of API spaces, methods, and expected return types.

import { SmiWindow, isSasMobileWindowApi } from "@sassoftware/mobile-investigator";

const smiWindow = window as SmiWindow;
if (isSasMobileWindowApi(smiWindow.sas)) {
smiWindow.sas.smi.config.registerSolutionExtension(control);
}