mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-14 01:37:26 +00:00
Remove TypeScript-specific static Compress import (#338)
Previously, Compress had a static import only used by TypeScript, as the module was loaded dynamically. The type can be replaced with `import().default`. TypeScript 2.9 introduced the ability to use `import()` within type statements. https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#import-types
This commit is contained in:
committed by
Jake Archibald
parent
b3ab983f02
commit
32f2b4e573
@@ -9,9 +9,6 @@ import '../../lib/SnackBar';
|
|||||||
import Intro from '../intro';
|
import Intro from '../intro';
|
||||||
import '../custom-els/LoadingSpinner';
|
import '../custom-els/LoadingSpinner';
|
||||||
|
|
||||||
// This is imported for TypeScript only. It isn't used.
|
|
||||||
import Compress from '../compress';
|
|
||||||
|
|
||||||
const compressPromise = import(
|
const compressPromise = import(
|
||||||
/* webpackChunkName: "main-app" */
|
/* webpackChunkName: "main-app" */
|
||||||
'../compress',
|
'../compress',
|
||||||
@@ -31,7 +28,7 @@ interface Props {}
|
|||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
file?: File | Fileish;
|
file?: File | Fileish;
|
||||||
Compress?: typeof Compress;
|
Compress?: typeof import('../compress').default;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class App extends Component<Props, State> {
|
export default class App extends Component<Props, State> {
|
||||||
|
|||||||
Reference in New Issue
Block a user