mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 09:15:15 +02:00
Type improvements
Former-commit-id: eec4df39fc4ce81240974a32a3fe76618bb62d39
This commit is contained in:
parent
40af2205b1
commit
2b2daf2b8b
@ -67,7 +67,7 @@ export interface ItemRemoveEvent<Props extends ItemProps> {
|
|||||||
* @param labelPosition Raw value.
|
* @param labelPosition Raw value.
|
||||||
*/
|
*/
|
||||||
const parseLabelPosition = (
|
const parseLabelPosition = (
|
||||||
labelPosition: any // eslint-disable-line @typescript-eslint/no-explicit-any
|
labelPosition: unknown
|
||||||
): ItemProps["labelPosition"] => {
|
): ItemProps["labelPosition"] => {
|
||||||
switch (labelPosition) {
|
switch (labelPosition) {
|
||||||
case "up":
|
case "up":
|
||||||
|
@ -27,9 +27,7 @@ export type ClockProps = {
|
|||||||
* Extract a valid enum value from a raw unknown value.
|
* Extract a valid enum value from a raw unknown value.
|
||||||
* @param clockType Raw value.
|
* @param clockType Raw value.
|
||||||
*/
|
*/
|
||||||
const parseClockType = (
|
const parseClockType = (clockType: unknown): ClockProps["clockType"] => {
|
||||||
clockType: any // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
||||||
): ClockProps["clockType"] => {
|
|
||||||
switch (clockType) {
|
switch (clockType) {
|
||||||
case "analogic":
|
case "analogic":
|
||||||
case "digital":
|
case "digital":
|
||||||
@ -43,12 +41,9 @@ const parseClockType = (
|
|||||||
* Extract a valid enum value from a raw unknown value.
|
* Extract a valid enum value from a raw unknown value.
|
||||||
* @param clockFormat Raw value.
|
* @param clockFormat Raw value.
|
||||||
*/
|
*/
|
||||||
const parseClockFormat = (
|
const parseClockFormat = (clockFormat: unknown): ClockProps["clockFormat"] => {
|
||||||
clockFormat: any // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
||||||
): ClockProps["clockFormat"] => {
|
|
||||||
switch (clockFormat) {
|
switch (clockFormat) {
|
||||||
case "datetime":
|
case "datetime":
|
||||||
case "date":
|
|
||||||
case "time":
|
case "time":
|
||||||
return clockFormat;
|
return clockFormat;
|
||||||
default:
|
default:
|
||||||
|
@ -36,8 +36,9 @@ export type PercentileProps = {
|
|||||||
* Extract a valid enum value from a raw type value.
|
* Extract a valid enum value from a raw type value.
|
||||||
* @param type Raw value.
|
* @param type Raw value.
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
function extractPercentileType(
|
||||||
function extractPercentileType(type: any): PercentileProps["percentileType"] {
|
type: unknown
|
||||||
|
): PercentileProps["percentileType"] {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "progress-bar":
|
case "progress-bar":
|
||||||
case "bubble":
|
case "bubble":
|
||||||
@ -60,8 +61,7 @@ function extractPercentileType(type: any): PercentileProps["percentileType"] {
|
|||||||
* Extract a valid enum value from a raw value type value.
|
* Extract a valid enum value from a raw value type value.
|
||||||
* @param type Raw value.
|
* @param type Raw value.
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
function extractValueType(valueType: unknown): PercentileProps["valueType"] {
|
||||||
function extractValueType(valueType: any): PercentileProps["valueType"] {
|
|
||||||
switch (valueType) {
|
switch (valueType) {
|
||||||
case "percent":
|
case "percent":
|
||||||
case "value":
|
case "value":
|
||||||
|
@ -31,9 +31,7 @@ export type SimpleValueProps = {
|
|||||||
* Extract a valid enum value from a raw value type.
|
* Extract a valid enum value from a raw value type.
|
||||||
* @param valueType Raw value.
|
* @param valueType Raw value.
|
||||||
*/
|
*/
|
||||||
const parseValueType = (
|
const parseValueType = (valueType: unknown): SimpleValueProps["valueType"] => {
|
||||||
valueType: any // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
||||||
): SimpleValueProps["valueType"] => {
|
|
||||||
switch (valueType) {
|
switch (valueType) {
|
||||||
case "string":
|
case "string":
|
||||||
case "image":
|
case "image":
|
||||||
@ -48,7 +46,7 @@ const parseValueType = (
|
|||||||
* @param processValue Raw value.
|
* @param processValue Raw value.
|
||||||
*/
|
*/
|
||||||
const parseProcessValue = (
|
const parseProcessValue = (
|
||||||
processValue: any // eslint-disable-line @typescript-eslint/no-explicit-any
|
processValue: unknown
|
||||||
): SimpleValueProps["processValue"] => {
|
): SimpleValueProps["processValue"] => {
|
||||||
switch (processValue) {
|
switch (processValue) {
|
||||||
case "none":
|
case "none":
|
||||||
|
@ -25,7 +25,7 @@ export type StaticGraphProps = {
|
|||||||
* @param showLastValueTooltip Raw value.
|
* @param showLastValueTooltip Raw value.
|
||||||
*/
|
*/
|
||||||
const parseShowLastValueTooltip = (
|
const parseShowLastValueTooltip = (
|
||||||
showLastValueTooltip: any // eslint-disable-line @typescript-eslint/no-explicit-any
|
showLastValueTooltip: unknown
|
||||||
): StaticGraphProps["showLastValueTooltip"] => {
|
): StaticGraphProps["showLastValueTooltip"] => {
|
||||||
switch (showLastValueTooltip) {
|
switch (showLastValueTooltip) {
|
||||||
case "default":
|
case "default":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user