Skip to content

Commit

Permalink
simplify exports
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Aug 15, 2024
1 parent 88fc21f commit c7170a0
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 289 deletions.
55 changes: 8 additions & 47 deletions src/api/endpoints/index.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,8 @@
import getReadAuthFactorEndpoints, {
type ListAuthFactorsArg,
type ListAuthFactorsResult,
AUTH_FACTOR_TAG,
} from "./authFactor"
import getReadClassEndpoints, {
type ListClassesArg,
type ListClassesResult,
type RetrieveClassArg,
type RetrieveClassResult,
CLASS_TAG,
} from "./klass"
import getReadSchoolEndpoints, {
type RetrieveSchoolArg,
type RetrieveSchoolResult,
SCHOOL_TAG,
} from "./school"
import getReadUserEndpoints, {
type ListUsersArg,
type ListUsersResult,
type RetrieveUserArg,
type RetrieveUserResult,
USER_TAG,
} from "./user"

export {
AUTH_FACTOR_TAG,
CLASS_TAG,
getReadAuthFactorEndpoints,
getReadClassEndpoints,
getReadSchoolEndpoints,
getReadUserEndpoints,
SCHOOL_TAG,
USER_TAG,
type ListAuthFactorsArg,
type ListAuthFactorsResult,
type ListClassesArg,
type ListClassesResult,
type ListUsersArg,
type ListUsersResult,
type RetrieveClassArg,
type RetrieveClassResult,
type RetrieveSchoolArg,
type RetrieveSchoolResult,
type RetrieveUserArg,
type RetrieveUserResult,
}
export * from "./authFactor"
export { default as getReadAuthFactorEndpoints } from "./authFactor"
export * from "./klass"
export { default as getReadClassEndpoints } from "./klass"
export * from "./school"
export { default as getReadSchoolEndpoints } from "./school"
export * from "./user"
export { default as getReadUserEndpoints } from "./user"
51 changes: 4 additions & 47 deletions src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,4 @@
import createApi from "./createApi"
import type {
AdminSchoolTeacher,
AdminSchoolTeacherUser,
AuthFactor,
Class,
IndependentUser,
NonAdminSchoolTeacher,
NonAdminSchoolTeacherUser,
NonSchoolTeacher,
NonSchoolTeacherUser,
OtpBypassToken,
School,
SchoolTeacher,
SchoolTeacherUser,
Student,
StudentUser,
Teacher,
TeacherUser,
User,
} from "./models"
import tagTypes from "./tagTypes"
import urls from "./urls"

export {
createApi,
tagTypes,
urls,
type AdminSchoolTeacher,
type AdminSchoolTeacherUser,
type AuthFactor,
type Class,
type IndependentUser,
type NonAdminSchoolTeacher,
type NonAdminSchoolTeacherUser,
type NonSchoolTeacher,
type NonSchoolTeacherUser,
type OtpBypassToken,
type School,
type SchoolTeacher,
type SchoolTeacherUser,
type Student,
type StudentUser,
type Teacher,
type TeacherUser,
type User,
}
export { default as createApi } from "./createApi"
export * from "./models"
export { default as tagTypes } from "./tagTypes"
export { default as urls } from "./urls"
78 changes: 28 additions & 50 deletions src/components/form/index.tsx
Original file line number Diff line number Diff line change
@@ -1,50 +1,28 @@
import ApiAutocompleteField, {
type ApiAutocompleteFieldProps,
} from "./ApiAutocompleteField"
import AutocompleteField, {
type AutocompleteFieldProps,
} from "./AutocompleteField"
import CheckboxField, { type CheckboxFieldProps } from "./CheckboxField"
import CountryField, { type CountryFieldProps } from "./CountryField"
import DatePickerField, { type DatePickerFieldProps } from "./DatePickerField"
import EmailField, { type EmailFieldProps } from "./EmailField"
import FirstNameField, { type FirstNameFieldProps } from "./FirstNameField"
import Form, { type FormErrors, type FormProps } from "./Form"
import OtpField, { type OtpFieldProps } from "./OtpField"
import PasswordField, { type PasswordFieldProps } from "./PasswordField"
import RepeatField, { type RepeatFieldProps } from "./RepeatField"
import SubmitButton, { type SubmitButtonProps } from "./SubmitButton"
import TextField, { type TextFieldProps } from "./TextField"
import UkCountyField, { type UkCountyFieldProps } from "./UkCountyField"

