diff --git a/packages/pl-fe/src/actions/bookmarks.ts b/packages/pl-fe/src/actions/bookmarks.ts index 276e1b397..49de0a058 100644 --- a/packages/pl-fe/src/actions/bookmarks.ts +++ b/packages/pl-fe/src/actions/bookmarks.ts @@ -90,7 +90,6 @@ type BookmarksAction = ReturnType | ReturnType | ReturnType - | ReturnType | ReturnType | ReturnType | ReturnType; diff --git a/packages/pl-fe/src/actions/importer/index.ts b/packages/pl-fe/src/actions/importer/index.ts index 8315825dd..3ea3632b1 100644 --- a/packages/pl-fe/src/actions/importer/index.ts +++ b/packages/pl-fe/src/actions/importer/index.ts @@ -6,9 +6,9 @@ import { normalizeGroup } from 'pl-fe/normalizers/group'; import type { Account as BaseAccount, Group, Poll, Status as BaseStatus } from 'pl-api'; import type { AppDispatch } from 'pl-fe/store'; -const STATUS_IMPORT = 'STATUS_IMPORT'; -const STATUSES_IMPORT = 'STATUSES_IMPORT'; -const POLLS_IMPORT = 'POLLS_IMPORT'; +const STATUS_IMPORT = 'STATUS_IMPORT' as const; +const STATUSES_IMPORT = 'STATUSES_IMPORT' as const; +const POLLS_IMPORT = 'POLLS_IMPORT' as const; const importAccount = (data: BaseAccount) => importAccounts([data]); @@ -153,6 +153,11 @@ const importFetchedPoll = (poll: Poll) => dispatch(importPolls([poll])); }; +type ImporterAction = + | ReturnType + | ReturnType + | ReturnType; + export { STATUS_IMPORT, STATUSES_IMPORT, @@ -169,4 +174,5 @@ export { importFetchedStatus, importFetchedStatuses, importFetchedPoll, + type ImporterAction, }; diff --git a/packages/pl-fe/src/components/fork-awesome-icon.tsx b/packages/pl-fe/src/components/fork-awesome-icon.tsx index cdceef256..f86048d73 100644 --- a/packages/pl-fe/src/components/fork-awesome-icon.tsx +++ b/packages/pl-fe/src/components/fork-awesome-icon.tsx @@ -31,4 +31,4 @@ const ForkAwesomeIcon: React.FC = ({ id, className, fixedWidth ); }; -export { type IForkAwesomeIcon, ForkAwesomeIcon as default }; +export { ForkAwesomeIcon as default }; diff --git a/packages/pl-fe/src/components/media-gallery.tsx b/packages/pl-fe/src/components/media-gallery.tsx index 03e67cf69..9a5d2d81d 100644 --- a/packages/pl-fe/src/components/media-gallery.tsx +++ b/packages/pl-fe/src/components/media-gallery.tsx @@ -563,7 +563,4 @@ const MediaGallery: React.FC = (props) => { ); }; -export { - type IMediaGallery, - MediaGallery as default, -}; +export { MediaGallery as default }; diff --git a/packages/pl-fe/src/components/ui/column.tsx b/packages/pl-fe/src/components/ui/column.tsx index 4ebc194f7..582660e88 100644 --- a/packages/pl-fe/src/components/ui/column.tsx +++ b/packages/pl-fe/src/components/ui/column.tsx @@ -120,7 +120,6 @@ const Column = React.forwardRef((props, ref): JSX.Eleme }); export { - type IColumn, Column as default, Column, ColumnHeader, diff --git a/packages/pl-fe/src/features/compose/components/schedule-form.tsx b/packages/pl-fe/src/features/compose/components/schedule-form.tsx index d52e62679..55f8ca57e 100644 --- a/packages/pl-fe/src/features/compose/components/schedule-form.tsx +++ b/packages/pl-fe/src/features/compose/components/schedule-form.tsx @@ -85,8 +85,4 @@ const ScheduleForm: React.FC = ({ composeId }) => { ); }; -export { - isCurrentOrFutureDate, - type IScheduleForm, - ScheduleForm as default, -}; +export { ScheduleForm as default, isCurrentOrFutureDate }; diff --git a/packages/pl-fe/src/features/compose/components/upload-button.tsx b/packages/pl-fe/src/features/compose/components/upload-button.tsx index 983b6b260..d8b7bcc18 100644 --- a/packages/pl-fe/src/features/compose/components/upload-button.tsx +++ b/packages/pl-fe/src/features/compose/components/upload-button.tsx @@ -88,8 +88,4 @@ const UploadButton: React.FC = ({ ); }; -export { - onlyImages, - type IUploadButton, - UploadButton as default, -}; +export { UploadButton as default, onlyImages }; diff --git a/packages/pl-fe/src/features/compose/editor/nodes/image-node.tsx b/packages/pl-fe/src/features/compose/editor/nodes/image-node.tsx index 6106c65ed..e8988542a 100644 --- a/packages/pl-fe/src/features/compose/editor/nodes/image-node.tsx +++ b/packages/pl-fe/src/features/compose/editor/nodes/image-node.tsx @@ -170,8 +170,6 @@ const $isImageNode = ( ): node is ImageNode => node instanceof ImageNode; export { - type ImagePayload, - type SerializedImageNode, ImageNode, $createImageNode, $isImageNode, diff --git a/packages/pl-fe/src/features/crypto-donate/components/lightning-address.tsx b/packages/pl-fe/src/features/crypto-donate/components/lightning-address.tsx index 2869a31af..6e785b055 100644 --- a/packages/pl-fe/src/features/crypto-donate/components/lightning-address.tsx +++ b/packages/pl-fe/src/features/crypto-donate/components/lightning-address.tsx @@ -32,7 +32,4 @@ const LightningAddress: React.FC = (props): JSX.Element => { ); }; -export { - type ILightningAddress, - LightningAddress as default, -}; +export { LightningAddress as default }; diff --git a/packages/pl-fe/src/features/emoji/data.ts b/packages/pl-fe/src/features/emoji/data.ts index 0615fd01e..a0a057e72 100644 --- a/packages/pl-fe/src/features/emoji/data.ts +++ b/packages/pl-fe/src/features/emoji/data.ts @@ -48,13 +48,8 @@ const emojiData = data as EmojiData; const { categories, emojis, aliases, sheet } = emojiData; export { - type NativeEmoji, type CustomEmoji, type Emoji, - type EmojiCategory, - type EmojiMap, - type EmojiAlias, - type EmojiSheet, type EmojiData, categories, emojis, diff --git a/packages/pl-fe/src/features/emoji/search.ts b/packages/pl-fe/src/features/emoji/search.ts index 286873ca7..c6dc249fc 100644 --- a/packages/pl-fe/src/features/emoji/search.ts +++ b/packages/pl-fe/src/features/emoji/search.ts @@ -75,8 +75,4 @@ const search = ( } }).filter(Boolean) as Emoji[]; -export { - type searchOptions, - addCustomToPool, - search as default, -}; +export { search as default, addCustomToPool }; diff --git a/packages/pl-fe/src/features/ui/components/hotkeys.tsx b/packages/pl-fe/src/features/ui/components/hotkeys.tsx index 0e87ecf31..0be57b9ae 100644 --- a/packages/pl-fe/src/features/ui/components/hotkeys.tsx +++ b/packages/pl-fe/src/features/ui/components/hotkeys.tsx @@ -11,4 +11,4 @@ const HotKeys = React.forwardRef(({ children, ...rest }, ref) )); -export { HotKeys, type HotKeysProps as IHotKeys }; +export { HotKeys }; diff --git a/packages/pl-fe/src/hooks/forms/useImageField.ts b/packages/pl-fe/src/hooks/forms/useImageField.ts index 4d25f549f..ff3e54159 100644 --- a/packages/pl-fe/src/hooks/forms/useImageField.ts +++ b/packages/pl-fe/src/hooks/forms/useImageField.ts @@ -37,4 +37,4 @@ const useImageField = (opts: UseImageFieldOpts = {}) => { }; }; -export { type UseImageFieldOpts, useImageField }; +export { useImageField }; diff --git a/packages/pl-fe/src/queries/accounts.ts b/packages/pl-fe/src/queries/accounts.ts index 4ff5fc2f0..6dbe03199 100644 --- a/packages/pl-fe/src/queries/accounts.ts +++ b/packages/pl-fe/src/queries/accounts.ts @@ -5,30 +5,6 @@ import { useAppDispatch } from 'pl-fe/hooks/useAppDispatch'; import { useClient } from 'pl-fe/hooks/useClient'; import toast from 'pl-fe/toast'; -type IAccount = { - acct: string; - avatar: string; - avatar_static: string; - bot: boolean; - created_at: string; - discoverable: boolean; - display_name: string; - followers_count: number; - following_count: number; - group: boolean; - header: string; - header_static: string; - id: string; - last_status_at: string; - location: string; - locked: boolean; - note: string; - statuses_count: number; - url: string; - username: string; - verified: boolean; -} - type UpdateCredentialsData = { accepts_chat_messages?: boolean; } @@ -58,4 +34,4 @@ const useUpdateCredentials = () => { }); }; -export { type IAccount, useUpdateCredentials }; +export { useUpdateCredentials }; diff --git a/packages/pl-fe/src/reducers/compose.ts b/packages/pl-fe/src/reducers/compose.ts index b9095c8e2..2eb64ae2b 100644 --- a/packages/pl-fe/src/reducers/compose.ts +++ b/packages/pl-fe/src/reducers/compose.ts @@ -605,7 +605,6 @@ const compose = (state = initialState, action: ComposeAction | EventsAction | In export { ReducerCompose, - type Compose, statusToMentionsArray, statusToMentionsAccountIdsArray, initialState, diff --git a/packages/pl-fe/src/reducers/contexts.ts b/packages/pl-fe/src/reducers/contexts.ts index dbebc0d22..6a6fe4d00 100644 --- a/packages/pl-fe/src/reducers/contexts.ts +++ b/packages/pl-fe/src/reducers/contexts.ts @@ -11,8 +11,9 @@ import { CONTEXT_FETCH_SUCCESS, STATUS_CREATE_REQUEST, STATUS_CREATE_SUCCESS, + type StatusesAction, } from '../actions/statuses'; -import { TIMELINE_DELETE } from '../actions/timelines'; +import { TIMELINE_DELETE, type TimelineAction } from '../actions/timelines'; import type { Status } from 'pl-api'; import type { AnyAction } from 'redux'; @@ -185,7 +186,7 @@ const deletePendingStatus = (state: State, params: Pick { +const replies = (state = ReducerRecord(), action: AnyAction | StatusesAction | TimelineAction) => { switch (action.type) { case ACCOUNT_BLOCK_SUCCESS: case ACCOUNT_MUTE_SUCCESS: diff --git a/packages/pl-fe/src/reducers/status-lists.ts b/packages/pl-fe/src/reducers/status-lists.ts index 3eaf5249a..62a253676 100644 --- a/packages/pl-fe/src/reducers/status-lists.ts +++ b/packages/pl-fe/src/reducers/status-lists.ts @@ -11,6 +11,7 @@ import { STATUS_QUOTES_FETCH_FAIL, STATUS_QUOTES_FETCH_REQUEST, STATUS_QUOTES_FETCH_SUCCESS, + type StatusQuotesAction, } from 'pl-fe/actions/status-quotes'; import { STATUS_CREATE_SUCCESS } from 'pl-fe/actions/statuses'; @@ -21,6 +22,7 @@ import { BOOKMARKED_STATUSES_EXPAND_REQUEST, BOOKMARKED_STATUSES_EXPAND_SUCCESS, BOOKMARKED_STATUSES_EXPAND_FAIL, + type BookmarksAction, } from '../actions/bookmarks'; import { RECENT_EVENTS_FETCH_REQUEST, @@ -150,7 +152,7 @@ const removeBookmarkFromLists = (state: State, status: Pick { +const statusLists = (state = initialState, action: AnyAction | BookmarksAction | FavouritesAction | InteractionsAction | PinStatusesAction | StatusQuotesAction) => { switch (action.type) { case FAVOURITED_STATUSES_FETCH_REQUEST: case FAVOURITED_STATUSES_EXPAND_REQUEST: diff --git a/packages/pl-fe/src/reducers/statuses.ts b/packages/pl-fe/src/reducers/statuses.ts index 99d30f8e5..478b9d35c 100644 --- a/packages/pl-fe/src/reducers/statuses.ts +++ b/packages/pl-fe/src/reducers/statuses.ts @@ -15,8 +15,9 @@ import { EVENT_JOIN_FAIL, EVENT_LEAVE_REQUEST, EVENT_LEAVE_FAIL, + type EventsAction, } from '../actions/events'; -import { STATUS_IMPORT, STATUSES_IMPORT } from '../actions/importer'; +import { STATUS_IMPORT, STATUSES_IMPORT, type ImporterAction } from '../actions/importer'; import { REBLOG_REQUEST, REBLOG_FAIL, @@ -28,6 +29,7 @@ import { DISLIKE_REQUEST, UNDISLIKE_REQUEST, DISLIKE_FAIL, + type InteractionsAction, } from '../actions/interactions'; import { STATUS_CREATE_REQUEST, @@ -46,8 +48,9 @@ import { STATUS_LANGUAGE_CHANGE, STATUS_COLLAPSE_SPOILER, STATUS_EXPAND_SPOILER, + type StatusesAction, } from '../actions/statuses'; -import { TIMELINE_DELETE } from '../actions/timelines'; +import { TIMELINE_DELETE, type TimelineAction } from '../actions/timelines'; import type { Status as BaseStatus, Translation } from 'pl-api'; import type { AnyAction } from 'redux'; @@ -184,7 +187,7 @@ const deleteTranslation = (state: State, statusId: string) => state.deleteIn([st const initialState: State = ImmutableMap(); -const statuses = (state = initialState, action: EmojiReactsAction | AnyAction): State => { +const statuses = (state = initialState, action: AnyAction | EmojiReactsAction | EventsAction | ImporterAction | InteractionsAction | StatusesAction | TimelineAction): State => { switch (action.type) { case STATUS_IMPORT: return importStatus(state, action.status); diff --git a/packages/pl-fe/src/reducers/user-lists.ts b/packages/pl-fe/src/reducers/user-lists.ts index 24d4bc581..422377efd 100644 --- a/packages/pl-fe/src/reducers/user-lists.ts +++ b/packages/pl-fe/src/reducers/user-lists.ts @@ -218,7 +218,6 @@ const userLists = (state = ReducerRecord(), action: DirectoryAction | AnyAction) export { ListRecord, - type List, ReactionRecord, ParticipationRequest, ReducerRecord, diff --git a/packages/pl-fe/src/selectors/index.ts b/packages/pl-fe/src/selectors/index.ts index f721cfe1b..188009c6d 100644 --- a/packages/pl-fe/src/selectors/index.ts +++ b/packages/pl-fe/src/selectors/index.ts @@ -347,7 +347,6 @@ const makeGetStatusIds = () => createSelector([ ); export { - type HostFederation, type RemoteInstance, selectAccount, selectAccounts, diff --git a/packages/pl-fe/src/types/history.ts b/packages/pl-fe/src/types/history.ts index 956be3234..3ac81bc22 100644 --- a/packages/pl-fe/src/types/history.ts +++ b/packages/pl-fe/src/types/history.ts @@ -1,9 +1,7 @@ -import { useHistory, useLocation } from 'react-router-dom'; +import { useHistory } from 'react-router-dom'; type History = ReturnType; -type Location = ReturnType; export type { History, - Location, }; diff --git a/packages/pl-fe/src/utils/config-db.ts b/packages/pl-fe/src/utils/config-db.ts index 9eda99bae..bd39fcd99 100644 --- a/packages/pl-fe/src/utils/config-db.ts +++ b/packages/pl-fe/src/utils/config-db.ts @@ -57,4 +57,4 @@ const ConfigDB = { fromSimplePolicy, }; -export { type Config, type Policy, ConfigDB as default }; +export { type Config, ConfigDB as default };