2
0

New QR code block (#1142)

This commit is contained in:
Dinesh Kashikar
2024-01-11 12:39:58 +05:30
committed by GitHub
parent 9b5b277b5b
commit 799c694522
11 changed files with 240 additions and 11 deletions

View File

@ -1,3 +1,4 @@
import { ZodRawShape } from 'zod'
import { AuthDefinition, BlockDefinition, ActionDefinition } from './types'
import { z } from './zod'
@ -18,8 +19,8 @@ export const createBlock = <
export const createAction = <
A extends AuthDefinition,
BaseOptions extends z.ZodObject<any>,
O extends z.ZodObject<any>
BaseOptions extends z.ZodObject<ZodRawShape> = z.ZodObject<{}>,
O extends z.ZodObject<ZodRawShape> = z.ZodObject<{}>
>(
actionDefinition: {
auth?: A

View File

@ -1,5 +1,6 @@
import { SVGProps } from 'react'
import { z } from './zod'
import { ZodRawShape } from 'zod'
export type VariableStore = {
get: (variableId: string) => string | (string | null)[] | null | undefined
@ -28,8 +29,8 @@ export type ReadOnlyVariableStore = Omit<VariableStore, 'set'>
export type ActionDefinition<
A extends AuthDefinition,
BaseOptions extends z.ZodObject<any>,
Options extends z.ZodObject<any> = z.ZodObject<{}>
BaseOptions extends z.ZodObject<ZodRawShape> = z.ZodObject<{}>,
Options extends z.ZodObject<ZodRawShape> = z.ZodObject<{}>
> = {
name: string
fetchers?: FetcherDefinition<A, z.infer<BaseOptions> & z.infer<Options>>[]