Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document plugin parameter types #3045

Open
jodeleeuw opened this issue May 22, 2023 Discussed in #3044 · 1 comment
Open

Document plugin parameter types #3045

jodeleeuw opened this issue May 22, 2023 Discussed in #3044 · 1 comment

Comments

@jodeleeuw
Copy link
Member

Discussed in #3044

Originally posted by SHogenboom May 22, 2023
Is there an overview of the available jspsych.ParameterTypes? Ideally accompanied by a description of best practices in terms of when to use which one? Have been searching but was unable to find it.

It would be pretty useful as I’m trying to develop a plugin from scratch (although according to the provided template).

Thanks in advance!

@ChristopheBossens
Copy link

I started looking into this starting from the overview in the modules/plugins.ts file. For best practices I looked into how these parameter types are used in the different plugins. But here it appears to me that the parameter types do not always appear to cover the actual type of the variable that would be assigned. For example, in the preload plugin images are defined as ParameterType.STRING, but the description says that this property needs an array (the default value is an array as well).

The ParameterTypeMap on the other hand does make a distinction between e.g. ParameterType.KEY and ParameterType.KEYS, which are mapped on string and string[] respectively.

Any thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants