@sassoftware/mobile-investigator
v4.4.2
Published
The SAS Mobile Investigator Client API
Downloads
109
Maintainers
Keywords
Readme
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.
Getting Started
For documentation and examples please see our Solution Extension GitHub.
API
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:
ControlLabelElement
<smi-control-label></smi-control-label>
RelateCreateStepElement
<smi-relate-create-step id="relate-create"></smi-relate-create-step>
SmiRelateToStepComponent
<smi-relate-to-step id="relate-to"></smi-relate-to-step>
RelateSearchResultsStepElement
<smi-relate-search-results-step id="relate-search-results"></smi-relate-search-results-step>
RelateCreateStepElement
<smi-relate-view-step id="relate-view"></smi-relate-view-step>
SmiRelatePropertiesStepComponent
<smi-relate-properties-step id="relate-properties"></smi-relate-properties-step>
WizardElement
<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>
Typings
To complement the API, solution developers can download the API typings package. Run the following command in your project:
npm install @sassoftware/mobile-investigator
The types can be used to help with 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);
}