export {
ApiAutocompleteField,
AutocompleteField,
CheckboxField,
CountryField,
DatePickerField,
EmailField,
FirstNameField,
Form,
OtpField,
PasswordField,
RepeatField,
SubmitButton,
TextField,
UkCountyField,
type ApiAutocompleteFieldProps,
type AutocompleteFieldProps,
type CheckboxFieldProps,
type CountryFieldProps,
type DatePickerFieldProps,
type EmailFieldProps,
type FirstNameFieldProps,
type FormErrors,
type FormProps,
type OtpFieldProps,
type PasswordFieldProps,
type RepeatFieldProps,
type SubmitButtonProps,
type TextFieldProps,
type UkCountyFieldProps,
}
export * from "./ApiAutocompleteField"
export { default as ApiAutocompleteField } from "./ApiAutocompleteField"
export * from "./AutocompleteField"
export { default as AutocompleteField } from "./AutocompleteField"
export * from "./CheckboxField"
export { default as CheckboxField } from "./CheckboxField"
export * from "./CountryField"
export { default as CountryField } from "./CountryField"
export * from "./DatePickerField"
export { default as DatePickerField } from "./DatePickerField"
export * from "./EmailField"
export { default as EmailField } from "./EmailField"
export * from "./FirstNameField"
export { default as FirstNameField } from "./FirstNameField"
export * from "./Form"
export { default as Form } from "./Form"
export * from "./OtpField"
export { default as OtpField } from "./OtpField"
export * from "./PasswordField"
export { default as PasswordField } from "./PasswordField"
export * from "./RepeatField"
export { default as RepeatField } from "./RepeatField"
export * from "./SubmitButton"
export { default as SubmitButton } from "./SubmitButton"
export * from "./TextField"
export { default as TextField } from "./TextField"
export * from "./UkCountyField"
export { default as UkCountyField } from "./UkCountyField"
65 changes: 24 additions & 41 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,24 @@
import App, { type AppProps } from "./App"
import ClickableTooltip, {
type ClickableTooltipProps,
} from "./ClickableTooltip"
import CopyIconButton, { type CopyIconButtonProps } from "./CopyIconButton"
import Countdown, { type CountdownProps } from "./Countdown"
import ElevatedAppBar, { type ElevatedAppBarProps } from "./ElevatedAppBar"
import Image, { type ImageProps } from "./Image"
import ItemizedList, { type ItemizedListProps } from "./ItemizedList"
import OrderedGrid, { type OrderedGridProps } from "./OrderedGrid"
import ScrollRoutes, { type ScrollRoutesProps } from "./ScrollRoutes"
import SyncError, { type SyncErrorProps } from "./SyncError"
import TablePagination, { type TablePaginationProps } from "./TablePagination"
import YouTubeVideo, { type YouTubeVideoProps } from "./YouTubeVideo"

export {
App,
ClickableTooltip,
CopyIconButton,
Countdown,
ElevatedAppBar,
Image,
ItemizedList,
OrderedGrid,
ScrollRoutes,
SyncError,
TablePagination,
YouTubeVideo,
type AppProps,
type ClickableTooltipProps,
type CopyIconButtonProps,
type CountdownProps,
type ElevatedAppBarProps,
type ImageProps,
type ItemizedListProps,
type OrderedGridProps,
type ScrollRoutesProps,
type SyncErrorProps,
type TablePaginationProps,
type YouTubeVideoProps,
}
export * from "./App"
export { default as App } from "./App"
export * from "./ClickableTooltip"
export { default as ClickableTooltip } from "./ClickableTooltip"
export * from "./CopyIconButton"
export { default as CopyIconButton } from "./CopyIconButton"
export * from "./Countdown"
export { default as Countdown } from "./Countdown"
export * from "./ElevatedAppBar"
export { default as ElevatedAppBar } from "./ElevatedAppBar"
export * from "./Image"
export { default as Image } from "./Image"
export * from "./ItemizedList"
export { default as ItemizedList } from "./ItemizedList"
export * from "./OrderedGrid"
export { default as OrderedGrid } from "./OrderedGrid"
export * from "./ScrollRoutes"
export { default as ScrollRoutes } from "./ScrollRoutes"
export * from "./SyncError"
export { default as SyncError } from "./SyncError"
export * from "./TablePagination"
export { default as TablePagination } from "./TablePagination"
export * from "./YouTubeVideo"
export { default as YouTubeVideo } from "./YouTubeVideo"
29 changes: 10 additions & 19 deletions src/components/page/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
import Banner, { type BannerProps } from "./Banner"
import Notification, { type NotificationProps } from "./Notification"
import Page, { type PageProps, type PageState } from "./Page"
import Section, { type SectionProps } from "./Section"
import TabBar, { type TabBarProps } from "./TabBar"

