Browse Source

refactor: add proper typing

pull/7268/head
Pranav C 11 months ago
parent
commit
e8a316a9cd
  1. 30
      packages/nc-gui/utils/formulaUtils.ts

30
packages/nc-gui/utils/formulaUtils.ts

@ -1,14 +1,30 @@
import type { Input as AntInput } from 'ant-design-vue'
const formulaTypes = {
NUMERIC: 'numeric',
STRING: 'string',
DATE: 'date',
LOGICAL: 'logical',
COND_EXP: 'conditional_expression',
enum formulaTypes {
NUMERIC = 'numeric',
STRING = 'string',
DATE = 'date',
LOGICAL = 'logical',
COND_EXP = 'conditional_expression',
}
const formulas: Record<string, any> = {
interface FormulaMeta {
type?: string
validation?: {
args?: {
min?: number
max?: number
rqd?: number
}
}
description?: string
syntax?: string
examples?: string[]
returnType?: ((args: any[]) => formulaTypes) | formulaTypes
}
const formulas: Record<string, FormulaMeta> = {
AVG: {
type: formulaTypes.NUMERIC,
validation: {

Loading…
Cancel
Save