scorm-again 2.6.6 → 2.6.8

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.
Files changed (43) hide show
  1. package/.claude/settings.local.json +94 -2
  2. package/dist/aicc.js +3095 -3070
  3. package/dist/aicc.js.map +1 -1
  4. package/dist/aicc.min.js +1 -1
  5. package/dist/aicc.min.js.map +1 -1
  6. package/dist/esm/aicc.js +3088 -3069
  7. package/dist/esm/aicc.js.map +1 -1
  8. package/dist/esm/aicc.min.js +1 -1
  9. package/dist/esm/aicc.min.js.map +1 -1
  10. package/dist/esm/scorm-again.js +5616 -5591
  11. package/dist/esm/scorm-again.js.map +1 -1
  12. package/dist/esm/scorm-again.min.js +1 -1
  13. package/dist/esm/scorm-again.min.js.map +1 -1
  14. package/dist/esm/scorm12.js +2837 -2812
  15. package/dist/esm/scorm12.js.map +1 -1
  16. package/dist/esm/scorm12.min.js +1 -1
  17. package/dist/esm/scorm12.min.js.map +1 -1
  18. package/dist/esm/scorm2004.js +1955 -1936
  19. package/dist/esm/scorm2004.js.map +1 -1
  20. package/dist/esm/scorm2004.min.js +1 -1
  21. package/dist/esm/scorm2004.min.js.map +1 -1
  22. package/dist/scorm-again.js +5616 -5591
  23. package/dist/scorm-again.js.map +1 -1
  24. package/dist/scorm-again.min.js +1 -1
  25. package/dist/scorm-again.min.js.map +1 -1
  26. package/dist/scorm12.js +2832 -2807
  27. package/dist/scorm12.js.map +1 -1
  28. package/dist/scorm12.min.js +1 -1
  29. package/dist/scorm12.min.js.map +1 -1
  30. package/dist/scorm2004.js +1798 -1773
  31. package/dist/scorm2004.js.map +1 -1
  32. package/dist/scorm2004.min.js +1 -1
  33. package/dist/scorm2004.min.js.map +1 -1
  34. package/dist/types/types/api_types.d.ts +1 -1
  35. package/examples/react-native-offline/.claude/settings.local.json +31 -0
  36. package/index.d.ts +24 -81
  37. package/package.json +25 -1
  38. package/src/BaseAPI.ts +70 -63
  39. package/src/Scorm2004API.ts +2 -2
  40. package/src/constants/default_settings.ts +12 -12
  41. package/src/types/api_types.ts +2 -6
  42. package/tsconfig.json +1 -2
  43. package/.claude/.claude/settings.local.json +0 -13
@@ -53,7 +53,7 @@ export type RefObject = {
53
53
  [key: string]: any;
54
54
  };
55
55
  export type ResultObject = {
56
- result: string;
56
+ result: string | boolean;
57
57
  errorCode: number;
58
58
  navRequest?: string;
59
59
  };
