Import types consistently from @uppy/core (#5589)

* Import types consistently from @uppy/core

* Add new eslint rule

* Clean up exports
This commit is contained in:
Merlijn Vos 2025-01-09 11:03:43 +01:00 committed by GitHub
parent 817ce721c0
commit 6e65cd8c51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
85 changed files with 293 additions and 208 deletions

View file

@ -441,6 +441,10 @@ module.exports = {
}, {
selector: 'ImportDeclaration[source.value=/^@uppy\\x2Futils\\x2Flib\\x2F.+\\.[mc]?[jt]sx?$/]',
message: 'Do not use file extension when importing from @uppy/utils',
},
{
selector: 'ImportDeclaration[source.value=/^@uppy\\x2F[a-z-0-9]+\\x2Fsrc\\x2F/]',
message: 'Importing from "src/" is not allowed. Import from root or from "lib/" if you must.',
}],
'import/extensions': ['error', 'ignorePackages'],
'import/prefer-default-export': 'off',

View file

@ -1,12 +1,13 @@
import { h } from 'preact'
import { UIPlugin, type UIPluginOptions } from '@uppy/core'
import { UIPlugin } from '@uppy/core'
import type {
Uppy,
UIPluginOptions,
Body,
Meta,
MinimalRequiredUppyFile,
} from '@uppy/utils/lib/UppyFile'
import type { Uppy } from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import getFileTypeExtension from '@uppy/utils/lib/getFileTypeExtension'
import supportsMediaRecorder from './supportsMediaRecorder.js'

View file

