remove surplus | 'radius's

This commit is contained in:
Kurt Hutten Irev-Dev
2024-09-10 13:23:21 +10:00
parent 04e82bf728
commit 9fafc90c57
4 changed files with 10 additions and 14 deletions

View File

@ -40,7 +40,6 @@ test.describe('Testing segment overlays', () => {
| 'horizontal' | 'horizontal'
| 'vertical' | 'vertical'
| 'tangentialWithPrevious' | 'tangentialWithPrevious'
| 'radius'
| LineInputsType | LineInputsType
expectBeforeUnconstrained: string expectBeforeUnconstrained: string
expectAfterUnconstrained: string expectAfterUnconstrained: string
@ -122,7 +121,6 @@ test.describe('Testing segment overlays', () => {
| 'horizontal' | 'horizontal'
| 'vertical' | 'vertical'
| 'tangentialWithPrevious' | 'tangentialWithPrevious'
| 'radius'
| LineInputsType | LineInputsType
expectBeforeUnconstrained: string expectBeforeUnconstrained: string
expectAfterUnconstrained: string expectAfterUnconstrained: string

View File

@ -34,7 +34,6 @@ import { CustomIcon, CustomIconName } from 'components/CustomIcon'
import { ConstrainInfo } from 'lang/std/stdTypes' import { ConstrainInfo } from 'lang/std/stdTypes'
import { getConstraintInfo } from 'lang/std/sketch' import { getConstraintInfo } from 'lang/std/sketch'
import { Dialog, Popover, Transition } from '@headlessui/react' import { Dialog, Popover, Transition } from '@headlessui/react'
import { LineInputsType } from 'lang/std/sketchcombos'
import toast from 'react-hot-toast' import toast from 'react-hot-toast'
import { InstanceProps, create } from 'react-modal-promise' import { InstanceProps, create } from 'react-modal-promise'
import { executeAst } from 'lang/langHelpers' import { executeAst } from 'lang/langHelpers'
@ -547,12 +546,10 @@ const ConstraintSymbol = ({
iconName: 'dimension', iconName: 'dimension',
}, },
} }
const varName = const varName = _type in varNameMap ? varNameMap[_type].varName : 'var'
_type in varNameMap ? varNameMap[_type as LineInputsType].varName : 'var' const name: CustomIconName = varNameMap[_type].iconName
const name: CustomIconName = varNameMap[_type as LineInputsType].iconName const displayName = varNameMap[_type]?.displayName
const displayName = varNameMap[_type as LineInputsType]?.displayName const implicitDesc = varNameMap[_type]?.implicitConstraintDesc
const implicitDesc =
varNameMap[_type as LineInputsType]?.implicitConstraintDesc
const _node = useMemo( const _node = useMemo(
() => getNodeFromPath<Expr>(kclManager.ast, pathToNode), () => getNodeFromPath<Expr>(kclManager.ast, pathToNode),

View File

@ -59,6 +59,7 @@ export type LineInputsType =
| 'length' | 'length'
| 'intersectionOffset' | 'intersectionOffset'
| 'intersectionTag' | 'intersectionTag'
| 'radius'
export type ConstraintType = export type ConstraintType =
| 'equalLength' | 'equalLength'

View File

@ -82,19 +82,19 @@ export type VarValueKeys =
| 'center' | 'center'
export interface SingleValueInput<T> { export interface SingleValueInput<T> {
type: 'singleValue' type: 'singleValue'
argType: LineInputsType | 'radius' argType: LineInputsType
expr: T expr: T
} }
export interface ArrayItemInput<T> { export interface ArrayItemInput<T> {
type: 'arrayItem' type: 'arrayItem'
index: 0 | 1 index: 0 | 1
argType: LineInputsType | 'radius' argType: LineInputsType
expr: T expr: T
} }
export interface ObjectPropertyInput<T> { export interface ObjectPropertyInput<T> {
type: 'objectProperty' type: 'objectProperty'
key: VarValueKeys key: VarValueKeys
argType: LineInputsType | 'radius' argType: LineInputsType
expr: T expr: T
} }
@ -102,14 +102,14 @@ interface ArrayOrObjItemInput<T> {
type: 'arrayOrObjItem' type: 'arrayOrObjItem'
key: VarValueKeys key: VarValueKeys
index: 0 | 1 index: 0 | 1
argType: LineInputsType | 'radius' argType: LineInputsType
expr: T expr: T
} }
interface ArrayInObject<T> { interface ArrayInObject<T> {
type: 'arrayInObject' type: 'arrayInObject'
key: VarValueKeys key: VarValueKeys
argType: LineInputsType | 'radius' argType: LineInputsType
index: 0 | 1 index: 0 | 1
expr: T expr: T
} }