import _ from 'lodash' import React from 'react' window.lodash = _.noConflict() import { Switch } from "@headlessui/react"; declare global { interface Props {} interface Window { wp:any, lodash:any } interface Math { round:(x: number) => number } } const CustomToggle:React.FC<{ title:string,attrname:string,attrval:boolean,width?:string,className?:string,style?:any,setAttributes:any }> = props => { const {title,attrname,attrval,width="6",className="",style={},setAttributes=()=>{}} = props; let w = Math.round((parseInt(width)/12)*100)+'%' return (