mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-13 09:17:20 +00:00
Fix typings for TypeScript v3.2
This commit is contained in:
@@ -56,8 +56,8 @@ export default class App extends Component<Props, State> {
|
|||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
this.setState(window.STATE);
|
this.setState(window.STATE);
|
||||||
const oldCDU = this.componentDidUpdate;
|
const oldCDU = this.componentDidUpdate;
|
||||||
this.componentDidUpdate = (props, state) => {
|
this.componentDidUpdate = (props, state, prev) => {
|
||||||
if (oldCDU) oldCDU.call(this, props, state);
|
if (oldCDU) oldCDU.call(this, props, state, prev);
|
||||||
window.STATE = this.state;
|
window.STATE = this.state;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,9 @@ import Checkbox from '../checkbox';
|
|||||||
import Expander from '../expander';
|
import Expander from '../expander';
|
||||||
import Select from '../select';
|
import Select from '../select';
|
||||||
|
|
||||||
const encoderOptionsComponentMap = {
|
const encoderOptionsComponentMap: {
|
||||||
|
[x: string]: (new (...args: any[]) => Component<any, any>) | undefined;
|
||||||
|
} = {
|
||||||
[identity.type]: undefined,
|
[identity.type]: undefined,
|
||||||
[optiPNG.type]: OptiPNGEncoderOptions,
|
[optiPNG.type]: OptiPNGEncoderOptions,
|
||||||
[mozJPEG.type]: MozJpegEncoderOptions,
|
[mozJPEG.type]: MozJpegEncoderOptions,
|
||||||
|
|||||||
@@ -576,9 +576,9 @@ export default class Compress extends Component<Props, State> {
|
|||||||
mobileView={mobileView}
|
mobileView={mobileView}
|
||||||
preprocessorState={side.latestSettings.preprocessorState}
|
preprocessorState={side.latestSettings.preprocessorState}
|
||||||
encoderState={side.latestSettings.encoderState}
|
encoderState={side.latestSettings.encoderState}
|
||||||
onEncoderTypeChange={this.onEncoderTypeChange.bind(this, index)}
|
onEncoderTypeChange={this.onEncoderTypeChange.bind(this, index as 0|1)}
|
||||||
onEncoderOptionsChange={this.onEncoderOptionsChange.bind(this, index)}
|
onEncoderOptionsChange={this.onEncoderOptionsChange.bind(this, index as 0|1)}
|
||||||
onPreprocessorOptionsChange={this.onPreprocessorOptionsChange.bind(this, index)}
|
onPreprocessorOptionsChange={this.onPreprocessorOptionsChange.bind(this, index as 0|1)}
|
||||||
/>
|
/>
|
||||||
));
|
));
|
||||||
|
|
||||||
@@ -592,7 +592,7 @@ export default class Compress extends Component<Props, State> {
|
|||||||
source={source}
|
source={source}
|
||||||
loading={loading || side.loading}
|
loading={loading || side.loading}
|
||||||
copyDirection={copyDirections[index]}
|
copyDirection={copyDirections[index]}
|
||||||
onCopyToOtherClick={this.onCopyToOtherClick.bind(this, index)}
|
onCopyToOtherClick={this.onCopyToOtherClick.bind(this, index as 0|1)}
|
||||||
buttonPosition={mobileView ? 'stack-right' : buttonPositions[index]}
|
buttonPosition={mobileView ? 'stack-right' : buttonPositions[index]}
|
||||||
>
|
>
|
||||||
{!mobileView ? null : [
|
{!mobileView ? null : [
|
||||||
|
|||||||
Reference in New Issue
Block a user