@citolab/tspci 2.5.30-beta.3 → 2.5.30-beta.4

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.5.30-beta.4](/compare/v2.5.30-beta.3...v2.5.30-beta.4) (2025-02-03)
7
+
8
+ **Note:** Version bump only for package @citolab/tspci
9
+
10
+
11
+
12
+
13
+
6
14
  ## [2.5.30-beta.3](/compare/v2.5.30-beta.2...v2.5.30-beta.3) (2025-02-03)
7
15
 
8
16
  **Note:** Version bump only for package @citolab/tspci
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citolab/tspci",
3
- "version": "2.5.30-beta.3",
3
+ "version": "2.5.30-beta.4",
4
4
  "description": "an opiniated typescript ims-pci builder with tao integration",
5
5
  "author": "patrick <patrick.deklein@cito.nl>",
6
6
  "repository": "@citolab/tspci",
@@ -50,5 +50,5 @@
50
50
  "resolutions": {
51
51
  "chokidar": "^4.0.0"
52
52
  },
53
- "gitHead": "5b9acc4c3375c831ed4885bfd8a389e4c5e5a990"
53
+ "gitHead": "8b22951f33e93e15da089e977a426bbc4846273d"
54
54
  }
package/types/index.d.ts CHANGED
@@ -1,22 +1,22 @@
1
1
  // Define the payload structure for the custom event
2
2
  export interface QtiInteractionChangedDetail {
3
- interaction: IMSpci<ConfigProperties>; // The PCI instance itself
3
+ interaction: IMSpci<ConfigProperties<unknown>>; // The PCI instance itself
4
4
  responseIdentifier: string; // The response identifier provided in the getInstance call
5
5
  valid?: boolean; // Optional boolean indicating if checkValidity() returns true
6
6
  value?: QtiVariableJSON; // Optional value returned by getResponse()
7
7
  }
8
8
 
9
9
  // Define the ConfigProperties interface
10
- export interface ConfigProperties {
11
- properties: Record<string, string>; // Follows dataset conversion rules (camelCased keys)
10
+ export interface ConfigProperties<T> {
11
+ properties: T; // Follows dataset conversion rules (camelCased keys)
12
12
  templateVariables: Record<string, QtiVariableJSON>; // Follows structure in Appendix C
13
13
  contextVariables: Record<string, QtiVariableJSON>; // Follows structure in Appendix C
14
14
  boundTo: Record<string, QtiVariableJSON>; // Follows structure in Appendix C
15
15
  responseIdentifier: string; // Unique within interaction scope
16
16
 
17
- onready: (interaction: IMSpci<ConfigProperties>, state?: string) => void; // Callback when PCI is fully constructed and ready
17
+ onready: (interaction: IMSpci<ConfigProperties<unknown>>, state?: string) => void; // Callback when PCI is fully constructed and ready
18
18
  ondone?: (
19
- interaction: IMSpci<ConfigProperties>,
19
+ interaction: IMSpci<ConfigProperties<unknown>>,
20
20
  response: Record<string, QtiVariableJSON>,
21
21
  state: string,
22
22
  status?: "interacting" | "closed" | "solution" | "review"
@@ -25,7 +25,7 @@ export interface ConfigProperties {
25
25
  status?: "interacting" | "suspended" | "closed" | "solution" | "review"; // Optional, defaults to "interacting"
26
26
  }
27
27
 
28
- export interface IMSpci<CustomConfigProperties extends ConfigProperties> {
28
+ export interface IMSpci<T> {
29
29
  typeIdentifier: string;
30
30
 
31
31
  /** @access public
@@ -37,7 +37,7 @@ export interface IMSpci<CustomConfigProperties extends ConfigProperties> {
37
37
  * This must have been obtained from a prior call to getState on an
38
38
  * instance of this type (same typeIdentifier)
39
39
  */
40
- getInstance: (dom: HTMLElement, configuration: Configuration<CustomConfigProperties>, state: string) => void;
40
+ getInstance: (dom: HTMLElement, configuration: ConfigProperties<T>, state: string) => void;
41
41
 
42
42
  /** @access public
43
43
  * @method getResponse
@@ -55,11 +55,6 @@ export interface IMSpci<CustomConfigProperties extends ConfigProperties> {
55
55
  destroy?: () => void; // Not used in IMS and not in TAO implementation, so not used here (optional)
56
56
  }
57
57
 
58
- export declare type Configuration<T extends ConfigProperties> = {
59
- onready: () => void;
60
- properties: T;
61
- };
62
-
63
58
  export interface directedPair {
64
59
  destination: string;
65
60
  source: string;