diff --git a/index.d.ts b/index.d.ts index 17d7f89..0371085 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,4 @@ -import { FC, CSSProperties } from "react"; +import { FC, ForwardedRef, CSSProperties } from "react"; type State = { width?: number; @@ -47,6 +47,7 @@ declare const Canvas: FC<{ frames: ImageData[]; width?: number; height?: number; + ref?: ForwardedRef; fit?: "cover" | "contain" | "fill"; className?: string; style?: CSSProperties; diff --git a/test-d/index.tsx b/test-d/index.tsx index 80c87d7..0d3666a 100644 --- a/test-d/index.tsx +++ b/test-d/index.tsx @@ -94,5 +94,16 @@ expectError(usePlayback(pstate, update)); expectType(); +const ref = React.createRef(); +expectType(); +expectType( + { + expectType(ref); + }} + /> +); + useWorkerParser("str", update); useParser("str", update);