@ -1,4 +1,4 @@
import type { Meta, Body, UppyFile } from '@uppy/utils/lib/UppyFile'
import type { Meta, Body, UppyFile } from '@uppy/core'
import type {
RateLimitedQueue,
WrapPromiseFunctionType,

View file

@ -1,11 +1,12 @@
import BasePlugin, {
import {
type DefinePluginOpts,
type PluginOpts,
} from '@uppy/core/lib/BasePlugin.js'
Uppy,
BasePlugin,
} from '@uppy/core'
import { RequestClient } from '@uppy/companion-client'
import type { RequestOptions } from '@uppy/utils/lib/CompanionClientProvider'
import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile'
import type { Uppy } from '@uppy/core'
import EventManager from '@uppy/core/lib/EventManager.js'
import { RateLimitedQueue } from '@uppy/utils/lib/RateLimitedQueue'
import {

View file

@ -8,12 +8,14 @@ import { UIPlugin, Uppy } from '@uppy/core'
import { ProviderViews } from '@uppy/provider-views'
import { h, type ComponentChild } from 'preact'
import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
import type {
UppyFile,
Body,
Meta,
AsyncStore,
UnknownProviderPlugin,
UnknownProviderPluginState,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import locale from './locale.js'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json

View file

@ -1,5 +1,4 @@
import type { UIPluginOptions } from '@uppy/core'
import type { AsyncStore } from '@uppy/core/lib/Uppy.js'
import type { UIPluginOptions, AsyncStore } from '@uppy/core'
export interface CompanionPluginOptions extends UIPluginOptions {
storage?: AsyncStore

View file

@ -1,11 +1,14 @@
import type { Uppy } from '@uppy/core'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { PluginOpts } from '@uppy/core/lib/BasePlugin.js'
import type {
Uppy,
Body,
Meta,
PluginOpts,
UnknownProviderPlugin,
} from '@uppy/core'
import type {
RequestOptions,
CompanionClientProvider,
} from '@uppy/utils/lib/CompanionClientProvider'
import type { UnknownProviderPlugin } from '@uppy/core/lib/Uppy.js'
import RequestClient, { authErrorStatusCode } from './RequestClient.js'
import type { CompanionPluginOptions } from './index.js'
import { isOriginAllowed } from './getAllowedHosts.js'

View file

@ -1,5 +1,4 @@
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { Uppy } from '@uppy/core'
import type { Body, Meta, Uppy } from '@uppy/core'
import type { CompanionClientSearchProvider } from '@uppy/utils/lib/CompanionClientProvider'
import RequestClient, { type Opts } from './RequestClient.js'

View file

@ -7,7 +7,7 @@ import prettierBytes from '@transloadit/prettier-bytes'
import CompressorJS from 'compressorjs'
import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile'
import type { DefinePluginOpts, PluginOpts } from '@uppy/core/lib/BasePlugin.js'
import type { DefinePluginOpts, PluginOpts } from '@uppy/core'
import locale from './locale.js'

View file

@ -6,7 +6,7 @@ import assert from 'node:assert'
import fs from 'node:fs'
import path from 'node:path'
import prettierBytes from '@transloadit/prettier-bytes'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { Body, Meta } from '@uppy/core'
import type { Locale } from '@uppy/utils/lib/Translator'
import Core from './index.js'
import UIPlugin from './UIPlugin.js'

View file

@ -1,13 +1,22 @@
export { default } from './Uppy.js'
export {
default as Uppy,
type State,
type UnknownPlugin,
type UnknownProviderPlugin,
type UnknownSearchProviderPlugin,
type UploadResult,
type UppyEventMap,
type UppyOptions,
export { default, default as Uppy } from './Uppy.js'
export type {
State,
BaseProviderPlugin,
PartialTree,
PartialTreeFile,
PartialTreeFolder,
PartialTreeFolderNode,
PartialTreeFolderRoot,
PartialTreeId,
UnknownPlugin,
UnknownProviderPlugin,
UnknownProviderPluginState,
UnknownSearchProviderPlugin,
UnknownSearchProviderPluginState,
UploadResult,
UppyEventMap,
UppyOptions,
AsyncStore,
} from './Uppy.js'
export { default as UIPlugin } from './UIPlugin.js'
@ -20,4 +29,9 @@ export { debugLogger } from './loggers.js'
export type { Store } from '@uppy/store-default'
export type { UppyFile, Meta, Body } from '@uppy/utils/lib/UppyFile'
export type {
UppyFile,
MinimalRequiredUppyFile,
Meta,
Body,
} from '@uppy/utils/lib/UppyFile'

View file

@ -1,14 +1,16 @@
import {
UIPlugin,
type UIPluginOptions,
type UnknownPlugin,
type Uppy,
type UploadResult,
type State,
} from '@uppy/core'
import type { ComponentChild, VNode } from 'preact'
import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js'
import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile'
import { UIPlugin } from '@uppy/core'
import type {
Body,
Meta,
UppyFile,
UIPluginOptions,
UnknownPlugin,
Uppy,
UploadResult,
State,
DefinePluginOpts,
} from '@uppy/core'
import StatusBar from '@uppy/status-bar'
import Informer from '@uppy/informer'
import ThumbnailGenerator from '@uppy/thumbnail-generator'

View file

@ -2,8 +2,15 @@
import { h } from 'preact'
import classNames from 'classnames'
import isDragDropSupported from '@uppy/utils/lib/isDragDropSupported'
import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile'
import type { State, UIPlugin, UIPluginOptions, Uppy } from '@uppy/core'
import type {
Body,
Meta,
UppyFile,
State,
UIPlugin,
UIPluginOptions,
Uppy,
} from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import type Translator from '@uppy/utils/lib/Translator'
import type { TargetedEvent } from 'preact/compat'

View file

@ -1,5 +1,5 @@
import { h } from 'preact'
import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile'
import type { Body, Meta, UppyFile } from '@uppy/core'
import type Uppy from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import copyToClipboard from '../../../utils/copyToClipboard.js'

View file

@ -1,8 +1,7 @@
/* eslint-disable react/no-unused-prop-types */
/* eslint-disable react/destructuring-assignment */
import type { State, Uppy, UppyFile } from '@uppy/core'
import type { Body, Meta, State, Uppy, UppyFile } from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import { h, type ComponentChild } from 'preact'
interface Props<M extends Meta, B extends Body> {

View file

@ -2,10 +2,9 @@
import { h, Component, type ComponentChild } from 'preact'
import classNames from 'classnames'
import { shallowEqualObjects } from 'shallow-equal'
import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { UppyFile, Body, Meta, State } from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import type Uppy from '@uppy/core'
import type { State } from '@uppy/core'
import FilePreviewAndLink from './FilePreviewAndLink/index.jsx'
import FileProgress from './FileProgress/index.jsx'
import FileInfo from './FileInfo/index.jsx'

View file

@ -3,9 +3,8 @@ import { useMemo } from 'preact/hooks'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore untyped
import VirtualList from '@uppy/utils/lib/VirtualList'
import type { UppyFile, Uppy, State } from '@uppy/core'
import type { UppyFile, Uppy, State, Body, Meta } from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import FileItem from './FileItem/index.jsx'
import type { DashboardState } from '../Dashboard.js'

View file

@ -1,4 +1,4 @@
import type { UppyFile } from '@uppy/utils/lib/UppyFile'
import type { UppyFile } from '@uppy/core'
import { h } from 'preact'
type $TSFixMe = any

View file

@ -1,7 +1,11 @@
import { UIPlugin, type Uppy } from '@uppy/core'
import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js'
import type { UIPluginOptions } from '@uppy/core/lib/UIPlugin.js'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import { UIPlugin } from '@uppy/core'
import type {
UIPluginOptions,
Uppy,
DefinePluginOpts,
Body,
Meta,
} from '@uppy/core'
import type { TargetedEvent } from 'preact/compat'
import toArray from '@uppy/utils/lib/toArray'
import isDragDropSupported from '@uppy/utils/lib/isDragDropSupported'

View file

@ -1,7 +1,5 @@
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { Uppy } from '@uppy/core/lib/Uppy.js'
import type { DefinePluginOpts, PluginOpts } from '@uppy/core/lib/BasePlugin.js'
import BasePlugin from '@uppy/core/lib/BasePlugin.js'
import type { Uppy, Body, Meta, DefinePluginOpts, PluginOpts } from '@uppy/core'
import { BasePlugin } from '@uppy/core'
import getDroppedFiles from '@uppy/utils/lib/getDroppedFiles'
import toArray from '@uppy/utils/lib/toArray'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment

View file

@ -8,12 +8,14 @@ import { UIPlugin, Uppy } from '@uppy/core'
import { ProviderViews } from '@uppy/provider-views'
import { h, type ComponentChild } from 'preact'
import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
import type {
UppyFile,
Body,
Meta,
AsyncStore,
UnknownProviderPlugin,
UnknownProviderPluginState,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import locale from './locale.js'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json

View file

@ -8,12 +8,14 @@ import { UIPlugin, Uppy } from '@uppy/core'
import { ProviderViews } from '@uppy/provider-views'
import { h, type ComponentChild } from 'preact'
import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
import type {
UppyFile,
Body,
Meta,
AsyncStore,
UnknownProviderPlugin,
UnknownProviderPluginState,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import locale from './locale.js'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json

View file

@ -1,9 +1,14 @@
import { h, type ComponentChild } from 'preact'
import { UIPlugin, Uppy, type UIPluginOptions } from '@uppy/core'
import { UIPlugin } from '@uppy/core'
import type {
Uppy,
UIPluginOptions,
Body,
Meta,
DefinePluginOpts,
} from '@uppy/core'
import toArray from '@uppy/utils/lib/toArray'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js'
import type { TargetedEvent } from 'preact/compat'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json

View file

@ -1,4 +1,12 @@
import BasePlugin, { type DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js'
import { BasePlugin } from '@uppy/core'
import type {
DefinePluginOpts,
UIPluginOptions,
Uppy,
UppyEventMap,
Body,
Meta,
} from '@uppy/core'
import findDOMElement from '@uppy/utils/lib/findDOMElement'
import toArray from '@uppy/utils/lib/toArray'
@ -6,8 +14,6 @@ import toArray from '@uppy/utils/lib/toArray'
// @ts-ignore untyped
import getFormData from 'get-form-data'
import type { UIPluginOptions, Uppy, UppyEventMap } from '@uppy/core'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json
import packageJson from '../package.json'

View file

@ -1,5 +1,4 @@
import type { State as UppyState } from '@uppy/core'
import type { Meta, Body } from '@uppy/utils/lib/UppyFile'
import type { State as UppyState, Meta, Body } from '@uppy/core'
export type StoredState<M extends Meta, B extends Body> = {
expires: number

View file

@ -1,9 +1,14 @@
import throttle from 'lodash/throttle.js'
import BasePlugin from '@uppy/core/lib/BasePlugin.js'
import type { PluginOpts, DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js'
import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile'
import type Uppy from '@uppy/core'
import type { UploadResult } from '@uppy/core'
import { BasePlugin } from '@uppy/core'
import type {
Body,
Meta,
UppyFile,
Uppy,
UploadResult,
PluginOpts,
DefinePluginOpts,
} from '@uppy/core'
import ServiceWorkerStore, {
type ServiceWorkerStoredFile,
} from './ServiceWorkerStore.js'

View file

@ -9,8 +9,7 @@ import {
} from '@uppy/companion-client'
import type { PickedItem } from '@uppy/provider-views/lib/GooglePicker/googlePicker.js'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { AsyncStore, BaseProviderPlugin } from '@uppy/core/lib/Uppy.js'
import type { Body, Meta, AsyncStore, BaseProviderPlugin } from '@uppy/core'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json

View file

@ -1,9 +1,10 @@
import type {
PartialTreeFile,
PartialTreeFolderNode,
} from '@uppy/core/lib/Uppy.js'
Body,
Meta,
} from '@uppy/core'
import { ProviderViews } from '@uppy/provider-views'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
export default class DriveProviderViews<
M extends Meta,

View file

@ -8,12 +8,14 @@ import { UIPlugin, Uppy } from '@uppy/core'
import { ProviderViews } from '@uppy/provider-views'
import { h, type ComponentChild } from 'preact'
import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
import type {
UppyFile,
Body,
Meta,
AsyncStore,
UnknownProviderPlugin,
UnknownProviderPluginState,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import DriveProviderViews from './DriveProviderViews.js'
import locale from './locale.js'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment

View file

@ -9,8 +9,7 @@ import {
} from '@uppy/companion-client'
import type { PickedItem } from '@uppy/provider-views/lib/GooglePicker/googlePicker.js'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { AsyncStore, BaseProviderPlugin } from '@uppy/core/lib/Uppy.js'
import type { Body, Meta, AsyncStore, BaseProviderPlugin } from '@uppy/core'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json

View file

@ -8,12 +8,14 @@ import {
} from '@uppy/companion-client'
import { h, type ComponentChild } from 'preact'
import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
import type {
UppyFile,
Body,
Meta,
AsyncStore,
UnknownProviderPlugin,
UnknownProviderPluginState,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json

View file

@ -1,7 +1,7 @@
/* eslint-disable jsx-a11y/label-has-associated-control */
import Cropper from 'cropperjs'
import { h, Component } from 'preact'
import type { Meta, Body, UppyFile } from '@uppy/utils/lib/UppyFile'
import type { Meta, Body, UppyFile } from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import getCanvasDataThatFitsPerfectlyIntoContainer from './utils/getCanvasDataThatFitsPerfectlyIntoContainer.js'
import getScaleFactorThatRemovesDarkCorners from './utils/getScaleFactorThatRemovesDarkCorners.js'

View file

@ -1,9 +1,15 @@
import { UIPlugin, type UIPluginOptions, type Uppy } from '@uppy/core'
import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js'
import { UIPlugin } from '@uppy/core'
import type {
UIPluginOptions,
Uppy,
DefinePluginOpts,
Meta,
Body,
UppyFile,
} from '@uppy/core'
import type Cropper from 'cropperjs'
import { h } from 'preact'
import type { Meta, Body, UppyFile } from '@uppy/utils/lib/UppyFile'
import Editor from './Editor.jsx'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json

View file

@ -2,8 +2,7 @@
/* eslint-disable jsx-a11y/click-events-have-key-events */
import { h, type ComponentChild } from 'preact'
import { UIPlugin } from '@uppy/core'
import type { State, UIPluginOptions, Uppy } from '@uppy/core'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { State, UIPluginOptions, Uppy, Body, Meta } from '@uppy/core'
import FadeIn from './FadeIn.jsx'
import TransitionGroup from './TransitionGroup.js'

View file

@ -8,12 +8,14 @@ import { UIPlugin, Uppy } from '@uppy/core'
import { ProviderViews } from '@uppy/provider-views'
import { h, type ComponentChild } from 'preact'
import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
import type {
UppyFile,
Body,
Meta,
AsyncStore,
UnknownProviderPlugin,
UnknownProviderPluginState,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import locale from './locale.js'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json

View file

@ -8,12 +8,14 @@ import { UIPlugin, Uppy } from '@uppy/core'
import { ProviderViews } from '@uppy/provider-views'
import { h, type ComponentChild } from 'preact'
import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
import type {
UppyFile,
Body,
Meta,
AsyncStore,
UnknownProviderPlugin,
UnknownProviderPluginState,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import locale from './locale.js'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json

View file

@ -1,8 +1,13 @@
import { h, type ComponentChild } from 'preact'
import { UIPlugin, type UIPluginOptions } from '@uppy/core'
import type { Uppy, State } from '@uppy/core/lib/Uppy.js'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js'
import { UIPlugin } from '@uppy/core'
import type {
Uppy,
State,
UIPluginOptions,
Body,
Meta,
DefinePluginOpts,
} from '@uppy/core'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json

View file

@ -1,6 +1,5 @@
import type { PartialTreeFolder } from '@uppy/core/lib/Uppy.js'
import type { PartialTreeFolder, Body, Meta } from '@uppy/core'
import { h, Fragment } from 'preact'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type ProviderView from './ProviderView/index.js'
type BreadcrumbsProps<M extends Meta, B extends Body> = {

View file

@ -3,12 +3,13 @@ import { h } from 'preact'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore untyped
import VirtualList from '@uppy/utils/lib/VirtualList'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { I18n } from '@uppy/utils/lib/Translator'
import type {
Body,
Meta,
PartialTreeFile,
PartialTreeFolderNode,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import { useEffect, useState } from 'preact/hooks'
import Item from './Item/index.jsx'
import ProviderView from './ProviderView/ProviderView.jsx'

View file

@ -1,8 +1,7 @@
import { h } from 'preact'
import type { I18n } from '@uppy/utils/lib/Translator'
import type { Meta, Body } from '@uppy/utils/lib/UppyFile'
import type { Meta, Body, PartialTree } from '@uppy/core'
import classNames from 'classnames'
import type { PartialTree } from '@uppy/core/lib/Uppy.js'
import { useMemo } from 'preact/hooks'
import getNumberOfSelectedFiles from './utils/PartialTreeUtils/getNumberOfSelectedFiles.js'
import ProviderView from './ProviderView/ProviderView.jsx'

View file

@ -1,8 +1,7 @@
import { h } from 'preact'
import { useCallback, useEffect, useRef, useState } from 'preact/hooks'
import type { Uppy } from '@uppy/core'
import type { AsyncStore } from '@uppy/core/lib/Uppy.js'
import type { Uppy, AsyncStore } from '@uppy/core'
import {
authorize,

View file

@ -1,8 +1,5 @@
import { h } from 'preact'
import type {
PartialTreeFile,
PartialTreeFolderNode,
} from '@uppy/core/lib/Uppy.js'
import type { PartialTreeFile, PartialTreeFolderNode } from '@uppy/core'
import ItemIcon from './ItemIcon.jsx'
type GridItemProps = {

View file

@ -2,7 +2,7 @@ import type {
PartialTreeFile,
PartialTreeFolderNode,
PartialTreeId,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import { h } from 'preact'
import ItemIcon from './ItemIcon.jsx'

View file

@ -7,7 +7,7 @@ import type {
PartialTreeFile,
PartialTreeFolderNode,
PartialTreeId,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import GridItem from './components/GridItem.jsx'
import ListItem from './components/ListItem.jsx'

View file

@ -1,6 +1,6 @@
import { h } from 'preact'
import { useCallback } from 'preact/hooks'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { Body, Meta } from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import type { Opts } from './ProviderView.js'
import type ProviderViews from './ProviderView.js'

View file

@ -1,8 +1,7 @@
/* eslint-disable react/destructuring-assignment */
import { h } from 'preact'
import type { I18n } from '@uppy/utils/lib/Translator'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { PartialTreeFolder } from '@uppy/core/lib/Uppy.js'
import type { Body, Meta, PartialTreeFolder } from '@uppy/core'
import classNames from 'classnames'
import User from './User.jsx'
import Breadcrumbs from '../Breadcrumbs.jsx'

View file

@ -7,8 +7,9 @@ import type {
UnknownProviderPluginState,
PartialTreeId,
PartialTree,
} from '@uppy/core/lib/Uppy.js'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
Body,
Meta,
} from '@uppy/core'
import type { CompanionFile } from '@uppy/utils/lib/CompanionFile'
import classNames from 'classnames'
import type { ValidateableFile } from '@uppy/core/lib/Restricter.js'

View file

@ -1,19 +1,20 @@
import { h } from 'preact'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type {
Body,
Meta,
DefinePluginOpts,
PartialTree,
PartialTreeFile,
PartialTreeFolderNode,
PartialTreeFolderRoot,
UnknownSearchProviderPlugin,
UnknownSearchProviderPluginState,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import type { CompanionFile } from '@uppy/utils/lib/CompanionFile'
import classNames from 'classnames'
import type { ValidateableFile } from '@uppy/core/lib/Restricter.js'
import remoteFileObjToLocal from '@uppy/utils/lib/remoteFileObjToLocal'
import type { DefinePluginOpts } from '@uppy/core'
import SearchInput from '../SearchInput.jsx'
import Browser from '../Browser.jsx'

View file

@ -4,7 +4,7 @@ import type {
PartialTreeFile,
PartialTreeFolderNode,
PartialTreeId,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import type { CompanionFile } from '@uppy/utils/lib/CompanionFile'
// p-queue does not have a `"main"` field in its `package.json`, and that makes `import/no-unresolved` freak out.
// We can safely ignore it because bundlers will happily use the `"exports"` field instead.

View file

@ -3,7 +3,7 @@ import type {
PartialTreeFile,
PartialTreeFolder,
PartialTreeFolderNode,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import type { CompanionFile } from '@uppy/utils/lib/CompanionFile'
const afterOpenFolder = (

View file

@ -4,7 +4,7 @@ import type {
PartialTreeFolder,
PartialTreeFolderNode,
PartialTreeId,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import type { CompanionFile } from '@uppy/utils/lib/CompanionFile'
const afterScrollFolder = (

View file

@ -5,7 +5,7 @@ import type {
PartialTreeFolder,
PartialTreeFolderNode,
PartialTreeId,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import shallowClone from './shallowClone.js'
/*

View file

@ -3,7 +3,7 @@ import type {
PartialTreeFolder,
PartialTreeFolderNode,
PartialTreeId,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
const getBreadcrumbs = (
partialTree: PartialTree,

View file

@ -4,7 +4,7 @@ import type {
PartialTreeFile,
PartialTreeFolderNode,
PartialTreeId,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import type { CompanionFile } from '@uppy/utils/lib/CompanionFile'
export interface Cache {

View file

@ -1,4 +1,4 @@
import type { PartialTree } from '@uppy/core/lib/Uppy.js'
import type { PartialTree } from '@uppy/core'
/**
* We're interested in all 'checked' leaves of this tree,

View file

@ -7,7 +7,7 @@ import type {
PartialTreeFolderNode,
PartialTreeFolderRoot,
PartialTreeId,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import afterToggleCheckbox from './afterToggleCheckbox.js'
import afterOpenFolder from './afterOpenFolder.js'
import afterScrollFolder from './afterScrollFolder.js'

View file

@ -1,4 +1,4 @@
import type { PartialTree } from '@uppy/core/lib/Uppy.js'
import type { PartialTree } from '@uppy/core'
/**
* One-level copying is sufficient as mutations within our `partialTree` are limited to properties

View file

@ -1,7 +1,4 @@
import type {
PartialTreeFile,
PartialTreeFolderNode,
} from '@uppy/core/lib/Uppy.js'
import type { PartialTreeFile, PartialTreeFolderNode } from '@uppy/core'
// Shift-clicking selects a single consecutive list of items
// starting at the previous click.

View file

@ -1,8 +1,7 @@
import { createElement as h, Component } from 'react'
import type React from 'react'
import type { UnknownPlugin, Uppy } from '@uppy/core'
import type { UnknownPlugin, Uppy, Body, Meta } from '@uppy/core'
import DashboardPlugin from '@uppy/dashboard'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { DashboardOptions } from '@uppy/dashboard'
import getHTMLProps from './getHTMLProps.js'
import nonHtmlPropsHaveChanged from './nonHtmlPropsHaveChanged.js'

View file

@ -1,8 +1,7 @@
import { createElement as h, Component } from 'react'
import type React from 'react'
import DashboardPlugin, { type DashboardOptions } from '@uppy/dashboard'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { Uppy } from '@uppy/core'
import type { Body, Meta, Uppy } from '@uppy/core'
import getHTMLProps from './getHTMLProps.js'
import nonHtmlPropsHaveChanged from './nonHtmlPropsHaveChanged.js'

View file

@ -1,7 +1,6 @@
import { createElement as h, Component } from 'react'
import type { UnknownPlugin, Uppy } from '@uppy/core'
import type { UnknownPlugin, Uppy, Body, Meta } from '@uppy/core'
import DragDropPlugin, { type DragDropOptions } from '@uppy/drag-drop'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import getHTMLProps from './getHTMLProps.js'
import nonHtmlPropsHaveChanged from './nonHtmlPropsHaveChanged.js'

View file

@ -1,7 +1,12 @@
import { createElement as h, Component } from 'react'
import type { UIPluginOptions, UnknownPlugin, Uppy } from '@uppy/core'
import type {
UIPluginOptions,
UnknownPlugin,
Uppy,
Body,
Meta,
} from '@uppy/core'
import FileInputPlugin from '@uppy/file-input'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { Locale } from '@uppy/utils/lib/Translator'
interface FileInputProps<M extends Meta, B extends Body>

View file

@ -1,7 +1,6 @@
import { createElement as h, Component } from 'react'
import type { UnknownPlugin, Uppy } from '@uppy/core'
import type { UnknownPlugin, Uppy, Body, Meta } from '@uppy/core'
import ProgressBarPlugin, { type ProgressBarOptions } from '@uppy/progress-bar'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import getHTMLProps from './getHTMLProps.js'
import nonHtmlPropsHaveChanged from './nonHtmlPropsHaveChanged.js'

View file

@ -1,7 +1,6 @@
import { createElement as h, Component } from 'react'
import type { UnknownPlugin, Uppy } from '@uppy/core'
import type { UnknownPlugin, Uppy, Body, Meta } from '@uppy/core'
import StatusBarPlugin, { type StatusBarOptions } from '@uppy/status-bar'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import getHTMLProps from './getHTMLProps.js'
import nonHtmlPropsHaveChanged from './nonHtmlPropsHaveChanged.js'

View file

@ -1,5 +1,4 @@
import type { Uppy, UppyEventMap } from '@uppy/core'
import type { Meta, Body } from '@uppy/utils/lib/UppyFile'
import type { Meta, Body, Uppy, UppyEventMap } from '@uppy/core'
import { useEffect, useState } from 'react'
type EventResults<

View file

@ -1,5 +1,4 @@
import type { Uppy, State } from '@uppy/core'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { Uppy, State, Body, Meta } from '@uppy/core'
import { useMemo, useCallback } from 'react'
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector.js'

View file

@ -1,4 +1,11 @@
import { BasePlugin, Uppy, type UnknownProviderPlugin } from '@uppy/core'
import { BasePlugin } from '@uppy/core'
import type {
Uppy,
UnknownProviderPlugin,
DefinePluginOpts,
Body,
Meta,
} from '@uppy/core'
import Dropbox from '@uppy/dropbox'
import GoogleDrive from '@uppy/google-drive'
import GooglePhotos from '@uppy/google-photos'
@ -10,8 +17,6 @@ import Unsplash from '@uppy/unsplash'
import Url from '@uppy/url'
import Zoom from '@uppy/zoom'
import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { CompanionPluginOptions } from '@uppy/companion-client'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json

View file

@ -1,6 +1,6 @@
/* eslint-disable react/jsx-props-no-spreading */
import { h, Component, type ComponentChild } from 'preact'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { Body, Meta } from '@uppy/core'
import RecordButton from './RecordButton.jsx'
import SubmitButton from './SubmitButton.jsx'
import StopWatch from './StopWatch.jsx'

View file

@ -1,8 +1,13 @@
import { h, type ComponentChild } from 'preact'
import { UIPlugin, Uppy, type UIPluginOptions } from '@uppy/core'
import { UIPlugin } from '@uppy/core'
import type {
Uppy,
UIPluginOptions,
DefinePluginOpts,
Body,
Meta,
} from '@uppy/core'
import getFileTypeExtension from '@uppy/utils/lib/getFileTypeExtension'
import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import ScreenRecIcon from './ScreenRecIcon.jsx'
import RecorderScreen from './RecorderScreen.jsx'

View file

@ -1,5 +1,4 @@
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { State, Uppy } from '@uppy/core/lib/Uppy.js'
import type { Body, Meta, State, Uppy } from '@uppy/core'
import type { FileProcessingInfo } from '@uppy/utils/lib/FileProgress'
import type { I18n } from '@uppy/utils/lib/Translator'
import { h } from 'preact'

View file

@ -1,7 +1,12 @@
import type { ComponentChild } from 'preact'
import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile'
import type { Uppy, State } from '@uppy/core/lib/Uppy.js'
import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js'
import type {
Body,
Meta,
UppyFile,
DefinePluginOpts,
Uppy,
State,
} from '@uppy/core'
import { UIPlugin } from '@uppy/core'
import emaFilter from '@uppy/utils/lib/emaFilter'
import getTextDirection from '@uppy/utils/lib/getTextDirection'

View file

@ -1,6 +1,5 @@
import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile'
import type { Body, Meta, UppyFile, Uppy, State } from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import type { Uppy, State } from '@uppy/core/lib/Uppy.js'
import { h } from 'preact'
import classNames from 'classnames'
import statusBarStates from './StatusBarStates.js'

View file

@ -1,4 +1,5 @@
import { UIPlugin, Uppy, type UIPluginOptions } from '@uppy/core'
import { UIPlugin } from '@uppy/core'
import type { Uppy, UIPluginOptions, DefinePluginOpts } from '@uppy/core'
import dataURItoBlob from '@uppy/utils/lib/dataURItoBlob'
import isObjectURL from '@uppy/utils/lib/isObjectURL'
import isPreviewSupported from '@uppy/utils/lib/isPreviewSupported'
@ -6,7 +7,6 @@ import isPreviewSupported from '@uppy/utils/lib/isPreviewSupported'
// @ts-ignore untyped
import { rotation } from 'exifr/dist/mini.esm.mjs'
import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js'
import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile'
import locale from './locale.js'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment

View file

@ -1,5 +1,4 @@
import type { Uppy } from '@uppy/core'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { Uppy, Body, Meta } from '@uppy/core'
import Emitter from 'component-emitter'
import type { AssemblyResponse } from './index.js'

View file

@ -1,11 +1,16 @@
import hasProperty from '@uppy/utils/lib/hasProperty'
import ErrorWithCause from '@uppy/utils/lib/ErrorWithCause'
import { RateLimitedQueue } from '@uppy/utils/lib/RateLimitedQueue'
import BasePlugin from '@uppy/core/lib/BasePlugin.js'
import type { DefinePluginOpts, PluginOpts } from '@uppy/core/lib/BasePlugin.js'
import Tus, { type TusDetailedError, type TusOpts } from '@uppy/tus'
import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile'
import type { Uppy } from '@uppy/core'
import { BasePlugin } from '@uppy/core'
import type {
DefinePluginOpts,
PluginOpts,
Uppy,
Body,
Meta,
UppyFile,
} from '@uppy/core'
import Assembly from './Assembly.js'
import Client, { AssemblyError } from './Client.js'
import AssemblyWatcher from './AssemblyWatcher.js'

View file

@ -1,7 +1,12 @@
import BasePlugin, {
type DefinePluginOpts,
type PluginOpts,
} from '@uppy/core/lib/BasePlugin.js'
import { BasePlugin } from '@uppy/core'
import type {
Uppy,
DefinePluginOpts,
PluginOpts,
Meta,
Body,
UppyFile,
} from '@uppy/core'
import * as tus from 'tus-js-client'
import EventManager from '@uppy/core/lib/EventManager.js'
import NetworkError from '@uppy/utils/lib/NetworkError'
@ -14,8 +19,6 @@ import {
filterNonFailedFiles,
filterFilesToEmitUploadStarted,
} from '@uppy/utils/lib/fileFilters'
import type { Meta, Body, UppyFile } from '@uppy/utils/lib/UppyFile'
import type { Uppy } from '@uppy/core'
import type { RequestClient } from '@uppy/companion-client'
import getAllowedMetaFields from '@uppy/utils/lib/getAllowedMetaFields'
import getFingerprint from './getFingerprint.js'

View file

@ -8,12 +8,14 @@ import { UIPlugin, Uppy } from '@uppy/core'
import { SearchProviderViews } from '@uppy/provider-views'
import { h, type ComponentChild } from 'preact'
import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
import type {
UppyFile,
Body,
Meta,
AsyncStore,
UnknownSearchProviderPlugin,
UnknownSearchProviderPluginState,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import locale from './locale.js'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json

View file

@ -5,7 +5,8 @@ import {
type CompanionPluginOptions,
} from '@uppy/companion-client'
import toArray from '@uppy/utils/lib/toArray'
import type { TagFile, Meta, Body } from '@uppy/utils/lib/UppyFile'
import type { Meta, Body } from '@uppy/core'
import type { TagFile } from '@uppy/utils/lib/UppyFile'
import UrlUI from './UrlUI.jsx'
import forEachDroppedOrPastedUrl from './utils/forEachDroppedOrPastedUrl.js'

View file

@ -1,7 +1,7 @@
import { defineComponent, ref, watch, h, type PropType } from 'vue'
import DashboardPlugin, { type DashboardOptions } from '@uppy/dashboard'
import { Uppy } from '@uppy/core'
import type { Meta, Body } from '@uppy/utils/lib/UppyFile'
import type { Meta, Body } from '@uppy/core'
import useUppy from './useUppy.js'
type DashboardModalOptions<M extends Meta, B extends Body> = Omit<

View file

@ -1,7 +1,6 @@
import { defineComponent, ref, h, type PropType } from 'vue'
import DashboardPlugin, { type DashboardOptions } from '@uppy/dashboard'
import type { Uppy } from '@uppy/core'
import type { Meta, Body } from '@uppy/utils/lib/UppyFile'
import type { Uppy, Meta, Body } from '@uppy/core'
import useUppy from './useUppy.js'
type DashboardInlineOptions<M extends Meta, B extends Body> = Omit<

View file

@ -1,13 +1,14 @@
import { h, type ComponentChild } from 'preact'
import { UIPlugin } from '@uppy/core'
import type { Uppy, UIPluginOptions } from '@uppy/core'
import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js'
import type {
Uppy,
UIPluginOptions,
DefinePluginOpts,
Body,
Meta,
MinimalRequiredUppyFile,
} from '@uppy/utils/lib/UppyFile'
} from '@uppy/core'
import type { PluginTarget } from '@uppy/core/lib/UIPlugin.js'
import getFileTypeExtension from '@uppy/utils/lib/getFileTypeExtension'
import mimeTypes from '@uppy/utils/lib/mimeTypes'

View file

@ -1,12 +1,15 @@
import { h, type ComponentChild } from 'preact'
import { useState, useCallback } from 'preact/hooks'
import {
UIPlugin,
type Body,
type Meta,
type UnknownProviderPlugin,
type UppyFile,
import { UIPlugin } from '@uppy/core'
import type {
Body,
Meta,
UnknownProviderPlugin,
UppyFile,
AsyncStore,
UnknownProviderPluginState,
Uppy,
} from '@uppy/core'
import {
Provider,
@ -15,11 +18,6 @@ import {
} from '@uppy/companion-client'
import { SearchInput, ProviderViews } from '@uppy/provider-views'
import type {
AsyncStore,
UnknownProviderPluginState,
Uppy,
} from '@uppy/core/lib/Uppy.js'
import type { I18n } from '@uppy/utils/lib/Translator'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json

View file

@ -1,5 +1,13 @@
import BasePlugin from '@uppy/core/lib/BasePlugin.js'
import type { DefinePluginOpts, PluginOpts } from '@uppy/core/lib/BasePlugin.js'
import { BasePlugin } from '@uppy/core'
import type {
State,
Uppy,
DefinePluginOpts,
PluginOpts,
Meta,
Body,
UppyFile,
} from '@uppy/core'
import type { RequestClient } from '@uppy/companion-client'
import EventManager from '@uppy/core/lib/EventManager.js'
import {
@ -15,10 +23,6 @@ import {
filterNonFailedFiles,
filterFilesToEmitUploadStarted,
} from '@uppy/utils/lib/fileFilters'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json
import type { Meta, Body, UppyFile } from '@uppy/utils/lib/UppyFile'
import type { State, Uppy } from '@uppy/core'
import getAllowedMetaFields from '@uppy/utils/lib/getAllowedMetaFields'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json

View file

@ -8,12 +8,14 @@ import { UIPlugin, Uppy } from '@uppy/core'
import { ProviderViews } from '@uppy/provider-views'
import { h, type ComponentChild } from 'preact'
import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
import type {
UppyFile,
Body,
Meta,
AsyncStore,
UnknownProviderPlugin,
UnknownProviderPluginState,
} from '@uppy/core/lib/Uppy.js'
} from '@uppy/core'
import locale from './locale.js'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json

View file

@ -4,7 +4,7 @@ export { default as Uppy, debugLogger } from '@uppy/core'
// Plugin base classes
export { default as UIPlugin } from '@uppy/core/lib/UIPlugin.js'
export { default as BasePlugin } from '@uppy/core/lib/BasePlugin.js'
export { default as BasePlugin } from '@uppy/core'
/**
* @deprecated Use `Uppy` instead of `Core`