From b5ce0fc95aefcf7d60253588dc2d0277fa0467bb Mon Sep 17 00:00:00 2001 From: Leslie Zimmermann Date: Tue, 8 Aug 2023 09:17:35 +0200 Subject: [PATCH] refactor(types): use named exports for types --- src/Geosuggest.tsx | 7 ++++--- src/input.tsx | 3 ++- src/suggest-item.tsx | 3 ++- src/suggest-list.tsx | 3 ++- src/types/fixture.d.ts | 2 +- src/types/location.d.ts | 4 ++-- src/types/props.d.ts | 8 ++++---- src/types/suggest.d.ts | 2 +- 8 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/Geosuggest.tsx b/src/Geosuggest.tsx index 09ad7f1..417643c 100644 --- a/src/Geosuggest.tsx +++ b/src/Geosuggest.tsx @@ -9,9 +9,10 @@ import filterInputAttributes from './filter-input-attributes'; import Input from './input'; import SuggestList from './suggest-list'; -import Suggest from './types/suggest'; -import Props from './types/props'; -import Location from './types/location'; + +import {Suggest} from './types/suggest'; +import {Props} from './types/props'; +import {Location} from './types/location'; // Escapes special characters in user input for regex function escapeRegExp(str: string): string { diff --git a/src/input.tsx b/src/input.tsx index 9258791..c0c9138 100644 --- a/src/input.tsx +++ b/src/input.tsx @@ -2,7 +2,8 @@ import * as React from 'react'; import classnames from 'classnames'; import filterInputAttributes from './filter-input-attributes'; -import Suggest from './types/suggest'; + +import {Suggest} from './types/suggest'; interface Props { readonly value: string; diff --git a/src/suggest-item.tsx b/src/suggest-item.tsx index 271b8f2..5b89373 100644 --- a/src/suggest-item.tsx +++ b/src/suggest-item.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import classnames from 'classnames'; -import Suggest from './types/suggest'; + +import {Suggest} from './types/suggest'; interface Props { readonly userInput: string; diff --git a/src/suggest-list.tsx b/src/suggest-list.tsx index b6c0462..0f291ad 100644 --- a/src/suggest-list.tsx +++ b/src/suggest-list.tsx @@ -1,7 +1,8 @@ import * as React from 'react'; import classnames from 'classnames'; import SuggestItem from './suggest-item'; -import Suggest from './types/suggest'; + +import {Suggest} from './types/suggest'; interface Props { readonly isHidden: boolean; diff --git a/src/types/fixture.d.ts b/src/types/fixture.d.ts index 9a03566..c32f37c 100644 --- a/src/types/fixture.d.ts +++ b/src/types/fixture.d.ts @@ -1,7 +1,7 @@ /** * The fixture interface */ -export default interface Fixture { +export interface Fixture { readonly label: string; readonly placeId?: string; readonly location?: { diff --git a/src/types/location.d.ts b/src/types/location.d.ts index 687fd1b..693cea5 100644 --- a/src/types/location.d.ts +++ b/src/types/location.d.ts @@ -1,9 +1,9 @@ -import Suggest from './suggest'; +import {Suggest} from './suggest'; /** * The suggest interface */ -export default interface Location extends Suggest { +export interface Location extends Suggest { readonly location: { lat: number; lng: number; diff --git a/src/types/props.d.ts b/src/types/props.d.ts index 8d84b4c..f240d6a 100644 --- a/src/types/props.d.ts +++ b/src/types/props.d.ts @@ -1,11 +1,11 @@ -import Fixture from './fixture'; -import Suggest from './suggest'; -import Location from './location'; +import {Fixture} from './fixture'; +import {Suggest} from './suggest'; +import {Location} from './location'; /** * Prop Types */ -export default interface Props { +export interface Props { readonly fixtures?: Fixture[]; readonly maxFixtures?: number; readonly initialValue?: string; diff --git a/src/types/suggest.d.ts b/src/types/suggest.d.ts index 42abc2d..6f86d64 100644 --- a/src/types/suggest.d.ts +++ b/src/types/suggest.d.ts @@ -1,7 +1,7 @@ /** * The suggest interface */ -export default interface Suggest { +export interface Suggest { readonly description?: string; readonly label: string; readonly placeId: string;