jinbi-utils 1.0.0-beta.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/.babelrc +19 -0
- package/.cz-config.js +55 -0
- package/.dockerignore +3 -0
- package/.editorconfig +12 -0
- package/.eslintignore +8 -0
- package/.eslintrc.js +54 -0
- package/Dockerfile +3 -0
- package/README.md +160 -0
- package/api-extractor.json +15 -0
- package/commitlint.config.js +3 -0
- package/dist/index.esm.js +1277 -0
- package/dist/index.esm.min.js +15 -0
- package/dist/index.umd.js +1348 -0
- package/dist/index.umd.min.js +16 -0
- package/docs/assets/images/icons.png +0 -0
- package/docs/assets/images/icons@2x.png +0 -0
- package/docs/assets/images/widgets.png +0 -0
- package/docs/assets/images/widgets@2x.png +0 -0
- package/docs/assets/js/main.js +1 -0
- package/docs/assets/js/search.json +1 -0
- package/docs/globals.html +144 -0
- package/docs/index.html +147 -0
- package/docs/interfaces/file.compressimgqualitycallback.html +212 -0
- package/docs/interfaces/file.compressimgscalecallback.html +206 -0
- package/docs/interfaces/file.exportbyblobparams.html +294 -0
- package/docs/interfaces/file.filesizeobject.html +227 -0
- package/docs/interfaces/file.genexportbyblobparams.html +237 -0
- package/docs/modules/common.html +188 -0
- package/docs/modules/date.html +364 -0
- package/docs/modules/file.html +452 -0
- package/docs/modules/number.html +356 -0
- package/docs/modules/object.html +245 -0
- package/docs/modules/print.html +183 -0
- package/docs/modules/string.html +352 -0
- package/docs/modules/validate.html +389 -0
- package/jest.config.js +15 -0
- package/package.json +76 -0
- package/rollup.config.js +65 -0
- package/src/common/index.ts +323 -0
- package/src/constant/common.constant.ts +13 -0
- package/src/date/index.ts +143 -0
- package/src/file/index.ts +296 -0
- package/src/http/http.ts +79 -0
- package/src/http/httpEnums.ts +61 -0
- package/src/index.ts +10 -0
- package/src/number/index.ts +190 -0
- package/src/object/index.ts +54 -0
- package/src/print/index.ts +102 -0
- package/src/string/index.ts +111 -0
- package/src/validate/index.ts +78 -0
- package/src/wecom/wecom.ts +75 -0
- package/test/common/index.test.ts +19 -0
- package/test/date/index.test.ts +107 -0
- package/test/file/index.test.ts +104 -0
- package/test/number/index.test.ts +108 -0
- package/test/object/index.test.ts +20 -0
- package/test/string/index.test.ts +82 -0
- package/tsconfig.json +39 -0
- package/typedoc.json +9 -0
- package/types/common/index.d.ts +47 -0
- package/types/constant/common.constant.d.ts +12 -0
- package/types/date/index.d.ts +60 -0
- package/types/file/index.d.ts +96 -0
- package/types/http/http.d.ts +17 -0
- package/types/http/httpEnums.d.ts +53 -0
- package/types/index.d.ts +10 -0
- package/types/number/index.d.ts +62 -0
- package/types/object/index.d.ts +25 -0
- package/types/print/index.d.ts +11 -0
- package/types/string/index.d.ts +53 -0
- package/types/validate/index.d.ts +45 -0
- package/types/wecom/wecom.d.ts +3 -0
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html class="default no-js">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
+
<title>File | fe-utils</title>
|
|
7
|
+
<meta name="description" content="Documentation for fe-utils">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
+
<link rel="stylesheet" href="../assets/css/main.css">
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<header>
|
|
13
|
+
<div class="tsd-page-toolbar">
|
|
14
|
+
<div class="container">
|
|
15
|
+
<div class="table-wrap">
|
|
16
|
+
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
|
17
|
+
<div class="field">
|
|
18
|
+
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
|
19
|
+
<input id="tsd-search-field" type="text" />
|
|
20
|
+
</div>
|
|
21
|
+
<ul class="results">
|
|
22
|
+
<li class="state loading">Preparing search index...</li>
|
|
23
|
+
<li class="state failure">The search index is not available</li>
|
|
24
|
+
</ul>
|
|
25
|
+
<a href="../index.html" class="title">fe-utils</a>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="table-cell" id="tsd-widgets">
|
|
28
|
+
<div id="tsd-filter">
|
|
29
|
+
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
|
30
|
+
<div class="tsd-filter-group">
|
|
31
|
+
<div class="tsd-select" id="tsd-filter-visibility">
|
|
32
|
+
<span class="tsd-select-label">All</span>
|
|
33
|
+
<ul class="tsd-select-list">
|
|
34
|
+
<li data-value="public">Public</li>
|
|
35
|
+
<li data-value="protected">Public/Protected</li>
|
|
36
|
+
<li data-value="private" class="selected">All</li>
|
|
37
|
+
</ul>
|
|
38
|
+
</div>
|
|
39
|
+
<input type="checkbox" id="tsd-filter-inherited" checked />
|
|
40
|
+
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
|
41
|
+
<input type="checkbox" id="tsd-filter-externals" checked />
|
|
42
|
+
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="tsd-page-title">
|
|
51
|
+
<div class="container">
|
|
52
|
+
<ul class="tsd-breadcrumb">
|
|
53
|
+
<li>
|
|
54
|
+
<a href="../globals.html">Globals</a>
|
|
55
|
+
</li>
|
|
56
|
+
<li>
|
|
57
|
+
<a href="file.html">File</a>
|
|
58
|
+
</li>
|
|
59
|
+
</ul>
|
|
60
|
+
<h1>Module File</h1>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</header>
|
|
64
|
+
<div class="container container-main">
|
|
65
|
+
<div class="row">
|
|
66
|
+
<div class="col-8 col-content">
|
|
67
|
+
<section class="tsd-panel tsd-comment">
|
|
68
|
+
<div class="tsd-comment tsd-typography">
|
|
69
|
+
<div class="lead">
|
|
70
|
+
<p>文件处理相关</p>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</section>
|
|
74
|
+
<section class="tsd-panel-group tsd-index-group">
|
|
75
|
+
<h2>Index</h2>
|
|
76
|
+
<section class="tsd-panel tsd-index-panel">
|
|
77
|
+
<div class="tsd-index-content">
|
|
78
|
+
<section class="tsd-index-section ">
|
|
79
|
+
<h3>Interfaces</h3>
|
|
80
|
+
<ul class="tsd-index-list">
|
|
81
|
+
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/file.compressimgqualitycallback.html" class="tsd-kind-icon">Compress<wbr>Img<wbr>Quality<wbr>Callback</a></li>
|
|
82
|
+
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/file.compressimgscalecallback.html" class="tsd-kind-icon">Compress<wbr>Img<wbr>Scale<wbr>Callback</a></li>
|
|
83
|
+
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/file.exportbyblobparams.html" class="tsd-kind-icon">Export<wbr>ByBlob<wbr>Params</a></li>
|
|
84
|
+
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/file.filesizeobject.html" class="tsd-kind-icon">File<wbr>Size<wbr>Object</a></li>
|
|
85
|
+
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/file.genexportbyblobparams.html" class="tsd-kind-icon">Gen<wbr>Export<wbr>ByBlob<wbr>Params</a></li>
|
|
86
|
+
</ul>
|
|
87
|
+
</section>
|
|
88
|
+
<section class="tsd-index-section ">
|
|
89
|
+
<h3>Type aliases</h3>
|
|
90
|
+
<ul class="tsd-index-list">
|
|
91
|
+
<li class="tsd-kind-type-alias tsd-parent-kind-module"><a href="file.html#filesizeunit" class="tsd-kind-icon">File<wbr>Size<wbr>Unit</a></li>
|
|
92
|
+
<li class="tsd-kind-type-alias tsd-parent-kind-module"><a href="file.html#method" class="tsd-kind-icon">Method</a></li>
|
|
93
|
+
</ul>
|
|
94
|
+
</section>
|
|
95
|
+
<section class="tsd-index-section ">
|
|
96
|
+
<h3>Functions</h3>
|
|
97
|
+
<ul class="tsd-index-list">
|
|
98
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="file.html#blobtodataurl" class="tsd-kind-icon">blob<wbr>ToDataURL</a></li>
|
|
99
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="file.html#calcfilesize" class="tsd-kind-icon">calc<wbr>File<wbr>Size</a></li>
|
|
100
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="file.html#compressimg" class="tsd-kind-icon">compress<wbr>Img</a></li>
|
|
101
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="file.html#dataurltoblob" class="tsd-kind-icon">dataURLto<wbr>Blob</a></li>
|
|
102
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="file.html#filesizeformat" class="tsd-kind-icon">file<wbr>Size<wbr>Format</a></li>
|
|
103
|
+
<li class="tsd-kind-function tsd-parent-kind-module"><a href="file.html#genexportbyblob" class="tsd-kind-icon">gen<wbr>Export<wbr>ByBlob</a></li>
|
|
104
|
+
</ul>
|
|
105
|
+
</section>
|
|
106
|
+
</div>
|
|
107
|
+
</section>
|
|
108
|
+
</section>
|
|
109
|
+
<section class="tsd-panel-group tsd-member-group ">
|
|
110
|
+
<h2>Type aliases</h2>
|
|
111
|
+
<section class="tsd-panel tsd-member tsd-kind-type-alias tsd-parent-kind-module">
|
|
112
|
+
<a name="filesizeunit" class="tsd-anchor"></a>
|
|
113
|
+
<h3>File<wbr>Size<wbr>Unit</h3>
|
|
114
|
+
<div class="tsd-signature tsd-kind-icon">File<wbr>Size<wbr>Unit<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"B"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"KB"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"MB"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"GB"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"TB"</span></div>
|
|
115
|
+
<aside class="tsd-sources">
|
|
116
|
+
<ul>
|
|
117
|
+
<li>Defined in src/file/index.ts:11</li>
|
|
118
|
+
</ul>
|
|
119
|
+
</aside>
|
|
120
|
+
</section>
|
|
121
|
+
<section class="tsd-panel tsd-member tsd-kind-type-alias tsd-parent-kind-module">
|
|
122
|
+
<a name="method" class="tsd-anchor"></a>
|
|
123
|
+
<h3>Method</h3>
|
|
124
|
+
<div class="tsd-signature tsd-kind-icon">Method<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"get"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"GET"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"delete"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"DELETE"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"head"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"HEAD"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"options"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"OPTIONS"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"post"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"POST"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"put"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"PUT"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"patch"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"PATCH"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"link"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"LINK"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"unlink"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"UNLINK"</span></div>
|
|
125
|
+
<aside class="tsd-sources">
|
|
126
|
+
<ul>
|
|
127
|
+
<li>Defined in src/file/index.ts:171</li>
|
|
128
|
+
</ul>
|
|
129
|
+
</aside>
|
|
130
|
+
</section>
|
|
131
|
+
</section>
|
|
132
|
+
<section class="tsd-panel-group tsd-member-group ">
|
|
133
|
+
<h2>Functions</h2>
|
|
134
|
+
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
|
|
135
|
+
<a name="blobtodataurl" class="tsd-anchor"></a>
|
|
136
|
+
<h3>blob<wbr>ToDataURL</h3>
|
|
137
|
+
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
|
|
138
|
+
<li class="tsd-signature tsd-kind-icon">blob<wbr>ToDataURL<span class="tsd-signature-symbol">(</span>blob<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Blob</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li>
|
|
139
|
+
</ul>
|
|
140
|
+
<ul class="tsd-descriptions">
|
|
141
|
+
<li class="tsd-description">
|
|
142
|
+
<aside class="tsd-sources">
|
|
143
|
+
<ul>
|
|
144
|
+
<li>Defined in src/file/index.ts:83</li>
|
|
145
|
+
</ul>
|
|
146
|
+
</aside>
|
|
147
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
148
|
+
<ul class="tsd-parameters">
|
|
149
|
+
<li>
|
|
150
|
+
<h5>blob: <span class="tsd-signature-type">Blob</span></h5>
|
|
151
|
+
</li>
|
|
152
|
+
</ul>
|
|
153
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4>
|
|
154
|
+
</li>
|
|
155
|
+
</ul>
|
|
156
|
+
</section>
|
|
157
|
+
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
|
|
158
|
+
<a name="calcfilesize" class="tsd-anchor"></a>
|
|
159
|
+
<h3>calc<wbr>File<wbr>Size</h3>
|
|
160
|
+
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
|
|
161
|
+
<li class="tsd-signature tsd-kind-icon">calc<wbr>File<wbr>Size<span class="tsd-signature-symbol">(</span>size<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, unit<span class="tsd-signature-symbol">?: </span><a href="file.html#filesizeunit" class="tsd-signature-type">FileSizeUnit</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/file.filesizeobject.html" class="tsd-signature-type">FileSizeObject</a></li>
|
|
162
|
+
</ul>
|
|
163
|
+
<ul class="tsd-descriptions">
|
|
164
|
+
<li class="tsd-description">
|
|
165
|
+
<aside class="tsd-sources">
|
|
166
|
+
<ul>
|
|
167
|
+
<li>Defined in src/file/index.ts:30</li>
|
|
168
|
+
</ul>
|
|
169
|
+
</aside>
|
|
170
|
+
<div class="tsd-comment tsd-typography">
|
|
171
|
+
<div class="lead">
|
|
172
|
+
<p>计算文件大小</p>
|
|
173
|
+
<a href="#使用说明" id="使用说明" style="color: inherit; text-decoration: none;">
|
|
174
|
+
<h4>使用说明</h4>
|
|
175
|
+
</a>
|
|
176
|
+
<pre><code><span class="hljs-selector-tag">calcFileSize</span>(<span class="hljs-number">100</span>) 返回 { <span class="hljs-attribute">size</span>: <span class="hljs-number">100</span>, <span class="hljs-attribute">unit</span>: <span class="hljs-string">'B'</span> }
|
|
177
|
+
<span class="hljs-selector-tag">calcFileSize</span>(<span class="hljs-number">1024</span>) 返回 { <span class="hljs-attribute">size</span>: <span class="hljs-number">1</span>, <span class="hljs-attribute">unit</span>: <span class="hljs-string">'KB'</span> }
|
|
178
|
+
<span class="hljs-selector-tag">calcFileSize</span>(<span class="hljs-number">1024</span>, <span class="hljs-string">'KB'</span>) 返回 { <span class="hljs-attribute">size</span>: <span class="hljs-number">1</span>, <span class="hljs-attribute">unit</span>: <span class="hljs-string">'MB'</span> }
|
|
179
|
+
<span class="hljs-selector-tag">calcFileSize</span>(<span class="hljs-number">1126.4</span>, <span class="hljs-string">'mb'</span>) 返回 { <span class="hljs-attribute">size</span>: <span class="hljs-number">1.1</span>, <span class="hljs-attribute">unit</span>: <span class="hljs-string">'GB'</span> }
|
|
180
|
+
<span class="hljs-selector-tag">calcFileSize</span>(Math.pow(<span class="hljs-number">1024</span>, <span class="hljs-number">2</span>), <span class="hljs-string">'kb'</span>) 返回 { <span class="hljs-attribute">size</span>: <span class="hljs-number">1</span>, <span class="hljs-attribute">unit</span>: <span class="hljs-string">'GB'</span> }</code></pre>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
184
|
+
<ul class="tsd-parameters">
|
|
185
|
+
<li>
|
|
186
|
+
<h5>size: <span class="tsd-signature-type">number</span></h5>
|
|
187
|
+
<div class="tsd-comment tsd-typography">
|
|
188
|
+
<p>单位 k</p>
|
|
189
|
+
</div>
|
|
190
|
+
</li>
|
|
191
|
+
<li>
|
|
192
|
+
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> unit: <a href="file.html#filesizeunit" class="tsd-signature-type">FileSizeUnit</a><span class="tsd-signature-symbol"> = "B"</span></h5>
|
|
193
|
+
</li>
|
|
194
|
+
</ul>
|
|
195
|
+
<h4 class="tsd-returns-title">Returns <a href="../interfaces/file.filesizeobject.html" class="tsd-signature-type">FileSizeObject</a></h4>
|
|
196
|
+
<p>number</p>
|
|
197
|
+
</li>
|
|
198
|
+
</ul>
|
|
199
|
+
</section>
|
|
200
|
+
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
|
|
201
|
+
<a name="compressimg" class="tsd-anchor"></a>
|
|
202
|
+
<h3>compress<wbr>Img</h3>
|
|
203
|
+
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
|
|
204
|
+
<li class="tsd-signature tsd-kind-icon">compress<wbr>Img<span class="tsd-signature-symbol">(</span>file<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">File</span>, scaleCallback<span class="tsd-signature-symbol">?: </span><a href="../interfaces/file.compressimgscalecallback.html" class="tsd-signature-type">CompressImgScaleCallback</a>, qualityCallback<span class="tsd-signature-symbol">?: </span><a href="../interfaces/file.compressimgqualitycallback.html" class="tsd-signature-type">CompressImgQualityCallback</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Blob</span><span class="tsd-signature-symbol">></span></li>
|
|
205
|
+
</ul>
|
|
206
|
+
<ul class="tsd-descriptions">
|
|
207
|
+
<li class="tsd-description">
|
|
208
|
+
<aside class="tsd-sources">
|
|
209
|
+
<ul>
|
|
210
|
+
<li>Defined in src/file/index.ts:113</li>
|
|
211
|
+
</ul>
|
|
212
|
+
</aside>
|
|
213
|
+
<div class="tsd-comment tsd-typography">
|
|
214
|
+
<div class="lead">
|
|
215
|
+
<p>压缩图片方法</p>
|
|
216
|
+
</div>
|
|
217
|
+
</div>
|
|
218
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
219
|
+
<ul class="tsd-parameters">
|
|
220
|
+
<li>
|
|
221
|
+
<h5>file: <span class="tsd-signature-type">File</span></h5>
|
|
222
|
+
<div class="tsd-comment tsd-typography">
|
|
223
|
+
<p>图片</p>
|
|
224
|
+
</div>
|
|
225
|
+
</li>
|
|
226
|
+
<li>
|
|
227
|
+
<h5><span class="tsd-flag ts-flagOptional">Optional</span> scaleCallback: <a href="../interfaces/file.compressimgscalecallback.html" class="tsd-signature-type">CompressImgScaleCallback</a></h5>
|
|
228
|
+
<div class="tsd-comment tsd-typography">
|
|
229
|
+
<p>宽高 压缩规则</p>
|
|
230
|
+
</div>
|
|
231
|
+
</li>
|
|
232
|
+
<li>
|
|
233
|
+
<h5><span class="tsd-flag ts-flagOptional">Optional</span> qualityCallback: <a href="../interfaces/file.compressimgqualitycallback.html" class="tsd-signature-type">CompressImgQualityCallback</a></h5>
|
|
234
|
+
<div class="tsd-comment tsd-typography">
|
|
235
|
+
<p>质量 压缩规则</p>
|
|
236
|
+
</div>
|
|
237
|
+
</li>
|
|
238
|
+
</ul>
|
|
239
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Blob</span><span class="tsd-signature-symbol">></span></h4>
|
|
240
|
+
</li>
|
|
241
|
+
</ul>
|
|
242
|
+
</section>
|
|
243
|
+
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
|
|
244
|
+
<a name="dataurltoblob" class="tsd-anchor"></a>
|
|
245
|
+
<h3>dataURLto<wbr>Blob</h3>
|
|
246
|
+
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
|
|
247
|
+
<li class="tsd-signature tsd-kind-icon">dataURLto<wbr>Blob<span class="tsd-signature-symbol">(</span>dataurl<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Blob</span></li>
|
|
248
|
+
</ul>
|
|
249
|
+
<ul class="tsd-descriptions">
|
|
250
|
+
<li class="tsd-description">
|
|
251
|
+
<aside class="tsd-sources">
|
|
252
|
+
<ul>
|
|
253
|
+
<li>Defined in src/file/index.ts:71</li>
|
|
254
|
+
</ul>
|
|
255
|
+
</aside>
|
|
256
|
+
<div class="tsd-comment tsd-typography">
|
|
257
|
+
<div class="lead">
|
|
258
|
+
<p>base64转换为file
|
|
259
|
+
dataurl base64图片</p>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
263
|
+
<ul class="tsd-parameters">
|
|
264
|
+
<li>
|
|
265
|
+
<h5>dataurl: <span class="tsd-signature-type">string</span></h5>
|
|
266
|
+
</li>
|
|
267
|
+
</ul>
|
|
268
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Blob</span></h4>
|
|
269
|
+
</li>
|
|
270
|
+
</ul>
|
|
271
|
+
</section>
|
|
272
|
+
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
|
|
273
|
+
<a name="filesizeformat" class="tsd-anchor"></a>
|
|
274
|
+
<h3>file<wbr>Size<wbr>Format</h3>
|
|
275
|
+
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
|
|
276
|
+
<li class="tsd-signature tsd-kind-icon">file<wbr>Size<wbr>Format<span class="tsd-signature-symbol">(</span>str<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span>, unit<span class="tsd-signature-symbol">?: </span><a href="file.html#filesizeunit" class="tsd-signature-type">FileSizeUnit</a>, defaultValue<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
|
|
277
|
+
</ul>
|
|
278
|
+
<ul class="tsd-descriptions">
|
|
279
|
+
<li class="tsd-description">
|
|
280
|
+
<aside class="tsd-sources">
|
|
281
|
+
<ul>
|
|
282
|
+
<li>Defined in src/file/index.ts:59</li>
|
|
283
|
+
</ul>
|
|
284
|
+
</aside>
|
|
285
|
+
<div class="tsd-comment tsd-typography">
|
|
286
|
+
<div class="lead">
|
|
287
|
+
<p>文件大小转换</p>
|
|
288
|
+
<a href="#使用说明" id="使用说明" style="color: inherit; text-decoration: none;">
|
|
289
|
+
<h4>使用说明</h4>
|
|
290
|
+
</a>
|
|
291
|
+
<pre><code><span class="hljs-function"><span class="hljs-title">fileSizeFormat</span><span class="hljs-params">(<span class="hljs-string">''</span>)</span></span> 返回 -
|
|
292
|
+
<span class="hljs-function"><span class="hljs-title">fileSizeFormat</span><span class="hljs-params">(<span class="hljs-string">'1024'</span>)</span></span> 返回 <span class="hljs-number">1</span>KB
|
|
293
|
+
<span class="hljs-function"><span class="hljs-title">fileSizeFormat</span><span class="hljs-params">(<span class="hljs-string">'1024'</span>, <span class="hljs-string">'KB'</span>)</span></span> 返回 <span class="hljs-number">1</span>MB
|
|
294
|
+
<span class="hljs-function"><span class="hljs-title">fileSizeFormat</span><span class="hljs-params">(<span class="hljs-string">'2645'</span>, <span class="hljs-string">'B'</span>)</span></span> 返回 ceil(<span class="hljs-number">2645</span> / <span class="hljs-number">1024</span>, <span class="hljs-number">2</span>)MB</code></pre>
|
|
295
|
+
</div>
|
|
296
|
+
</div>
|
|
297
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
298
|
+
<ul class="tsd-parameters">
|
|
299
|
+
<li>
|
|
300
|
+
<h5>str: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></h5>
|
|
301
|
+
<div class="tsd-comment tsd-typography">
|
|
302
|
+
<p>字符串 单位k</p>
|
|
303
|
+
</div>
|
|
304
|
+
</li>
|
|
305
|
+
<li>
|
|
306
|
+
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> unit: <a href="file.html#filesizeunit" class="tsd-signature-type">FileSizeUnit</a><span class="tsd-signature-symbol"> = "B"</span></h5>
|
|
307
|
+
</li>
|
|
308
|
+
<li>
|
|
309
|
+
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> defaultValue: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = "-"</span></h5>
|
|
310
|
+
</li>
|
|
311
|
+
</ul>
|
|
312
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
|
|
313
|
+
</li>
|
|
314
|
+
</ul>
|
|
315
|
+
</section>
|
|
316
|
+
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
|
|
317
|
+
<a name="genexportbyblob" class="tsd-anchor"></a>
|
|
318
|
+
<h3>gen<wbr>Export<wbr>ByBlob</h3>
|
|
319
|
+
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
|
|
320
|
+
<li class="tsd-signature tsd-kind-icon">gen<wbr>Export<wbr>ByBlob<span class="tsd-signature-symbol">(</span>__namedParameters<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>axiosRequest<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">; </span>notWithCredentials<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">exportByBlob</span></li>
|
|
321
|
+
</ul>
|
|
322
|
+
<ul class="tsd-descriptions">
|
|
323
|
+
<li class="tsd-description">
|
|
324
|
+
<aside class="tsd-sources">
|
|
325
|
+
<ul>
|
|
326
|
+
<li>Defined in src/file/index.ts:219</li>
|
|
327
|
+
</ul>
|
|
328
|
+
</aside>
|
|
329
|
+
<div class="tsd-comment tsd-typography">
|
|
330
|
+
<div class="lead">
|
|
331
|
+
<p>生成导出函数</p>
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
334
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
335
|
+
<ul class="tsd-parameters">
|
|
336
|
+
<li>
|
|
337
|
+
<h5>__namedParameters: <span class="tsd-signature-symbol">{ </span>axiosRequest<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">; </span>notWithCredentials<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> }</span></h5>
|
|
338
|
+
<ul class="tsd-parameters">
|
|
339
|
+
<li class="tsd-parameter">
|
|
340
|
+
<h5>axios<wbr>Request<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></h5>
|
|
341
|
+
</li>
|
|
342
|
+
<li class="tsd-parameter">
|
|
343
|
+
<h5>not<wbr>With<wbr>Credentials<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">[]</span></h5>
|
|
344
|
+
</li>
|
|
345
|
+
</ul>
|
|
346
|
+
</li>
|
|
347
|
+
</ul>
|
|
348
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">exportByBlob</span></h4>
|
|
349
|
+
</li>
|
|
350
|
+
</ul>
|
|
351
|
+
</section>
|
|
352
|
+
</section>
|
|
353
|
+
</div>
|
|
354
|
+
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
355
|
+
<nav class="tsd-navigation primary">
|
|
356
|
+
<ul>
|
|
357
|
+
<li class="globals ">
|
|
358
|
+
<a href="../globals.html"><em>Globals</em></a>
|
|
359
|
+
</li>
|
|
360
|
+
<li class=" tsd-kind-module">
|
|
361
|
+
<a href="common.html">Common</a>
|
|
362
|
+
</li>
|
|
363
|
+
<li class=" tsd-kind-module">
|
|
364
|
+
<a href="date.html">Date</a>
|
|
365
|
+
</li>
|
|
366
|
+
<li class="current tsd-kind-module">
|
|
367
|
+
<a href="file.html">File</a>
|
|
368
|
+
</li>
|
|
369
|
+
<li class=" tsd-kind-module">
|
|
370
|
+
<a href="number.html">Number</a>
|
|
371
|
+
</li>
|
|
372
|
+
<li class=" tsd-kind-module">
|
|
373
|
+
<a href="object.html">Object</a>
|
|
374
|
+
</li>
|
|
375
|
+
<li class=" tsd-kind-module">
|
|
376
|
+
<a href="print.html">Print</a>
|
|
377
|
+
</li>
|
|
378
|
+
<li class=" tsd-kind-module">
|
|
379
|
+
<a href="string.html">String</a>
|
|
380
|
+
</li>
|
|
381
|
+
<li class=" tsd-kind-module">
|
|
382
|
+
<a href="validate.html">Validate</a>
|
|
383
|
+
</li>
|
|
384
|
+
</ul>
|
|
385
|
+
</nav>
|
|
386
|
+
<nav class="tsd-navigation secondary menu-sticky">
|
|
387
|
+
<ul class="before-current">
|
|
388
|
+
<li class=" tsd-kind-interface tsd-parent-kind-module">
|
|
389
|
+
<a href="../interfaces/file.compressimgqualitycallback.html" class="tsd-kind-icon">Compress<wbr>Img<wbr>Quality<wbr>Callback</a>
|
|
390
|
+
</li>
|
|
391
|
+
<li class=" tsd-kind-interface tsd-parent-kind-module">
|
|
392
|
+
<a href="../interfaces/file.compressimgscalecallback.html" class="tsd-kind-icon">Compress<wbr>Img<wbr>Scale<wbr>Callback</a>
|
|
393
|
+
</li>
|
|
394
|
+
<li class=" tsd-kind-interface tsd-parent-kind-module">
|
|
395
|
+
<a href="../interfaces/file.exportbyblobparams.html" class="tsd-kind-icon">Export<wbr>ByBlob<wbr>Params</a>
|
|
396
|
+
</li>
|
|
397
|
+
<li class=" tsd-kind-interface tsd-parent-kind-module">
|
|
398
|
+
<a href="../interfaces/file.filesizeobject.html" class="tsd-kind-icon">File<wbr>Size<wbr>Object</a>
|
|
399
|
+
</li>
|
|
400
|
+
<li class=" tsd-kind-interface tsd-parent-kind-module">
|
|
401
|
+
<a href="../interfaces/file.genexportbyblobparams.html" class="tsd-kind-icon">Gen<wbr>Export<wbr>ByBlob<wbr>Params</a>
|
|
402
|
+
</li>
|
|
403
|
+
<li class=" tsd-kind-type-alias tsd-parent-kind-module">
|
|
404
|
+
<a href="file.html#filesizeunit" class="tsd-kind-icon">File<wbr>Size<wbr>Unit</a>
|
|
405
|
+
</li>
|
|
406
|
+
<li class=" tsd-kind-type-alias tsd-parent-kind-module">
|
|
407
|
+
<a href="file.html#method" class="tsd-kind-icon">Method</a>
|
|
408
|
+
</li>
|
|
409
|
+
<li class=" tsd-kind-function tsd-parent-kind-module">
|
|
410
|
+
<a href="file.html#blobtodataurl" class="tsd-kind-icon">blob<wbr>ToDataURL</a>
|
|
411
|
+
</li>
|
|
412
|
+
<li class=" tsd-kind-function tsd-parent-kind-module">
|
|
413
|
+
<a href="file.html#calcfilesize" class="tsd-kind-icon">calc<wbr>File<wbr>Size</a>
|
|
414
|
+
</li>
|
|
415
|
+
<li class=" tsd-kind-function tsd-parent-kind-module">
|
|
416
|
+
<a href="file.html#compressimg" class="tsd-kind-icon">compress<wbr>Img</a>
|
|
417
|
+
</li>
|
|
418
|
+
<li class=" tsd-kind-function tsd-parent-kind-module">
|
|
419
|
+
<a href="file.html#dataurltoblob" class="tsd-kind-icon">dataURLto<wbr>Blob</a>
|
|
420
|
+
</li>
|
|
421
|
+
<li class=" tsd-kind-function tsd-parent-kind-module">
|
|
422
|
+
<a href="file.html#filesizeformat" class="tsd-kind-icon">file<wbr>Size<wbr>Format</a>
|
|
423
|
+
</li>
|
|
424
|
+
<li class=" tsd-kind-function tsd-parent-kind-module">
|
|
425
|
+
<a href="file.html#genexportbyblob" class="tsd-kind-icon">gen<wbr>Export<wbr>ByBlob</a>
|
|
426
|
+
</li>
|
|
427
|
+
</ul>
|
|
428
|
+
</nav>
|
|
429
|
+
</div>
|
|
430
|
+
</div>
|
|
431
|
+
</div>
|
|
432
|
+
<footer class="with-border-bottom">
|
|
433
|
+
<div class="container">
|
|
434
|
+
<h2>Legend</h2>
|
|
435
|
+
<div class="tsd-legend-group">
|
|
436
|
+
<ul class="tsd-legend">
|
|
437
|
+
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
|
|
438
|
+
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
|
|
439
|
+
</ul>
|
|
440
|
+
<ul class="tsd-legend">
|
|
441
|
+
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
|
|
442
|
+
</ul>
|
|
443
|
+
</div>
|
|
444
|
+
</div>
|
|
445
|
+
</footer>
|
|
446
|
+
<div class="container tsd-generator">
|
|
447
|
+
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
|
448
|
+
</div>
|
|
449
|
+
<div class="overlay"></div>
|
|
450
|
+
<script src="../assets/js/main.js"></script>
|
|
451
|
+
</body>
|
|
452
|
+
</html>
|