Options
All
  • Public
  • Public/Protected
  • All
Menu

Base class for a source of photos for a Screensaver

Hierarchy

Index

Constructors

Protected constructor

  • new PhotoSource(useKey: UseKey, photosKey: string, type: Type, desc: string, isLimited: boolean, isDaily: boolean, isArray: boolean, loadArg?: any): PhotoSource
  • Create a new photo source

    Parameters

    • useKey: UseKey

      The key for if the source is selected

    • photosKey: string

      The key for the collection of photos

    • type: Type

      A descriptor of the photo source

    • desc: string

      A human readable description of the source

    • isLimited: boolean

      Should we limit the frequency of updates

    • isDaily: boolean

      Should the source be updated daily

    • isArray: boolean

      Is the source an Array of photo Arrays

    • Optional loadArg: any

      optional arg for load function

    Returns PhotoSource

Properties

Private _desc

_desc: string

A human readable description of the source

Private _isArray

_isArray: boolean

Flag to indicate if source is an Array of arrays

Private _isDaily

_isDaily: boolean

Flag to indicate if source should be updated daily

Private _isLimited

_isLimited: boolean

Flag to indicate if source has limits to the number of times it can be called in a time period

Private Optional _loadArg

_loadArg: any

Optional argument to pass to the load method

Private _photosKey

_photosKey: string

The storage key for the collection of photos

Private _type

_type: Type

A unique descriptor of the photo source

Private _useKey

_useKey: UseKey

The storage key for if the source is selected

Methods

Abstract fetchPhotos

getDesc

  • getDesc(): string

getLoadArg

  • getLoadArg(): any

getPhotos

getPhotosKey

  • getPhotosKey(): string

getUseKey

isDaily

  • isDaily(): boolean

isLimited

  • isLimited(): boolean

process

  • process(): Promise<undefined>

Private save

use

  • use(): null | false | true

Static addPhoto

  • addPhoto(photos: IPhoto[], url: string, author: string, asp: number, ex: any, point?: string): void
  • Add a IPhoto to an existing Array

    Parameters

    • photos: IPhoto[]

      The array to add to

    • url: string

      The url to the photo

    • author: string

      The photographer

    • asp: number

      The aspect ratio of the photo

    • ex: any

      Additional information about the photo

    • Default value point: string = ""

      An optional geolocation

    Returns void

Static createPoint

  • createPoint(lat: number, lon: number): string
  • Create a geo point string from a latitude and longitude

    Parameters

    • lat: number

      latitude

    • lon: number

      longitude

    Returns string

    'lat lon'

Generated using TypeDoc