ThorVG WebCanvas API - v1.1.4
    Preparing search index...

    Type Alias AssetResolverBeta

    AssetResolver: (paint: Paint, src: string) => boolean

    Callback that resolves an external asset (image or font) referenced by a loaded picture, such as the assets inside a Lottie file.

    The callback is invoked synchronously during Picture.load for each external reference, so any data it needs must already be in memory — fetch and cache assets before loading, then resolve them here.

    Type Declaration

      • (paint: Paint, src: string): boolean
      • Parameters

        • paint: Paint

          The paint that needs the asset. A Picture for an image reference, or a Text for a font reference. Use instanceof to tell them apart.

        • src: string

          The asset source string exactly as authored in the file.

        Returns boolean

        true if you resolved the asset, false otherwise.