Skip to main content

CachedResource <T>

A decorator for a resource that adds caching functionality.

Hierarchy

Index

Constructors

constructor

  • Type parameters

    • T: Directory | File

    Parameters

    Returns CachedResource<T>

Accessors

isAsync

  • get isAsync(): boolean
  • Whether this Resource is loaded asynchronously


    Returns boolean

name

  • get name(): string
  • The name of the referenced file


    Returns string

progress

  • get progress(): undefined | ProgressTracker
  • set progress(value: undefined | ProgressTracker): void
  • @inheritDoc

    Returns undefined | ProgressTracker

  • @inheritDoc

    Parameters

    • value: undefined | ProgressTracker

    Returns void

Methods

resolve

  • resolve(): Promise<T>
  • @inheritDoc

    Returns Promise<T>

setPlayground

  • setPlayground(playground: UniversalPHP): void
  • @inheritDoc

    Parameters

    • playground: UniversalPHP

    Returns void

staticcreate

  • create(ref: FileReference | DirectoryReference, options: { corsProxy?: string; progress?: ProgressTracker; semaphore?: default }): Resource<Directory | File>
  • Creates a new Resource based on the given file reference


    Parameters

    • ref: FileReference | DirectoryReference

      The file reference to create the Resource for

    • options: { corsProxy?: string; progress?: ProgressTracker; semaphore?: default }

      Additional options for the Resource

    Returns Resource<Directory | File>

    A new Resource instance