appModule
MS Code Extension API / core/extensionAPI/modules/appModule
core/extensionAPI/modules/appModule
Functions
createAppModule()
createAppModule(
extId):object
Defined in: core/extensionAPI/modules/appModule.ts:6
Parameters
extId
string
Returns
object
app
app:
object
app.exitApp
exitApp: () =>
Promise<any>
Trigger the app exit confirmation directly
Returns
Promise<any>
app.onBackButton
onBackButton: (
callback) =>object
Registers a callback for the hardware back button.
Returns true inside the callback to stop the event from bubbling down to exit the app.
*
Parameters
callback
() => boolean | Promise<boolean>
Returns
object
dispose
dispose: () =>
void
Returns
void
Example
const backSub = mscode.app.onBackButton(() => {
if (myCustomPopupIsOpen) {
closePopup();
return true; // We handled it! Don't exit app.
}
return false; // Let it pass to the next handler/exit.
});