From 9d7fe9d5c5335f8a202a3fa1617b607974a392c9 Mon Sep 17 00:00:00 2001 From: ysandler Date: Wed, 22 Jun 2022 21:41:33 -0500 Subject: [PATCH] style: filterType now dynamic from const --- src/types/noduleTypes.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/types/noduleTypes.ts b/src/types/noduleTypes.ts index 697133d..b2c13b5 100644 --- a/src/types/noduleTypes.ts +++ b/src/types/noduleTypes.ts @@ -1,3 +1,4 @@ +import filterTypes from "../constants/filterTypes" import Table from "../entities/Table" import { tableRow } from "./tableTypes" @@ -8,7 +9,9 @@ type noduleConstructorProps = { tables?: Table[] } -type filterType = 'EQUAL' | 'GREATER' | 'GREATEREQUAL' | 'LESSER' | 'LESSEREQUAL' +type filterKeys = keyof typeof filterTypes +type filterValues = typeof filterTypes[filterKeys] +type filterType = filterValues type filterParams = Record type filterNoduleConstructionProps = noduleConstructorProps & {filterType: filterType} & {filterParams: filterParams}