Function ProvideImage

  • Decorator that marks a method as an image provider. The method will be called when a request is made to retrieve an image.

    Supported Decorators:

    • @Auth

    Parameters

    • accessor: string

      The accessor for the image provider.

    Returns ((target, propertyKey) => void)

      • (target, propertyKey): void
      • Parameters

        • target: any
        • propertyKey: string

        Returns void

    Example

    The following code initializes the image provider. When running a GET request to '/image/example[/id[/auth]]', this method is called.

    @ProvideImage("example")
    async provideImage(id: string, auth: string) {
    return ProvidedImage.getFromDataURL(
    dataUrl,
    id,
    "Example"
    );
    }

Generated using TypeDoc