okam-core
Version:
The extension for small program framework
57 lines (46 loc) • 814 B
JavaScript
/**
* @file The swan mini program env
* @author sparklewhy@gmail.com
*/
;
/* global self:false */
/* global window:false */
/* global swan:false */
/* global getApp:false */
/* global getCurrentPages:false */
import globalAPI from './api';
import {getGlobal} from '../util/index';
/**
* The native app global object
*
* @type {Object}
*/
export const appGlobal = getGlobal();
/**
* The native env variable
*
* @return {Object}
*/
export const appEnv = swan;
/**
* The native env api
*
* @type {Object}
*/
export const api = globalAPI;
/**
* Get current app instance
*
* @return {Object}
*/
export function getCurrApp() {
return getApp();
}
/**
* Get current opened pages stack
*
* @return {Array}
*/
export function getCurrPages() {
return getCurrentPages();
}