Add import type whenever possible

This commit is contained in:
Alejandro Celaya
2023-02-18 10:40:37 +01:00
parent 7add854b40
commit 2a5480da79
317 changed files with 955 additions and 807 deletions

View File

@@ -1,5 +1,5 @@
import { isInvalidArgumentError } from './utils';
import { ProblemDetailsError } from './types/errors';
import type { ProblemDetailsError } from './types/errors';
export interface ShlinkApiErrorProps {
errorData?: ProblemDetailsError;

View File

@@ -1,7 +1,7 @@
import { isEmpty, isNil, reject } from 'ramda';
import { ShortUrl, ShortUrlData } from '../../short-urls/data';
import { OptionalString } from '../../utils/utils';
import {
import type { ShortUrl, ShortUrlData } from '../../short-urls/data';
import type { OptionalString } from '../../utils/utils';
import type {
ShlinkHealth,
ShlinkMercureInfo,
ShlinkShortUrlsResponse,
@@ -20,7 +20,7 @@ import {
import { orderToString } from '../../utils/helpers/ordering';
import { isRegularNotFound, parseApiError } from '../utils';
import { stringifyQuery } from '../../utils/helpers/query';
import { HttpClient } from '../../common/services/HttpClient';
import type { HttpClient } from '../../common/services/HttpClient';
const buildShlinkBaseUrl = (url: string, version: 2 | 3) => `${url}/rest/v${version}`;
const rejectNilProps = reject(isNil);

View File

@@ -1,7 +1,8 @@
import { hasServerData, ServerWithId } from '../../servers/data';
import { GetState } from '../../container/types';
import type { ServerWithId } from '../../servers/data';
import { hasServerData } from '../../servers/data';
import type { GetState } from '../../container/types';
import { ShlinkApiClient } from './ShlinkApiClient';
import { HttpClient } from '../../common/services/HttpClient';
import type { HttpClient } from '../../common/services/HttpClient';
const apiClients: Record<string, ShlinkApiClient> = {};

View File

@@ -1,4 +1,4 @@
import Bottle from 'bottlejs';
import type Bottle from 'bottlejs';
import { buildShlinkApiClient } from './ShlinkApiClientBuilder';
const provideServices = (bottle: Bottle) => {

View File

@@ -1,7 +1,7 @@
import { Visit } from '../../visits/types';
import { OptionalString } from '../../utils/utils';
import { ShortUrl, ShortUrlMeta } from '../../short-urls/data';
import { Order } from '../../utils/helpers/ordering';
import type { Visit } from '../../visits/types';
import type { OptionalString } from '../../utils/utils';
import type { ShortUrl, ShortUrlMeta } from '../../short-urls/data';
import type { Order } from '../../utils/helpers/ordering';
export interface ShlinkShortUrlsResponse {
data: ShortUrl[];

View File

@@ -1,10 +1,11 @@
import {
ErrorTypeV2,
ErrorTypeV3,
import type {
InvalidArgumentError,
InvalidShortUrlDeletion,
ProblemDetailsError,
RegularNotFound,
RegularNotFound } from '../types/errors';
import {
ErrorTypeV2,
ErrorTypeV3,
} from '../types/errors';
const isProblemDetails = (e: unknown): e is ProblemDetailsError =>