38 lines
981 B
TypeScript
38 lines
981 B
TypeScript
import { z } from "zod"
|
|
import type { visoes_pilao, z_padroes } from "./listaDeVisoes"
|
|
|
|
export const z_tipos_campos_reg_grafico = z.enum([
|
|
"tabela",
|
|
"coluna",
|
|
"texto",
|
|
"lista_colunas",
|
|
"lista_filtros",
|
|
"ordem",
|
|
"booleana",
|
|
])
|
|
|
|
export type tipo_estrutura_visao_grafico<T extends keyof typeof visoes_pilao> =
|
|
{
|
|
/** Nome da Visão */
|
|
visao: T
|
|
/** Rotulo */
|
|
rotulo: string
|
|
/** Retorna a tabela Referente ao Registro */
|
|
tabela: (
|
|
_: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>,
|
|
) => string
|
|
/** Descrição */
|
|
descricao: (
|
|
_: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>,
|
|
) => string
|
|
/** Lista os campos e suas configurações */
|
|
campos: {
|
|
[c in keyof Required<
|
|
z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>
|
|
>]: {
|
|
rotulo: string
|
|
tipo_campo: z.infer<typeof z_tipos_campos_reg_grafico>
|
|
order: number
|
|
}
|
|
}
|
|
}
|