dozy 1.0.49 → 1.0.51
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-COLOR.md +117 -0
- package/dist/assets/fonts/forthecode.ttf +0 -0
- package/dist/assets/fonts/forthecode.woff2 +0 -0
- package/dist/assets/fonts/forthefont.ttf +0 -0
- package/dist/assets/fonts/forthefont.woff2 +0 -0
- package/dist/assets/fonts/xaifont.ttf +0 -0
- package/dist/assets/fonts/xaifont.woff2 +0 -0
- package/dist/assets/reset.css +3 -3
- package/dist/chunk-7Q6CTFBS.js +2 -0
- package/dist/chunk-7Q6CTFBS.js.map +1 -0
- package/dist/index.d.ts +226 -229
- package/dist/index.js +48 -58
- package/dist/index.js.map +1 -7
- package/dist/zod.d.ts +2 -0
- package/dist/zod.js +24 -0
- package/dist/zod.js.map +1 -0
- package/package.json +12 -15
- package/dist/Dozy.d.ts +0 -9
- package/dist/Dozy.d.ts.map +0 -1
- package/dist/Functions.d.ts +0 -48
- package/dist/Functions.d.ts.map +0 -1
- package/dist/Test.d.ts +0 -2
- package/dist/Test.d.ts.map +0 -1
- package/dist/WebFunctions.d.ts +0 -20
- package/dist/WebFunctions.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/modules/Color.d.ts +0 -75
- package/dist/modules/Color.d.ts.map +0 -1
- package/dist/modules/EnableScaler.d.ts +0 -39
- package/dist/modules/EnableScaler.d.ts.map +0 -1
- package/dist/modules/Interface.d.ts +0 -4
- package/dist/modules/Interface.d.ts.map +0 -1
- package/dist/modules/Store.d.ts +0 -83
- package/dist/modules/Store.d.ts.map +0 -1
- package/dist/modules/XCode.d.ts +0 -9
- package/dist/modules/XCode.d.ts.map +0 -1
- package/dist/modules/gens/Gens.d.ts +0 -18
- package/dist/modules/gens/Gens.d.ts.map +0 -1
- package/dist/modules/gens/GensDirectives.d.ts +0 -4
- package/dist/modules/gens/GensDirectives.d.ts.map +0 -1
- package/dist/modules/gens/GensStyleIds.d.ts +0 -3
- package/dist/modules/gens/GensStyleIds.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,187 +1,194 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Options } from 'browser-image-compression';
|
|
2
|
+
export * from 'browser-image-compression';
|
|
3
|
+
export { default as imageCompression } from 'browser-image-compression';
|
|
4
4
|
import { Color } from 'culori';
|
|
5
|
-
import * as
|
|
6
|
-
|
|
5
|
+
import * as culori from 'culori';
|
|
6
|
+
export { culori as ColorLib };
|
|
7
|
+
export * from 'axios';
|
|
8
|
+
export { default as axios } from 'axios';
|
|
9
|
+
import * as lodashEs from 'lodash-es';
|
|
10
|
+
export { lodashEs as l };
|
|
11
|
+
export { default as Cryptojs } from 'crypto-js';
|
|
12
|
+
export { customAlphabet, nanoid, urlAlphabet } from 'nanoid';
|
|
7
13
|
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
type DozyConfigItem = {};
|
|
15
|
+
type DozyConfig = Partial<DozyConfigItem>;
|
|
10
16
|
declare class Dozy {
|
|
11
|
-
|
|
12
|
-
|
|
17
|
+
loadConfig(config: DozyConfig): void;
|
|
18
|
+
config: DozyConfig;
|
|
13
19
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
20
|
+
declare const dozy: Dozy;
|
|
21
|
+
|
|
22
|
+
declare function $isObject(value: unknown): value is Record<string, unknown>;
|
|
23
|
+
declare function $deepClone<T>(value: T): T;
|
|
24
|
+
declare function $capitalize(s: string): string;
|
|
25
|
+
declare function $clamp(n: number, min: number, max: number): number;
|
|
26
|
+
declare function $loadOpt(thiz: Object, obj?: Object): any;
|
|
27
|
+
declare function errMsg(msg: string): void;
|
|
28
|
+
declare function $pureText(fragment: string): string;
|
|
29
|
+
declare function $oc(o: any): o is Record<string, any>;
|
|
30
|
+
declare function $s(s: any, val?: boolean): s is string;
|
|
31
|
+
declare function $sc(n: any): n is number;
|
|
32
|
+
declare function $lplus(v: number, t: number, plus?: number): number;
|
|
33
|
+
declare function $lindex(arr: Array<any>, i: number): any;
|
|
34
|
+
declare function $validName(id?: string): id is string;
|
|
35
|
+
type FileType = 'text' | 'image' | 'audio' | 'video' | 'font' | 'unknown';
|
|
36
|
+
declare function $getFileType(fileName: string): FileType;
|
|
37
|
+
declare function $isValidOrBriefURL(url?: string): boolean;
|
|
38
|
+
declare function $getTimeString(stampTicks: number, short: boolean, unitS?: boolean, exact?: boolean): string;
|
|
39
|
+
declare function $magic(start: number, end?: number): number;
|
|
40
|
+
declare function $randomByte(len?: number): string;
|
|
41
|
+
declare function $rsValue(s?: string, path?: string, def?: any): any;
|
|
42
|
+
declare function $rsetValue(obj: Object, path: string, value: any): any;
|
|
43
|
+
declare function $rvalue(obj: Object, path?: string, def?: any, sdef?: boolean, set?: boolean): any;
|
|
44
|
+
declare function $hasKey(obj: Object, key: string): boolean;
|
|
45
|
+
declare function maybeString(a: any, maxLength?: number): string;
|
|
46
|
+
declare function errToString(e: unknown): string;
|
|
47
|
+
declare function smallChance(): boolean;
|
|
48
|
+
declare function $isPlainClass(obj: any, clas?: Function): boolean;
|
|
49
|
+
declare function $encodeUnicodeToBase64(str: string): string;
|
|
50
|
+
declare function $decodeBase64ToUnicode(base64: string): string;
|
|
51
|
+
declare function $fileToBase64(file: File): Promise<string>;
|
|
52
|
+
declare function $decodeBase64ToBinary(base64: string): Uint8Array<ArrayBuffer>;
|
|
53
|
+
declare function $setRange(v: number, min?: number, max?: number): number;
|
|
54
|
+
declare function $inRange2(v: number, mid: number, range: number): boolean;
|
|
55
|
+
declare function $inRange(v: number, min?: number, max?: number): boolean;
|
|
56
|
+
declare function $strings(str: string, cut?: string): string[];
|
|
57
|
+
declare function $genSSF(f: (s1: string, s2: string) => string, gap?: string): (...args: string[]) => string;
|
|
58
|
+
declare function xtrim(s: string): string;
|
|
59
|
+
declare function $if<T extends string | number | symbol, V>(val: T, fs: Record<T, Function | V>): any;
|
|
60
|
+
declare function $lastIndex(items: Array<any> | number): number;
|
|
61
|
+
declare function $replaceHolesWithUndefined<T>(arr: Array<T | undefined>): Array<T | undefined>;
|
|
62
|
+
declare function $stringToRange(str: string, max: number): number;
|
|
63
|
+
declare function $rmvSlash(path: string): string;
|
|
64
|
+
declare function $parseParams(path: string): (string | undefined)[];
|
|
65
|
+
declare function $formatWithCommas(num: number | string): string;
|
|
66
|
+
declare function $isValidEmailWithUnicode(email?: string): boolean;
|
|
67
|
+
declare function $checkValidEmailWithUnicode(email?: string): void;
|
|
68
|
+
declare function $formatDate(dateInput: string | number | Date): string;
|
|
69
|
+
|
|
70
|
+
declare function web$setPathTarget(s: string): void;
|
|
71
|
+
declare function web$pathStartData(): {
|
|
72
|
+
href: string;
|
|
73
|
+
origin: string;
|
|
74
|
+
target: string;
|
|
75
|
+
host: string;
|
|
76
|
+
path: string;
|
|
77
|
+
search: string;
|
|
78
|
+
standardJump: boolean;
|
|
71
79
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
declare function web$enableProdProtector(): void;
|
|
81
|
+
declare function web$enableHttpsRedirect(): void;
|
|
82
|
+
declare function web$redirectToDomain(newDomain: string): void;
|
|
83
|
+
declare function $copy(content: string): Promise<boolean | undefined>;
|
|
84
|
+
declare function $fallbackCopy(content: string): boolean;
|
|
85
|
+
declare function web$encodeURI(hash?: string): string;
|
|
86
|
+
declare function $compressImage(file: File, options?: Options): Promise<File>;
|
|
87
|
+
declare function $compressImage(files: File[], options?: Options): Promise<File[]>;
|
|
88
|
+
|
|
89
|
+
declare const $jsonParse: (text: string, reviver?: (this: any, key: string, value: any) => any) => any;
|
|
90
|
+
declare const $jsonStringify: {
|
|
91
|
+
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
92
|
+
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
84
93
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
[s: string]: T;
|
|
93
|
-
} | ArrayLike<T>): T[];
|
|
94
|
-
(o: {}): any[];
|
|
94
|
+
declare const $keys: <T extends object>(obj: T) => (keyof T & string)[];
|
|
95
|
+
declare const $entries: <T extends object>(obj: T) => [keyof T & string, T[keyof T]][];
|
|
96
|
+
declare const $values: {
|
|
97
|
+
<T>(o: {
|
|
98
|
+
[s: string]: T;
|
|
99
|
+
} | ArrayLike<T>): T[];
|
|
100
|
+
(o: {}): any[];
|
|
95
101
|
};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
declare const $assign: {
|
|
103
|
+
<T extends {}, U>(target: T, source: U): T & U;
|
|
104
|
+
<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
|
|
105
|
+
<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
|
|
106
|
+
(target: object, ...sources: any[]): any;
|
|
101
107
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
declare const $defineProperty: <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T;
|
|
109
|
+
declare const $freeze: {
|
|
110
|
+
<T extends Function>(f: T): T;
|
|
111
|
+
<T extends {
|
|
112
|
+
[idx: string]: U | null | undefined | object;
|
|
113
|
+
}, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;
|
|
114
|
+
<T>(o: T): Readonly<T>;
|
|
109
115
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
declare const $is: (value1: any, value2: any) => boolean;
|
|
117
|
+
declare const $arrayFrom: {
|
|
118
|
+
<T>(arrayLike: ArrayLike<T>): T[];
|
|
119
|
+
<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
120
|
+
<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
|
121
|
+
<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
116
122
|
};
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
123
|
+
declare const $arrayIsArray: (arg: any) => arg is any[];
|
|
124
|
+
declare const $stringFromCharCode: (...codes: number[]) => string;
|
|
125
|
+
declare const $stringFromCodePoint: (...codePoints: number[]) => string;
|
|
126
|
+
declare const $numberIsNaN: (number: unknown) => boolean;
|
|
127
|
+
declare const $numberIsFinite: (number: unknown) => boolean;
|
|
128
|
+
declare const $math: Math;
|
|
129
|
+
declare const $now: () => number;
|
|
130
|
+
declare const $date: DateConstructor;
|
|
131
|
+
declare const $promise: PromiseConstructor;
|
|
132
|
+
declare const $URL: {
|
|
133
|
+
new (url: string | URL, base?: string | URL): URL;
|
|
134
|
+
prototype: URL;
|
|
135
|
+
canParse(url: string | URL, base?: string | URL): boolean;
|
|
136
|
+
createObjectURL(obj: Blob | MediaSource): string;
|
|
137
|
+
parse(url: string | URL, base?: string | URL): URL | null;
|
|
138
|
+
revokeObjectURL(url: string): void;
|
|
133
139
|
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
140
|
+
declare const $URLSearchParams: {
|
|
141
|
+
new (init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
|
|
142
|
+
prototype: URLSearchParams;
|
|
137
143
|
};
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
144
|
+
declare const $clone: typeof structuredClone;
|
|
145
|
+
declare const $window: (Window & typeof globalThis) | undefined;
|
|
146
|
+
declare const $document: Document | undefined;
|
|
147
|
+
declare const $location: Location | undefined;
|
|
148
|
+
declare const $open: (((url?: string | URL, target?: string, features?: string) => WindowProxy | null) & typeof open) | undefined;
|
|
149
|
+
declare const $setTimeout: (((handler: TimerHandler, timeout?: number, ...arguments: any[]) => number) & typeof setTimeout) | undefined;
|
|
150
|
+
declare const $clearTimeout: (((id: number | undefined) => void) & typeof clearTimeout) | undefined;
|
|
151
|
+
declare const $setInterval: (((handler: TimerHandler, timeout?: number, ...arguments: any[]) => number) & typeof setInterval) | undefined;
|
|
152
|
+
declare const $clearInterval: (((id: number | undefined) => void) & typeof clearInterval) | undefined;
|
|
153
|
+
declare const $fetch: typeof fetch | undefined;
|
|
154
|
+
declare const $Headers: {
|
|
155
|
+
new (init?: HeadersInit): Headers;
|
|
156
|
+
prototype: Headers;
|
|
151
157
|
} | undefined;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
158
|
+
declare const $Request: {
|
|
159
|
+
new (input: RequestInfo | URL, init?: RequestInit): Request;
|
|
160
|
+
prototype: Request;
|
|
155
161
|
} | undefined;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
+
declare const $Response: {
|
|
163
|
+
new (body?: BodyInit | null, init?: ResponseInit): Response;
|
|
164
|
+
prototype: Response;
|
|
165
|
+
error(): Response;
|
|
166
|
+
json(data: any, init?: ResponseInit): Response;
|
|
167
|
+
redirect(url: string | URL, status?: number): Response;
|
|
162
168
|
} | undefined;
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
169
|
+
declare const $log: <T>(a?: T, ...x: any[]) => T | undefined;
|
|
170
|
+
declare const $crypto: Crypto | undefined;
|
|
171
|
+
|
|
172
|
+
type ScaleComputer = undefined | ((scaler: Scaler) => number);
|
|
173
|
+
type ScaleIniter = (scaler: Scaler) => void;
|
|
167
174
|
declare class Scaler {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
175
|
+
#private;
|
|
176
|
+
heightElement: HTMLElement;
|
|
177
|
+
widthElement: HTMLElement;
|
|
178
|
+
set base(val: number);
|
|
179
|
+
get base(): number;
|
|
180
|
+
set mainScale(val: number);
|
|
181
|
+
get mainScale(): number;
|
|
182
|
+
get scaleComputer(): ScaleComputer;
|
|
183
|
+
set scaleComputer(val: ScaleComputer);
|
|
184
|
+
onMainScaleChange?: (scale: number) => void;
|
|
185
|
+
innerContainer: HTMLElement;
|
|
186
|
+
constructor(innerContainer: HTMLElement);
|
|
180
187
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
188
|
+
declare function enableScaler(outerContainer: HTMLElement, initer?: ScaleIniter, innerContainer?: HTMLElement): {
|
|
189
|
+
resizer: () => void;
|
|
190
|
+
clean: () => void;
|
|
191
|
+
setBase: (val: number) => void;
|
|
185
192
|
} | undefined;
|
|
186
193
|
/**
|
|
187
194
|
* Hello
|
|
@@ -190,51 +197,57 @@ export declare function enableScaler(outerContainer: HTMLElement, initer?: Scale
|
|
|
190
197
|
* @param maxAspectRatio 请输入 Number(0.57) && 0.64
|
|
191
198
|
* @returns
|
|
192
199
|
*/
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
200
|
+
declare const standardIniter: (args: {
|
|
201
|
+
maxAspectRatio?: number;
|
|
202
|
+
setFullScreenWidth?: (x: number) => void;
|
|
203
|
+
setFullContentHeight?: (x: number) => void;
|
|
204
|
+
setMainScale?: (x: number) => void;
|
|
205
|
+
heightElement?: HTMLElement;
|
|
206
|
+
widthElement?: HTMLElement;
|
|
207
|
+
base?: number;
|
|
201
208
|
}) => ScaleIniter;
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
+
|
|
210
|
+
declare class StringObfuscator {
|
|
211
|
+
key: string;
|
|
212
|
+
length: number;
|
|
213
|
+
constructor(key: string, length?: number);
|
|
214
|
+
xors(str: string, key: string): string;
|
|
215
|
+
en(input: string): string;
|
|
216
|
+
de(obfuscated: string): string;
|
|
209
217
|
}
|
|
210
|
-
|
|
211
|
-
|
|
218
|
+
|
|
219
|
+
type Items<T> = {
|
|
220
|
+
[key: string]: T;
|
|
212
221
|
};
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
222
|
+
|
|
223
|
+
declare function $escapeHTML(str: string): string;
|
|
224
|
+
declare class RainbowGen {
|
|
225
|
+
i: number;
|
|
226
|
+
ten: number;
|
|
227
|
+
static staticRainbowHTMLRaw(text: string, dark?: boolean, offset?: number): string;
|
|
228
|
+
static rainbowHTMLRaw(text: string, version?: number, offset?: number): string;
|
|
229
|
+
backAStep(): this;
|
|
230
|
+
getColorValue(): string;
|
|
231
|
+
versions: number[];
|
|
232
|
+
getStyleId(version: number): string;
|
|
233
|
+
constructor(useTimes?: number);
|
|
224
234
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
235
|
+
declare function boxShadow(color?: string): string;
|
|
236
|
+
declare function textShadow(color?: string, focus?: boolean, removeName?: boolean): string;
|
|
237
|
+
declare function s(literature: string, ...args: any[]): string;
|
|
238
|
+
declare function getColorMap(dark?: boolean): string[];
|
|
239
|
+
declare function Gens(literature: string, ...args: any[]): string;
|
|
240
|
+
|
|
241
|
+
declare let _res: (x: string) => string;
|
|
242
|
+
|
|
243
|
+
declare function __GensDirectives(): Items<(...args: string[]) => string>;
|
|
244
|
+
|
|
232
245
|
/**
|
|
233
246
|
* Register a custom color alias.
|
|
234
247
|
* @param name The name of the alias (e.g., 'abc', 'myColor')
|
|
235
248
|
* @param color The valid color string it maps to (e.g., '#ff0000', 'red')
|
|
236
249
|
*/
|
|
237
|
-
|
|
250
|
+
declare function registerCustomColor(name: string, color: string): void;
|
|
238
251
|
/**
|
|
239
252
|
* Smartly parses a color string.
|
|
240
253
|
* Supports:
|
|
@@ -247,18 +260,18 @@ export declare function registerCustomColor(name: string, color: string): void;
|
|
|
247
260
|
* @param fallback Optional fallback color string if parsing fails.
|
|
248
261
|
* @returns The parsed Color object or undefined if invalid.
|
|
249
262
|
*/
|
|
250
|
-
|
|
263
|
+
declare function smartParse(input: string | Color | any, fallback?: string): Color | undefined;
|
|
251
264
|
/**
|
|
252
265
|
* Smartly parses a color and returns a CSS string.
|
|
253
266
|
* Defaults to Hex for sRGB colors, or CSS function for others (like oklch).
|
|
254
267
|
* @param input The color string or object.
|
|
255
268
|
*/
|
|
256
|
-
|
|
269
|
+
declare function smartString(input: string | Color | any, fallback?: string): string | undefined;
|
|
257
270
|
/**
|
|
258
271
|
* Check if a color string is valid (smartly).
|
|
259
272
|
* @param input The color string or object.
|
|
260
273
|
*/
|
|
261
|
-
|
|
274
|
+
declare function isValidColor(input: string | Color | any): boolean;
|
|
262
275
|
/**
|
|
263
276
|
* Calculates the brightness of a color.
|
|
264
277
|
* Uses the Rec. 601 luma formula: (R * 299 + G * 587 + B * 114) / 1000.
|
|
@@ -267,7 +280,7 @@ export declare function isValidColor(input: string | Color | any): boolean;
|
|
|
267
280
|
* @param input The color string or object to check.
|
|
268
281
|
* @returns The brightness value (0-1), or 0 if invalid.
|
|
269
282
|
*/
|
|
270
|
-
|
|
283
|
+
declare function getBrightness(input: string | Color | any): number;
|
|
271
284
|
/**
|
|
272
285
|
* Converts a color to an RGBA array [r, g, b, a].
|
|
273
286
|
* RGB values are 0-255, Alpha is 0-1.
|
|
@@ -275,18 +288,13 @@ export declare function getBrightness(input: string | Color | any): number;
|
|
|
275
288
|
* @param input The color string or object to convert.
|
|
276
289
|
* @returns [r, g, b, a] or undefined if invalid.
|
|
277
290
|
*/
|
|
278
|
-
|
|
279
|
-
number,
|
|
280
|
-
number,
|
|
281
|
-
number,
|
|
282
|
-
number
|
|
283
|
-
] | undefined;
|
|
291
|
+
declare function toRgbaArray(input: string | Color | any): [number, number, number, number] | undefined;
|
|
284
292
|
/**
|
|
285
293
|
* Converts a color to a Hex string.
|
|
286
294
|
* @param input The color string or object.
|
|
287
295
|
* @returns Hex string (e.g. #ff0000) or undefined.
|
|
288
296
|
*/
|
|
289
|
-
|
|
297
|
+
declare function toHexString(input: string | Color | any): string | undefined;
|
|
290
298
|
/**
|
|
291
299
|
* Converts a color to an RGB/RGBA string.
|
|
292
300
|
* Uses modern comma-separated syntax for compatibility if preferred, or standard CSS.
|
|
@@ -296,7 +304,7 @@ export declare function toHexString(input: string | Color | any): string | undef
|
|
|
296
304
|
* @param input The color string or object.
|
|
297
305
|
* @returns RGB/RGBA string or undefined.
|
|
298
306
|
*/
|
|
299
|
-
|
|
307
|
+
declare function toRgbString(input: string | Color | any): string | undefined;
|
|
300
308
|
/**
|
|
301
309
|
* Converts a color to an HSL/HSLA string.
|
|
302
310
|
* Forces legacy comma-separated syntax: hsl(h, s%, l%) or hsla(h, s%, l%, a).
|
|
@@ -304,19 +312,8 @@ export declare function toRgbString(input: string | Color | any): string | undef
|
|
|
304
312
|
* @param input The color string or object.
|
|
305
313
|
* @returns HSL/HSLA string or undefined.
|
|
306
314
|
*/
|
|
307
|
-
|
|
308
|
-
export declare const DOZY = "1.0.49";
|
|
309
|
-
export * from "browser-image-compression";
|
|
310
|
-
export * from "axios";
|
|
311
|
-
export * from "zod";
|
|
315
|
+
declare function toHslString(input: string | Color | any): string | undefined;
|
|
312
316
|
|
|
313
|
-
|
|
314
|
-
ColorLib,
|
|
315
|
-
Options,
|
|
316
|
-
axios,
|
|
317
|
-
imageCompression$1 as imageCompression,
|
|
318
|
-
l,
|
|
319
|
-
z,
|
|
320
|
-
};
|
|
317
|
+
declare const DOZY = "1.0.51";
|
|
321
318
|
|
|
322
|
-
export {};
|
|
319
|
+
export { $Headers, $Request, $Response, $URL, $URLSearchParams, $arrayFrom, $arrayIsArray, $assign, $capitalize, $checkValidEmailWithUnicode, $clamp, $clearInterval, $clearTimeout, $clone, $compressImage, $copy, $crypto, $date, $decodeBase64ToBinary, $decodeBase64ToUnicode, $deepClone, $defineProperty, $document, $encodeUnicodeToBase64, $entries, $escapeHTML, $fallbackCopy, $fetch, $fileToBase64, $formatDate, $formatWithCommas, $freeze, $genSSF, $getFileType, $getTimeString, $hasKey, $if, $inRange, $inRange2, $is, $isObject, $isPlainClass, $isValidEmailWithUnicode, $isValidOrBriefURL, $jsonParse, $jsonStringify, $keys, $lastIndex, $lindex, $loadOpt, $location, $log, $lplus, $magic, $math, $now, $numberIsFinite, $numberIsNaN, $oc, $open, $parseParams, $promise, $pureText, $randomByte, $replaceHolesWithUndefined, $rmvSlash, $rsValue, $rsetValue, $rvalue, $s, $sc, $setInterval, $setRange, $setTimeout, $stringFromCharCode, $stringFromCodePoint, $stringToRange, $strings, $validName, $values, $window, DOZY, type DozyConfig, type DozyConfigItem, type FileType, Gens, type Items, RainbowGen, type ScaleComputer, type ScaleIniter, StringObfuscator, __GensDirectives, _res, boxShadow, dozy, enableScaler, errMsg, errToString, getBrightness, getColorMap, isValidColor, maybeString, registerCustomColor, s, smallChance, smartParse, smartString, standardIniter, textShadow, toHexString, toHslString, toRgbString, toRgbaArray, web$enableHttpsRedirect, web$enableProdProtector, web$encodeURI, web$pathStartData, web$redirectToDomain, web$setPathTarget, xtrim };
|