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.
|
||||
*/
|
||||
const parseLabelPosition = (
|
||||
labelPosition: any // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||
labelPosition: unknown
|
||||
): ItemProps["labelPosition"] => {
|
||||
switch (labelPosition) {
|
||||
case "up":
|
||||
|
|
|
@ -27,9 +27,7 @@ export type ClockProps = {
|
|||
* Extract a valid enum value from a raw unknown value.
|
||||
* @param clockType Raw value.
|
||||
*/
|
||||
const parseClockType = (
|
||||
clockType: any // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||
): ClockProps["clockType"] => {
|
||||
const parseClockType = (clockType: unknown): ClockProps["clockType"] => {
|
||||
switch (clockType) {
|
||||
case "analogic":
|
||||
case "digital":
|
||||
|
@ -43,12 +41,9 @@ const parseClockType = (
|
|||
* Extract a valid enum value from a raw unknown value.
|
||||
* @param clockFormat Raw value.
|
||||
*/
|
||||
const parseClockFormat = (
|
||||
clockFormat: any // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||
): ClockProps["clockFormat"] => {
|
||||
const parseClockFormat = (clockFormat: unknown): ClockProps["clockFormat"] => {
|
||||
switch (clockFormat) {
|
||||
case "datetime":
|
||||
case "date":
|
||||
case "time":
|
||||
return clockFormat;
|
||||
default:
|
||||
|
|
|
@ -36,8 +36,9 @@ export type PercentileProps = {
|
|||
* Extract a valid enum value from a raw type value.
|
||||
* @param type Raw value.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function extractPercentileType(type: any): PercentileProps["percentileType"] {
|
||||
function extractPercentileType(
|
||||
type: unknown
|
||||
): PercentileProps["percentileType"] {
|
||||
switch (type) {
|
||||
case "progress-bar":
|
||||
case "bubble":
|
||||
|
@ -60,8 +61,7 @@ function extractPercentileType(type: any): PercentileProps["percentileType"] {
|
|||
* Extract a valid enum value from a raw value type value.
|
||||
* @param type Raw value.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function extractValueType(valueType: any): PercentileProps["valueType"] {
|
||||
function extractValueType(valueType: unknown): PercentileProps["valueType"] {
|
||||
switch (valueType) {
|
||||
case "percent":
|
||||
case "value":
|
||||
|
|
|
@ -31,9 +31,7 @@ export type SimpleValueProps = {
|
|||
* Extract a valid enum value from a raw value type.
|
||||
* @param valueType Raw value.
|
||||
*/
|
||||
const parseValueType = (
|
||||
valueType: any // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||
): SimpleValueProps["valueType"] => {
|
||||
const parseValueType = (valueType: unknown): SimpleValueProps["valueType"] => {
|
||||
switch (valueType) {
|
||||
case "string":
|
||||
case "image":
|
||||
|
@ -48,7 +46,7 @@ const parseValueType = (
|
|||
* @param processValue Raw value.
|
||||
*/
|
||||
const parseProcessValue = (
|
||||
processValue: any // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||
processValue: unknown
|
||||
): SimpleValueProps["processValue"] => {
|
||||
switch (processValue) {
|
||||
case "none":
|
||||
|
|
|
@ -25,7 +25,7 @@ export type StaticGraphProps = {
|
|||
* @param showLastValueTooltip Raw value.
|
||||
*/
|
||||
const parseShowLastValueTooltip = (
|
||||
showLastValueTooltip: any // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||
showLastValueTooltip: unknown
|
||||
): StaticGraphProps["showLastValueTooltip"] => {
|
||||
switch (showLastValueTooltip) {
|
||||
case "default":
|
||||
|
|
Loading…
Reference in New Issue