dozy 1.0.64 → 1.0.66

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.ts CHANGED
@@ -94,12 +94,13 @@ declare function isNowAroundUtcHour(targetHour: number): boolean;
94
94
  * 说明:
95
95
  * - 会移除 `data:*;base64,` 前缀。
96
96
  * - 会移除所有空白字符并 trim。
97
- * - 非字符串输入会返回空字符串。
97
+ * - 会校验 base64 格式;不合法时返回 null。
98
+ * - 非字符串输入会返回 null。
98
99
  *
99
100
  * 返回值约定:
100
- * - 一定返回 `string`(不会返回 null/undefined)。
101
+ * - 返回合法的纯 base64;不合法时返回 `null`。
101
102
  */
102
- declare function $purifyBase64(input: string | null | undefined): string;
103
+ declare function $purifyBase64(input: string | Null): string | null;
103
104
  /**
104
105
  * 基于“纯 base64”推断图片 mime 类型。
105
106
  *
@@ -111,19 +112,19 @@ declare function $purifyBase64(input: string | null | undefined): string;
111
112
  * 返回值约定:
112
113
  * - 一定返回非空 mime 字符串(不会返回 null/undefined/空串)。
113
114
  */
114
- declare function $inferMimeTypeFormPureBase64(pureBase64: string | null | undefined): "image/jpeg" | "image/png" | "image/gif" | "image/webp" | "image/bmp" | "image/tiff" | "image/avif" | "image/heic" | "image/x-icon";
115
+ declare function $inferMimeTypeFormPureBase64(pureBase64: string | Null): "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/bmp" | "image/tiff" | "image/avif" | "image/heic" | "image/x-icon";
115
116
  /**
116
117
  * 将“纯 base64 或 data URL”统一转成标准 data URL。
117
118
  *
118
119
  * 说明:
119
120
  * - 如果输入本来是 data URL,会清洗并标准化后返回。
120
121
  * - 如果输入是纯 base64,会自动推断 mime 并补齐 `data:*;base64,` 前缀。
121
- * - 非字符串或空字符串输入返回空字符串。
122
+ * - 非字符串、空字符串或不合法内容返回 null。
122
123
  *
123
124
  * 返回值约定:
124
- * - 一定返回 `string`(不会返回 null/undefined)。
125
+ * - 返回标准 data URL;若输入不合法则返回 `null`。
125
126
  */
126
- declare function $toDataUrlFromBase64(base64WithDataOrPure: string | null | undefined): string;
127
+ declare function $toDataUrlFromBase64(base64WithDataOrPure: string | Null): string | null;
127
128
 
128
129
  declare function web$setPathTarget(s: string): void;
129
130
  declare function web$pathStartData(): {
@@ -141,6 +142,8 @@ declare function web$redirectToDomain(newDomain: string): void;
141
142
  declare function $copy(content: string): Promise<boolean | undefined>;
142
143
  declare function $fallbackCopy(content: string): boolean;
143
144
  declare function web$encodeURI(hash?: string): string;
145
+ declare const $compressImageDefaultOptions: Options;
146
+ declare function $compressImageBase64(base64: string, options?: Options): Promise<string>;
144
147
  declare function $compressImage(file: File, options?: Options): Promise<File>;
145
148
  declare function $compressImage(files: File[], options?: Options): Promise<File[]>;
146
149
 
@@ -370,6 +373,6 @@ declare function toRgbString(input: string | Color | any): string | undefined;
370
373
  */
371
374
  declare function toHslString(input: string | Color | any): string | undefined;
372
375
 
373
- declare const DOZY = "1.0.64";
376
+ declare const DOZY = "1.0.66";
374
377
 
375
- 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, $inferMimeTypeFormPureBase64, $is, $isObject, $isPlainClass, $isValidEmailWithUnicode, $isValidOrBriefURL, $jsonParse, $jsonStringify, $keys, $lastIndex, $lindex, $loadOpt, $location, $log, $lplus, $magic, $math, $now, $numberIsFinite, $numberIsNaN, $oc, $open, $parseParams, $promise, $pureText, $purifyBase64, $randomByte, $replaceHolesWithUndefined, $rmvSlash, $rsValue, $rsetValue, $rvalue, $s, $sc, $setInterval, $setRange, $setTimeout, $stringFromCharCode, $stringFromCodePoint, $stringToRange, $strings, $toDataUrlFromBase64, $validName, $values, $window, type Any, type Atoa, type Coord, type Coord3, DOZY, type DozyConfig, type DozyConfigItem, type FileType, Gens, type Hel, type IOpt, type Items, type Null, type Nullable, RainbowGen, type ScaleComputer, type ScaleIniter, StringObfuscator, type UNumber, __GensDirectives, _res, boxShadow, dozy, enableScaler, err403, errArg, errCode, errContent, errMsg, errNotLoggedIn, errToString, getBrightness, getColorMap, isNowAroundUtcHour, isNull, 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 };
378
+ export { $Headers, $Request, $Response, $URL, $URLSearchParams, $arrayFrom, $arrayIsArray, $assign, $capitalize, $checkValidEmailWithUnicode, $clamp, $clearInterval, $clearTimeout, $clone, $compressImage, $compressImageBase64, $compressImageDefaultOptions, $copy, $crypto, $date, $decodeBase64ToBinary, $decodeBase64ToUnicode, $deepClone, $defineProperty, $document, $encodeUnicodeToBase64, $entries, $escapeHTML, $fallbackCopy, $fetch, $fileToBase64, $formatDate, $formatWithCommas, $freeze, $genSSF, $getFileType, $getTimeString, $hasKey, $if, $inRange, $inRange2, $inferMimeTypeFormPureBase64, $is, $isObject, $isPlainClass, $isValidEmailWithUnicode, $isValidOrBriefURL, $jsonParse, $jsonStringify, $keys, $lastIndex, $lindex, $loadOpt, $location, $log, $lplus, $magic, $math, $now, $numberIsFinite, $numberIsNaN, $oc, $open, $parseParams, $promise, $pureText, $purifyBase64, $randomByte, $replaceHolesWithUndefined, $rmvSlash, $rsValue, $rsetValue, $rvalue, $s, $sc, $setInterval, $setRange, $setTimeout, $stringFromCharCode, $stringFromCodePoint, $stringToRange, $strings, $toDataUrlFromBase64, $validName, $values, $window, type Any, type Atoa, type Coord, type Coord3, DOZY, type DozyConfig, type DozyConfigItem, type FileType, Gens, type Hel, type IOpt, type Items, type Null, type Nullable, RainbowGen, type ScaleComputer, type ScaleIniter, StringObfuscator, type UNumber, __GensDirectives, _res, boxShadow, dozy, enableScaler, err403, errArg, errCode, errContent, errMsg, errNotLoggedIn, errToString, getBrightness, getColorMap, isNowAroundUtcHour, isNull, 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 };