dev-classes 1.2.3 → 1.3.4
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 +250 -0
- package/dist/classes/Color/Color.d.ts +28 -37
- package/dist/classes/Color/Color.js +167 -205
- package/dist/classes/Color/Color.types.d.ts +36 -0
- package/dist/classes/Color/Color.types.js +1 -0
- package/dist/classes/Color/index.d.ts +2 -0
- package/dist/classes/Color/index.js +4 -0
- package/dist/classes/DateProcessing/DateProcessing.d.ts +30 -78
- package/dist/classes/DateProcessing/DateProcessing.js +2 -1
- package/dist/classes/DateProcessing/DateProcessing.types.d.ts +50 -0
- package/dist/classes/DateProcessing/DateProcessing.types.js +5 -0
- package/dist/classes/DateProcessing/index.d.ts +2 -0
- package/dist/classes/DateProcessing/index.js +4 -0
- package/dist/classes/DelaysPromise/DelaysPromise.d.ts +8 -0
- package/dist/classes/DelaysPromise/DelaysPromise.js +69 -0
- package/dist/classes/DelaysPromise/DelaysPromise.types.d.ts +28 -0
- package/dist/classes/DelaysPromise/DelaysPromise.types.js +1 -0
- package/dist/classes/DelaysPromise/index.d.ts +2 -0
- package/dist/classes/DelaysPromise/index.js +4 -0
- package/dist/classes/File/File.d.ts +8 -0
- package/dist/classes/File/File.js +22 -0
- package/dist/classes/File/File.types.d.ts +7 -0
- package/dist/classes/File/File.types.js +1 -0
- package/dist/classes/File/index.d.ts +2 -0
- package/dist/classes/File/index.js +4 -0
- package/dist/classes/HTTPSApi/HTTPSApi.d.ts +14 -4
- package/dist/classes/HTTPSApi/HTTPSApi.js +61 -38
- package/dist/classes/HTTPSApi/HTTPSApi.types.d.ts +3 -0
- package/dist/classes/HTTPSApi/index.d.ts +2 -0
- package/dist/classes/HTTPSApi/index.js +4 -0
- package/dist/classes/Numbers/Numbers.d.ts +5 -3
- package/dist/classes/Numbers/Numbers.js +17 -20
- package/dist/classes/Numbers/Numbers.types.d.ts +5 -0
- package/dist/classes/Numbers/Numbers.types.js +1 -0
- package/dist/classes/Numbers/index.d.ts +2 -0
- package/dist/classes/Numbers/index.js +4 -0
- package/dist/classes/SocketApi/SocketApi.d.ts +25 -38
- package/dist/classes/SocketApi/SocketApi.js +112 -84
- package/dist/classes/SocketApi/SocketApi.types.d.ts +6 -0
- package/dist/classes/SocketApi/SocketApi.types.js +1 -0
- package/dist/classes/SocketApi/deps/WsApi/WsApi.d.ts +31 -26
- package/dist/classes/SocketApi/deps/WsApi/WsApi.js +91 -69
- package/dist/classes/SocketApi/deps/WsApi/WsApi.types.d.ts +7 -22
- package/dist/classes/SocketApi/deps/WsApi/index.d.ts +1 -1
- package/dist/classes/SocketApi/index.d.ts +2 -0
- package/dist/classes/SocketApi/index.js +4 -0
- package/dist/classes/Utils/EventSubscribers/EventSubscribers.d.ts +14 -0
- package/dist/classes/Utils/EventSubscribers/EventSubscribers.js +33 -0
- package/dist/classes/Utils/EventSubscribers/EventSubscribers.types.d.ts +9 -0
- package/dist/classes/Utils/EventSubscribers/EventSubscribers.types.js +1 -0
- package/dist/classes/Utils/EventSubscribers/index.d.ts +2 -0
- package/dist/classes/Utils/EventSubscribers/index.js +4 -0
- package/dist/classes/Utils/NetworkInformation/NetworkInformation.d.ts +9 -0
- package/dist/classes/Utils/NetworkInformation/NetworkInformation.js +24 -0
- package/dist/classes/Utils/NetworkInformation/classes/InternetWatchers.d.ts +6 -0
- package/dist/classes/Utils/NetworkInformation/classes/InternetWatchers.js +39 -0
- package/dist/classes/Utils/NetworkInformation/classes/NetworkInformationCordova.d.ts +11 -0
- package/dist/classes/Utils/NetworkInformation/classes/NetworkInformationCordova.js +26 -0
- package/dist/classes/Utils/NetworkInformation/classes/NetworkInformationPC.d.ts +11 -0
- package/dist/classes/Utils/NetworkInformation/classes/NetworkInformationPC.js +22 -0
- package/dist/classes/Utils/NetworkInformation/classes/index.d.ts +2 -0
- package/dist/classes/Utils/NetworkInformation/classes/index.js +6 -0
- package/dist/classes/Utils/NetworkInformation/classes/types/types.abscruct.d.ts +10 -0
- package/dist/classes/Utils/NetworkInformation/classes/types/types.abscruct.js +5 -0
- package/dist/classes/Utils/NetworkInformation/index.d.ts +4 -0
- package/dist/classes/Utils/NetworkInformation/index.js +10 -0
- package/dist/classes/Utils/Utils.d.ts +4 -4
- package/dist/classes/Utils/Utils.js +34 -39
- package/dist/classes/Utils/Utils.types.d.ts +17 -0
- package/dist/classes/Utils/Utils.types.js +1 -0
- package/dist/index.d.ts +9 -9
- package/dist/index.js +26 -20
- package/package.json +16 -2
- package/dist/classes/Delay/Delay.d.ts +0 -26
- package/dist/classes/Delay/Delay.js +0 -66
- package/dist/classes/DownloadFile/DownloadFile.d.ts +0 -8
- package/dist/classes/DownloadFile/DownloadFile.js +0 -23
- package/dist/classes/ProcessingWS/ProcessingWS.d.ts +0 -11
- package/dist/classes/ProcessingWS/ProcessingWS.js +0 -20
- package/dist/classes/SocketApi/deps/InternetWatcher/InternetWatcher.d.ts +0 -8
- package/dist/classes/SocketApi/deps/InternetWatcher/InternetWatcher.js +0 -24
package/README.md
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
<h3 align="center">SocketApi</h3>
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { SocketApi } from 'dev-classes';
|
|
5
|
+
|
|
6
|
+
SocketApi.init({
|
|
7
|
+
url: 'wss://...',
|
|
8
|
+
timeReConnect: 5000,
|
|
9
|
+
numberOfRepit: 5,
|
|
10
|
+
isReConnectNetworkOnline: true
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
SocketApi.on('status', (status) => { console.log('onStatus', status); });
|
|
14
|
+
SocketApi.on('msg', (messages) => { console.log('onMessages', messages); });
|
|
15
|
+
SocketApi.on('reConnect', (status) => { console.log('reConnect', status); });
|
|
16
|
+
SocketApi.on('timeOffReConnect', (data) => { console.log('timeOffReConnect', data); });
|
|
17
|
+
|
|
18
|
+
SocketApi.connect();
|
|
19
|
+
//...
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
<h3 align="center">HTTPSApi</h3>
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { HTTPSApi, RequestPayloadHTTPSApi } from "dev-classes";
|
|
26
|
+
|
|
27
|
+
HTTPSApi.init();
|
|
28
|
+
|
|
29
|
+
HTTPSApi.on('fetch', (info) => { })
|
|
30
|
+
HTTPSApi.request({keyAction: 'action1', request: {url: '...'}})
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
<h3 align="center">Color</h3>
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
|
|
37
|
+
type ColorRgb = [number, number, number];
|
|
38
|
+
|
|
39
|
+
interface Color_P{
|
|
40
|
+
ColorRgb: ColorRgb;
|
|
41
|
+
ColorRgba: [...ColorRgb, number];
|
|
42
|
+
ColorHsla: Record<"h" | "s" | "l" | "a", number>;
|
|
43
|
+
TypeBrightness_OR:"BT601" | "BT709" | "BT2020"
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface ColorProps{
|
|
47
|
+
componentToHex: (c: number) => string;
|
|
48
|
+
rgbToHex(r: number, g: number, b: number): string;
|
|
49
|
+
rgbToHsv(r: number, g: number, b: number): Color_P['ColorRgb'];
|
|
50
|
+
hsvToRgb(h: number, s: number, v: number): Color_P['ColorRgb'];
|
|
51
|
+
rgbaToHsla(r: number, g: number, b: number, a: number): Color_P['ColorHsla'];
|
|
52
|
+
hslaToRgba(h: number, s: number, l: number, a: number): Color_P['ColorRgba'];
|
|
53
|
+
hslaStringToRgba(hsla: string): Color_P['ColorRgba'];
|
|
54
|
+
hexaToRgba(hexa: string): Color_P['ColorRgba'];
|
|
55
|
+
hexToRgb(hex: string): Color_P['ColorRgb'];
|
|
56
|
+
hexaToHsla(hexa: string): Color_P['ColorHsla'];
|
|
57
|
+
rgbaToHexa(rgba: Color_P['ColorRgba'] | Color_P['ColorRgb'] ): string;
|
|
58
|
+
hslaStringToHexa(hsla: string): string;
|
|
59
|
+
hslaStringToHex(hsla: string): string;
|
|
60
|
+
mixColors(color1: Color_P['ColorRgb'] , color2: Color_P['ColorRgb'], weight: number): Color_P['ColorRgb'];
|
|
61
|
+
getRgbByTypeBrightness(type: Color_P['TypeBrightness_OR']): Color_P['ColorRgb'];
|
|
62
|
+
getAverageColor(color1: Color_P['ColorRgb'], color2: Color_P['ColorRgb']): Color_P['ColorRgb'];
|
|
63
|
+
getAccentColor(baseHsv: number[], baseColor: Color_P['ColorRgb'], elementColor: Color_P['ColorRgb']): Color_P['ColorRgb']
|
|
64
|
+
changeColorAccent(baseHsv: number[], accentHsv: number[], color: Color_P['ColorRgb'], isDarkTheme: boolean): Color_P['ColorRgb'];
|
|
65
|
+
changeBrightness(color: Color_P['ColorRgb'], amount: number): Color_P['ColorRgb'];
|
|
66
|
+
hexBrightness(hex:string, amount: number):string;
|
|
67
|
+
getHexColorFromTelegramColor(color: number): string;
|
|
68
|
+
getRgbColorFromTelegramColor(color: number): Color_P['ColorRgb'];
|
|
69
|
+
rgbaToRgb(rgba: Color_P['ColorRgba'], bg: Color_P['ColorRgb']): Color_P['ColorRgb'];
|
|
70
|
+
calculateBrightness(rgb: Color_P['ColorRgb'], type?:Color_P['TypeBrightness_OR']): number;
|
|
71
|
+
getTextColor(luminance: number): Color_P['ColorRgb']
|
|
72
|
+
calculateOpacity(luminance: number, targetContrast: number): number;
|
|
73
|
+
clamp(v: number, min: number, max: number): number;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
<h3 align="center">DateProcessing</h3>
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
|
|
81
|
+
interface DateProcessingProps{
|
|
82
|
+
getActiveColorClassInDiffDate(a:string, b:string, c:string):string
|
|
83
|
+
getClassByDifferenceDay(a:string, b:{className:string, diffDay:number}[]):string
|
|
84
|
+
getMinMaxDate(a:string, b:string, c:string):Record<'minDate' | 'maxDate' | 'minMaxMonth', string >
|
|
85
|
+
splitDateFromTime(a:string):string[]
|
|
86
|
+
getCorrectDateAndTime(a:string):[string, string]
|
|
87
|
+
reverseDate(a:string):string
|
|
88
|
+
correctionDataISO8601(a:string):string
|
|
89
|
+
isDateDMY(a:string):boolean
|
|
90
|
+
correctionDateAndRemoveYear(a:string, b?:Partial<{isYear:boolean}>):string
|
|
91
|
+
correctionDateWithOutCurrentYear(a:string, b?:Partial<{shortYear:boolean}>):string
|
|
92
|
+
correctionShortYear(a:string):string
|
|
93
|
+
correctionDate(a:string, b?:Partial<Record<'isRemoveYear'| 'shortYear' | 'withOutCurrentYear', boolean>>):string
|
|
94
|
+
hasDateLessPeriod(a:string, b: string, c?:{dateMinMax: '<=' | '>=' | '<' | '>'}):boolean
|
|
95
|
+
hasDateLessPeriods(a:string, b: string, c:string, d?:{dateMinMax: '<=' | '>=' | '<' | '>'}):Record<'one' | 'two', boolean>
|
|
96
|
+
getDi(a:string, b: string):number
|
|
97
|
+
getDifferenceDates(a:string, b: string):number
|
|
98
|
+
hasDateLessInNumber(a:string, b: string, c:number):boolean
|
|
99
|
+
correctionCurrentYear(a:[string], b?:number):string[]
|
|
100
|
+
getChunkFromDate(a:string, b:'day' | 'month' | 'year', c?:{isBeforeZero:boolean}):string
|
|
101
|
+
getNameMonthByNumber(a:number):(typeof itemsMonths)[number]
|
|
102
|
+
minMaxMountStr(a:Record<'minDate' | 'maxDate', string>): {minMaxMonth: string}
|
|
103
|
+
getDatesToCurrentDate(a:string[]):string[]
|
|
104
|
+
getDayOfWeek(a:string):(typeof itemsWeek)[number] | null
|
|
105
|
+
cropSecond(a:string):string
|
|
106
|
+
getRenderDate(a:string, b?:{withOutCurrentYear: boolean} ):'Сегодня' | 'Вчера' | 'Позавчера' | string
|
|
107
|
+
getCurrentDate():string
|
|
108
|
+
getDaysInMonth(a: number, b: number):number
|
|
109
|
+
getCurrentYear():number
|
|
110
|
+
getDateDeviation(date: string, config: Partial<Record<"day" | "month" | "year", number>>): string
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
<h3 align="center">DelaysPromise</h3>
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
|
|
118
|
+
interface ControlAction{
|
|
119
|
+
stop(status?: boolean):void;
|
|
120
|
+
getIsActiveEvent():boolean;
|
|
121
|
+
}
|
|
122
|
+
interface StartActionEveryConfigI {
|
|
123
|
+
interval: number,
|
|
124
|
+
cutoffTime?: number;//4000
|
|
125
|
+
countAction?:number;//example 5
|
|
126
|
+
watchIdInterval?(id:number | null):void;
|
|
127
|
+
controlAction?(control:ControlAction):void
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
interface OneOfPromiseReject{
|
|
131
|
+
status: boolean;
|
|
132
|
+
msg: string;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
interface DelaysPromiseProps{
|
|
136
|
+
startActionEvery: (cb: () => boolean, config: StartActionEveryConfigI) => Promise<{status: boolean, msg: string}>
|
|
137
|
+
oneOf: (watchPromise: () => Promise<any>, potentialCaseCB: () => void, config: {second: number}) => void
|
|
138
|
+
oneOfPromise:(watchPromise: () => Promise<any>, cbPotentialReject: (p:OneOfPromiseReject) => OneOfPromiseReject, config: {second: number}) => Promise<any>
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
<h3 align="center">Number</h3>
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
|
|
146
|
+
interface NumbersProps {
|
|
147
|
+
randomNumber: () => number;
|
|
148
|
+
getOnlyTheStringNumbers(dirtyString: string): string;
|
|
149
|
+
isNumber(charStr: string | number): boolean;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
<h3 align="center">Number</h3>
|
|
154
|
+
|
|
155
|
+
```ts
|
|
156
|
+
|
|
157
|
+
interface NumbersProps {
|
|
158
|
+
randomNumber: () => number;
|
|
159
|
+
getOnlyTheStringNumbers(dirtyString: string): string;
|
|
160
|
+
isNumber(charStr: string | number): boolean;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
<h3 align="center">Number</h3>
|
|
165
|
+
|
|
166
|
+
```ts
|
|
167
|
+
|
|
168
|
+
import { File } from 'dev-classes';
|
|
169
|
+
|
|
170
|
+
File.download({
|
|
171
|
+
name: 'test',
|
|
172
|
+
base64: 'test',
|
|
173
|
+
format: 'pdf',
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
<h3 align="center">Utils</h3>
|
|
178
|
+
|
|
179
|
+
```ts
|
|
180
|
+
|
|
181
|
+
interface UtilsProps {
|
|
182
|
+
events (status: 'add' | 'remove', who:EventTarget, entriesEvents, msg: string): Promise<string>;
|
|
183
|
+
sortDataByAlphabet(arrData: {[key: string]: any}[], sortKey: string): {[key: string]: any}[] ;
|
|
184
|
+
sortDataByDate(data:any[], keyDate: string): string[];
|
|
185
|
+
sortDataByDateAndTime(data:any[], keyDate: string): string[];
|
|
186
|
+
reverseDate(datePPR:string):string;
|
|
187
|
+
correctionDataISO8601(date:string):string;
|
|
188
|
+
hasDateLessPeriod(date: string, period: string, option?:{ dateMinMax: '<=' | '>=' | '<' | '>'; } ): boolean;
|
|
189
|
+
getEndsWithArr(arr: any[], countEnd: number): any[];
|
|
190
|
+
deepMerge<T extends object = object>(...itemsOb: T[]): T
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
<h3 align="center">NetworkInformation</h3>
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
|
|
198
|
+
import { NetworkInformation, NetworkInformationPC, NetworkInformationCordova } from 'dev-classes';
|
|
199
|
+
|
|
200
|
+
const internet = new NetworkInformation([new NetworkInformationPC(), new NetworkInformationCordova()]);
|
|
201
|
+
|
|
202
|
+
const online = () => {}
|
|
203
|
+
const offline = () => {}
|
|
204
|
+
internet.run((status) => {
|
|
205
|
+
status ? online() : offline();
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
<h3 align="center">EventSubscribers</h3>
|
|
210
|
+
|
|
211
|
+
```ts
|
|
212
|
+
|
|
213
|
+
interface EventSubscribersProps<EventsProps>{
|
|
214
|
+
getSubscribers: () => {[K in keyof EventsProps]?: EventsProps[K][]}
|
|
215
|
+
subscribe: <K extends keyof EventsProps>(name: K, cb: EventsProps[K]) => void
|
|
216
|
+
unsubscribe: <K extends keyof EventsProps>(name: K, cb: EventsProps[K]) => void
|
|
217
|
+
publish: <K extends keyof EventsProps>(name: K, data: EventsProps[K] extends (...args: any[]) => any ? Parameters<EventsProps[K]>[0] : any) => void
|
|
218
|
+
resetSubscribers: () => void
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
import { EventSubscribers } from 'dev-classes';
|
|
223
|
+
|
|
224
|
+
interface CustomEvents{
|
|
225
|
+
myEvent(status: boolean): void;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
class MyClass{
|
|
229
|
+
private static events = new EventSubscribers<CustomEvents>(["myEvent"]);
|
|
230
|
+
static on = MyClass.events.subscribe;
|
|
231
|
+
static off = MyClass.events.unsubscribe;
|
|
232
|
+
|
|
233
|
+
static runTime(num: number){
|
|
234
|
+
const id = setTimeout(() => {
|
|
235
|
+
let status = true;
|
|
236
|
+
//...
|
|
237
|
+
// if(/*.... */) { status = false; }
|
|
238
|
+
MyClass.events.publish('myEvent', status);
|
|
239
|
+
|
|
240
|
+
clearTimeout(id);
|
|
241
|
+
}, num * 1000)
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
MyClass.on('myEvent', (status) => {
|
|
246
|
+
console.log(status)
|
|
247
|
+
})
|
|
248
|
+
MyClass.runTime(2);
|
|
249
|
+
|
|
250
|
+
```
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
ColorRgb: ColorRgb;
|
|
4
|
-
ColorRgba: [...ColorRgb, number];
|
|
5
|
-
ColorHsla: Record<"h" | "s" | "l" | "a", number>;
|
|
6
|
-
TypeBrightness_OR: "BT601" | "BT709" | "BT2020";
|
|
7
|
-
}
|
|
1
|
+
import { ColorProps } from './Color.types';
|
|
2
|
+
|
|
8
3
|
export declare class Color {
|
|
9
4
|
private static componentToHex;
|
|
10
|
-
static
|
|
11
|
-
static rgbToHex: (r: any, g: any, b: any) => string;
|
|
5
|
+
static rgbToHex: ColorProps['rgbToHex'];
|
|
12
6
|
/**
|
|
13
7
|
* https://stackoverflow.com/a/54070620/6758968
|
|
14
8
|
* r, g, b in [0, 255]
|
|
15
9
|
* @returns h in [0,360) and s, v in [0,1]
|
|
16
10
|
*/
|
|
17
|
-
static rgbToHsv
|
|
11
|
+
static rgbToHsv: ColorProps['rgbToHsv'];
|
|
18
12
|
/**
|
|
19
13
|
* https://stackoverflow.com/a/54024653/6758968
|
|
20
14
|
* @param h [0, 360]
|
|
@@ -22,11 +16,11 @@ export declare class Color {
|
|
|
22
16
|
* @param v [0, 1]
|
|
23
17
|
* @returns r, g, b in [0, 255]
|
|
24
18
|
*/
|
|
25
|
-
static hsvToRgb
|
|
19
|
+
static hsvToRgb: ColorProps['hsvToRgb'];
|
|
26
20
|
/**
|
|
27
21
|
* @returns h [0, 360], s [0, 100], l [0, 100], a [0, 1]
|
|
28
22
|
*/
|
|
29
|
-
static rgbaToHsla
|
|
23
|
+
static rgbaToHsla: ColorProps['rgbaToHsla'];
|
|
30
24
|
/**
|
|
31
25
|
* Converts an HSL color value to RGB. Conversion formula
|
|
32
26
|
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
|
|
@@ -36,32 +30,29 @@ export declare class Color {
|
|
|
36
30
|
* @param {number} l The lightness [0, 1]
|
|
37
31
|
* @return {Array} The RGB representation [0, 255]
|
|
38
32
|
*/
|
|
39
|
-
static hslaToRgba
|
|
40
|
-
static hslaStringToRgba
|
|
41
|
-
static hexaToRgba
|
|
42
|
-
static
|
|
43
|
-
static
|
|
44
|
-
static rgbaToHexa
|
|
45
|
-
static hslaStringToHexa
|
|
46
|
-
static hslaStringToHex
|
|
33
|
+
static hslaToRgba: ColorProps['hslaToRgba'];
|
|
34
|
+
static hslaStringToRgba: ColorProps['hslaStringToRgba'];
|
|
35
|
+
static hexaToRgba: ColorProps['hexaToRgba'];
|
|
36
|
+
static hexaToHsla: ColorProps['hexaToHsla'];
|
|
37
|
+
static hexToRgb: ColorProps['hexToRgb'];
|
|
38
|
+
static rgbaToHexa: ColorProps['rgbaToHexa'];
|
|
39
|
+
static hslaStringToHexa: ColorProps['hslaStringToHexa'];
|
|
40
|
+
static hslaStringToHex: ColorProps['hslaStringToHex'];
|
|
47
41
|
/**
|
|
48
42
|
* @param weight [0, 1]
|
|
49
43
|
*/
|
|
50
|
-
static mixColors
|
|
51
|
-
static getRgbByTypeBrightness
|
|
52
|
-
static
|
|
53
|
-
static
|
|
54
|
-
static
|
|
55
|
-
static
|
|
56
|
-
static
|
|
57
|
-
static
|
|
58
|
-
static
|
|
59
|
-
static
|
|
60
|
-
static
|
|
61
|
-
static
|
|
62
|
-
static
|
|
63
|
-
static
|
|
64
|
-
static calculateOpacity(luminance: number, targetContrast: number): number;
|
|
65
|
-
static clamp(v: number, min: number, max: number): number;
|
|
44
|
+
static mixColors: ColorProps['mixColors'];
|
|
45
|
+
static getRgbByTypeBrightness: ColorProps['getRgbByTypeBrightness'];
|
|
46
|
+
static getAverageColor: ColorProps['getAverageColor'];
|
|
47
|
+
static getAccentColor: ColorProps['getAccentColor'];
|
|
48
|
+
static changeColorAccent: ColorProps['changeColorAccent'];
|
|
49
|
+
static changeBrightness: ColorProps['changeBrightness'];
|
|
50
|
+
static hexBrightness: ColorProps['hexBrightness'];
|
|
51
|
+
static getHexColorFromTelegramColor: ColorProps['getHexColorFromTelegramColor'];
|
|
52
|
+
static getRgbColorFromTelegramColor: ColorProps['getRgbColorFromTelegramColor'];
|
|
53
|
+
static rgbaToRgb: ColorProps['rgbaToRgb'];
|
|
54
|
+
static calculateBrightness: ColorProps['calculateBrightness'];
|
|
55
|
+
static getTextColor: ColorProps['getTextColor'];
|
|
56
|
+
static calculateOpacity: ColorProps['calculateOpacity'];
|
|
57
|
+
static clamp: ColorProps['clamp'];
|
|
66
58
|
}
|
|
67
|
-
export {};
|