Sha256: 25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc

Contents?: true

Size: 1.67 KB

Versions: 29

Compression:

Stored size: 1.67 KB

Contents

// Based on https://github.com/octet-stream/form-data/blob/2d0f0dc371517444ce1f22cdde13f51995d0953a/lib/File.ts (MIT)
/// <reference types="node" />

import { Blob } from 'buffer'

export interface BlobPropertyBag {
  type?: string
  endings?: 'native' | 'transparent'
}

export interface FilePropertyBag extends BlobPropertyBag {
  /**
   * The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
   */
  lastModified?: number
}

export declare class File extends Blob {
  /**
   * Creates a new File instance.
   *
   * @param fileBits An `Array` strings, or [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), [`ArrayBufferView`](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView), [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) objects, or a mix of any of such objects, that will be put inside the [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File).
   * @param fileName The name of the file.
   * @param options An options object containing optional attributes for the file.
   */
  constructor(fileBits: ReadonlyArray<string | NodeJS.ArrayBufferView | Blob>, fileName: string, options?: FilePropertyBag)

  /**
   * Name of the file referenced by the File object.
   */
  readonly name: string

  /**
   * The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
   */
  readonly lastModified: number

  readonly [Symbol.toStringTag]: string
}

Version data entries

29 entries across 29 versions & 3 rubygems

Version Path
clapton-0.0.26 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.25 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.24 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.23 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.22 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.21 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.20 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.19 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.18 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.17 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.16 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.15 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.14 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.13 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.12 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.11 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.10 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.9 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.8 lib/clapton/javascripts/node_modules/undici-types/file.d.ts
clapton-0.0.7 lib/clapton/javascripts/node_modules/undici-types/file.d.ts