Skip to content
This repository has been archived by the owner on Nov 23, 2022. It is now read-only.

Commit

Permalink
Make type imports more explicit
Browse files Browse the repository at this point in the history
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
  • Loading branch information
mrdrogdrog committed Oct 17, 2021
1 parent 6628046 commit def3cc7
Show file tree
Hide file tree
Showing 54 changed files with 71 additions and 71 deletions.
2 changes: 1 addition & 1 deletion src/api/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { Config } from './types'
import type { Config } from './types'

export const getConfig = async (): Promise<Config> => {
const response = await fetch(getApiUrl() + 'config', {
Expand Down
2 changes: 1 addition & 1 deletion src/api/history/dto-methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { HistoryEntry, HistoryEntryOrigin } from '../../redux/history/types'
import { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types'
import type { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types'

export const historyEntryDtoToHistoryEntry = (entryDto: HistoryEntryDto): HistoryEntry => {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/api/history/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types'
import type { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types'

export const getHistory = async (): Promise<HistoryEntryDto[]> => {
const response = await fetch(getApiUrl() + 'me/history')
Expand Down
2 changes: 1 addition & 1 deletion src/api/me/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { UserResponse } from '../users/types'
import type { UserResponse } from '../users/types'
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { isMockMode } from '../../utils/test-modes'

Expand Down
2 changes: 1 addition & 1 deletion src/api/notes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { NoteDto } from './types'
import type { NoteDto } from './types'
import { isMockMode } from '../../utils/test-modes'

export const getNote = async (noteId: string): Promise<NoteDto> => {
Expand Down
2 changes: 1 addition & 1 deletion src/api/revisions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { Cache } from '../../components/common/cache/cache'
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { Revision, RevisionListEntry } from './types'
import type { Revision, RevisionListEntry } from './types'

const revisionCache = new Cache<string, Revision>(3600)

Expand Down
2 changes: 1 addition & 1 deletion src/api/tokens/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { AccessToken, AccessTokenSecret } from './types'
import type { AccessToken, AccessTokenSecret } from './types'

export const getAccessTokenList = async (): Promise<AccessToken[]> => {
const response = await fetch(`${getApiUrl()}tokens`, {
Expand Down
2 changes: 1 addition & 1 deletion src/api/users/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { Cache } from '../../components/common/cache/cache'
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { UserResponse } from './types'
import type { UserResponse } from './types'

const cache = new Cache<string, UserResponse>(600)

Expand Down
2 changes: 1 addition & 1 deletion src/components/common/fork-awesome/fork-awesome-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import React from 'react'
import { IconName, IconSize } from './types'
import type { IconName, IconSize } from './types'

export interface ForkAwesomeIconProps {
icon: IconName
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/icon-button/icon-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react'
import { Button, ButtonProps } from 'react-bootstrap'
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
import { IconName } from '../fork-awesome/types'
import type { IconName } from '../fork-awesome/types'
import { ShowIf } from '../show-if/show-if'
import './icon-button.scss'

Expand Down
4 changes: 2 additions & 2 deletions src/components/common/links/external-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import React from 'react'
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
import { IconName } from '../fork-awesome/types'
import type { IconName } from '../fork-awesome/types'
import { ShowIf } from '../show-if/show-if'
import { LinkWithTextProps } from './types'
import type { LinkWithTextProps } from './types'

export const ExternalLink: React.FC<LinkWithTextProps> = ({
href,
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/links/internal-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import React from 'react'
import { Link } from 'react-router-dom'
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
import { IconName } from '../fork-awesome/types'
import type { IconName } from '../fork-awesome/types'
import { ShowIf } from '../show-if/show-if'
import { LinkWithTextProps } from './types'
import type { LinkWithTextProps } from './types'

export const InternalLink: React.FC<LinkWithTextProps> = ({
href,
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/links/translated-external-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react'
import { useTranslation } from 'react-i18next'
import { ExternalLink } from './external-link'
import { TranslatedLinkProps } from './types'
import type { TranslatedLinkProps } from './types'

export const TranslatedExternalLink: React.FC<TranslatedLinkProps> = ({ i18nKey, i18nOption, ...props }) => {
const { t } = useTranslation()
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/links/translated-internal-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react'
import { useTranslation } from 'react-i18next'
import { InternalLink } from './internal-link'
import { TranslatedLinkProps } from './types'
import type { TranslatedLinkProps } from './types'

export const TranslatedInternalLink: React.FC<TranslatedLinkProps> = ({ i18nKey, i18nOption, ...props }) => {
const { t } = useTranslation()
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/links/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { StringMap, TOptionsBase } from 'i18next'
import { IconName } from '../fork-awesome/fork-awesome-icon'
import type { IconName } from '../fork-awesome/fork-awesome-icon'

interface GeneralLinkProp {
href: string
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/modals/common-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React from 'react'
import { Modal } from 'react-bootstrap'
import { Trans, useTranslation } from 'react-i18next'
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
import { IconName } from '../fork-awesome/types'
import type { IconName } from '../fork-awesome/types'
import { ShowIf } from '../show-if/show-if'

export interface CommonModalProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Redirect } from 'react-router'
import { useParams } from 'react-router-dom'
import { getNote } from '../../../api/notes'
import { NotFoundErrorScreen } from './not-found-error-screen'
import { NoteDto } from '../../../api/notes/types'
import type { NoteDto } from '../../../api/notes/types'

interface RouteParameters {
id: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import React from 'react'
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
import { IconName } from '../../../common/fork-awesome/types'
import type { IconName } from '../../../common/fork-awesome/types'

export interface DocumentInfoLineProps {
icon: IconName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { DateTime } from 'luxon'
import React from 'react'
import { Trans, useTranslation } from 'react-i18next'
import { IconName } from '../../../common/fork-awesome/types'
import type { IconName } from '../../../common/fork-awesome/types'
import { UserAvatar } from '../../../common/user-avatar/user-avatar'
import { DocumentInfoLine } from './document-info-line'
import { TimeFromNow } from './time-from-now'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { DateTime } from 'luxon'
import React from 'react'
import { ListGroup } from 'react-bootstrap'
import { Trans } from 'react-i18next'
import { RevisionListEntry } from '../../../../api/revisions/types'
import { UserResponse } from '../../../../api/users/types'
import type { RevisionListEntry } from '../../../../api/revisions/types'
import type { UserResponse } from '../../../../api/users/types'
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
import { UserAvatar } from '../../../common/user-avatar/user-avatar'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import ReactDiffViewer, { DiffMethod } from 'react-diff-viewer'
import { Trans, useTranslation } from 'react-i18next'
import { useParams } from 'react-router'
import { getAllRevisions, getRevision } from '../../../../api/revisions'
import { Revision, RevisionListEntry } from '../../../../api/revisions/types'
import { UserResponse } from '../../../../api/users/types'
import type { Revision, RevisionListEntry } from '../../../../api/revisions/types'
import type { UserResponse } from '../../../../api/users/types'
import { useIsDarkModeActivated } from '../../../../hooks/common/use-is-dark-mode-activated'
import { useNoteMarkdownContent } from '../../../../hooks/common/use-note-markdown-content'
import { CommonModal } from '../../../common/modals/common-modal'
Expand Down
4 changes: 2 additions & 2 deletions src/components/editor-page/document-bar/revisions/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { Revision } from '../../../../api/revisions/types'
import type { Revision } from '../../../../api/revisions/types'
import { getUserById } from '../../../../api/users'
import { UserResponse } from '../../../../api/users/types'
import type { UserResponse } from '../../../../api/users/types'
import { download } from '../../../common/download/download'
import { Logger } from '../../../../utils/logger'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { Editor, Hint, Hints, Pos } from 'codemirror'
import Database from 'emoji-picker-element/database'
import { Emoji, EmojiClickEventDetail, NativeEmoji } from 'emoji-picker-element/shared'
import type { Emoji, EmojiClickEventDetail, NativeEmoji } from 'emoji-picker-element/shared'
import { emojiPickerConfig } from '../tool-bar/emoji-picker/emoji-picker'
import { getEmojiIcon, getEmojiShortCode } from '../tool-bar/utils/emojiUtils'
import { findWordAtCursor, Hinter } from './index'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { Picker } from 'emoji-picker-element'
import { CustomEmoji, EmojiClickEvent, EmojiClickEventDetail } from 'emoji-picker-element/shared'
import type { CustomEmoji, EmojiClickEvent, EmojiClickEventDetail } from 'emoji-picker-element/shared'
import React, { useEffect, useRef } from 'react'
import { useClickAway } from 'react-use'
import { useIsDarkModeActivated } from '../../../../../hooks/common/use-is-dark-mode-activated'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { EmojiClickEventDetail, NativeEmoji } from 'emoji-picker-element/shared'
import type { EmojiClickEventDetail, NativeEmoji } from 'emoji-picker-element/shared'

export const getEmojiIcon = (emoji: EmojiClickEventDetail): string => {
if (emoji.unicode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { Editor } from 'codemirror'
import { EmojiClickEventDetail } from 'emoji-picker-element/shared'
import type { EmojiClickEventDetail } from 'emoji-picker-element/shared'
import { createNumberRangeArray } from '../../../../common/number-range/number-range'
import { getEmojiShortCode } from './emojiUtils'

Expand Down
4 changes: 2 additions & 2 deletions src/components/editor-page/sidebar/sidebar-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import React from 'react'
import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
import { IconName } from '../../common/fork-awesome/types'
import type { IconName } from '../../common/fork-awesome/types'
import { ShowIf } from '../../common/show-if/show-if'
import { SidebarEntryProps } from './types'
import type { SidebarEntryProps } from './types'

export type SidebarEntryVariant = 'primary'

Expand Down
2 changes: 1 addition & 1 deletion src/components/editor-page/sidebar/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { RefObject } from 'react'
import { IconName } from '../../common/fork-awesome/types'
import type { IconName } from '../../common/fork-awesome/types'
import { SidebarEntryVariant } from './sidebar-button'

export interface SpecificSidebarEntryProps {
Expand Down
2 changes: 1 addition & 1 deletion src/components/editor-page/synced-scroll/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { LineMarkerPosition } from '../../markdown-renderer/types'
import type { LineMarkerPosition } from '../../markdown-renderer/types'

export const findLineMarks = (
lineMarks: LineMarkerPosition[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React, { Fragment, useState } from 'react'
import { Dropdown } from 'react-bootstrap'
import { Trans, useTranslation } from 'react-i18next'
import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
import { IconName } from '../../common/fork-awesome/types'
import type { IconName } from '../../common/fork-awesome/types'
import { DeletionModal } from '../../common/modals/deletion-modal'

export interface DropdownItemWithDeletionModalProps {
Expand Down
2 changes: 1 addition & 1 deletion src/components/history-page/sort-button/sort-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import React from 'react'
import { ButtonProps } from 'react-bootstrap'
import { IconName } from '../../common/fork-awesome/types'
import type { IconName } from '../../common/fork-awesome/types'
import { IconButton } from '../../common/icon-button/icon-button'

export enum SortModeEnum {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Modal, Row } from 'react-bootstrap'
import { VersionInfoModalColumn } from './version-info-modal-column'
import frontendVersion from '../../../../version.json'
import links from '../../../../links.json'
import { BackendVersion } from '../../../../api/config/types'
import type { BackendVersion } from '../../../../api/config/types'
import { useApplicationState } from '../../../../hooks/common/use-application-state'

export const VersionInfoModal: React.FC<CommonModalProps> = ({ onHide, show }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import React from 'react'
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
import { IconName } from '../../../common/fork-awesome/types'
import type { IconName } from '../../../common/fork-awesome/types'
import './social-link-button.scss'

export interface SocialButtonProps {
Expand Down
2 changes: 1 addition & 1 deletion src/components/login-page/auth/via-one-click.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import React from 'react'
import { useApplicationState } from '../../../hooks/common/use-application-state'
import { IconName } from '../../common/fork-awesome/types'
import type { IconName } from '../../common/fork-awesome/types'
import { SocialLinkButton } from './social-link-button/social-link-button'

export enum OneClickType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React, { useMemo, useRef } from 'react'
import { DocumentLengthLimitReachedAlert } from './document-length-limit-reached-alert'
import { useConvertMarkdownToReactDom } from './hooks/use-convert-markdown-to-react-dom'
import './markdown-renderer.scss'
import { LineMarkerPosition } from './types'
import type { LineMarkerPosition } from './types'
import { useComponentReplacers } from './hooks/use-component-replacers'
import { useTranslation } from 'react-i18next'
import { LineMarkers } from './replace-components/linemarker/line-number-marker'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import MarkdownIt from 'markdown-it/lib'
import { useMemo, useRef } from 'react'
import { ComponentReplacer, ValidReactDomElement } from '../replace-components/ComponentReplacer'
import { LineKeys } from '../types'
import type { LineKeys } from '../types'
import { buildTransformer } from '../utils/html-react-transformer'
import { calculateNewLineNumberMapping } from '../utils/line-number-mapping'
import convertHtmlToReact from '@hedgedoc/html-to-react'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import MarkdownIt from 'markdown-it/lib'
import Token from 'markdown-it/lib/token'
import { IconName } from '../../common/fork-awesome/types'
import type { IconName } from '../../common/fork-awesome/types'

export const quoteExtra: (quoteLabel: string, icon: IconName) => MarkdownIt.PluginSimple =
(quoteLabel: string, icon: IconName) => (md) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import React, { useEffect, useState } from 'react'
import { Trans } from 'react-i18next'
import { IconName } from '../../../common/fork-awesome/types'
import type { IconName } from '../../../common/fork-awesome/types'
import { ShowIf } from '../../../common/show-if/show-if'
import './one-click-embedding.scss'
import { ProxyImageFrame } from '../image/proxy-image-frame'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import equal from 'fast-deep-equal'
import { RefObject, useCallback, useEffect, useRef } from 'react'
import useResizeObserver from 'use-resize-observer'
import { LineMarkerPosition } from '../types'
import type { LineMarkerPosition } from '../types'
import { LineMarkers } from '../replace-components/linemarker/line-number-marker'

export const calculateLineMarkerPositions = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
SubNodeTransform,
ValidReactDomElement
} from '../replace-components/ComponentReplacer'
import { LineKeys } from '../types'
import type { LineKeys } from '../types'
import { NodeToReactElementTransformer } from '@hedgedoc/html-to-react/dist/NodeToReactElementTransformer'

export interface TextDifferenceResult {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { diffArrays } from 'diff'
import { TextDifferenceResult } from './html-react-transformer'
import { LineKeys } from '../types'
import type { LineKeys } from '../types'

export const calculateNewLineNumberMapping = (
newMarkdownLines: string[],
Expand Down
4 changes: 2 additions & 2 deletions src/components/notifications/ui-notification-toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import React, { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'
import { Button, ProgressBar, Toast } from 'react-bootstrap'
import { UiNotification } from '../../redux/ui-notifications/types'
import type { UiNotification } from '../../redux/ui-notifications/types'
import { ForkAwesomeIcon } from '../common/fork-awesome/fork-awesome-icon'
import { ShowIf } from '../common/show-if/show-if'
import { IconName } from '../common/fork-awesome/types'
import type { IconName } from '../common/fork-awesome/types'
import { dismissUiNotification } from '../../redux/ui-notifications/methods'
import { Trans, useTranslation } from 'react-i18next'
import { Logger } from '../../utils/logger'
Expand Down

0 comments on commit def3cc7

Please sign in to comment.