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

      ThorVG WebCanvas API - v1.1.4

      ThorVG WebCanvas - TypeScript API for ThorVG

      A high-performance TypeScript Canvas API for ThorVG, with fluent and object-oriented vector graphics rendering via WebAssembly.

      • Intuitive OOP API - Fluent interface with method chaining
      • Type-Safe - Full TypeScript support with strict typing
      • High Performance - WebGPU, WebGL, and Software rendering backends
      • Automatic Memory Management - FinalizationRegistry for garbage collection
      • Method Chaining - Ergonomic fluent API design
      • Zero Overhead - Direct WASM bindings with minimal abstraction
      • Animation Support - Frame-based Lottie animation playback
      • Rich Primitives - Shapes, scenes, pictures, text, and gradients
      import ThorVG from '@thorvg/webcanvas';

      // Initialize ThorVG with renderer
      const TVG = await ThorVG.init({
      locateFile: (path) => `/wasm/${path}`,
      renderer: 'gl'
      });

      // Create canvas and draw
      const canvas = new TVG.Canvas('#canvas', { width: 800, height: 600 });
      const shape = new TVG.Shape();
      shape.appendRect(100, 100, 200, 150)
      .fill(255, 0, 0, 255);
      canvas.add(shape).render();
      <internal>
      constants
      ThorVGResultCode
      Canvas
      Paint
      Shape
      Scene
      Picture
      Text
      Animation
      LottieAnimation
      ConicGradient
      LinearGradient
      RadialGradient
      Font
      FontsourceProvider
      Accessor
      ThorVGError
      Video
      InitOptions
      CanvasOptions
      Bounds
      Matrix
      RectOptions
      StrokeOptions
      LoadDataOptions
      PictureSize
      TextLayout
      TextOutline
      TextMetrics
      GlyphMetrics
      AnimationInfo
      AnimationSegment
      LottieMarker
      AudioInfo
      LoadFontOptions
      FontProviderResult
      FontProvider
      FontsourceOptions
      ErrorContext
      ErrorHandler
      ThorVGNamespace
      AssetResolver
      LottieSlotData
      AudioResolver
      ColorStop
      FontType
      default
      init
      RendererType → constants.RendererType
      CanvasTarget → constants.CanvasTarget
      MimeType → constants.MimeType