diff --git a/js/common/mipmapDownscale.ts b/js/common/mipmapDownscale.ts index 190b9c81..c16ba7ac 100644 --- a/js/common/mipmapDownscale.ts +++ b/js/common/mipmapDownscale.ts @@ -1,8 +1,6 @@ // Copyright 2015-2024, University of Colorado Boulder -import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.js'; - type MipMap = { data: Buffer; width: number; @@ -25,7 +23,7 @@ type MipMap = { * * @author Jonathan Olson */ -function mipmapDownscale( mipmap: MipMap, createData: ( width: number, height: number ) => Buffer ): { data: IntentionalAny; width: number; height: number } { +function mipmapDownscale( mipmap: MipMap, createData: ( width: number, height: number ) => Buffer ): { data: Buffer; width: number; height: number } { // array index constants for the channels const R = 0; const G = 1; diff --git a/js/grunt/copySupplementalPhetioFiles.ts b/js/grunt/copySupplementalPhetioFiles.ts index 5fbebe1c..2f50a81d 100644 --- a/js/grunt/copySupplementalPhetioFiles.ts +++ b/js/grunt/copySupplementalPhetioFiles.ts @@ -12,6 +12,7 @@ import assert from 'assert'; import fs from 'fs'; import _ from 'lodash'; import path from 'path'; +import { Stats } from 'webpack'; import SimVersion from '../../../perennial-alias/js/browser-and-node/SimVersion.js'; import dirname from '../../../perennial-alias/js/common/dirname.js'; import execute from '../../../perennial-alias/js/common/execute.js'; @@ -482,7 +483,7 @@ const handleOfflineArtifact = async ( buildDir: string, repo: string, version: s const output = fs.createWriteStream( `${buildDir}${repo}-phet-io-${version}.zip` ); const archive = archiver( 'zip' ); - archive.on( 'error', ( err: IntentionalAny ) => grunt.fail.fatal( `error creating archive: ${err}` ) ); + archive.on( 'error', ( err: unknown ) => grunt.fail.fatal( `error creating archive: ${err}` ) ); archive.pipe( output ); @@ -717,7 +718,7 @@ const getCompiledMigrationProcessors = async ( repo: string, buildDir: string ): } } ); - compiler.run( ( err: Error, stats: IntentionalAny ) => { + compiler.run( ( err: Error, stats: Stats ) => { if ( err || stats.hasErrors() ) { console.error( 'Migration processors webpack build errors:', stats.compilation.errors ); reject( err || stats.compilation.errors[ 0 ] ); diff --git a/js/grunt/webpackBuild.ts b/js/grunt/webpackBuild.ts index e341cfa2..b50848d5 100644 --- a/js/grunt/webpackBuild.ts +++ b/js/grunt/webpackBuild.ts @@ -14,6 +14,7 @@ import dirname from '../../../perennial-alias/js/common/dirname.js'; import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.js'; import ChipperConstants from '../common/ChipperConstants.js'; import webpackGlobalLibraries from '../common/webpackGlobalLibraries.js'; +import { Stats } from 'webpack'; const webpack = require( 'webpack' ); @@ -163,7 +164,7 @@ const webpackBuild = function webpackBuild( repo: string, brand: string, provide ] } ); - compiler.run( ( err: Error, stats: IntentionalAny ) => { + compiler.run( ( err: Error, stats: Stats ) => { if ( err || stats.hasErrors() ) { console.error( 'Webpack build errors:', stats.compilation.errors ); reject( err || stats.compilation.errors[ 0 ] ); diff --git a/js/phet-io/formatPhetioAPI.ts b/js/phet-io/formatPhetioAPI.ts index 940c2dbb..0cd64883 100644 --- a/js/phet-io/formatPhetioAPI.ts +++ b/js/phet-io/formatPhetioAPI.ts @@ -18,7 +18,7 @@ import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.js'; * Creates a new object, recursively, by sorting the keys at each level. * @param unordered - jsonifiable object to be sorted by key name. Sorting is recursive. */ -const copyWithSortedKeys = ( unordered: IntentionalAny ): Record => { +const copyWithSortedKeys = ( unordered: Record ): Record => { if ( Array.isArray( unordered ) ) { return unordered.map( copyWithSortedKeys ); } @@ -34,7 +34,7 @@ const copyWithSortedKeys = ( unordered: IntentionalAny ): Record { +export default ( api: object ): string => { assert( api, 'api expected' ); const objectString = JSON.stringify( copyWithSortedKeys( api ), null, 2 ); return fixEOL( objectString );