diff --git a/packages/media/src/test/isAnimatedGif.ts b/packages/media/src/test/isAnimatedGif.ts index 9c2b05bbc3df..b74d7335f35c 100644 --- a/packages/media/src/test/isAnimatedGif.ts +++ b/packages/media/src/test/isAnimatedGif.ts @@ -32,7 +32,7 @@ describe('isAnimatedGif', () => { buffer.byteOffset, buffer.byteOffset + buffer.byteLength ); - const result = isAnimatedGif(arrayBuffer); + const result = isAnimatedGif(arrayBuffer as unknown as ArrayBuffer); expect(result).toBeTrue(); }); @@ -43,7 +43,7 @@ describe('isAnimatedGif', () => { buffer.byteOffset, buffer.byteOffset + buffer.byteLength ); - const result = isAnimatedGif(arrayBuffer); + const result = isAnimatedGif(arrayBuffer as unknown as ArrayBuffer); expect(result).toBeFalse(); }); diff --git a/packages/rich-text/src/utils/getCaretCharacterOffsetWithin.ts b/packages/rich-text/src/utils/getCaretCharacterOffsetWithin.ts index 12ba29adfaee..7e46be0dcd67 100644 --- a/packages/rich-text/src/utils/getCaretCharacterOffsetWithin.ts +++ b/packages/rich-text/src/utils/getCaretCharacterOffsetWithin.ts @@ -44,7 +44,11 @@ interface CaretPosition { } interface SelectionDocument extends Document { - caretPositionFromPoint?: (x: number, y: number) => CaretPosition | null; + caretPositionFromPoint: ( + x: number, + y: number, + options?: CaretPositionFromPointOptions + ) => CaretPosition | null; } // Extend for wider browser support. diff --git a/packages/story-editor/src/app/canvas/useCanvasKeys.ts b/packages/story-editor/src/app/canvas/useCanvasKeys.ts index 33fc4c88a9ae..b0134effd6c6 100644 --- a/packages/story-editor/src/app/canvas/useCanvasKeys.ts +++ b/packages/story-editor/src/app/canvas/useCanvasKeys.ts @@ -179,7 +179,7 @@ function useCanvasKeys(ref: RefObject) { // Position (x/y) key handler. useGlobalKeyDownEffect( { key: ['up', 'down', 'left', 'right'], shift: true }, - ({ key, shiftKey }) => { + ({ key, shiftKey }: KeyboardEvent) => { if (isEditing || !selectedElements?.length) { return; } @@ -204,7 +204,7 @@ function useCanvasKeys(ref: RefObject) { // Layer up/down. useGlobalKeyDownEffect( { key: ['mod+up', 'mod+down', 'mod+left', 'mod+right'], shift: true }, - (evt) => { + (evt: KeyboardEvent) => { const { key, shiftKey } = evt; // Cancel the default behavior of the event: it's very jarring to run @@ -293,7 +293,7 @@ function useCanvasKeys(ref: RefObject) { ].includes(animationState); useGlobalKeyDownEffect( { key: ['mod+enter'] }, - (evt) => { + (evt: KeyboardEvent) => { evt.preventDefault(); if (currentPageNumber === 1) { return; @@ -313,7 +313,7 @@ function useCanvasKeys(ref: RefObject) { useGlobalKeyDownEffect( { key: ['mod+k'] }, - (evt) => { + (evt: KeyboardEvent) => { evt.preventDefault(); if ( !selectedElements.length || diff --git a/packages/story-editor/src/app/media/utils/heif/utils.ts b/packages/story-editor/src/app/media/utils/heif/utils.ts index db379ee986a0..f92f74e5d5c1 100644 --- a/packages/story-editor/src/app/media/utils/heif/utils.ts +++ b/packages/story-editor/src/app/media/utils/heif/utils.ts @@ -60,7 +60,7 @@ export async function decodeImage(image: DecodeResult) { if (!result) { reject(new Error('HEIF processing error')); } else { - resolve(result.data.buffer); + resolve(result.data.buffer as ArrayBuffer); } } ); diff --git a/packages/story-editor/src/app/media/utils/useFFmpeg.ts b/packages/story-editor/src/app/media/utils/useFFmpeg.ts index a52efbb9c766..d865d21ca009 100644 --- a/packages/story-editor/src/app/media/utils/useFFmpeg.ts +++ b/packages/story-editor/src/app/media/utils/useFFmpeg.ts @@ -205,7 +205,7 @@ function useFFmpeg() { const data = ffmpeg.FS('readFile', tempFileName); return blobToFile( - new Blob([data.buffer], { type: MEDIA_POSTER_IMAGE_MIME_TYPE }), + new Blob([data.buffer as BlobPart], { type: MEDIA_POSTER_IMAGE_MIME_TYPE }), outputFileName, MEDIA_POSTER_IMAGE_MIME_TYPE ); @@ -263,7 +263,7 @@ function useFFmpeg() { const data = ffmpeg.FS('readFile', tempFileName); return blobToFile( - new Blob([data.buffer], { type: MEDIA_TRANSCODED_MIME_TYPE }), + new Blob([data.buffer as BlobPart], { type: MEDIA_TRANSCODED_MIME_TYPE }), outputFileName, MEDIA_TRANSCODED_MIME_TYPE ); @@ -348,7 +348,7 @@ function useFFmpeg() { .map((outputFile) => { const data = (ffmpeg as FFmpeg).FS('readFile', outputFile); return blobToFile( - new Blob([data.buffer], { type }), + new Blob([data.buffer as BlobPart], { type }), outputFile, type ); @@ -417,7 +417,7 @@ function useFFmpeg() { const data = ffmpeg.FS('readFile', tempFileName); return blobToFile( - new Blob([data.buffer], { type }), + new Blob([data.buffer as BlobPart], { type }), outputFileName, type ); @@ -478,7 +478,7 @@ function useFFmpeg() { const data = ffmpeg.FS('readFile', tempFileName); return blobToFile( - new Blob([data.buffer], { type }), + new Blob([data.buffer as BlobPart], { type }), outputFileName, type ); @@ -538,7 +538,7 @@ function useFFmpeg() { const data = ffmpeg.FS('readFile', tempFileName); return blobToFile( - new Blob([data.buffer], { type }), + new Blob([data.buffer as BlobPart], { type }), outputFileName, type ); @@ -596,7 +596,7 @@ function useFFmpeg() { const data = ffmpeg.FS('readFile', tempFileName); return blobToFile( - new Blob([data.buffer], { type: MEDIA_TRANSCODED_MIME_TYPE }), + new Blob([data.buffer as BlobPart], { type: MEDIA_TRANSCODED_MIME_TYPE }), outputFileName, MEDIA_TRANSCODED_MIME_TYPE ); @@ -651,7 +651,7 @@ function useFFmpeg() { const data = ffmpeg.FS('readFile', tempFileName); return blobToFile( - new Blob([data.buffer], { type: 'audio/mpeg' }), + new Blob([data.buffer as BlobPart], { type: 'audio/mpeg' }), outputFileName, 'audio/mpeg' ); diff --git a/packages/story-editor/src/components/footer/carousel/carouselContext/useCarouselKeys.ts b/packages/story-editor/src/components/footer/carousel/carouselContext/useCarouselKeys.ts index f85c5999d38d..b7506c69c681 100644 --- a/packages/story-editor/src/components/footer/carousel/carouselContext/useCarouselKeys.ts +++ b/packages/story-editor/src/components/footer/carousel/carouselContext/useCarouselKeys.ts @@ -70,7 +70,7 @@ function useCarouselKeys({ useKeyDownEffect( listElement, { key: ['up', 'down', 'left', 'right'] }, - ({ key }) => { + ({ key }: KeyboardEvent) => { // Intercept all keys, but only handle left and right. const dir = getArrowDir(key, 'ArrowRight', 'ArrowLeft', isRTL); if (dir === 0) { @@ -103,7 +103,7 @@ function useCarouselKeys({ useKeyDownEffect( listElement, { key: ['mod+up', 'mod+down', 'mod+left', 'mod+right'], shift: true }, - (evt) => { + (evt: KeyboardEvent) => { const { key, shiftKey } = evt; // Cancel the default behavior of the event: it's very jarring to run