Skip to content

lib.photos library.model.file type.FileType

steilerDev edited this page Mar 13, 2023 · 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

src/lib/photos-library/model/file-type.ts:53

Properties

descriptor

descriptor: string

The descriptor, as provided by the backend

Defined in

src/lib/photos-library/model/file-type.ts:47

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

src/lib/photos-library/model/file-type.ts:106


getExtension

getExtension(): string

Returns

string

The FileType as a file extension

Defined in

src/lib/photos-library/model/file-type.ts:97


fromAssetType

Static fromAssetType(descriptor, ext): 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
ext string The extension as provided by the encoded filename

Returns

FileType

The newly created FileType

Defined in

src/lib/photos-library/model/file-type.ts:64


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

src/lib/photos-library/model/file-type.ts:79

Clone this wiki locally