@jspsych/plugin-audio-slider-response 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,203 +1,203 @@
1
- import { JsPsych, JsPsychPlugin, ParameterType, TrialType } from "jspsych";
2
- declare const info: {
3
- readonly name: "audio-slider-response";
4
- readonly parameters: {
5
- /** The audio file to be played. */
6
- readonly stimulus: {
7
- readonly type: ParameterType.AUDIO;
8
- readonly pretty_name: "Stimulus";
9
- readonly default: any;
10
- };
11
- /** Sets the minimum value of the slider. */
12
- readonly min: {
13
- readonly type: ParameterType.INT;
14
- readonly pretty_name: "Min slider";
15
- readonly default: 0;
16
- };
17
- /** Sets the maximum value of the slider */
18
- readonly max: {
19
- readonly type: ParameterType.INT;
20
- readonly pretty_name: "Max slider";
21
- readonly default: 100;
22
- };
23
- /** Sets the starting value of the slider */
24
- readonly slider_start: {
25
- readonly type: ParameterType.INT;
26
- readonly pretty_name: "Slider starting value";
27
- readonly default: 50;
28
- };
29
- /** Sets the step of the slider */
30
- readonly step: {
31
- readonly type: ParameterType.INT;
32
- readonly pretty_name: "Step";
33
- readonly default: 1;
34
- };
35
- /** Array containing the labels for the slider. Labels will be displayed at equidistant locations along the slider. */
36
- readonly labels: {
37
- readonly type: ParameterType.HTML_STRING;
38
- readonly pretty_name: "Labels";
39
- readonly default: readonly [];
40
- readonly array: true;
41
- };
42
- /** Width of the slider in pixels. */
43
- readonly slider_width: {
44
- readonly type: ParameterType.INT;
45
- readonly pretty_name: "Slider width";
46
- readonly default: any;
47
- };
48
- /** Label of the button to advance. */
49
- readonly button_label: {
50
- readonly type: ParameterType.STRING;
51
- readonly pretty_name: "Button label";
52
- readonly default: "Continue";
53
- readonly array: false;
54
- };
55
- /** If true, the participant will have to move the slider before continuing. */
56
- readonly require_movement: {
57
- readonly type: ParameterType.BOOL;
58
- readonly pretty_name: "Require movement";
59
- readonly default: false;
60
- };
61
- /** Any content here will be displayed below the slider. */
62
- readonly prompt: {
63
- readonly type: ParameterType.HTML_STRING;
64
- readonly pretty_name: "Prompt";
65
- readonly default: any;
66
- };
67
- /** How long to show the trial. */
68
- readonly trial_duration: {
69
- readonly type: ParameterType.INT;
70
- readonly pretty_name: "Trial duration";
71
- readonly default: any;
72
- };
73
- /** If true, trial will end when user makes a response. */
74
- readonly response_ends_trial: {
75
- readonly type: ParameterType.BOOL;
76
- readonly pretty_name: "Response ends trial";
77
- readonly default: true;
78
- };
79
- /** If true, then the trial will end as soon as the audio file finishes playing. */
80
- readonly trial_ends_after_audio: {
81
- readonly type: ParameterType.BOOL;
82
- readonly pretty_name: "Trial ends after audio";
83
- readonly default: false;
84
- };
85
- /** If true, then responses are allowed while the audio is playing. If false, then the audio must finish playing before a response is accepted. */
86
- readonly response_allowed_while_playing: {
87
- readonly type: ParameterType.BOOL;
88
- readonly pretty_name: "Response allowed while playing";
89
- readonly default: true;
90
- };
91
- };
92
- };
93
- declare type Info = typeof info;
94
- /**
95
- * **audio-slider-response**
96
- *
97
- * jsPsych plugin for playing audio and getting a slider response
98
- *
99
- * @author Josh de Leeuw
100
- * @see {@link https://www.jspsych.org/plugins/jspsych-audio-slider-response/ audio-slider-response plugin documentation on jspsych.org}
101
- */
102
- declare class AudioSliderResponsePlugin implements JsPsychPlugin<Info> {
103
- private jsPsych;
104
- static info: {
105
- readonly name: "audio-slider-response";
106
- readonly parameters: {
107
- /** The audio file to be played. */
108
- readonly stimulus: {
109
- readonly type: ParameterType.AUDIO;
110
- readonly pretty_name: "Stimulus";
111
- readonly default: any;
112
- };
113
- /** Sets the minimum value of the slider. */
114
- readonly min: {
115
- readonly type: ParameterType.INT;
116
- readonly pretty_name: "Min slider";
117
- readonly default: 0;
118
- };
119
- /** Sets the maximum value of the slider */
120
- readonly max: {
121
- readonly type: ParameterType.INT;
122
- readonly pretty_name: "Max slider";
123
- readonly default: 100;
124
- };
125
- /** Sets the starting value of the slider */
126
- readonly slider_start: {
127
- readonly type: ParameterType.INT;
128
- readonly pretty_name: "Slider starting value";
129
- readonly default: 50;
130
- };
131
- /** Sets the step of the slider */
132
- readonly step: {
133
- readonly type: ParameterType.INT;
134
- readonly pretty_name: "Step";
135
- readonly default: 1;
136
- };
137
- /** Array containing the labels for the slider. Labels will be displayed at equidistant locations along the slider. */
138
- readonly labels: {
139
- readonly type: ParameterType.HTML_STRING;
140
- readonly pretty_name: "Labels";
141
- readonly default: readonly [];
142
- readonly array: true;
143
- };
144
- /** Width of the slider in pixels. */
145
- readonly slider_width: {
146
- readonly type: ParameterType.INT;
147
- readonly pretty_name: "Slider width";
148
- readonly default: any;
149
- };
150
- /** Label of the button to advance. */
151
- readonly button_label: {
152
- readonly type: ParameterType.STRING;
153
- readonly pretty_name: "Button label";
154
- readonly default: "Continue";
155
- readonly array: false;
156
- };
157
- /** If true, the participant will have to move the slider before continuing. */
158
- readonly require_movement: {
159
- readonly type: ParameterType.BOOL;
160
- readonly pretty_name: "Require movement";
161
- readonly default: false;
162
- };
163
- /** Any content here will be displayed below the slider. */
164
- readonly prompt: {
165
- readonly type: ParameterType.HTML_STRING;
166
- readonly pretty_name: "Prompt";
167
- readonly default: any;
168
- };
169
- /** How long to show the trial. */
170
- readonly trial_duration: {
171
- readonly type: ParameterType.INT;
172
- readonly pretty_name: "Trial duration";
173
- readonly default: any;
174
- };
175
- /** If true, trial will end when user makes a response. */
176
- readonly response_ends_trial: {
177
- readonly type: ParameterType.BOOL;
178
- readonly pretty_name: "Response ends trial";
179
- readonly default: true;
180
- };
181
- /** If true, then the trial will end as soon as the audio file finishes playing. */
182
- readonly trial_ends_after_audio: {
183
- readonly type: ParameterType.BOOL;
184
- readonly pretty_name: "Trial ends after audio";
185
- readonly default: false;
186
- };
187
- /** If true, then responses are allowed while the audio is playing. If false, then the audio must finish playing before a response is accepted. */
188
- readonly response_allowed_while_playing: {
189
- readonly type: ParameterType.BOOL;
190
- readonly pretty_name: "Response allowed while playing";
191
- readonly default: true;
192
- };
193
- };
194
- };
195
- private audio;
196
- constructor(jsPsych: JsPsych);
197
- trial(display_element: HTMLElement, trial: TrialType<Info>, on_load: () => void): Promise<unknown>;
198
- simulate(trial: TrialType<Info>, simulation_mode: any, simulation_options: any, load_callback: () => void): void;
199
- private create_simulation_data;
200
- private simulate_data_only;
201
- private simulate_visual;
202
- }
203
- export default AudioSliderResponsePlugin;
1
+ import { JsPsych, JsPsychPlugin, ParameterType, TrialType } from "jspsych";
2
+ declare const info: {
3
+ readonly name: "audio-slider-response";
4
+ readonly parameters: {
5
+ /** The audio file to be played. */
6
+ readonly stimulus: {
7
+ readonly type: ParameterType.AUDIO;
8
+ readonly pretty_name: "Stimulus";
9
+ readonly default: any;
10
+ };
11
+ /** Sets the minimum value of the slider. */
12
+ readonly min: {
13
+ readonly type: ParameterType.INT;
14
+ readonly pretty_name: "Min slider";
15
+ readonly default: 0;
16
+ };
17
+ /** Sets the maximum value of the slider */
18
+ readonly max: {
19
+ readonly type: ParameterType.INT;
20
+ readonly pretty_name: "Max slider";
21
+ readonly default: 100;
22
+ };
23
+ /** Sets the starting value of the slider */
24
+ readonly slider_start: {
25
+ readonly type: ParameterType.INT;
26
+ readonly pretty_name: "Slider starting value";
27
+ readonly default: 50;
28
+ };
29
+ /** Sets the step of the slider */
30
+ readonly step: {
31
+ readonly type: ParameterType.INT;
32
+ readonly pretty_name: "Step";
33
+ readonly default: 1;
34
+ };
35
+ /** Array containing the labels for the slider. Labels will be displayed at equidistant locations along the slider. */
36
+ readonly labels: {
37
+ readonly type: ParameterType.HTML_STRING;
38
+ readonly pretty_name: "Labels";
39
+ readonly default: readonly [];
40
+ readonly array: true;
41
+ };
42
+ /** Width of the slider in pixels. */
43
+ readonly slider_width: {
44
+ readonly type: ParameterType.INT;
45
+ readonly pretty_name: "Slider width";
46
+ readonly default: any;
47
+ };
48
+ /** Label of the button to advance. */
49
+ readonly button_label: {
50
+ readonly type: ParameterType.STRING;
51
+ readonly pretty_name: "Button label";
52
+ readonly default: "Continue";
53
+ readonly array: false;
54
+ };
55
+ /** If true, the participant will have to move the slider before continuing. */
56
+ readonly require_movement: {
57
+ readonly type: ParameterType.BOOL;
58
+ readonly pretty_name: "Require movement";
59
+ readonly default: false;
60
+ };
61
+ /** Any content here will be displayed below the slider. */
62
+ readonly prompt: {
63
+ readonly type: ParameterType.HTML_STRING;
64
+ readonly pretty_name: "Prompt";
65
+ readonly default: any;
66
+ };
67
+ /** How long to show the trial. */
68
+ readonly trial_duration: {
69
+ readonly type: ParameterType.INT;
70
+ readonly pretty_name: "Trial duration";
71
+ readonly default: any;
72
+ };
73
+ /** If true, trial will end when user makes a response. */
74
+ readonly response_ends_trial: {
75
+ readonly type: ParameterType.BOOL;
76
+ readonly pretty_name: "Response ends trial";
77
+ readonly default: true;
78
+ };
79
+ /** If true, then the trial will end as soon as the audio file finishes playing. */
80
+ readonly trial_ends_after_audio: {
81
+ readonly type: ParameterType.BOOL;
82
+ readonly pretty_name: "Trial ends after audio";
83
+ readonly default: false;
84
+ };
85
+ /** If true, then responses are allowed while the audio is playing. If false, then the audio must finish playing before a response is accepted. */
86
+ readonly response_allowed_while_playing: {
87
+ readonly type: ParameterType.BOOL;
88
+ readonly pretty_name: "Response allowed while playing";
89
+ readonly default: true;
90
+ };
91
+ };
92
+ };
93
+ type Info = typeof info;
94
+ /**
95
+ * **audio-slider-response**
96
+ *
97
+ * jsPsych plugin for playing audio and getting a slider response
98
+ *
99
+ * @author Josh de Leeuw
100
+ * @see {@link https://www.jspsych.org/plugins/jspsych-audio-slider-response/ audio-slider-response plugin documentation on jspsych.org}
101
+ */
102
+ declare class AudioSliderResponsePlugin implements JsPsychPlugin<Info> {
103
+ private jsPsych;
104
+ static info: {
105
+ readonly name: "audio-slider-response";
106
+ readonly parameters: {
107
+ /** The audio file to be played. */
108
+ readonly stimulus: {
109
+ readonly type: ParameterType.AUDIO;
110
+ readonly pretty_name: "Stimulus";
111
+ readonly default: any;
112
+ };
113
+ /** Sets the minimum value of the slider. */
114
+ readonly min: {
115
+ readonly type: ParameterType.INT;
116
+ readonly pretty_name: "Min slider";
117
+ readonly default: 0;
118
+ };
119
+ /** Sets the maximum value of the slider */
120
+ readonly max: {
121
+ readonly type: ParameterType.INT;
122
+ readonly pretty_name: "Max slider";
123
+ readonly default: 100;
124
+ };
125
+ /** Sets the starting value of the slider */
126
+ readonly slider_start: {
127
+ readonly type: ParameterType.INT;
128
+ readonly pretty_name: "Slider starting value";
129
+ readonly default: 50;
130
+ };
131
+ /** Sets the step of the slider */
132
+ readonly step: {
133
+ readonly type: ParameterType.INT;
134
+ readonly pretty_name: "Step";
135
+ readonly default: 1;
136
+ };
137
+ /** Array containing the labels for the slider. Labels will be displayed at equidistant locations along the slider. */
138
+ readonly labels: {
139
+ readonly type: ParameterType.HTML_STRING;
140
+ readonly pretty_name: "Labels";
141
+ readonly default: readonly [];
142
+ readonly array: true;
143
+ };
144
+ /** Width of the slider in pixels. */
145
+ readonly slider_width: {
146
+ readonly type: ParameterType.INT;
147
+ readonly pretty_name: "Slider width";
148
+ readonly default: any;
149
+ };
150
+ /** Label of the button to advance. */
151
+ readonly button_label: {
152
+ readonly type: ParameterType.STRING;
153
+ readonly pretty_name: "Button label";
154
+ readonly default: "Continue";
155
+ readonly array: false;
156
+ };
157
+ /** If true, the participant will have to move the slider before continuing. */
158
+ readonly require_movement: {
159
+ readonly type: ParameterType.BOOL;
160
+ readonly pretty_name: "Require movement";
161
+ readonly default: false;
162
+ };
163
+ /** Any content here will be displayed below the slider. */
164
+ readonly prompt: {
165
+ readonly type: ParameterType.HTML_STRING;
166
+ readonly pretty_name: "Prompt";
167
+ readonly default: any;
168
+ };
169
+ /** How long to show the trial. */
170
+ readonly trial_duration: {
171
+ readonly type: ParameterType.INT;
172
+ readonly pretty_name: "Trial duration";
173
+ readonly default: any;
174
+ };
175
+ /** If true, trial will end when user makes a response. */
176
+ readonly response_ends_trial: {
177
+ readonly type: ParameterType.BOOL;
178
+ readonly pretty_name: "Response ends trial";
179
+ readonly default: true;
180
+ };
181
+ /** If true, then the trial will end as soon as the audio file finishes playing. */
182
+ readonly trial_ends_after_audio: {
183
+ readonly type: ParameterType.BOOL;
184
+ readonly pretty_name: "Trial ends after audio";
185
+ readonly default: false;
186
+ };
187
+ /** If true, then responses are allowed while the audio is playing. If false, then the audio must finish playing before a response is accepted. */
188
+ readonly response_allowed_while_playing: {
189
+ readonly type: ParameterType.BOOL;
190
+ readonly pretty_name: "Response allowed while playing";
191
+ readonly default: true;
192
+ };
193
+ };
194
+ };
195
+ private audio;
196
+ constructor(jsPsych: JsPsych);
197
+ trial(display_element: HTMLElement, trial: TrialType<Info>, on_load: () => void): Promise<unknown>;
198
+ simulate(trial: TrialType<Info>, simulation_mode: any, simulation_options: any, load_callback: () => void): void;
199
+ private create_simulation_data;
200
+ private simulate_data_only;
201
+ private simulate_visual;
202
+ }
203
+ export default AudioSliderResponsePlugin;