@@ -23,7 +23,20 @@ export default eventHandler(async () => {
2323
2424#### Params
2525
26- - ` options ` : [ ` BlobListOptions ` ] ( #bloblistoptions )
26+ :: field-group
27+ :: field { name =" options " type =" Object " }
28+ The list options.
29+ ::field{name="limit" type="Number"}
30+ The maximum number of blobs to return per request. Defaults to `1000`.
31+ ::
32+ ::field{name="prefix" type="String"}
33+ Filters the results to only those that begin with the specified prefix.
34+ ::
35+ ::field{name="cursor" type="String"}
36+ The cursor to continue from a previous list operation.
37+ ::
38+ ::
39+ ::
2740
2841#### Return
2942
@@ -43,8 +56,14 @@ export default eventHandler(async (event) => {
4356
4457#### Params
4558
46- - ` event ` : [ ` H3Event ` ] ( https://github.com/unjs/h3 ) {target=_ blank}
47- - ` pathname ` : ` string `
59+ :: field-group
60+ :: field { name =" event " type =" H3Event " }
61+ Handler's event, needed to set headers.
62+ ::
63+ :: field { name =" pathname " type =" String " }
64+ The name of the blob to serve.
65+ ::
66+ ::
4867
4968#### Return
5069
@@ -68,7 +87,11 @@ const blob = await useBlob().head(pathname)
6887
6988#### Params
7089
71- - ` pathname ` : ` string `
90+ :: field-group
91+ :: field { name =" pathname " type =" String " }
92+ The name of the blob to serve.
93+ ::
94+ ::
7295
7396#### Return
7497
@@ -96,9 +119,26 @@ export default eventHandler(async (event) => {
96119
97120#### Params
98121
99- - ` pathname ` : ` string `
100- - ` body ` : ` string ` | ` ReadableStream<any> ` | ` ArrayBuffer ` | ` ArrayBufferView ` | ` Blob `
101- - ` options ` : [ ` BlobPutOptions ` ] ( #blobputoptions )
122+ :: field-group
123+ :: field { name =" pathname " type =" String " }
124+ The name of the blob to serve.
125+ ::
126+ :: field { name =" body " type =" String | ReadableStream<any> | ArrayBuffer | ArrayBufferView | Blob " }
127+ The blob's data.
128+ ::
129+ :: field { name =" options " type =" Object " }
130+ The put options. Any other provided field will be stored in the blob's metadata.
131+ ::field{name="contentType" type="String"}
132+ The content type of the blob. If not given, it will be inferred from the Blob or the file extension.
133+ ::
134+ ::field{name="contentLength" type="String"}
135+ The content length of the blob.
136+ ::
137+ ::field{name="addRandomSuffix" type="Boolean"}
138+ If `true`, a random suffix will be added to the blob's name. Defaults to `false`.
139+ ::
140+ ::
141+ ::
102142
103143#### Return
104144
@@ -120,7 +160,11 @@ export default eventHandler(async (event) => {
120160
121161#### Params
122162
123- - ` pathname ` : ` string `
163+ :: field-group
164+ :: field { name =" pathname " type =" String " }
165+ The name of the blob to serve.
166+ ::
167+ ::
124168
125169#### Return
126170
@@ -140,17 +184,17 @@ ensureBlob(file, { maxSize: '1MB', types: ['image' ]})
140184
141185:: field-group
142186 :: field { name =" file " type =" Blob " required }
143- The file to validate.
187+ The file to validate.
144188 ::
145189 :: field { name =" options " type =" Object " required }
146190 Note that at least `maxSize` or `types` should be provided.
147191 ::field{name="maxSize" type="BlobSize"}
148- The maximum size of the file, should be: :br
149- (`1` | `2` | `4` | `8` | `16` | `32` | `64` | `128` | `256` | `512` | `1024`) + (`B` | `KB` | `MB` | `GB`) :br
150- e.g. `'512KB'`, `'1MB'`, `'2GB'`, etc.
192+ The maximum size of the file, should be: :br
193+ (`1` | `2` | `4` | `8` | `16` | `32` | `64` | `128` | `256` | `512` | `1024`) + (`B` | `KB` | `MB` | `GB`) :br
194+ e.g. `'512KB'`, `'1MB'`, `'2GB'`, etc.
151195 ::
152196 ::field{name="types" type="BlobType[]"}
153- Allowed types of the file, e.g. `['image/jpeg']`.
197+ Allowed types of the file, e.g. `['image/jpeg']`.
154198 ::
155199 ::
156200::
@@ -163,31 +207,6 @@ Throws an error if `file` doesn't meet the requirements.
163207
164208## Types
165209
166- ### ` BlobListOptions `
167-
168- ``` ts
169- interface BlobListOptions {
170- /**
171- * The maximum number of blobs to return per request.
172- * @default 1000
173- */
174- limit? : number
175- prefix? : string
176- cursor? : string
177- }
178- ```
179-
180- ### ` BlobPutOptions `
181-
182- ``` ts
183- interface BlobPutOptions {
184- contentType? : string ,
185- contentLength? : string ,
186- addRandomSuffix? : boolean ,
187- [key : string ]: any
188- }
189- ```
190-
191210### ` BlobObject `
192211
193212``` ts
0 commit comments