@upandgo/react-scorm-container
Advanced tools
Comparing version 1.0.0 to 1.0.1
import * as React from "react"; | ||
import { LMSState, SCORMVersion } from "./lms"; | ||
import { LMSState, SCORMVersion, SCORMEvent } from "./lms"; | ||
export declare type Props = { | ||
@@ -9,3 +9,3 @@ bridgeUrl: string; | ||
initialState: LMSState; | ||
commitCallback: (state: LMSState) => void; | ||
commitCallback: (state: LMSState, eventList: SCORMEvent[]) => void; | ||
}; | ||
@@ -12,0 +12,0 @@ declare type State = { |
@@ -129,3 +129,3 @@ import { createRef, createElement, Component } from 'react'; | ||
if (ev.data.type === "commit") { | ||
_this.props.commitCallback(ev.data.data); | ||
_this.props.commitCallback(ev.data.data, ev.data.eventList); | ||
} | ||
@@ -132,0 +132,0 @@ }; |
@@ -133,3 +133,3 @@ 'use strict'; | ||
if (ev.data.type === "commit") { | ||
_this.props.commitCallback(ev.data.data); | ||
_this.props.commitCallback(ev.data.data, ev.data.eventList); | ||
} | ||
@@ -136,0 +136,0 @@ }; |
@@ -9,2 +9,13 @@ export declare type SCORMVersion = "1.2" | "2004"; | ||
} | ||
export interface SCORMEvent { | ||
type: "set"; | ||
key: string; | ||
value: string; | ||
timestamp: number; | ||
} | ||
export interface IncomingMessage { | ||
type: "commit" | "finish"; | ||
data: any; | ||
eventList: SCORMEvent[]; | ||
} | ||
export interface Interaction { | ||
@@ -11,0 +22,0 @@ id: string; |
{ | ||
"name": "@upandgo/react-scorm-container", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A React component acting as a LMS, listening to SCORM API events and reacting to SCORM API call.", | ||
@@ -5,0 +5,0 @@ "author": "Sangrene", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
68988
413