AlbumFile
Represents a file within a Switch.Album
content store,
which is either a screenshot (JPEG image) or a screen recording (MP4 movie).
It is a subclass of File
, so you can use familiar features like name
,
lastModified
and arrayBuffer()
. It also has additional metadata like
applicationId
to determine which application generated the contents.
Example
Extends
Constructors
new AlbumFile()
new AlbumFile(storage
, id
): AlbumFile
Parameters
Parameter | Type |
---|---|
storage | number |
id | string |
Returns
Overrides
Properties
Property | Type | Description | Inherited from |
---|---|---|---|
applicationId | bigint | The ID of the application which generated the album file. | - |
content | number | The type of content which the album file contains. The value corresponds with the CapsAlbumFileContents enum from @nx.js/constants . | - |
id | number | Unique ID for when there's multiple album files with the same timestamp. Note The value is usually 0 . | - |
lastModified | number | - | File .lastModified |
name | string | - | File .name |
storage | number | The storage device which contains the album file. The value corresponds with the CapsAlbumStorage enum from @nx.js/constants . | - |
webkitRelativePath | string | - | File .webkitRelativePath |
Accessors
size
get
size(): number
Returns the size of the Blob object, in bytes.
Returns
number
Inherited from
type
get
type(): string
Returns the MIME type of the Blob object.
Returns
string
Inherited from
Methods
arrayBuffer()
arrayBuffer(): Promise
<ArrayBuffer
>
Returns a promise that resolves with an ArrayBuffer representing the Blob's data.
Returns
Inherited from
slice()
slice(start
?, end
?, type
?): Blob
Returns a new Blob object containing the data in the specified range of bytes of the source Blob.
Parameters
Parameter | Type | Description |
---|---|---|
start ? | number | The start byte index. |
end ? | number | The end byte index. |
type ? | string | The content type of the new Blob. |
Returns
Overrides
stream()
stream(): ReadableStream
<Uint8Array
>
Returns a stream that can be used to read the contents of the Blob.
Returns
Overrides
text()
text(): Promise
<string
>
Returns a promise that resolves with a string representation of the Blob object.
Returns
Promise
<string
>
Overrides
thumbnail()
thumbnail(): Promise
<ArrayBuffer
>
Loads the thumbnail JPEG image for the album file.