export {
Banner,
Notification,
Page,
Section,
TabBar,
type BannerProps,
type NotificationProps,
type PageProps,
type PageState,
type SectionProps,
type TabBarProps,
}
export * from "./Banner"
export { default as Banner } from "./Banner"
export * from "./Notification"
export { default as Notification } from "./Notification"
export * from "./Page"
export { default as Page } from "./Page"
export * from "./Section"
export { default as Section } from "./Section"
export * from "./TabBar"
export { default as TabBar } from "./TabBar"
28 changes: 10 additions & 18 deletions src/components/router/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import Link, { type LinkProps } from "./Link"
import LinkButton, { type LinkButtonProps } from "./LinkButton"
import LinkIconButton, { type LinkIconButtonProps } from "./LinkIconButton"
import LinkListItem, { type LinkListItemProps } from "./LinkListItem"
import LinkTab, { type LinkTabProps } from "./LinkTab"

export {
Link,
LinkButton,
LinkIconButton,
LinkListItem,
LinkTab,
type LinkButtonProps,
type LinkIconButtonProps,
type LinkListItemProps,
type LinkProps,
type LinkTabProps,
}
export * from "./Link"
export { default as Link } from "./Link"
export * from "./LinkButton"
export { default as LinkButton } from "./LinkButton"
export * from "./LinkIconButton"
export { default as LinkIconButton } from "./LinkIconButton"
export * from "./LinkListItem"
export { default as LinkListItem } from "./LinkListItem"
export * from "./LinkTab"
export { default as LinkTab } from "./LinkTab"
15 changes: 4 additions & 11 deletions src/features/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import InactiveDialog, { type InactiveDialogProps } from "./InactiveDialog"
import ScreenTimeDialog, {
type ScreenTimeDialogProps,
} from "./ScreenTimeDialog"

export {
InactiveDialog,
type InactiveDialogProps,
ScreenTimeDialog,
type ScreenTimeDialogProps,
}
export * from "./InactiveDialog"
export { default as InactiveDialog } from "./InactiveDialog"
export * from "./ScreenTimeDialog"
export { default as ScreenTimeDialog } from "./ScreenTimeDialog"
44 changes: 4 additions & 40 deletions src/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,4 @@
import {
usePagination,
useQueryManager,
type Pagination,
type SetPagination,
type UsePaginationOptions,
type UseQueryManagerOptions,
} from "./api"
import {
useSession,
useSessionMetadata,
type SessionMetadata,
type UseSessionChildren,
type UseSessionChildrenFunction,
type UseSessionOptions,
} from "./auth"
import { useCountdown, useEventListener, useExternalScript } from "./general"
import { useLocation, useNavigate, useParams, useSearchParams } from "./router"

export {
useCountdown,
useEventListener,
useExternalScript,
useLocation,
useNavigate,
usePagination,
useParams,
useQueryManager,
useSearchParams,
useSession,
useSessionMetadata,
type Pagination,
type SessionMetadata,
type SetPagination,
type UsePaginationOptions,
type UseQueryManagerOptions,
type UseSessionChildren,
type UseSessionChildrenFunction,
type UseSessionOptions,
}
export * from "./api"
export * from "./auth"
export * from "./general"
export * from "./router"
10 changes: 2 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
import theme, { themeOptions, type PropsColorOverrides } from "./theme"

export {
// imports from './theme'
theme,
themeOptions,
type PropsColorOverrides,
}
export * from "./them"
export { default as theme } from "./theme"
Loading

0 comments on commit c7170a0

Please sign in to comment.