Skip to content

lib.photos library.model.file type.FileType

steilerDev edited this page Aug 2, 2022 · 9 revisions

Class: FileType

lib/photos-library/model/file-type.FileType

This class represents the type of file a given asset has

Table of contents

Constructors

Properties

Methods

Constructors

constructor

Private new FileType(descriptor)

Constructs a new FileType

Parameters

Name Type Description
descriptor string The descriptor as provided by the backend

Defined in

lib/photos-library/model/file-type.ts:27

Properties

descriptor

descriptor: string

The descriptor, as provided by the backend

Defined in

lib/photos-library/model/file-type.ts:21

Methods

equal

equal(fileType): boolean

Compares the given FileType to this instance

Parameters

Name Type Description
fileType FileType A FileType to compare this instance to

Returns

boolean

True, if the given FileType is equal to this instance

Defined in

lib/photos-library/model/file-type.ts:77


getExtension

getExtension(): string

Returns

string

The FileType as a file extension

Defined in

lib/photos-library/model/file-type.ts:68


fromAssetType

Static fromAssetType(descriptor): FileType

Creates the file type from the backend

Throws

An Error, if the provided descriptor is unknown to the script

Parameters

Name Type Description
descriptor string The descriptor as provided by the backend

Returns

FileType

The newly created FileType

Defined in

lib/photos-library/model/file-type.ts:37


fromExtension

Static fromExtension(ext): FileType

Creates a file type from a file extension

Throws

An error, if the provided extension is unknown to the script

Parameters

Name Type Description
ext string The file extension of the file

Returns

FileType

The newly created FileType

Defined in

lib/photos-library/model/file-type.ts:51

Clone this wiki locally