Skip to content

Commit

Permalink
update turnstile-types
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-clemente committed Sep 24, 2024
1 parent 08b37e9 commit 8d8f602
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"devDependencies": {
"@types/react": "^18.0.21",
"prettier": "^2.7.1",
"turnstile-types": "^1.2.2",
"turnstile-types": "^1.2.3",
"typescript": "^4.8.4"
}
}
14 changes: 4 additions & 10 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ export default function Turnstile({
},
"error-callback": (error?: any) =>
inplaceState.onError?.(error, boundTurnstileObject),
"expired-callback": () => inplaceState.onExpire?.(boundTurnstileObject),
"expired-callback": (token: string) =>
inplaceState.onExpire?.(token, boundTurnstileObject),
"timeout-callback": () =>
inplaceState.onTimeout?.(boundTurnstileObject),
"after-interactive-callback": () =>
Expand Down Expand Up @@ -201,14 +202,7 @@ export default function Turnstile({
onUnsupported,
]);

return (
<div
ref={ref}
id={id}
className={className}
style={style}
/>
);
return <div ref={ref} id={id} className={className} style={style} />;
}

export interface TurnstileProps extends TurnstileCallbacks {
Expand Down Expand Up @@ -245,7 +239,7 @@ export interface TurnstileCallbacks {
error?: Error | any,
boundTurnstile?: BoundTurnstileObject
) => void;
onExpire?: (boundTurnstile: BoundTurnstileObject) => void;
onExpire?: (token: string, boundTurnstile: BoundTurnstileObject) => void;
onTimeout?: (boundTurnstile: BoundTurnstileObject) => void;
onAfterInteractive?: (boundTurnstile: BoundTurnstileObject) => void;
onBeforeInteractive?: (boundTurnstile: BoundTurnstileObject) => void;
Expand Down

0 comments on commit 8d8f602

Please sign in to comment.