@jspsych/plugin-image-keyboard-response 1.1.1 → 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,156 +1,156 @@
1
- import { JsPsych, JsPsychPlugin, ParameterType, TrialType } from "jspsych";
2
- declare const info: {
3
- readonly name: "image-keyboard-response";
4
- readonly parameters: {
5
- /** The image to be displayed */
6
- readonly stimulus: {
7
- readonly type: ParameterType.IMAGE;
8
- readonly pretty_name: "Stimulus";
9
- readonly default: any;
10
- };
11
- /** Set the image height in pixels */
12
- readonly stimulus_height: {
13
- readonly type: ParameterType.INT;
14
- readonly pretty_name: "Image height";
15
- readonly default: any;
16
- };
17
- /** Set the image width in pixels */
18
- readonly stimulus_width: {
19
- readonly type: ParameterType.INT;
20
- readonly pretty_name: "Image width";
21
- readonly default: any;
22
- };
23
- /** Maintain the aspect ratio after setting width or height */
24
- readonly maintain_aspect_ratio: {
25
- readonly type: ParameterType.BOOL;
26
- readonly pretty_name: "Maintain aspect ratio";
27
- readonly default: true;
28
- };
29
- /** Array containing the key(s) the subject is allowed to press to respond to the stimulus. */
30
- readonly choices: {
31
- readonly type: ParameterType.KEYS;
32
- readonly pretty_name: "Choices";
33
- readonly default: "ALL_KEYS";
34
- };
35
- /** Any content here will be displayed below the stimulus. */
36
- readonly prompt: {
37
- readonly type: ParameterType.HTML_STRING;
38
- readonly pretty_name: "Prompt";
39
- readonly default: any;
40
- };
41
- /** How long to show the stimulus. */
42
- readonly stimulus_duration: {
43
- readonly type: ParameterType.INT;
44
- readonly pretty_name: "Stimulus duration";
45
- readonly default: any;
46
- };
47
- /** How long to show trial before it ends */
48
- readonly trial_duration: {
49
- readonly type: ParameterType.INT;
50
- readonly pretty_name: "Trial duration";
51
- readonly default: any;
52
- };
53
- /** If true, trial will end when subject makes a response. */
54
- readonly response_ends_trial: {
55
- readonly type: ParameterType.BOOL;
56
- readonly pretty_name: "Response ends trial";
57
- readonly default: true;
58
- };
59
- /**
60
- * If true, the image will be drawn onto a canvas element (prevents blank screen between consecutive images in some browsers).
61
- * If false, the image will be shown via an img element.
62
- */
63
- readonly render_on_canvas: {
64
- readonly type: ParameterType.BOOL;
65
- readonly pretty_name: "Render on canvas";
66
- readonly default: true;
67
- };
68
- };
69
- };
70
- declare type Info = typeof info;
71
- /**
72
- * **image-keyboard-response**
73
- *
74
- * jsPsych plugin for displaying an image stimulus and getting a keyboard response
75
- *
76
- * @author Josh de Leeuw
77
- * @see {@link https://www.jspsych.org/plugins/jspsych-image-keyboard-response/ image-keyboard-response plugin documentation on jspsych.org}
78
- */
79
- declare class ImageKeyboardResponsePlugin implements JsPsychPlugin<Info> {
80
- private jsPsych;
81
- static info: {
82
- readonly name: "image-keyboard-response";
83
- readonly parameters: {
84
- /** The image to be displayed */
85
- readonly stimulus: {
86
- readonly type: ParameterType.IMAGE;
87
- readonly pretty_name: "Stimulus";
88
- readonly default: any;
89
- };
90
- /** Set the image height in pixels */
91
- readonly stimulus_height: {
92
- readonly type: ParameterType.INT;
93
- readonly pretty_name: "Image height";
94
- readonly default: any;
95
- };
96
- /** Set the image width in pixels */
97
- readonly stimulus_width: {
98
- readonly type: ParameterType.INT;
99
- readonly pretty_name: "Image width";
100
- readonly default: any;
101
- };
102
- /** Maintain the aspect ratio after setting width or height */
103
- readonly maintain_aspect_ratio: {
104
- readonly type: ParameterType.BOOL;
105
- readonly pretty_name: "Maintain aspect ratio";
106
- readonly default: true;
107
- };
108
- /** Array containing the key(s) the subject is allowed to press to respond to the stimulus. */
109
- readonly choices: {
110
- readonly type: ParameterType.KEYS;
111
- readonly pretty_name: "Choices";
112
- readonly default: "ALL_KEYS";
113
- };
114
- /** Any content here will be displayed below the stimulus. */
115
- readonly prompt: {
116
- readonly type: ParameterType.HTML_STRING;
117
- readonly pretty_name: "Prompt";
118
- readonly default: any;
119
- };
120
- /** How long to show the stimulus. */
121
- readonly stimulus_duration: {
122
- readonly type: ParameterType.INT;
123
- readonly pretty_name: "Stimulus duration";
124
- readonly default: any;
125
- };
126
- /** How long to show trial before it ends */
127
- readonly trial_duration: {
128
- readonly type: ParameterType.INT;
129
- readonly pretty_name: "Trial duration";
130
- readonly default: any;
131
- };
132
- /** If true, trial will end when subject makes a response. */
133
- readonly response_ends_trial: {
134
- readonly type: ParameterType.BOOL;
135
- readonly pretty_name: "Response ends trial";
136
- readonly default: true;
137
- };
138
- /**
139
- * If true, the image will be drawn onto a canvas element (prevents blank screen between consecutive images in some browsers).
140
- * If false, the image will be shown via an img element.
141
- */
142
- readonly render_on_canvas: {
143
- readonly type: ParameterType.BOOL;
144
- readonly pretty_name: "Render on canvas";
145
- readonly default: true;
146
- };
147
- };
148
- };
149
- constructor(jsPsych: JsPsych);
150
- trial(display_element: HTMLElement, trial: TrialType<Info>): void;
151
- simulate(trial: TrialType<Info>, simulation_mode: any, simulation_options: any, load_callback: () => void): void;
152
- private simulate_data_only;
153
- private simulate_visual;
154
- private create_simulation_data;
155
- }
156
- export default ImageKeyboardResponsePlugin;
1
+ import { JsPsych, JsPsychPlugin, ParameterType, TrialType } from "jspsych";
2
+ declare const info: {
3
+ readonly name: "image-keyboard-response";
4
+ readonly parameters: {
5
+ /** The image to be displayed */
6
+ readonly stimulus: {
7
+ readonly type: ParameterType.IMAGE;
8
+ readonly pretty_name: "Stimulus";
9
+ readonly default: any;
10
+ };
11
+ /** Set the image height in pixels */
12
+ readonly stimulus_height: {
13
+ readonly type: ParameterType.INT;
14
+ readonly pretty_name: "Image height";
15
+ readonly default: any;
16
+ };
17
+ /** Set the image width in pixels */
18
+ readonly stimulus_width: {
19
+ readonly type: ParameterType.INT;
20
+ readonly pretty_name: "Image width";
21
+ readonly default: any;
22
+ };
23
+ /** Maintain the aspect ratio after setting width or height */
24
+ readonly maintain_aspect_ratio: {
25
+ readonly type: ParameterType.BOOL;
26
+ readonly pretty_name: "Maintain aspect ratio";
27
+ readonly default: true;
28
+ };
29
+ /** Array containing the key(s) the subject is allowed to press to respond to the stimulus. */
30
+ readonly choices: {
31
+ readonly type: ParameterType.KEYS;
32
+ readonly pretty_name: "Choices";
33
+ readonly default: "ALL_KEYS";
34
+ };
35
+ /** Any content here will be displayed below the stimulus. */
36
+ readonly prompt: {
37
+ readonly type: ParameterType.HTML_STRING;
38
+ readonly pretty_name: "Prompt";
39
+ readonly default: any;
40
+ };
41
+ /** How long to show the stimulus. */
42
+ readonly stimulus_duration: {
43
+ readonly type: ParameterType.INT;
44
+ readonly pretty_name: "Stimulus duration";
45
+ readonly default: any;
46
+ };
47
+ /** How long to show trial before it ends */
48
+ readonly trial_duration: {
49
+ readonly type: ParameterType.INT;
50
+ readonly pretty_name: "Trial duration";
51
+ readonly default: any;
52
+ };
53
+ /** If true, trial will end when subject makes a response. */
54
+ readonly response_ends_trial: {
55
+ readonly type: ParameterType.BOOL;
56
+ readonly pretty_name: "Response ends trial";
57
+ readonly default: true;
58
+ };
59
+ /**
60
+ * If true, the image will be drawn onto a canvas element (prevents blank screen between consecutive images in some browsers).
61
+ * If false, the image will be shown via an img element.
62
+ */
63
+ readonly render_on_canvas: {
64
+ readonly type: ParameterType.BOOL;
65
+ readonly pretty_name: "Render on canvas";
66
+ readonly default: true;
67
+ };
68
+ };
69
+ };
70
+ type Info = typeof info;
71
+ /**
72
+ * **image-keyboard-response**
73
+ *
74
+ * jsPsych plugin for displaying an image stimulus and getting a keyboard response
75
+ *
76
+ * @author Josh de Leeuw
77
+ * @see {@link https://www.jspsych.org/plugins/jspsych-image-keyboard-response/ image-keyboard-response plugin documentation on jspsych.org}
78
+ */
79
+ declare class ImageKeyboardResponsePlugin implements JsPsychPlugin<Info> {
80
+ private jsPsych;
81
+ static info: {
82
+ readonly name: "image-keyboard-response";
83
+ readonly parameters: {
84
+ /** The image to be displayed */
85
+ readonly stimulus: {
86
+ readonly type: ParameterType.IMAGE;
87
+ readonly pretty_name: "Stimulus";
88
+ readonly default: any;
89
+ };
90
+ /** Set the image height in pixels */
91
+ readonly stimulus_height: {
92
+ readonly type: ParameterType.INT;
93
+ readonly pretty_name: "Image height";
94
+ readonly default: any;
95
+ };
96
+ /** Set the image width in pixels */
97
+ readonly stimulus_width: {
98
+ readonly type: ParameterType.INT;
99
+ readonly pretty_name: "Image width";
100
+ readonly default: any;
101
+ };
102
+ /** Maintain the aspect ratio after setting width or height */
103
+ readonly maintain_aspect_ratio: {
104
+ readonly type: ParameterType.BOOL;
105
+ readonly pretty_name: "Maintain aspect ratio";
106
+ readonly default: true;
107
+ };
108
+ /** Array containing the key(s) the subject is allowed to press to respond to the stimulus. */
109
+ readonly choices: {
110
+ readonly type: ParameterType.KEYS;
111
+ readonly pretty_name: "Choices";
112
+ readonly default: "ALL_KEYS";
113
+ };
114
+ /** Any content here will be displayed below the stimulus. */
115
+ readonly prompt: {
116
+ readonly type: ParameterType.HTML_STRING;
117
+ readonly pretty_name: "Prompt";
118
+ readonly default: any;
119
+ };
120
+ /** How long to show the stimulus. */
121
+ readonly stimulus_duration: {
122
+ readonly type: ParameterType.INT;
123
+ readonly pretty_name: "Stimulus duration";
124
+ readonly default: any;
125
+ };
126
+ /** How long to show trial before it ends */
127
+ readonly trial_duration: {
128
+ readonly type: ParameterType.INT;
129
+ readonly pretty_name: "Trial duration";
130
+ readonly default: any;
131
+ };
132
+ /** If true, trial will end when subject makes a response. */
133
+ readonly response_ends_trial: {
134
+ readonly type: ParameterType.BOOL;
135
+ readonly pretty_name: "Response ends trial";
136
+ readonly default: true;
137
+ };
138
+ /**
139
+ * If true, the image will be drawn onto a canvas element (prevents blank screen between consecutive images in some browsers).
140
+ * If false, the image will be shown via an img element.
141
+ */
142
+ readonly render_on_canvas: {
143
+ readonly type: ParameterType.BOOL;
144
+ readonly pretty_name: "Render on canvas";
145
+ readonly default: true;
146
+ };
147
+ };
148
+ };
149
+ constructor(jsPsych: JsPsych);
150
+ trial(display_element: HTMLElement, trial: TrialType<Info>): void;
151
+ simulate(trial: TrialType<Info>, simulation_mode: any, simulation_options: any, load_callback: () => void): void;
152
+ private simulate_data_only;
153
+ private simulate_visual;
154
+ private create_simulation_data;
155
+ }
156
+ export default ImageKeyboardResponsePlugin;