๐Ÿ“ฆ toeverything / file-type

๐Ÿ“„ index.d.ts ยท 111 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111/* auto-generated by NAPI-RS */
/* eslint-disable */
export class FileType {
  constructor(bytes: Uint8Array)
  /**
   * Returns the common extension of the file format.
   *
   * Note: this information is never empty.
   *
   * # Examples
   *
   * Basic usage:
   *
   * ```
   * new FileType([...]).extension() // "wmv"
   *```
   */
  extension(): string
  /**
   * Returns the `Kind` of the file format.
   *
   * # Examples
   *
   * Basic usage:
   *
   * ```
   * new FileType([...]).kind() // Kind.Archive
   *```
   */
  kind(): Kind
  /**
   * Returns the common media type (formerly known as MIME type) of the file format as
   * defined in [IETF RFC 6838](https://tools.ietf.org/html/rfc6838).
   *
   * Note: some media types may not be defined in the
   * [IANA registry](https://www.iana.org/assignments/media-types/media-types.xhtml).
   *
   * # Examples
   *
   * Basic usage:
   *
   * ```
   * new FileType([...]).media_type() // "application/zstd"
   *```
   */
  mime(): string
  /**
   * Returns the full name of the file format.
   *
   * # Examples
   *
   * Basic usage:
   *
   * ```
   * new FileType([...]).name() // "MPEG-1/2 Audio Layer 3"
   *```
   */
  name(): string
}

/** A kind of file format. */
export enum Kind {
  /** Files and directories stored in a single, possibly compressed, archive. */
  Archive = 'Archive',
  /** Musics, sound effects, and spoken audio recordings. */
  Audio = 'Audio',
  /** Compressed single files or streams. */
  Compressed = 'Compressed',
  /** Organized collections of data. */
  Database = 'Database',
  /** Visual information using graphics and spatial relationships. */
  Diagram = 'Diagram',
  /** Floppy disk images, optical disc images and virtual machine disks. */
  Disk = 'Disk',
  /** Word processing and desktop publishing documents. */
  Document = 'Document',
  /** Electronic books. */
  Ebook = 'Ebook',
  /** Machine-executable code, virtual machine code and shared libraries. */
  Executable = 'Executable',
  /** Typefaces used for displaying text on screen or in print. */
  Font = 'Font',
  /** Mathematical formulas. */
  Formula = 'Formula',
  /** Collections of geospatial features, GPS tracks and other location-related files. */
  Geospatial = 'Geospatial',
  /** Animated images, icons, cursors, raster graphics and vector graphics. */
  Image = 'Image',
  /** Data that provides information about other data. */
  Metadata = 'Metadata',
  /** 3D models, CAD drawings, and other types of files used for creating or displaying 3D images. */
  Model = 'Model',
  /** Data which do not fit in any of the other kinds. */
  Other = 'Other',
  /** Collections of files bundled together for software distribution. */
  Package = 'Package',
  /** Lists of audio or video files, organized in a specific order for sequential playback. */
  Playlist = 'Playlist',
  /** Slide shows. */
  Presentation = 'Presentation',
  /** Copies of a read-only memory chip of computers, cartridges, or other electronic devices. */
  Rom = 'Rom',
  /** Data in tabular form. */
  Spreadsheet = 'Spreadsheet',
  /** Subtitles and captions. */
  Subtitle = 'Subtitle',
  /** Moving images, possibly with color and coordinated sound. */
  Video = 'Video'
}