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' import type { Input as AntInput } from 'ant-design-vue'
const formulaTypes = { enum formulaTypes {
NUMERIC: 'numeric', NUMERIC = 'numeric',
STRING: 'string', STRING = 'string',
DATE: 'date', DATE = 'date',
LOGICAL: 'logical', LOGICAL = 'logical',
COND_EXP: 'conditional_expression', 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: { AVG: {
type: formulaTypes.NUMERIC, type: formulaTypes.NUMERIC,
validation: { validation: {

Loading…
Cancel
Save