Use import type whenever possible

This commit is contained in:
DrMint 2024-07-13 13:05:20 +02:00
parent 04ce83b083
commit a5ca1ee9f2
8 changed files with 558 additions and 542 deletions

View File

@ -1,4 +1,4 @@
import { TrackRequestParams } from "./types"; import type { TrackRequestParams } from "./types";
type AnalyticsBody = Record<string, unknown> & { type AnalyticsBody = Record<string, unknown> & {
type: "event" | "request"; type: "event" | "request";

View File

@ -1,4 +1,4 @@
import { MeiliDocument, SearchRequest, SearchResponse } from "./types"; import type { MeiliDocument, SearchRequest, SearchResponse } from "./types";
export class MeilisearchSDK { export class MeilisearchSDK {
constructor( constructor(

View File

@ -1,5 +1,4 @@
import { Collections } from "../payload/constants"; import type {
import {
EndpointCollectible, EndpointCollectible,
EndpointPage, EndpointPage,
EndpointFolder, EndpointFolder,
@ -9,7 +8,8 @@ import {
EndpointFile, EndpointFile,
EndpointRecorder, EndpointRecorder,
EndpointChronologyEvent, EndpointChronologyEvent,
} from "../payload/endpoint-types"; } from "payload/endpoint-types";
import { Collections } from "../payload/constants";
export type MeiliDocument = { export type MeiliDocument = {
meilid: string; meilid: string;

View File

@ -1,4 +1,4 @@
import { RichTextContent } from "./rich-text"; import type { RichTextContent } from "./rich-text";
export interface TranscriptBlock extends GenericBlock { export interface TranscriptBlock extends GenericBlock {
lines: (LineBlock | CueBlock)[]; lines: (LineBlock | CueBlock)[];

View File

@ -1,5 +1,11 @@
import { AttributeTypes, CollectibleBindingTypes, CollectibleNature, CollectiblePageOrders, Collections } from "./constants"; import type {
import { RichTextContent } from "./rich-text"; Collections,
AttributeTypes,
CollectibleNature,
CollectibleBindingTypes,
CollectiblePageOrders,
} from "./constants";
import type { RichTextContent } from "./rich-text";
export interface EndpointCurrency { export interface EndpointCurrency {
id: string; id: string;
@ -207,7 +213,10 @@ export type EndpointFolderPreview = {
}; };
}; };
export type EndpointCollectible = Omit<EndpointCollectiblePreview, "translations"> & { export type EndpointCollectible = Omit<
EndpointCollectiblePreview,
"translations"
> & {
translations: (EndpointCollectiblePreview["translations"][number] & { translations: (EndpointCollectiblePreview["translations"][number] & {
description?: RichTextContent; description?: RichTextContent;
})[]; })[];
@ -408,7 +417,12 @@ export type EndpointFolderPreview = {
export type EndpointSourcePreview = { export type EndpointSourcePreview = {
id: string; id: string;
slug: string; slug: string;
translations: { language: string; pretitle?: string; title: string; subtitle?: string }[]; translations: {
language: string;
pretitle?: string;
title: string;
subtitle?: string;
}[];
}; };
export type EndpointSource = export type EndpointSource =
@ -419,7 +433,10 @@ export type EndpointFolderPreview = {
range?: range?:
| { type: "page"; page: number } | { type: "page"; page: number }
| { type: "timestamp"; timestamp: string } | { type: "timestamp"; timestamp: string }
| { type: "custom"; translations: { language: string; note: string }[] }; | {
type: "custom";
translations: { language: string; note: string }[];
};
} }
| { type: "page"; page: EndpointSourcePreview } | { type: "page"; page: EndpointSourcePreview }
| { type: "folder"; folder: EndpointSourcePreview } | { type: "folder"; folder: EndpointSourcePreview }
@ -547,4 +564,3 @@ export type EndpointFolderPreview = {
recorders: { ids: string[] }; recorders: { ids: string[] };
chronologyEvents: { ids: string[] }; chronologyEvents: { ids: string[] };
}; };

View File

@ -1,17 +1,17 @@
import { Collections } from "./constants";
import { import {
EndpointAudioPreview, type GenericBlock,
EndpointImagePreview, type SectionBlock,
EndpointVideoPreview, type TranscriptBlock,
} from "./endpoint-types"; type BreakBlock,
import {
GenericBlock,
SectionBlock,
TranscriptBlock,
BreakBlock,
isBlockTranscriptBlock, isBlockTranscriptBlock,
isBlockBreakBlock, isBlockBreakBlock,
} from "./blocks"; } from "./blocks";
import { Collections } from "./constants";
import type {
EndpointImagePreview,
EndpointVideoPreview,
EndpointAudioPreview,
} from "./endpoint-types";
export type RichTextContent = { export type RichTextContent = {
root: { root: {

View File

@ -1,24 +1,24 @@
import { Collections } from "./constants"; import { Collections } from "./constants";
import { import type {
EndpointAllIds, EndpointWebsiteConfig,
EndpointAllSDKUrls, EndpointFolder,
EndpointAudio, EndpointLanguage,
EndpointChronologyEvent, EndpointCurrency,
EndpointWording,
EndpointPage,
EndpointCollectible, EndpointCollectible,
EndpointCollectibleScans,
EndpointCollectibleScanPage,
EndpointCollectibleGallery, EndpointCollectibleGallery,
EndpointCollectibleGalleryImage, EndpointCollectibleGalleryImage,
EndpointCollectibleScanPage, EndpointChronologyEvent,
EndpointCollectibleScans,
EndpointCurrency,
EndpointFile,
EndpointFolder,
EndpointImage, EndpointImage,
EndpointLanguage, EndpointAudio,
EndpointPage,
EndpointRecorder,
EndpointVideo, EndpointVideo,
EndpointWebsiteConfig, EndpointFile,
EndpointWording, EndpointRecorder,
EndpointAllSDKUrls,
EndpointAllIds,
} from "./endpoint-types"; } from "./endpoint-types";
export const getSDKEndpoint = { export const getSDKEndpoint = {

View File

@ -1,4 +1,4 @@
import { Collections } from "./constants"; import type { Collections } from "./constants";
export type AfterOperationWebHookMessage = { export type AfterOperationWebHookMessage = {
collection: Collections; collection: Collections;