UNPKG

@lottiefiles/dotlottie-solid

Version:

Solid wrapper around the dotlottie-web library

28 lines (24 loc) 1.14 kB
import { Config, DotLottie } from '@lottiefiles/dotlottie-web'; export * from '@lottiefiles/dotlottie-web'; import { ComponentProps, JSX, Accessor } from 'solid-js'; type DotLottieSolidProps = Omit<Config, 'canvas'> & ComponentProps<'canvas'> & Partial<{ dotLottieRefCallback: (dotLottie: DotLottie) => void; playOnHover: boolean; themeData?: string; }>; declare const DotLottieSolid: (props: DotLottieSolidProps) => JSX.Element; type DotLottieConfig = Omit<Config, 'canvas'> & Partial<{ playOnHover: boolean; themeData?: string; }>; interface UseDotLottieReturn { DotLottieComponent: (props: ComponentProps<'canvas'>) => JSX.Element; canvas: HTMLCanvasElement | null; container: HTMLDivElement | null; dotLottie: Accessor<DotLottie | null>; setCanvasRef: (el: HTMLCanvasElement) => void; setContainerRef: (el: HTMLDivElement) => void; } declare const useDotLottie: (config: DotLottieConfig) => UseDotLottieReturn; declare const setWasmUrl: (url: string) => void; export { type DotLottieConfig, DotLottieSolid, type DotLottieSolidProps, type UseDotLottieReturn, setWasmUrl, useDotLottie };