UNPKG

@lottiefiles/dotlottie-solid

Version:

Solid wrapper around the dotlottie-web library

30 lines (29 loc) 1.22 kB
import { Accessor, ComponentProps, JSX } from "solid-js"; import { Config, DotLottie } from "@lottiefiles/dotlottie-web"; export * from "@lottiefiles/dotlottie-web"; //#region src/dotlottie.d.ts type DotLottieSolidProps = Omit<Config, 'canvas'> & ComponentProps<'canvas'> & Partial<{ dotLottieRefCallback: (dotLottie: DotLottie) => void; playOnHover: boolean; themeData?: string; }>; declare const DotLottieSolid: (props: DotLottieSolidProps) => JSX.Element; //#endregion //#region src/use-dotlottie.d.ts 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; //#endregion export { DotLottieConfig, DotLottieSolid, DotLottieSolidProps, UseDotLottieReturn, setWasmUrl, useDotLottie }; //# sourceMappingURL=index.d.ts.map