Skip to content

lib.photos library.model.file type.FileType

github-actions[bot] edited this page Oct 16, 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

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

Properties

descriptor

descriptor: string

The descriptor, as provided by the backend

Defined in

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

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:122


getExtension

getExtension(): string

Returns

string

The FileType as a file extension

Defined in

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


fromAssetType

Static fromAssetType(descriptor, ext): FileType

Creates the file type from the backend

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

Throws

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

Defined in

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


fromExtension

Static fromExtension(ext): FileType

Creates a file type from a file extension

Parameters

Name Type Description
ext string The file extension of the file

Returns

FileType

The newly created FileType

Throws

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

Defined in

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

Clone this wiki locally