@cowave-cli/utils 2.5.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/README.md +115 -0
- package/dist/error.d.ts +1 -0
- package/dist/js/fullscreen.d.ts +24 -0
- package/dist/js/http.d.ts +26 -0
- package/dist/js/logic.d.ts +1 -0
- package/dist/js/navigator.d.ts +9 -0
- package/dist/js/number.d.ts +15 -0
- package/dist/js/object.d.ts +52 -0
- package/dist/js/string.d.ts +44 -0
- package/dist/js/style.d.ts +6 -0
- package/dist/js/time.d.ts +77 -0
- package/dist/js/tiny-color.d.ts +288 -0
- package/dist/js.cjs +1652 -0
- package/dist/js.d.ts +10 -0
- package/dist/js.js +1627 -0
- package/dist/node/file.d.ts +40 -0
- package/dist/node/path.d.ts +26 -0
- package/dist/node.cjs +1883 -0
- package/dist/node.d.ts +3 -0
- package/dist/node.js +1849 -0
- package/dist/vue/api.d.ts +28 -0
- package/dist/vue/file.d.ts +16 -0
- package/dist/vue/store.d.ts +2 -0
- package/dist/vue/subscribe.d.ts +4 -0
- package/dist/vue.cjs +1846 -0
- package/dist/vue.d.ts +5 -0
- package/dist/vue.js +1816 -0
- package/package.json +77 -0
- package/type.d.ts +17 -0
package/README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# cowave-utils 控维工具包
|
|
2
|
+
|
|
3
|
+
## 更新记录
|
|
4
|
+
|
|
5
|
+
### 2.5.0
|
|
6
|
+
|
|
7
|
+
1. 添加组件工具函数 on ,用于中间件透传事件
|
|
8
|
+
|
|
9
|
+
### 2.4.0
|
|
10
|
+
|
|
11
|
+
1. 加入Vue工具函数,使用cowave-utils/vue 使用 vue工具函数
|
|
12
|
+
|
|
13
|
+
### 2.3.0
|
|
14
|
+
|
|
15
|
+
1. 包优化
|
|
16
|
+
|
|
17
|
+
### 2.2.0
|
|
18
|
+
|
|
19
|
+
1. 引入http
|
|
20
|
+
|
|
21
|
+
### 2.0.0
|
|
22
|
+
|
|
23
|
+
1. 从tsup升级为rollup,并保留注释,新增了所有函数注释使用方法,可以便捷使用所有函数。
|
|
24
|
+
2. 删除getDate的默认formatter, 默认输出Date格式。
|
|
25
|
+
3. 优化setTime时间同步逻辑。
|
|
26
|
+
|
|
27
|
+
## JS工具函数
|
|
28
|
+
|
|
29
|
+
<!-- 表格 -->
|
|
30
|
+
1. 全屏
|
|
31
|
+
|
|
32
|
+
| 函数 | 功能 |
|
|
33
|
+
| --------------------------------------------- | -------- |
|
|
34
|
+
| <code>isFullscreen()</code> | 是否全屏 |
|
|
35
|
+
| <code>inFullscreen( el : HTMLElement )</code> | 进入全屏 |
|
|
36
|
+
| <code>exitFullscreen()</code> | 退出全屏 |
|
|
37
|
+
| <code>fullscreen( el : HTMLElement )</code> | 切换全屏 |
|
|
38
|
+
|
|
39
|
+
2. 系统
|
|
40
|
+
|
|
41
|
+
| 函数 | 返回值 | 功能 |
|
|
42
|
+
| ---------------------------- | ------------------------------------------- | -------------- |
|
|
43
|
+
| <code>browserEngine()</code> | "Gecko" \| "Blink" \| "WebKit" \| "Unknown" | 浏览器引擎判断 |
|
|
44
|
+
|
|
45
|
+
3. 数字处理
|
|
46
|
+
|
|
47
|
+
| 函数 | 功能 |
|
|
48
|
+
| -------------------------------------------------------- | ---------- |
|
|
49
|
+
| <code>Num(num: string \| number, factor?: number)</code> | 转换为数字 |
|
|
50
|
+
|
|
51
|
+
4. 字符串处理
|
|
52
|
+
|
|
53
|
+
| 函数 | 功能 |
|
|
54
|
+
| --------------------------------------------------------------------------------- | ------------------------------ |
|
|
55
|
+
| <code>toHump(strings: string \| string[], hyphenType = '-', isGreatHump? )</code> | 将连字符字符串转换为驼峰字符串 |
|
|
56
|
+
| <code>toHyphen(strings: string \| string[], hyphenType = '-')</code> | 将驼峰字符串转换为连字符字符串 |
|
|
57
|
+
|
|
58
|
+
5. 对象处理
|
|
59
|
+
|
|
60
|
+
| 函数 | 功能 |
|
|
61
|
+
| ------------------------------------------------------------------- | -------------------------------------------- |
|
|
62
|
+
| <code>getObject(objectArr, keyName, keyValue, foundKeyName?)</code> | 从对象列表中,根据指定键值,找到对象(或属性) |
|
|
63
|
+
| <code>assignObject(dist: T, src: T): T</code> | 深合并对象 |
|
|
64
|
+
| <code>expose(option,...refs)</code> | 处理中间件事件向上透传(用于Vue组件封装) |
|
|
65
|
+
|
|
66
|
+
6. 时间处理
|
|
67
|
+
|
|
68
|
+
| 函数 | 功能 |
|
|
69
|
+
| --------------------------------------------------------------- | ---------------------------------- |
|
|
70
|
+
| <code>setTime(callback: () => Date \| string \| number)</code> | 服务器时间同步 |
|
|
71
|
+
| <code>getTime()</code> | 获取服务器时间戳 |
|
|
72
|
+
| <code>getDate(date?: Date \| string, formatter?: string)</code> | 获取时间(服务器时间)/转换时间格式 |
|
|
73
|
+
| <code>getDateObject(date: Date \| string \| number)</code> | 获取时间对象 |
|
|
74
|
+
| <code>getSpecialDate(dateType, date?, formatter?)</code> | 获取特殊时间节点(一个月前、一年前) |
|
|
75
|
+
|
|
76
|
+
7. AJAX请求
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
import { createHttp } from 'cowave-utils'
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
8. 颜色处理
|
|
83
|
+
| 函数 | 功能 | 文档 |
|
|
84
|
+
| ------------------------ | ---------- | ------------------------------------- |
|
|
85
|
+
| <code>new TinyColor(color)</code> | 颜色处理库 | [地址](./document/tiny-color.md) |
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
## Vue工具函数
|
|
89
|
+
|
|
90
|
+
1. API
|
|
91
|
+
2. 文件处理
|
|
92
|
+
3. store
|
|
93
|
+
4. 发布订阅
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
## Node工具函数
|
|
97
|
+
|
|
98
|
+
1. 文件处理
|
|
99
|
+
|
|
100
|
+
| 函数 | 功能 |
|
|
101
|
+
| --------------------------------------------------------- | ------------------------------ |
|
|
102
|
+
| <code>createDir(path: string)</code> | 创建文件夹 |
|
|
103
|
+
| <code>readDir(path: string)</code> | 读取文件夹下的所有文件、文件夹 |
|
|
104
|
+
| <code>readFile(pathName: string)</code> | 读取文件内容 |
|
|
105
|
+
| <code>writeFile(pathName: string, content: string)</code> | 写入文件内容 |
|
|
106
|
+
| <code>copyFileOrDir(src: string, dest: string)</code> | 复制文件夹或者文件 |
|
|
107
|
+
| <code>removeFileOrDir(path: string)</code> | 删除文件夹或者文件 |
|
|
108
|
+
|
|
109
|
+
2. 路径处理
|
|
110
|
+
|
|
111
|
+
| 函数 | 功能 |
|
|
112
|
+
| ----------------------------------------------------------------------------- | ------------------------------------------ |
|
|
113
|
+
| <code>relation(fromPath: string, toPath: string, toPathIsFile = false)</code> | 判断从toPath引入fromPath的路径相对关系 |
|
|
114
|
+
| <code>filter(files, basePath?, includePath?, excludePath?)</code> | 过滤文件(仅过滤文件路径,不过滤文件夹路径) |
|
|
115
|
+
| <code>findFiles(srcs, includePath?, excludePath?)</code> | 遍历寻找src目录下的所有文件 |
|
package/dist/error.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const noDisk: (fromPath1: any, toPath1: any) => never;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 是否全屏
|
|
3
|
+
*
|
|
4
|
+
* @returns boolean
|
|
5
|
+
*/
|
|
6
|
+
export declare function isFullscreen(): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* 进入全屏
|
|
9
|
+
*
|
|
10
|
+
* @param { HTMLElement } el 需要进入全屏的元素
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
export declare function inFullscreen(el?: any): void;
|
|
14
|
+
/**
|
|
15
|
+
* 退出全屏
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
export declare function exitFullscreen(): void;
|
|
19
|
+
/**
|
|
20
|
+
* 切换全屏显示
|
|
21
|
+
*
|
|
22
|
+
* @param { HTMLElement } el 需要进入全屏的元素
|
|
23
|
+
*/
|
|
24
|
+
export declare function fullscreen(el?: HTMLElement): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AxiosRequestConfig, AxiosResponse, CreateAxiosDefaults, InternalAxiosRequestConfig } from 'axios';
|
|
2
|
+
export type Config = CreateAxiosDefaults<any>;
|
|
3
|
+
export type Request = InternalAxiosRequestConfig<any>;
|
|
4
|
+
export type Response = AxiosResponse<any, any>;
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param config 配置 (如配置 baseUrl、timeout 等 )
|
|
8
|
+
* @param request 请求拦截
|
|
9
|
+
* @param response 响应成功拦截
|
|
10
|
+
* @param reject 响应错误拦截 (正常情况用不到)
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare const createHttp: ({ config, request, response, reject, }: {
|
|
14
|
+
config?: Config;
|
|
15
|
+
request?: (config: Request) => Request;
|
|
16
|
+
response?: (data: any, res: Response) => any;
|
|
17
|
+
reject?: (error: any) => any;
|
|
18
|
+
}) => {
|
|
19
|
+
(config: AxiosRequestConfig<any>): Promise<any>;
|
|
20
|
+
get: (url: string, params?: any, config?: AxiosRequestConfig<any>) => any;
|
|
21
|
+
delete: (url: string, params?: any, config?: AxiosRequestConfig<any>) => any;
|
|
22
|
+
head: (url: string, params?: any, config?: AxiosRequestConfig<any>) => any;
|
|
23
|
+
post: (url: string, data?: any, config?: AxiosRequestConfig<any>) => any;
|
|
24
|
+
put: (url: string, data?: any, config?: AxiosRequestConfig<any>) => any;
|
|
25
|
+
patch: (url: string, data?: any, config?: AxiosRequestConfig<any>) => any;
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const setValue: (condition: any, value: any, def?: any) => any;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 从对象数组中获取匹配特定键值对的对象。
|
|
3
|
+
* @param objectArr 对象数组,每个对象至少包含一个键值对。
|
|
4
|
+
* @param keyName 需要匹配的键的名称。
|
|
5
|
+
* @param keyValue 需要匹配的键对应的值。可以是具体值或函数,如果为函数,则会将函数应用于数组中每个对象的键值进行匹配。
|
|
6
|
+
* @param foundKeyName 如果找到匹配的对象,从该对象中返回的键的名称。如果未指定,则返回整个对象。
|
|
7
|
+
* @returns 如果找到匹配的对象且指定了`foundKeyName`,则返回该键的值;如果未指定`foundKeyName`,则返回整个匹配的对象。如果没有找到匹配的对象,则返回一个空对象。
|
|
8
|
+
*/
|
|
9
|
+
export declare const getObject: (objectArr: Record<string, any>[], keyName: string, keyValue: any, foundKeyName?: string) => any;
|
|
10
|
+
type DeepWritable<T> = {
|
|
11
|
+
-readonly [P in keyof T]: T[P] extends object ? DeepWritable<T[P]> : T[P];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* 将源对象[src]的属性分配到目标对象[dist],并递归地合并它们的属性。
|
|
15
|
+
* 如果源对象的属性是一个对象(且不是数组),则会递归地将其属性分配到目标对象的相应属性中。
|
|
16
|
+
* 如果源对象的属性是数组或其他类型,则直接覆盖目标对象的相应属性。
|
|
17
|
+
*
|
|
18
|
+
* @param dist 目标对象,其属性将被源对象的属性覆盖或合并。
|
|
19
|
+
* @param src 源对象,其属性将覆盖或合并到目标对象中。
|
|
20
|
+
* @returns 返回合并后的目标对象。
|
|
21
|
+
* @template T 目标对象和源对象的类型,该类型必须是可深度写入的对象类型。
|
|
22
|
+
*/
|
|
23
|
+
export declare const assignObject: <T extends DeepWritable<Record<string, any>>>(dist: T, src: T) => T;
|
|
24
|
+
/**
|
|
25
|
+
* 此函数用来处理中间件向上透传方法 (仅用于Vue组件封装)
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
*
|
|
29
|
+
* com.vue
|
|
30
|
+
* !暴露form表单的所有方法,table表格的所有方法,以及onClick
|
|
31
|
+
* defineExpose( { onClick: () => { console.log('click') } }, formRef,tableRef)
|
|
32
|
+
* !父组件调用
|
|
33
|
+
* com.value.change() //调用表单change方法
|
|
34
|
+
* com.value.onClick() //调用onClick方法
|
|
35
|
+
*
|
|
36
|
+
* @param callback 回调函数,传onMounted
|
|
37
|
+
* @param option 默认暴露对象
|
|
38
|
+
* @param refs 要暴露的组件
|
|
39
|
+
* @returns 暴露对象
|
|
40
|
+
*/
|
|
41
|
+
export declare const expose: (option: any, ...refs: {
|
|
42
|
+
value: any;
|
|
43
|
+
}[]) => any;
|
|
44
|
+
/**
|
|
45
|
+
* 此函数用来处理中间件向上透传事件 (仅用于Vue组件封装)
|
|
46
|
+
*
|
|
47
|
+
* @param emit emit
|
|
48
|
+
* @param emitStrs
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
export declare const on: (emit: any, emitStrs: string[] | Object) => {};
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated 这个函数已弃用,请使用 toHump() 代替
|
|
3
|
+
*/
|
|
4
|
+
export declare const pathToHump: (path: any, isGreatHump?: boolean) => any;
|
|
5
|
+
/**
|
|
6
|
+
* 将连接符字符串转换为驼峰字符串
|
|
7
|
+
*
|
|
8
|
+
* @param strings 字符串(列表)
|
|
9
|
+
* @param hyphenType 连接符
|
|
10
|
+
* @param isGreatHump 是否为大驼峰
|
|
11
|
+
* @returns humpString
|
|
12
|
+
*/
|
|
13
|
+
export declare const toHump: (strings: string | string[], hyphenType?: null | string, isGreatHump?: boolean) => string | string[];
|
|
14
|
+
/**
|
|
15
|
+
* 将驼峰字符串转换为连接符字符串
|
|
16
|
+
*
|
|
17
|
+
* @param strings 字符串(列表)
|
|
18
|
+
* @param hyphenType 连接符
|
|
19
|
+
* @returns hyphenString
|
|
20
|
+
*/
|
|
21
|
+
export declare const toHyphen: (strings: string | string[], hyphenType?: string) => void | void[];
|
|
22
|
+
/**
|
|
23
|
+
* 将object转换成query参数
|
|
24
|
+
*
|
|
25
|
+
* @param keyValue 对象
|
|
26
|
+
* @returns query参数
|
|
27
|
+
*/
|
|
28
|
+
export declare const query: (keyValue: object | null) => string;
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* 将url 传参转成data格式
|
|
32
|
+
*
|
|
33
|
+
* @param url (?********)
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
36
|
+
export declare const urlToData: (url: string) => any[];
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* 判断url格式
|
|
40
|
+
*
|
|
41
|
+
* @param url
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
44
|
+
export declare const isUrl: (path: string) => boolean;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { DateType } from '../type';
|
|
2
|
+
/**
|
|
3
|
+
* @param callback 获取服务器时间的回调函数,需要返回服务器时间
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
*
|
|
7
|
+
* setTime(async () => {
|
|
8
|
+
* return await getServerTime()
|
|
9
|
+
* })
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
declare const setTime: (callback: () => Date | string | number) => Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* 获取服务器时间戳
|
|
15
|
+
*
|
|
16
|
+
* @returns 服务器时间戳
|
|
17
|
+
*/
|
|
18
|
+
declare const getTime: () => number;
|
|
19
|
+
/** 时间格式化 (参考dayjs)
|
|
20
|
+
*
|
|
21
|
+
* @param date 时间
|
|
22
|
+
* @param formatStr 格式如下
|
|
23
|
+
* @returns 格式化后的时间
|
|
24
|
+
*
|
|
25
|
+
* @formatStr
|
|
26
|
+
*
|
|
27
|
+
* |格式 |输出| 描述|
|
|
28
|
+
* |----|----|----|
|
|
29
|
+
* |YY| 18 |两位数年份|
|
|
30
|
+
* |YYYY| 2018 |四位数年份|
|
|
31
|
+
* |M| 1-12 |月份,从 1 开始|
|
|
32
|
+
* |MM |01-12 |月份,2 位数字|
|
|
33
|
+
* |D |1-31 |该月的哪一天|
|
|
34
|
+
* |DD| 01-31| 月份中的日期,2 位数字|
|
|
35
|
+
* |h| 0-23| 小时|
|
|
36
|
+
* |hh |00-23 |小时,2 位数字|
|
|
37
|
+
* |m| 0-59| 分钟|
|
|
38
|
+
* |mm |00-59 |分钟,2 位数字|
|
|
39
|
+
* |s |0-59| 秒钟|
|
|
40
|
+
* |ss |00-59 |秒钟,2 位数字|
|
|
41
|
+
*/
|
|
42
|
+
declare const getDate: (date: Date | string | number | null | undefined, formatStr?: string) => string | Date;
|
|
43
|
+
/** 获取特殊时间节点
|
|
44
|
+
*
|
|
45
|
+
* @param {'weekstart' | 'weekend' | 'monthstart' | 'monthend' | 'yearstart' | 'yearend' | 'weekbefore' |'weekafter'| 'monthbefore' | 'yearbefore' | 'yearafter'} dateType 获取特殊时间
|
|
46
|
+
* @param {string } formatter 格式字符串或预设方案数字
|
|
47
|
+
*
|
|
48
|
+
* dateType:
|
|
49
|
+
*
|
|
50
|
+
* - weekstart —— 本周起始日期
|
|
51
|
+
*
|
|
52
|
+
* - weekend —— 本周结束日期
|
|
53
|
+
*
|
|
54
|
+
* - weekbefore —— 一周前日期
|
|
55
|
+
*
|
|
56
|
+
* - weekafter —— 一周后日期
|
|
57
|
+
*
|
|
58
|
+
* - monthstart —— 本月起始日期
|
|
59
|
+
*
|
|
60
|
+
* - monthend —— 本月结束日期
|
|
61
|
+
*
|
|
62
|
+
* - monthbefore—— 一个月前日期
|
|
63
|
+
*
|
|
64
|
+
* - yearstart —— 今年1月1日
|
|
65
|
+
*
|
|
66
|
+
* - yearend —— 今年12月31日
|
|
67
|
+
*
|
|
68
|
+
* - yearbefore —— 一年前日期
|
|
69
|
+
*
|
|
70
|
+
* - yearafter —— 一年后日期
|
|
71
|
+
*
|
|
72
|
+
* formatter: 参考 getDate
|
|
73
|
+
*
|
|
74
|
+
* @returns {Date | string}
|
|
75
|
+
*/
|
|
76
|
+
declare const getSpecialDate: (dateType: DateType, date?: Date | number | string | null, formatter?: any) => string | Date;
|
|
77
|
+
export { setTime, getTime, getDate, getSpecialDate };
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
interface TinyColorOptions {
|
|
2
|
+
format: string;
|
|
3
|
+
gradientType: string;
|
|
4
|
+
}
|
|
5
|
+
type Numberify<T> = {
|
|
6
|
+
[P in keyof T]: number;
|
|
7
|
+
};
|
|
8
|
+
type NumberOrString<T> = {
|
|
9
|
+
[P in keyof T]: number | string;
|
|
10
|
+
};
|
|
11
|
+
interface RGB {
|
|
12
|
+
r: number | string;
|
|
13
|
+
g: number | string;
|
|
14
|
+
b: number | string;
|
|
15
|
+
}
|
|
16
|
+
interface RGBA extends RGB {
|
|
17
|
+
a: number;
|
|
18
|
+
}
|
|
19
|
+
interface HSL {
|
|
20
|
+
h: number | string;
|
|
21
|
+
s: number | string;
|
|
22
|
+
l: number | string;
|
|
23
|
+
}
|
|
24
|
+
interface HSLA extends HSL {
|
|
25
|
+
a: number;
|
|
26
|
+
}
|
|
27
|
+
interface HSV {
|
|
28
|
+
h: number | string;
|
|
29
|
+
s: number | string;
|
|
30
|
+
v: number | string;
|
|
31
|
+
}
|
|
32
|
+
interface HSVA extends HSV {
|
|
33
|
+
a: number;
|
|
34
|
+
}
|
|
35
|
+
type ColorInput = string | number | RGB | RGBA | HSL | HSLA | HSV | HSVA | TinyColor;
|
|
36
|
+
export declare class TinyColor {
|
|
37
|
+
private matchers;
|
|
38
|
+
private names;
|
|
39
|
+
private _originalInput;
|
|
40
|
+
private _r;
|
|
41
|
+
private _g;
|
|
42
|
+
private _b;
|
|
43
|
+
private _a;
|
|
44
|
+
private _roundA;
|
|
45
|
+
private _format;
|
|
46
|
+
private _gradientType;
|
|
47
|
+
private _ok;
|
|
48
|
+
isDark: boolean;
|
|
49
|
+
isLight: boolean;
|
|
50
|
+
isValid: boolean;
|
|
51
|
+
constructor(color?: ColorInput, opts?: Partial<TinyColorOptions>);
|
|
52
|
+
init(color?: ColorInput, opts?: Partial<TinyColorOptions>): void;
|
|
53
|
+
initAttr(): void;
|
|
54
|
+
private static initNames;
|
|
55
|
+
private initMatchers;
|
|
56
|
+
getBrightness(): number;
|
|
57
|
+
toRgb(): Numberify<RGBA>;
|
|
58
|
+
static getNames(): {
|
|
59
|
+
aliceblue: string;
|
|
60
|
+
antiquewhite: string;
|
|
61
|
+
aqua: string;
|
|
62
|
+
aquamarine: string;
|
|
63
|
+
azure: string;
|
|
64
|
+
beige: string;
|
|
65
|
+
bisque: string;
|
|
66
|
+
black: string;
|
|
67
|
+
blanchedalmond: string;
|
|
68
|
+
blue: string;
|
|
69
|
+
blueviolet: string;
|
|
70
|
+
brown: string;
|
|
71
|
+
burlywood: string;
|
|
72
|
+
burntsienna: string;
|
|
73
|
+
cadetblue: string;
|
|
74
|
+
chartreuse: string;
|
|
75
|
+
chocolate: string;
|
|
76
|
+
coral: string;
|
|
77
|
+
cornflowerblue: string;
|
|
78
|
+
cornsilk: string;
|
|
79
|
+
crimson: string;
|
|
80
|
+
cyan: string;
|
|
81
|
+
darkblue: string;
|
|
82
|
+
darkcyan: string;
|
|
83
|
+
darkgoldenrod: string;
|
|
84
|
+
darkgray: string;
|
|
85
|
+
darkgreen: string;
|
|
86
|
+
darkgrey: string;
|
|
87
|
+
darkkhaki: string;
|
|
88
|
+
darkmagenta: string;
|
|
89
|
+
darkolivegreen: string;
|
|
90
|
+
darkorange: string;
|
|
91
|
+
darkorchid: string;
|
|
92
|
+
darkred: string;
|
|
93
|
+
darksalmon: string;
|
|
94
|
+
darkseagreen: string;
|
|
95
|
+
darkslateblue: string;
|
|
96
|
+
darkslategray: string;
|
|
97
|
+
darkslategrey: string;
|
|
98
|
+
darkturquoise: string;
|
|
99
|
+
darkviolet: string;
|
|
100
|
+
deeppink: string;
|
|
101
|
+
deepskyblue: string;
|
|
102
|
+
dimgray: string;
|
|
103
|
+
dimgrey: string;
|
|
104
|
+
dodgerblue: string;
|
|
105
|
+
firebrick: string;
|
|
106
|
+
floralwhite: string;
|
|
107
|
+
forestgreen: string;
|
|
108
|
+
fuchsia: string;
|
|
109
|
+
gainsboro: string;
|
|
110
|
+
ghostwhite: string;
|
|
111
|
+
gold: string;
|
|
112
|
+
goldenrod: string;
|
|
113
|
+
gray: string;
|
|
114
|
+
green: string;
|
|
115
|
+
greenyellow: string;
|
|
116
|
+
grey: string;
|
|
117
|
+
honeydew: string;
|
|
118
|
+
hotpink: string;
|
|
119
|
+
indianred: string;
|
|
120
|
+
indigo: string;
|
|
121
|
+
ivory: string;
|
|
122
|
+
khaki: string;
|
|
123
|
+
lavender: string;
|
|
124
|
+
lavenderblush: string;
|
|
125
|
+
lawngreen: string;
|
|
126
|
+
lemonchiffon: string;
|
|
127
|
+
lightblue: string;
|
|
128
|
+
lightcoral: string;
|
|
129
|
+
lightcyan: string;
|
|
130
|
+
lightgoldenrodyellow: string;
|
|
131
|
+
lightgray: string;
|
|
132
|
+
lightgreen: string;
|
|
133
|
+
lightgrey: string;
|
|
134
|
+
lightpink: string;
|
|
135
|
+
lightsalmon: string;
|
|
136
|
+
lightseagreen: string;
|
|
137
|
+
lightskyblue: string;
|
|
138
|
+
lightslategray: string;
|
|
139
|
+
lightslategrey: string;
|
|
140
|
+
lightsteelblue: string;
|
|
141
|
+
lightyellow: string;
|
|
142
|
+
lime: string;
|
|
143
|
+
limegreen: string;
|
|
144
|
+
linen: string;
|
|
145
|
+
magenta: string;
|
|
146
|
+
maroon: string;
|
|
147
|
+
mediumaquamarine: string;
|
|
148
|
+
mediumblue: string;
|
|
149
|
+
mediumorchid: string;
|
|
150
|
+
mediumpurple: string;
|
|
151
|
+
mediumseagreen: string;
|
|
152
|
+
mediumslateblue: string;
|
|
153
|
+
mediumspringgreen: string;
|
|
154
|
+
mediumturquoise: string;
|
|
155
|
+
mediumvioletred: string;
|
|
156
|
+
midnightblue: string;
|
|
157
|
+
mintcream: string;
|
|
158
|
+
mistyrose: string;
|
|
159
|
+
moccasin: string;
|
|
160
|
+
navajowhite: string;
|
|
161
|
+
navy: string;
|
|
162
|
+
oldlace: string;
|
|
163
|
+
olive: string;
|
|
164
|
+
olivedrab: string;
|
|
165
|
+
orange: string;
|
|
166
|
+
orangered: string;
|
|
167
|
+
orchid: string;
|
|
168
|
+
palegoldenrod: string;
|
|
169
|
+
palegreen: string;
|
|
170
|
+
paleturquoise: string;
|
|
171
|
+
palevioletred: string;
|
|
172
|
+
papayawhip: string;
|
|
173
|
+
peachpuff: string;
|
|
174
|
+
peru: string;
|
|
175
|
+
pink: string;
|
|
176
|
+
plum: string;
|
|
177
|
+
powderblue: string;
|
|
178
|
+
purple: string;
|
|
179
|
+
rebeccapurple: string;
|
|
180
|
+
red: string;
|
|
181
|
+
rosybrown: string;
|
|
182
|
+
royalblue: string;
|
|
183
|
+
saddlebrown: string;
|
|
184
|
+
salmon: string;
|
|
185
|
+
sandybrown: string;
|
|
186
|
+
seagreen: string;
|
|
187
|
+
seashell: string;
|
|
188
|
+
sienna: string;
|
|
189
|
+
silver: string;
|
|
190
|
+
skyblue: string;
|
|
191
|
+
slateblue: string;
|
|
192
|
+
slategray: string;
|
|
193
|
+
slategrey: string;
|
|
194
|
+
snow: string;
|
|
195
|
+
springgreen: string;
|
|
196
|
+
steelblue: string;
|
|
197
|
+
tan: string;
|
|
198
|
+
teal: string;
|
|
199
|
+
thistle: string;
|
|
200
|
+
tomato: string;
|
|
201
|
+
turquoise: string;
|
|
202
|
+
violet: string;
|
|
203
|
+
wheat: string;
|
|
204
|
+
white: string;
|
|
205
|
+
whitesmoke: string;
|
|
206
|
+
yellow: string;
|
|
207
|
+
yellowgreen: string;
|
|
208
|
+
};
|
|
209
|
+
getOriginalInput(): ColorInput;
|
|
210
|
+
getFormat(): string;
|
|
211
|
+
getAlpha(): number;
|
|
212
|
+
getLuminance(): number;
|
|
213
|
+
setAlpha(value?: any): this;
|
|
214
|
+
toHsv(): Numberify<HSVA>;
|
|
215
|
+
toHsvString(): string;
|
|
216
|
+
toHsl(): Numberify<HSLA>;
|
|
217
|
+
toHslString(): string;
|
|
218
|
+
toHex(allow3Char?: boolean): string;
|
|
219
|
+
toHexString(allow3Char?: boolean): string;
|
|
220
|
+
toHex8(allow4Char?: boolean): string;
|
|
221
|
+
toHex8String(allow4Char?: boolean): string;
|
|
222
|
+
toRgbString(): string;
|
|
223
|
+
toPercentageRgb(): NumberOrString<RGBA>;
|
|
224
|
+
toPercentageRgbString(): string;
|
|
225
|
+
toName(): string | boolean;
|
|
226
|
+
toFilter(secondColor?: ColorInput): string;
|
|
227
|
+
toString(format?: string): any;
|
|
228
|
+
clone(): TinyColor;
|
|
229
|
+
private _applyModification;
|
|
230
|
+
private _lighten;
|
|
231
|
+
lighten(...args: any): TinyColor;
|
|
232
|
+
private _brighten;
|
|
233
|
+
brighten(...args: any): TinyColor;
|
|
234
|
+
private _darken;
|
|
235
|
+
darken(...args: any): TinyColor;
|
|
236
|
+
private _desaturate;
|
|
237
|
+
desaturate(...args: any): TinyColor;
|
|
238
|
+
private _saturate;
|
|
239
|
+
saturate(...args: any): TinyColor;
|
|
240
|
+
private _greyscale;
|
|
241
|
+
greyscale(...args: any): TinyColor;
|
|
242
|
+
private _spin;
|
|
243
|
+
spin(...args: any): TinyColor;
|
|
244
|
+
private _applyCombination;
|
|
245
|
+
private _analogous;
|
|
246
|
+
analogous(...args: any): TinyColor;
|
|
247
|
+
private _complement;
|
|
248
|
+
complement(...args: any): TinyColor;
|
|
249
|
+
private _monochromatic;
|
|
250
|
+
monochromatic(...args: any): TinyColor;
|
|
251
|
+
private _splitcomplement;
|
|
252
|
+
splitcomplement(...args: any): TinyColor;
|
|
253
|
+
private _triad;
|
|
254
|
+
triad(...args: any): TinyColor;
|
|
255
|
+
private _tetrad;
|
|
256
|
+
tetrad(...args: any): TinyColor;
|
|
257
|
+
static fromRatio(color: ColorInput, opts?: Partial<TinyColorOptions>): TinyColor;
|
|
258
|
+
static equals(color1: ColorInput, color2: ColorInput): boolean;
|
|
259
|
+
static random(): TinyColor;
|
|
260
|
+
static mix(color1: ColorInput, color2: ColorInput, amount?: number): TinyColor;
|
|
261
|
+
static readability(color1: ColorInput, color2: ColorInput): number;
|
|
262
|
+
static isReadable(color1: ColorInput, color2: ColorInput, wcag2?: any): boolean;
|
|
263
|
+
static mostReadable(baseColor: ColorInput, colorList: any[], args?: any): any;
|
|
264
|
+
private clamp01;
|
|
265
|
+
private _flip;
|
|
266
|
+
private isValidCSSUnit;
|
|
267
|
+
private isOnePointZero;
|
|
268
|
+
private isPercentage;
|
|
269
|
+
private pad2;
|
|
270
|
+
private bound01;
|
|
271
|
+
private convertDecimalToHex;
|
|
272
|
+
private rgbToRgb;
|
|
273
|
+
private hsvToRgb;
|
|
274
|
+
private hslToRgb;
|
|
275
|
+
private rgbToHsl;
|
|
276
|
+
private rgbToHsv;
|
|
277
|
+
private rgbToHex;
|
|
278
|
+
private rgbaToHex;
|
|
279
|
+
private rgbaToArgbHex;
|
|
280
|
+
private static convertToPercentage;
|
|
281
|
+
private boundAlpha;
|
|
282
|
+
private inputToRGB;
|
|
283
|
+
private parseIntFromHex;
|
|
284
|
+
private convertHexToDecimal;
|
|
285
|
+
private stringInputToObject;
|
|
286
|
+
private static validateWCAG2Parms;
|
|
287
|
+
}
|
|
288
|
+
export {};
|