import { JsPsych } from "./JsPsych" ; import { MigrationError } from "./migration" ; if ( typeof window !== "undefined" && window . hasOwnProperty ( "webkitAudioContext" ) && ! window . hasOwnProperty ( "AudioContext" ) ) { window . AudioContext = webkitAudioContext ; } param options returns export function initJsPsych ( options ? ) { const jsPsych = new JsPsych ( options ) ; const migrationMessages = { init : "`jsPsych.init()` was replaced by `initJsPsych()` in jsPsych v7." , ALL_KEYS : 'jsPsych.ALL_KEYS was replaced by the "ALL_KEYS" string in jsPsych v7.' , NO_KEYS : 'jsPsych.NO_KEYS was replaced by the "NO_KEYS" string in jsPsych v7.' , currentTimelineNodeID : "`currentTimelineNodeID()` was renamed to `getCurrentTimelineNodeID()` in jsPsych v7." , progress : "`progress()` was renamed to `getProgress()` in jsPsych v7." , startTime : "`startTime()` was renamed to `getStartTime()` in jsPsych v7." , totalTime : "`totalTime()` was renamed to `getTotalTime()` in jsPsych v7." , currentTrial : "`currentTrial()` was renamed to `getCurrentTrial()` in jsPsych v7." , initSettings : "`initSettings()` was renamed to `getInitSettings()` in jsPsych v7." , allTimelineVariables : "`allTimelineVariables()` was renamed to `getAllTimelineVariables()` in jsPsych v7." , } ; Object . defineProperties ( jsPsych , Object . fromEntries ( Object . entries ( migrationMessages ) . map ( ( [ key , message ] ) => [ key , { get ( ) { throw new MigrationError ( message ) ; } , } , ] ) ) ) ; return jsPsych ; } export { JsPsych } from "./JsPsych" ; export { JsPsychPlugin , PluginInfo , TrialType , ParameterType , universalPluginParameters , UniversalPluginParameters , } from "./modules/plugins" ; export { JsPsychExtension , JsPsychExtensionInfo } from "./modules/extensions" ;