File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
types/cloudflare-turnstile Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ const refreshTimeoutNever: Turnstile.RefreshTimeoutMode = "never";
3535const refreshTimeoutManual : Turnstile . RefreshTimeoutMode = "manual" ;
3636const refreshTimeoutAuto : Turnstile . RefreshTimeoutMode = "auto" ;
3737
38+ const executionRender : Turnstile . ExecutionMode = "render" ;
39+ const executionExecute : Turnstile . ExecutionMode = "execute" ;
40+
3841// @ts -expect-error
3942turnstile . ready ( ) ;
4043// $ExpectType void
Original file line number Diff line number Diff line change @@ -87,6 +87,14 @@ declare namespace Turnstile {
8787 */
8888 type RefreshTimeoutMode = "never" | "manual" | "auto" ;
8989
90+ /**
91+ * The execution mode to controls when to obtain the widget token
92+ * The default is "render". "render" will make the challenge runs automatically after calling the render() function, while
93+ * "execute" will make the challenge runs after the render() function has been called, by invoking the turnstile.execute function separately.
94+ * This detaches the appearance and rendering of a widget from its execution.
95+ */
96+ type ExecutionMode = "render" | "execute" ;
97+
9098 /**
9199 * Parameters for the turnstile.render() method.
92100 */
@@ -219,5 +227,12 @@ declare namespace Turnstile {
219227 * @default "auto"
220228 */
221229 "refresh-timeout" ?: RefreshTimeoutMode | undefined ;
230+
231+ /**
232+ * Optional
233+ * @see ExecutionMode
234+ * @default "render"
235+ */
236+ execution ?: ExecutionMode | undefined ;
222237 }
223238}
You can’t perform that action at this time.
0 commit comments