diff --git a/package-lock.json b/package-lock.json index 865069a0..063c7ef2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14582,9 +14582,9 @@ "dev": true }, "typescript": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.1.6.tgz", - "integrity": "sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz", + "integrity": "sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index 16148912..c88cbaa1 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "tslint-config-semistandard": "7.0.0", "tslint-react": "3.6.0", "typed-css-modules": "0.3.7", - "typescript": "3.1.6", + "typescript": "3.2.2", "url-loader": "1.1.2", "webpack": "4.27.1", "webpack-bundle-analyzer": "3.0.3", diff --git a/src/components/App/index.tsx b/src/components/App/index.tsx index f30ddc7c..962d72bd 100644 --- a/src/components/App/index.tsx +++ b/src/components/App/index.tsx @@ -56,8 +56,8 @@ export default class App extends Component { if (process.env.NODE_ENV === 'development') { this.setState(window.STATE); const oldCDU = this.componentDidUpdate; - this.componentDidUpdate = (props, state) => { - if (oldCDU) oldCDU.call(this, props, state); + this.componentDidUpdate = (props, state, prev) => { + if (oldCDU) oldCDU.call(this, props, state, prev); window.STATE = this.state; }; } diff --git a/src/components/Options/index.tsx b/src/components/Options/index.tsx index 98783a07..5d2b1d31 100644 --- a/src/components/Options/index.tsx +++ b/src/components/Options/index.tsx @@ -40,7 +40,9 @@ import Checkbox from '../checkbox'; import Expander from '../expander'; import Select from '../select'; -const encoderOptionsComponentMap = { +const encoderOptionsComponentMap: { + [x: string]: (new (...args: any[]) => Component) | undefined; +} = { [identity.type]: undefined, [optiPNG.type]: OptiPNGEncoderOptions, [mozJPEG.type]: MozJpegEncoderOptions, diff --git a/src/components/compress/index.tsx b/src/components/compress/index.tsx index af631030..2bb90f03 100644 --- a/src/components/compress/index.tsx +++ b/src/components/compress/index.tsx @@ -576,9 +576,9 @@ export default class Compress extends Component { mobileView={mobileView} preprocessorState={side.latestSettings.preprocessorState} encoderState={side.latestSettings.encoderState} - onEncoderTypeChange={this.onEncoderTypeChange.bind(this, index)} - onEncoderOptionsChange={this.onEncoderOptionsChange.bind(this, index)} - onPreprocessorOptionsChange={this.onPreprocessorOptionsChange.bind(this, index)} + onEncoderTypeChange={this.onEncoderTypeChange.bind(this, index as 0|1)} + onEncoderOptionsChange={this.onEncoderOptionsChange.bind(this, index as 0|1)} + onPreprocessorOptionsChange={this.onPreprocessorOptionsChange.bind(this, index as 0|1)} /> )); @@ -592,7 +592,7 @@ export default class Compress extends Component { source={source} loading={loading || side.loading} copyDirection={copyDirections[index]} - onCopyToOtherClick={this.onCopyToOtherClick.bind(this, index)} + onCopyToOtherClick={this.onCopyToOtherClick.bind(this, index as 0|1)} buttonPosition={mobileView ? 'stack-right' : buttonPositions[index]} > {!mobileView ? null : [