jet-miniapp
Advanced tools
Comparing version 2.0.5 to 2.0.6
export * from './basic'; | ||
export * from './eventhub'; | ||
export * from './miniapp'; | ||
import * as R from 'ramda'; | ||
@@ -4,0 +5,0 @@ import * as _my from './my'; |
@@ -18,2 +18,3 @@ "use strict"; | ||
__export(require("./eventhub")); | ||
__export(require("./miniapp")); | ||
const R = __importStar(require("ramda")); | ||
@@ -20,0 +21,0 @@ exports.ramda = R; |
@@ -1,15 +0,6 @@ | ||
/// <reference types="_ts-toolbelt@4.10.21@ts-toolbelt" /> | ||
declare const mtop: import("Function/Curry").Curry<(api: string, v: string, data: any) => Promise<unknown>>; | ||
declare const http: import("Function/Curry").Curry<(url: string, method: "get" | "post", data: any, dataType: string) => Promise<unknown>>; | ||
declare const alert: import("Function/Curry").Curry<(title: string, content: string, buttonText: string) => Promise<unknown>>; | ||
declare const showLoading: import("Function/Curry").Curry<(content?: string | undefined, delay?: number | undefined) => Promise<unknown>>; | ||
declare const hideLoading: (page: Object) => void; | ||
declare const showToast: import("Function/Curry").Curry<(content?: string | undefined, duration?: number | undefined) => Promise<unknown>>; | ||
declare function hideToast(): void; | ||
declare const setState: (key: string, obj: any) => { | ||
complete: (fn: VoidCall) => void; | ||
}; | ||
declare const navigateTo: import("Function/Curry").Curry<(url: string) => Promise<unknown>>; | ||
declare const combinePage: (defaultOption: any, ...args: any[]) => any; | ||
declare const combineComponent: (defaultOption: any, ...args: any[]) => any; | ||
export { mtop, http, alert, showLoading, hideLoading, showToast, hideToast, setState, combinePage, combineComponent, navigateTo }; | ||
export { setState, combinePage, combineComponent }; |
"use strict"; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const R = __importStar(require("ramda")); | ||
const mtop = R.curry(function (api, v, data) { | ||
return new Promise((resolve, reject) => { | ||
my.sendMtop({ | ||
api, v, data, success: (data) => { | ||
resolve(data); | ||
}, fail: (error) => { | ||
reject(error); | ||
}, complete: () => { | ||
resolve(); | ||
} | ||
}); | ||
}); | ||
}); | ||
exports.mtop = mtop; | ||
const http = R.curry(function (url, method, data, dataType) { | ||
return new Promise((resolve, reject) => { | ||
my.request({ | ||
url, | ||
method, | ||
data, | ||
dataType, | ||
success: (res) => { | ||
resolve(res); | ||
}, | ||
fail: function (e) { | ||
reject(e); | ||
}, | ||
complete: function () { | ||
resolve(); | ||
} | ||
}); | ||
}); | ||
}); | ||
exports.http = http; | ||
const alert = R.curry(function (title, content, buttonText) { | ||
return new Promise((resolve, reject) => { | ||
my.alert({ | ||
title, content, buttonText, success: (data) => { | ||
resolve(data); | ||
}, fail: (error) => { | ||
reject(error); | ||
}, complete: () => { | ||
resolve(); | ||
} | ||
}); | ||
}); | ||
}); | ||
exports.alert = alert; | ||
const showLoading = R.curry(function (content, delay) { | ||
return new Promise((resolve, reject) => { | ||
my.showLoading({ | ||
content, delay, success: (data) => { | ||
resolve(data); | ||
}, fail: (error) => { | ||
reject(error); | ||
}, complete: () => { | ||
resolve(); | ||
} | ||
}); | ||
}); | ||
}); | ||
exports.showLoading = showLoading; | ||
const hideLoading = function (page) { | ||
my.hideLoading({ page }); | ||
}; | ||
exports.hideLoading = hideLoading; | ||
const showToast = R.curry(function (content, duration) { | ||
return new Promise((resolve, reject) => { | ||
my.showToast({ content, duration, success: (data) => { | ||
resolve(data); | ||
}, fail: (error) => { | ||
reject(error); | ||
}, complete: () => { | ||
resolve(); | ||
} }); | ||
}); | ||
}); | ||
exports.showToast = showToast; | ||
function hideToast() { | ||
my.hideToast(); | ||
} | ||
exports.hideToast = hideToast; | ||
; | ||
const setState = function (key, obj) { | ||
// @ts-ignore | ||
let setData = this.setData; | ||
// @ts-ignore | ||
if (workbench && workbench.jetProxy && workbench.jetProxy.setData) { | ||
if (setData) { | ||
// @ts-ignore | ||
setData = workbench.jetProxy.setData; | ||
setData = setData.bind(this); | ||
} | ||
try { | ||
// @ts-ignore | ||
if (workbench && workbench.jetProxy && workbench.jetProxy.setData) { | ||
// @ts-ignore | ||
setData = workbench.jetProxy.setData.bind(workbench.jetProxy); | ||
} | ||
} | ||
catch (_a) { | ||
console.warn('node working in simulator'); | ||
} | ||
//@ts-ignore | ||
@@ -120,14 +38,2 @@ if (setData) { | ||
exports.setState = setState; | ||
const navigateTo = R.curry(function (url) { | ||
return new Promise((resolve, reject) => { | ||
my.navigateTo({ url, success: (data) => { | ||
resolve(data); | ||
}, fail: (error) => { | ||
reject(error); | ||
}, complete: () => { | ||
resolve(); | ||
} }); | ||
}); | ||
}); | ||
exports.navigateTo = navigateTo; | ||
const pageEventNames = ['onLoad', 'onReady', 'onShow', 'onHide', 'onUnload', 'onTitleClick', 'onPullDownRefresh', 'onReachBottom', 'onShareAppMessage']; | ||
@@ -134,0 +40,0 @@ const componentEventNames = ['didMount', 'didUpdate', 'didUnmount']; |
{ | ||
"name": "jet-miniapp", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "客户端sdk", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98775
3068