@hlw-uni-mp/use 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +14 -3
- package/dist/index.d.ts +14 -3
- package/package.json +2 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
import { ApiRes } from '@hlw-uni-mp/request';
|
|
2
1
|
import * as pinia from 'pinia';
|
|
3
2
|
import { App, Ref, ComputedRef } from 'vue';
|
|
4
3
|
|
|
4
|
+
/**
|
|
5
|
+
* 具有消息提示属性的响应体对象
|
|
6
|
+
*/
|
|
7
|
+
interface ToastResponseLike {
|
|
8
|
+
/** 提示文案 */
|
|
9
|
+
msg?: string;
|
|
10
|
+
/** 是否为模态弹窗 */
|
|
11
|
+
modal?: boolean;
|
|
12
|
+
/** 模态弹窗配置 */
|
|
13
|
+
modalOptions?: UniApp.ShowModalOptions;
|
|
14
|
+
}
|
|
15
|
+
|
|
5
16
|
/**
|
|
6
17
|
* 提示回调函数类型 (confirm 为 true 表示确定,false 为取消)
|
|
7
18
|
*/
|
|
@@ -12,7 +23,7 @@ type ToastCallback = (confirm: boolean) => void;
|
|
|
12
23
|
*/
|
|
13
24
|
interface HlwMsg {
|
|
14
25
|
/** 显示轻提示或模态确认框 (支持回调与 Promise) */
|
|
15
|
-
toast
|
|
26
|
+
toast(opts: UniApp.ShowToastOptions | ToastResponseLike | string, callback?: ToastCallback): Promise<boolean>;
|
|
16
27
|
/** 成功提示框 */
|
|
17
28
|
success(msg: string): void;
|
|
18
29
|
/** 失败提示框 */
|
|
@@ -238,4 +249,4 @@ interface UseRefsReturn<T = unknown> {
|
|
|
238
249
|
*/
|
|
239
250
|
declare function useRefs<T = unknown>(): UseRefsReturn<T>;
|
|
240
251
|
|
|
241
|
-
export { DEFAULT_THEME, type FontFamily, type FontFamilyPreset, type FontSize, type FontSizePreset, type HlwInstance, type HlwMsg, type InitThemeOptions, type ShareConfig, type ShareHandlers, THEME_COLORS, type ThemeColor, type ThemeMode, type ThemeState, type ToastCallback, type UseRefsReturn, applyTheme, fontFamilyPresets, fontSizePresets, getTheme, hlw, initTheme, showShareMenu, useMsg, useRefs, useShare, useTheme, useThemeStore };
|
|
252
|
+
export { DEFAULT_THEME, type FontFamily, type FontFamilyPreset, type FontSize, type FontSizePreset, type HlwInstance, type HlwMsg, type InitThemeOptions, type ShareConfig, type ShareHandlers, THEME_COLORS, type ThemeColor, type ThemeMode, type ThemeState, type ToastCallback, type ToastResponseLike, type UseRefsReturn, applyTheme, fontFamilyPresets, fontSizePresets, getTheme, hlw, initTheme, showShareMenu, useMsg, useRefs, useShare, useTheme, useThemeStore };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
import { ApiRes } from '@hlw-uni-mp/request';
|
|
2
1
|
import * as pinia from 'pinia';
|
|
3
2
|
import { App, Ref, ComputedRef } from 'vue';
|
|
4
3
|
|
|
4
|
+
/**
|
|
5
|
+
* 具有消息提示属性的响应体对象
|
|
6
|
+
*/
|
|
7
|
+
interface ToastResponseLike {
|
|
8
|
+
/** 提示文案 */
|
|
9
|
+
msg?: string;
|
|
10
|
+
/** 是否为模态弹窗 */
|
|
11
|
+
modal?: boolean;
|
|
12
|
+
/** 模态弹窗配置 */
|
|
13
|
+
modalOptions?: UniApp.ShowModalOptions;
|
|
14
|
+
}
|
|
15
|
+
|
|
5
16
|
/**
|
|
6
17
|
* 提示回调函数类型 (confirm 为 true 表示确定,false 为取消)
|
|
7
18
|
*/
|
|
@@ -12,7 +23,7 @@ type ToastCallback = (confirm: boolean) => void;
|
|
|
12
23
|
*/
|
|
13
24
|
interface HlwMsg {
|
|
14
25
|
/** 显示轻提示或模态确认框 (支持回调与 Promise) */
|
|
15
|
-
toast
|
|
26
|
+
toast(opts: UniApp.ShowToastOptions | ToastResponseLike | string, callback?: ToastCallback): Promise<boolean>;
|
|
16
27
|
/** 成功提示框 */
|
|
17
28
|
success(msg: string): void;
|
|
18
29
|
/** 失败提示框 */
|
|
@@ -238,4 +249,4 @@ interface UseRefsReturn<T = unknown> {
|
|
|
238
249
|
*/
|
|
239
250
|
declare function useRefs<T = unknown>(): UseRefsReturn<T>;
|
|
240
251
|
|
|
241
|
-
export { DEFAULT_THEME, type FontFamily, type FontFamilyPreset, type FontSize, type FontSizePreset, type HlwInstance, type HlwMsg, type InitThemeOptions, type ShareConfig, type ShareHandlers, THEME_COLORS, type ThemeColor, type ThemeMode, type ThemeState, type ToastCallback, type UseRefsReturn, applyTheme, fontFamilyPresets, fontSizePresets, getTheme, hlw, initTheme, showShareMenu, useMsg, useRefs, useShare, useTheme, useThemeStore };
|
|
252
|
+
export { DEFAULT_THEME, type FontFamily, type FontFamilyPreset, type FontSize, type FontSizePreset, type HlwInstance, type HlwMsg, type InitThemeOptions, type ShareConfig, type ShareHandlers, THEME_COLORS, type ThemeColor, type ThemeMode, type ThemeState, type ToastCallback, type ToastResponseLike, type UseRefsReturn, applyTheme, fontFamilyPresets, fontSizePresets, getTheme, hlw, initTheme, showShareMenu, useMsg, useRefs, useShare, useTheme, useThemeStore };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hlw-uni-mp/use",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Universal Uni-App Vue 3 stateful composables library",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -33,8 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@hlw-uni-mp/pinia-plugin-storage": "^1.0.1"
|
|
37
|
-
"@hlw-uni-mp/request": "^1.0.5"
|
|
36
|
+
"@hlw-uni-mp/pinia-plugin-storage": "^1.0.1"
|
|
38
37
|
},
|
|
39
38
|
"devDependencies": {
|
|
40
39
|
"@dcloudio/types": "^3.4.30",
|