温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/bun/FormDataEntryValue
点击访问原文链接

Bun.FormDataEntryValue TypeScript type alias | API Reference | Bun

Bun.FormDataEntryValue TypeScript type alias | API Reference | BunBuildDocsReferenceGuidesBlogDiscord/Bun/FormDataEntryValueTFormDataEntryValue

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/Bun/FormDataEntryValueTFormDataEntryValue

type

FormDataEntryValuetype FormDataEntryValue = File | stringReferenced typesclass File

Provides information about files and allows JavaScript in a web page to access their content.

MDN Reference

readonly lastModified: numberreadonly name: stringreadonly size: numberreadonly type: stringreadonly webkitRelativePath: stringarrayBuffer(): PromiseArrayBuffer>;

Returns a promise that resolves to the contents of the blob as an ArrayBuffer

bytes(): PromiseUint8ArrayArrayBufferLike>>;bytes(): PromiseUint8ArrayArrayBuffer>>;

Returns a promise that resolves to the contents of the blob as a Uint8Array (array of bytes) its the same as new Uint8Array(await blob.arrayBuffer())

formData(): PromiseFormData>;

Read the data from the blob as a FormData object.

This first decodes the data from UTF-8, then parses it as a multipart/form-data body or a application/x-www-form-urlencoded body.

The type property of the blob is used to determine the format of the body.

This is a non-standard addition to the Blob API, to make it conform more closely to the BodyMixin API.

image(options?: ConstructorOptions): Image;

Wrap this blob in a Bun.Image pipeline. Equivalent to new Bun.Image(this, options) — the constructor is synchronous (the underlying read happens lazily when an Image terminal is awaited), so this works on Bun.file(), Bun.s3(), fd-backed and in-memory blobs alike:

await Bun.file("photo.jpg").image().resize(400).webp().write("thumb.webp");
json(): Promiseany>;

Read the data from the blob as a JSON object.

This first decodes the data from UTF-8, then parses it as JSON.

slice(start?: number,end?: number,contentType?: string): Blob;stream(): ReadableStreamUint8ArrayArrayBufferLike>>;stream(): ReadableStreamUint8ArrayArrayBuffer>>;

Returns a readable stream of the blob's contents

text(): Promisestring>;

Returns a promise that resolves to the contents of the blob as a string

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

Bun.FormDataEntryValue TypeScript type alias | API Reference | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for type bun.FormDataEntryValue | Bun