refactor[EditNodeModal]: Remove any types

This commit is contained in:
Igor Carvalho 2023-07-24 13:20:29 -03:00
commit 4fc636cb9b
3 changed files with 10 additions and 10 deletions

View file

@ -78,7 +78,7 @@ export default function EditNodeModal({
}
}
function changeAdvanced(node) {
function changeAdvanced(node: editNodeToggleType): void {
Object.keys(data.node.template).map((n, i) => {
if (n === node.name) {
data.node.template[n].advanced = !data.node.template[n].advanced;
@ -88,8 +88,7 @@ export default function EditNodeModal({
setNodeValue(!nodeValue);
}
const handleOnNewValue = (newValue, name) => {
console.log({ newValue, name })
const handleOnNewValue = (newValue: string | string[] | boolean, name: string): void => {
data.node.template[name].value = newValue;
// Set state to pending
setTabsState((prev) => {
@ -183,6 +182,7 @@ export default function EditNodeModal({
: data.node.template[n].value
}
onChange={(t: string[]) => {
console.log(t)
handleOnNewValue(t, n);
}}
/>

View file

@ -466,13 +466,13 @@ export type chatInputType = {
};
export type editNodeToggleType = {
advanced: boolean;
info: string;
advanced?: boolean;
info?: string;
list: boolean;
multiline: boolean;
name: string;
password: boolean;
placeholder: string;
multiline?: boolean;
name?: string;
password?: boolean;
placeholder?: string;
required: boolean;
show: boolean;
type: string;

View file

@ -15,7 +15,7 @@
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"noImplicitAny": false
"noImplicitAny": true
},
"include": ["src"]
}