@@ -0,0 +1,31 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(xcode-select:*)",
5
+ "Bash(xcrun:*)",
6
+ "Bash(npx eslint:*)",
7
+ "Bash(npx expo install:*)",
8
+ "WebSearch",
9
+ "WebFetch(domain:github.com)",
10
+ "WebFetch(domain:www.npmjs.com)",
11
+ "WebFetch(domain:dr.pogodin.studio)",
12
+ "Bash(npm install:*)",
13
+ "Bash(pod install)",
14
+ "Bash(npx expo run:ios:*)",
15
+ "Bash(cat:*)",
16
+ "Bash(zip -r:*)",
17
+ "Bash(unzip:*)",
18
+ "Bash(zip:*)",
19
+ "mcp__perplexity__perplexity_ask",
20
+ "WebFetch(domain:support.scorm.com)",
21
+ "mcp__playwright__browser_navigate",
22
+ "Bash(npx playwright install:*)",
23
+ "Bash(npm run download-release-notes:*)",
24
+ "mcp__playwright__browser_snapshot",
25
+ "mcp__playwright__browser_evaluate",
26
+ "mcp__playwright__browser_click",
27
+ "mcp__playwright__browser_run_code",
28
+ "Bash(node:*)"
29
+ ]
30
+ }
31
+ }
package/index.d.ts CHANGED
@@ -1,91 +1,34 @@
1
- import { Scorm12API as Scorm12Impl } from "./src/Scorm12API";
2
- import { CMI as Scorm12CMI } from "./src/cmi/scorm12/cmi";
3
- import { NAV as Scorm12NAV } from "./src/cmi/scorm12/nav";
4
- import { CMI as Scorm2004CMI } from "./src/cmi/scorm2004/cmi";
5
- import { ADL as Scorm2004ADL } from "./src/cmi/scorm2004/adl";
6
- import { Settings } from "./src/types/api_types";
7
- import { Scorm2004API as Scorm2004Impl } from "./src/Scorm2004API";
8
- import { AICC as AICCImpl } from "./src/AICC";
9
-
10
- declare class Scorm12API extends Scorm12Impl {
1
+ // Re-export all types from the generated declarations
2
+ export * from "./dist/types/Scorm12API";
3
+ export * from "./dist/types/Scorm2004API";
4
+ export * from "./dist/types/AICC";
5
+ export * from "./dist/types/types/api_types";
6
+ export * from "./dist/types/constants/enums";
7
+ export * from "./dist/types/constants/error_codes";
8
+ export * from "./dist/types/constants/api_constants";
9
+ export * from "./dist/types/exceptions";
10
+ export * from "./dist/types/exceptions/scorm12_exceptions";
11
+ export * from "./dist/types/exceptions/scorm2004_exceptions";
12
+ export * from "./dist/types/exceptions/aicc_exceptions";
13
+
14
+ // Import implementations for extending
15
+ import { Scorm12API as Scorm12APIImpl } from "./dist/types/Scorm12API";
16
+ import { Scorm2004API as Scorm2004APIImpl } from "./dist/types/Scorm2004API";
17
+ import { AICC as AICCImpl } from "./dist/types/AICC";
18
+ import { Settings } from "./dist/types/types/api_types";
19
+
20
+ // Declare the main API classes
21
+ declare class Scorm12API extends Scorm12APIImpl {
11
22
  constructor(settings?: Settings);
12
-
13
- cmi: Scorm12CMI;
14
- nav: Scorm12NAV;
15
- LMSInitialize: () => string;
16
- LMSFinish: () => string;
17
- LMSGetValue: (CMIElement: string) => string;
18
- LMSSetValue: (CMIElement: string, value: any) => string;
19
- LMSCommit: () => string;
20
- LMSGetLastError: () => string;
21
- LMSGetErrorString: (CMIErrorCode: string) => string;
22
- LMSGetDiagnostic: (CMIErrorCode: string) => string;
23
-
24
- loadFromJSON: (json: any, CMIElement?: string) => void;
25
- loadFromFlattenedJSON: (json: any, CMIElement?: string) => void;
26
- on: (listenerName: string, callback: Function) => void;
27
- off: (listenerName: string, callback: Function) => void;
28
- clear: (listenerName: string) => void;
29
-
30
-
31
- /**
32
- * Called when the API needs to be reset
33
- */
34
- reset(settings?: Settings): void;
35
23
  }
36
24
 
37
- declare class Scorm2004API extends Scorm2004Impl {
25
+ declare class Scorm2004API extends Scorm2004APIImpl {
38
26
  constructor(settings?: Settings);
39
-
40
- cmi: Scorm2004CMI;
41
- adl: Scorm2004ADL;
42
- Initialize: () => string;
43
- Terminate: () => string;
44
- GetValue: (CMIElement: string) => string;
45
- SetValue: (CMIElement: string, value: any) => string;
46
- Commit: () => string;
47
- GetLastError: () => string;
48
- GetErrorString: (CMIErrorCode: string) => string;
49
- GetDiagnostic: (CMIErrorCode: string) => string;
50
-
51
- loadFromJSON: (json: any, CMIElement?: string) => void;
52
- loadFromFlattenedJSON: (json: any, CMIElement?: string) => void;
53
- on: (listenerName: string, callback: Function) => void;
54
- off: (listenerName: string, callback: Function) => void;
55
- clear: (listenerName: string) => void;
56
-
57
-
58
- /**
59
- * Called when the API needs to be reset
60
- */
61
- reset(settings?: Settings): void;
62
27
  }
63
28
 
64
29
  declare class AICC extends AICCImpl {
65
30
  constructor(settings?: Settings);
66
-
67
- cmi: Scorm12CMI;
68
- nav: Scorm12NAV;
69
- LMSInitialize: () => string;
70
- LMSFinish: () => string;
71
- LMSGetValue: (CMIElement: string) => string;
72
- LMSSetValue: (CMIElement: string, value: any) => string;
73
- LMSCommit: () => string;
74
- LMSGetLastError: () => string;
75
- LMSGetErrorString: (CMIErrorCode: string) => string;
76
- LMSGetDiagnostic: (CMIErrorCode: string) => string;
77
-
78
- loadFromJSON: (json: any, CMIElement?: string) => void;
79
- loadFromFlattenedJSON: (json: any, CMIElement?: string) => void;
80
- on: (listenerName: string, callback: Function) => void;
81
- off: (listenerName: string, callback: Function) => void;
82
- clear: (listenerName: string) => void;
83
-
84
-
85
- /**
86
- * Called when the API needs to be reset
87
- */
88
- reset(settings?: Settings): void;
89
31
  }
90
32
 
91
- export { Scorm12API, Scorm2004API, AICC, Settings };
33
+ // Export the main API classes and commonly used types
34
+ export { Scorm12API, Scorm2004API, AICC, Settings };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scorm-again",
3
- "version": "2.6.6",
3
+ "version": "2.6.8",
4
4
  "description": "A modern SCORM JavaScript run-time library for AICC, SCORM 1.2, and SCORM 2004",
5
5
  "main": "dist/scorm-again.js",
6
6
  "types": "index.d.ts",
@@ -9,6 +9,29 @@
9
9
  "browser": {
10
10
  "electron": false
11
11
  },
12
+ "exports": {
13
+ ".": {
14
+ "types": "./index.d.ts",
15
+ "import": "./dist/esm/scorm-again.js",
16
+ "require": "./dist/scorm-again.js"
17
+ },
18
+ "./scorm12": {
19
+ "types": "./dist/types/Scorm12API.d.ts",
20
+ "import": "./dist/esm/scorm12.js",
21
+ "require": "./dist/scorm12.js"
22
+ },
23
+ "./scorm2004": {
24
+ "types": "./dist/types/Scorm2004API.d.ts",
25
+ "import": "./dist/esm/scorm2004.js",
26
+ "require": "./dist/scorm2004.js"
27
+ },
28
+ "./aicc": {
29
+ "types": "./dist/types/AICC.d.ts",
30
+ "import": "./dist/esm/aicc.js",
31
+ "require": "./dist/aicc.js"
32
+ },
33
+ "./package.json": "./package.json"
34
+ },
12
35
  "browserslist": [
13
36
  "> 1%",
14
37
  "edge >= 16",
@@ -59,6 +82,7 @@
59
82
  "sinon": "^19.0.2",
60
83
  "terser-webpack-plugin": "^5.3.10",
61
84
  "ts-loader": "^9.5.1",
85
+ "tslib": "^2.8.1",
62
86
  "tsx": "^4.19.2",
63
87
  "typescript": "^5.7.2",
64
88
  "typescript-eslint": "^8.18.0",