Skip to content

Commit

Permalink
converted JS to TS, see #160
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Apr 7, 2022
1 parent 607adf7 commit fb557c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
12 changes: 6 additions & 6 deletions js/WrappedAudioBuffer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Copyright 2020-2021, University of Colorado Boulder

// @ts-nocheck

/**
* WrappedAudioBuffer is an object that contains a Web Audio AudioBuffer and a TinyProperty that indicates whether the
* audio buffer has been decoded. This is *only* intended for usage during the loading process, not during run time,
Expand All @@ -15,15 +13,17 @@ import TinyProperty from '../../axon/js/TinyProperty.js';

class WrappedAudioBuffer {

// This TinyProperty is set to null during construction. Later, when audio data is loaded and decoded, the client
// should set this to the resultant AudioBuffer. Once this is set to an AudioBuffer, it should not be set again.
public readonly audioBufferProperty: TinyProperty<AudioBuffer | null>;

constructor() {

// @public {TinyProperty.<AudioBuffer|null>} - A TinyProperty that is initially set to null and is set to an audio
// buffer, which contains audio data, when the decoding of that data is complete.
this.audioBufferProperty = new TinyProperty( null );
this.audioBufferProperty = new TinyProperty<AudioBuffer | null>( null );

// Make sure that the audio buffer is only ever set once.
assert && this.audioBufferProperty.lazyLink( ( audioBuffer, previousAudioBuffer ) => {
assert( previousAudioBuffer === null && audioBuffer !== null, 'The audio buffer can only be set once' );
assert && assert( previousAudioBuffer === null && audioBuffer !== null, 'The audio buffer can only be set once' );
} );
}
}
Expand Down
2 changes: 0 additions & 2 deletions sounds/demo-and-test/sliderClick01_mp3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Copyright 2022, University of Colorado Boulder

/* eslint-disable */
import asyncLoader from '../../../phet-core/js/asyncLoader.js';
import base64SoundToByteArray from '../../../tambo/js/base64SoundToByteArray.js';
Expand Down
2 changes: 0 additions & 2 deletions sounds/demo-and-test/sliderClick02_mp3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Copyright 2022, University of Colorado Boulder

/* eslint-disable */
import asyncLoader from '../../../phet-core/js/asyncLoader.js';
import base64SoundToByteArray from '../../../tambo/js/base64SoundToByteArray.js';
Expand Down

0 comments on commit fb557c1

Please sign in to comment.