From 2821452307fe0a7ff3ad30441a3a954d0117aebd Mon Sep 17 00:00:00 2001 From: s3xysteak Date: Thu, 9 May 2024 11:27:19 +0800 Subject: [PATCH] fix(composables): type fix . `useMeasure` could receive a undefined `options` param. --- src/composables/useMeasure/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/composables/useMeasure/index.ts b/src/composables/useMeasure/index.ts index 9e88ffe..fb80572 100644 --- a/src/composables/useMeasure/index.ts +++ b/src/composables/useMeasure/index.ts @@ -6,10 +6,10 @@ type UseMeasureType = 'area' | 'distance' | 'height' type UseMeasureOptions = AreaOptions | DistanceOptions | HeightOptions type UseMeasureReturns = AreaReturn | DistanceReturn | HeightReturn -export function useMeasure(type: 'area', options: AreaOptions): AreaReturn -export function useMeasure(type: 'distance', options: DistanceOptions): DistanceReturn -export function useMeasure(type: 'height', options: HeightOptions): HeightReturn -export function useMeasure(type: UseMeasureType, options: UseMeasureOptions): UseMeasureReturns { +export function useMeasure(type: 'area', options?: AreaOptions): AreaReturn +export function useMeasure(type: 'distance', options?: DistanceOptions): DistanceReturn +export function useMeasure(type: 'height', options?: HeightOptions): HeightReturn +export function useMeasure(type: UseMeasureType, options?: UseMeasureOptions): UseMeasureReturns { const typeMap = { area, distance,