uview-pro 0.1.1 → 0.2.1

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/types/global.d.ts CHANGED
@@ -80,6 +80,46 @@ export type ButtonOpenType =
80
80
 
81
81
  // calendar 组件 mode
82
82
  export type CalendarMode = 'date' | 'range';
83
+
84
+ // calendar 农历数据类型定义
85
+ export type CalendarLunarItem = {
86
+ dayCn: string;
87
+ weekCn: string;
88
+ monthCn: string;
89
+ day: number;
90
+ week: number;
91
+ month: number;
92
+ year: number;
93
+ };
94
+
95
+ // calendar 事件类型定义,单个日期
96
+ export type CalendarChangeDate = {
97
+ year: number;
98
+ month: number;
99
+ day: number;
100
+ days: number;
101
+ result: string;
102
+ week: string;
103
+ isToday: boolean;
104
+ lunar: CalendarLunarItem | null; // getLunar 返回类型,建议后续补充具体类型
105
+ };
106
+
107
+ // calendar 事件类型定义,范围选择
108
+ export type CalendarChangeRange = {
109
+ startYear: number;
110
+ startMonth: number;
111
+ startDay: number;
112
+ startDate: string;
113
+ startWeek: string;
114
+ endYear: number;
115
+ endMonth: number;
116
+ endDay: number;
117
+ endDate: string;
118
+ endWeek: string;
119
+ startLunar: CalendarLunarItem | null;
120
+ endLunar: CalendarLunarItem | null;
121
+ };
122
+
83
123
  // CellItem 右侧箭头方向,可选值:right|up|down,默认为right
84
124
  export type CellItemArrowDirection = 'right' | 'up' | 'down';
85
125
 
package/types/index.d.ts CHANGED
@@ -1,89 +1,18 @@
1
1
  /// <reference path="./components.d.ts" />
2
2
  /// <reference path="./uni-app.d.ts" />
3
3
 
4
- import http from '../libs/request/index';
5
- import queryParams from '../libs/function/queryParams';
6
- import route from '../libs/function/route';
7
- import timeFormat from '../libs/function/timeFormat';
8
- import timeFrom from '../libs/function/timeFrom';
9
- import colorGradient from '../libs/function/colorGradient';
10
- import guid from '../libs/function/guid';
11
- import color from '../libs/function/color';
12
- import type2icon from '../libs/function/type2icon';
13
- import randomArray from '../libs/function/randomArray';
14
- import deepClone from '../libs/function/deepClone';
15
- import deepMerge from '../libs/function/deepMerge';
16
- import addUnit from '../libs/function/addUnit';
17
- import test from '../libs/function/test';
18
- import random from '../libs/function/random';
19
- import trim from '../libs/function/trim';
20
- import toast from '../libs/function/toast';
21
- import getParent from '../libs/function/getParent';
22
- import $parent from '../libs/function/$parent';
23
- import debounce from '../libs/function/debounce';
24
- import throttle from '../libs/function/throttle';
25
- import getRect from '../libs/function/getRect';
26
- import { sys, os } from '../libs/function/sys';
27
- import { parentData, parent } from '../libs/function/parent';
28
- import config from '../libs/config/config';
29
- import zIndex from '../libs/config/zIndex';
30
- import { dispatch, broadcast } from '../libs/util/emitter';
31
- import { mitt } from '../libs/util/mitt';
4
+ import { $u } from '../libs';
32
5
 
33
6
  // uview-pro 模块类型声明
34
7
  declare module 'uview-pro' {
35
8
  // 导出安装函数
36
9
  export function install(): void;
37
-
38
- // 导出 $u 工具类型
39
- export interface $Utils {
40
- queryParams: typeof queryParams;
41
- route: typeof route;
42
- timeFormat: typeof timeFormat;
43
- date: typeof timeFormat;
44
- timeFrom: typeof timeFrom;
45
- colorGradient: typeof colorGradient.colorGradient;
46
- colorToRgba: typeof colorGradient.colorToRgba;
47
- guid: typeof guid;
48
- color: typeof color;
49
- sys: typeof sys;
50
- os: typeof os;
51
- type2icon: typeof type2icon;
52
- randomArray: typeof randomArray;
53
- dispatch: typeof dispatch;
54
- broadcast: typeof broadcast;
55
- get: typeof http.get;
56
- post: typeof http.post;
57
- put: typeof http.put;
58
- delete: typeof http.delete;
59
- hexToRgb: typeof colorGradient.hexToRgb;
60
- rgbToHex: typeof colorGradient.rgbToHex;
61
- test: typeof test;
62
- random: typeof random;
63
- deepClone: typeof deepClone;
64
- deepMerge: typeof deepMerge;
65
- getParent: typeof getParent;
66
- $parent: typeof $parent;
67
- parent: typeof parent;
68
- parentData: typeof parentData;
69
- addUnit: typeof addUnit;
70
- trim: typeof trim;
71
- type: string[];
72
- http: typeof http;
73
- toast: typeof toast;
74
- config: typeof config;
75
- zIndex: typeof zIndex;
76
- debounce: typeof debounce;
77
- throttle: typeof throttle;
78
- mitt: ReturnType<typeof mitt>;
79
- getRect: typeof getRect;
80
- }
81
10
  }
82
11
 
83
12
  // 全局类型扩展
84
13
  declare global {
85
14
  interface Uni {
86
- $u: import('uview-pro').$Utils;
15
+ $u: typeof $u;
87
16
  }
88
17
  }
89
18