Hierarchy (view full)

Properties

uniqueId?: string

Accessors

  • get buffer(): undefined | string
  • Returns undefined | string

Methods

  • Releases native resources stored by the ref. If two different ImageRef objects have the same uniqueId both of them become cleared. If uniqueId is not set or the image is already released, an exception will be thrown.

    Returns Promise<void>

  • Returns the stored image as base64.

    Parameters

    Returns Promise<null | string>

  • Encode image.

    Returns Promise<void>

  • Compresses ImageRef and stores it either on disk or in memory according to global settings. If uniqueId is not set or the image is already released, an exception will be thrown.

    Returns Promise<void>

  • Information about stored image as reference. If uniqueId is not set or the image is already released, an exception will be thrown.

    Returns Promise<null | ImageInfo>

  • Releases strong reference to the image. If uniqueId to the image is not set, an exception will be thrown.

    Returns void

  • Saves the stored image with the given options. If uniqueId is not set or the image is already released, an exception will be thrown.

    Parameters

    Returns Promise<boolean>

  • Converts the Image Ref to Json representation

    Parameters

    Returns Promise<null | {
        buffer: undefined | string;
        uniqueId?: string;
        clear?(): Promise<void>;
        encodeImage?(options?): Promise<null | string>;
        encodeInPlace?(): Promise<void>;
        hibernate?(): Promise<void>;
        info?(): Promise<null | ImageInfo>;
        isRetained?(): boolean;
        release?(): void;
        retain?(): void;
        saveImage?(path, options?): Promise<boolean>;
        serialize?(imageSerializationMode): Promise<({ readonly uniqueId?: string | undefined; readonly buffer?: string | undefined; serialize?: ((imageSerializationMode: ImageSerializationMode) => Promise<...>) | undefined; ... 8 more ...; retain?: (() => void) | undefined; } & {}) | null>;
    } & {}>

  • Parameters

    • serializedRef: {
          buffer: undefined | string;
          uniqueId?: string;
          clear?(): Promise<void>;
          encodeImage?(options?): Promise<null | string>;
          encodeInPlace?(): Promise<void>;
          hibernate?(): Promise<void>;
          info?(): Promise<null | ImageInfo>;
          isRetained?(): boolean;
          release?(): void;
          retain?(): void;
          saveImage?(path, options?): Promise<boolean>;
          serialize?(imageSerializationMode): Promise<null | {
              buffer: undefined | string;
              uniqueId?: string;
              clear?(): Promise<void>;
              encodeImage?(options?): Promise<null | string>;
              encodeInPlace?(): Promise<void>;
              hibernate?(): Promise<void>;
              info?(): Promise<null | ImageInfo>;
              isRetained?(): boolean;
              release?(): void;
              retain?(): void;
              saveImage?(path, options?): Promise<boolean>;
              serialize?(imageSerializationMode): Promise<({ readonly uniqueId?: string | undefined; readonly buffer?: string | undefined; serialize?: ((imageSerializationMode: ImageSerializationMode) => Promise<...>) | undefined; ... 8 more ...; retain?: (() => void) | undefined; } & {}) | null>;
          } & {}>;
      }
      • buffer: undefined | string
      • Optional Readonly uniqueId?: string
      • clear?:function
        • Releases native resources stored by the ref. If two different ImageRef objects have the same uniqueId both of them become cleared. If uniqueId is not set or the image is already released, an exception will be thrown.

          Returns Promise<void>

      • encodeImage?:function
        • Returns the stored image as base64.

          Parameters

          Returns Promise<null | string>

      • encodeInPlace?:function
        • Encode image.

          Returns Promise<void>

      • hibernate?:function
        • Compresses ImageRef and stores it either on disk or in memory according to global settings. If uniqueId is not set or the image is already released, an exception will be thrown.

          Returns Promise<void>

      • info?:function
        • Information about stored image as reference. If uniqueId is not set or the image is already released, an exception will be thrown.

          Returns Promise<null | ImageInfo>

      • isRetained?:function
        • Returns boolean

      • release?:function
        • Releases strong reference to the image. If uniqueId to the image is not set, an exception will be thrown.

          Returns void

      • retain?:function
        • Returns void

      • saveImage?:function
        • Saves the stored image with the given options. If uniqueId is not set or the image is already released, an exception will be thrown.

          Parameters

          Returns Promise<boolean>

      • serialize?:function
        • Converts the Image Ref to Json representation

          Parameters

          Returns Promise<null | {
              buffer: undefined | string;
              uniqueId?: string;
              clear?(): Promise<void>;
              encodeImage?(options?): Promise<null | string>;
              encodeInPlace?(): Promise<void>;
              hibernate?(): Promise<void>;
              info?(): Promise<null | ImageInfo>;
              isRetained?(): boolean;
              release?(): void;
              retain?(): void;
              saveImage?(path, options?): Promise<boolean>;
              serialize?(imageSerializationMode): Promise<({ readonly uniqueId?: string | undefined; readonly buffer?: string | undefined; serialize?: ((imageSerializationMode: ImageSerializationMode) => Promise<...>) | undefined; ... 8 more ...; retain?: (() => void) | undefined; } & {}) | null>;
          } & {}>

    Returns ImageRef

  • Parameters

    • source: {
          buffer: undefined | string;
          uniqueId?: string;
          clear?(): Promise<void>;
          encodeImage?(options?): Promise<null | string>;
          encodeInPlace?(): Promise<void>;
          hibernate?(): Promise<void>;
          info?(): Promise<null | ImageInfo>;
          isRetained?(): boolean;
          release?(): void;
          retain?(): void;
          saveImage?(path, options?): Promise<boolean>;
          serialize?(imageSerializationMode): Promise<null | {
              buffer: undefined | string;
              uniqueId?: string;
              clear?(): Promise<void>;
              encodeImage?(options?): Promise<null | string>;
              encodeInPlace?(): Promise<void>;
              hibernate?(): Promise<void>;
              info?(): Promise<null | ImageInfo>;
              isRetained?(): boolean;
              release?(): void;
              retain?(): void;
              saveImage?(path, options?): Promise<boolean>;
              serialize?(imageSerializationMode): Promise<({ readonly uniqueId?: string | undefined; readonly buffer?: string | undefined; serialize?: ((imageSerializationMode: ImageSerializationMode) => Promise<...>) | undefined; ... 8 more ...; retain?: (() => void) | undefined; } & {}) | null>;
          } & {}>;
      }
      • buffer: undefined | string
      • Optional Readonly uniqueId?: string
      • clear?:function
        • Releases native resources stored by the ref. If two different ImageRef objects have the same uniqueId both of them become cleared. If uniqueId is not set or the image is already released, an exception will be thrown.

          Returns Promise<void>

      • encodeImage?:function
        • Returns the stored image as base64.

          Parameters

          Returns Promise<null | string>

      • encodeInPlace?:function
        • Encode image.

          Returns Promise<void>

      • hibernate?:function
        • Compresses ImageRef and stores it either on disk or in memory according to global settings. If uniqueId is not set or the image is already released, an exception will be thrown.

          Returns Promise<void>

      • info?:function
        • Information about stored image as reference. If uniqueId is not set or the image is already released, an exception will be thrown.

          Returns Promise<null | ImageInfo>

      • isRetained?:function
        • Returns boolean

      • release?:function
        • Releases strong reference to the image. If uniqueId to the image is not set, an exception will be thrown.

          Returns void

      • retain?:function
        • Returns void

      • saveImage?:function
        • Saves the stored image with the given options. If uniqueId is not set or the image is already released, an exception will be thrown.

          Parameters

          Returns Promise<boolean>

      • serialize?:function
        • Converts the Image Ref to Json representation

          Parameters

          Returns Promise<null | {
              buffer: undefined | string;
              uniqueId?: string;
              clear?(): Promise<void>;
              encodeImage?(options?): Promise<null | string>;
              encodeInPlace?(): Promise<void>;
              hibernate?(): Promise<void>;
              info?(): Promise<null | ImageInfo>;
              isRetained?(): boolean;
              release?(): void;
              retain?(): void;
              saveImage?(path, options?): Promise<boolean>;
              serialize?(imageSerializationMode): Promise<({ readonly uniqueId?: string | undefined; readonly buffer?: string | undefined; serialize?: ((imageSerializationMode: ImageSerializationMode) => Promise<...>) | undefined; ... 8 more ...; retain?: (() => void) | undefined; } & {}) | null>;
          } & {}>

    Returns ImageRef

  • Creates ImageRef with uniqueId from base64 encoded buffer, e.g. from jpeg.

    Parameters

    Returns Promise<null | ImageRef>

  • Creates ImageRef with uniqueId from the file uri to an image.

    Parameters

    Returns Promise<null | ImageRef>

  • Returns a snapshot of all alive ImageRefs. The snapshot contains a list of ImageRefs with information such as in-memory size.

    Returns Promise<null | ImageRefPoolSnapshot>

  • Releases all alive images despite any existing references.

    Returns void