Skip to content

Commit

Permalink
remove IntentionalAny usages, #1465
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Dec 3, 2024
1 parent c74013d commit d102cdd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 1 addition & 3 deletions js/common/mipmapDownscale.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -25,7 +23,7 @@ type MipMap = {
*
* @author Jonathan Olson <[email protected]>
*/
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;
Expand Down
5 changes: 3 additions & 2 deletions js/grunt/copySupplementalPhetioFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 );

Expand Down Expand Up @@ -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 ] );
Expand Down
3 changes: 2 additions & 1 deletion js/grunt/webpackBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' );

Expand Down Expand Up @@ -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 ] );
Expand Down
4 changes: 2 additions & 2 deletions js/phet-io/formatPhetioAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, IntentionalAny> => {
const copyWithSortedKeys = ( unordered: Record<string, IntentionalAny> ): Record<string, IntentionalAny> => {
if ( Array.isArray( unordered ) ) {
return unordered.map( copyWithSortedKeys );
}
Expand All @@ -34,7 +34,7 @@ const copyWithSortedKeys = ( unordered: IntentionalAny ): Record<string, Intenti
return ordered;
};

export default ( api: IntentionalAny ): string => {
export default ( api: object ): string => {
assert( api, 'api expected' );
const objectString = JSON.stringify( copyWithSortedKeys( api ), null, 2 );
return fixEOL( objectString );
Expand Down

0 comments on commit d102cdd

Please sign in to comment.