import { SCORMStorageType, NormalizeReadKeyValue, NormalizeWriteKeyValue, NormalizeInteractionKeyValue, NormalizeObjectiveKeyValue, SuccessStatus, CompletionStatus, MergedStatus, FilterScormKeyValue, FilterScormPresets } from "./types"; import { LogLevel, MinLogLevel } from "./logger"; export interface SCORMInterface { SCORM: { init: () => boolean; quit: () => boolean; get: (key: string) => any; set: (key: string, value: any) => boolean; save: () => boolean; version: "1.2" | "2004" | "local"; }; UTILS: { trace: (msg: string, level: LogLevel) => void; }; debug: { isActive: boolean; }; } type DebounceOptions = { isActive: boolean; delayInMs: number; }; type DebugOptions = { minLogLevel: MinLogLevel; sendLogs: boolean; context: { env?: string; service?: string; }; }; interface createWrapperInterface { baseStorageType: CurrentStorageType; scormAPIInterface?: SCORMInterface; shouldStoreEverythingInSuspendData?: boolean; debounceCommits?: Partial; debug?: Partial; moduleId?: string; filteredScormValues?: FilterScormPresets | Partial>; } /** * SCORM storage types * @typedef {"1.2" | "2004" | "local"} SCORMStorageType */ /** * Creates an interface between the LMS API and the custom module * @param {Object} config - The wrapper configuration * @param {SCORMStorageType} config.baseStorageType - The targeted SCORM storage type * @param {Object} config.scormAPIInterface - A way to override pipewek behaviour * @param {boolean} [config.shouldStoreEverythingInSuspendData=false] - Indicates whether objectives and interactions should be stored in suspend data * @param {Object} [config.debounceCommits = {}] - Object indicating how to debounce commits (if needed) * @param {boolean} config.debounceCommits.isActive - Activate debounce or not * @param {number} config.debounceCommits.delayInMs - Commit delay * @param {Object} [config.debug = {}] - Object indicating how to provide debug data * @param {MinLogLevel} config.debug.minLogLevel - Filter applied on log levels printed * @param {boolean} config.debug.sendLogs - Tells whether logs should be forwarded to Datadog * @param {Object} config.debug.context - Add some contexts to Datadog logs * @param {string} config.debug.context.env - Context environment (production, preprod... for instance) * @param {string} config.debug.context.service - Name of the service (product name for instance) * @returns A SCORM interface to communicate with LMS */ declare const create: ({ baseStorageType, scormAPIInterface, shouldStoreEverythingInSuspendData, debounceCommits, debug, moduleId, filteredScormValues, }: createWrapperInterface) => { version: CurrentStorageType; init: ({ startSession }: { isDebug?: boolean; startSession?: boolean; }) => Promise; close: () => Promise; safelySetProgressMeasure: (newProgessMeasure: number) => Promise; safelySetScore: (newScore: number) => Promise; safelySetScoreScaled: (newScore: number) => Promise; safelySetCompleteStatus: (targetedStatus: CurrentStorageType extends "1.2" ? MergedStatus : CompletionStatus) => Promise; safelySetSuccessStatus: (targetedStatus: CurrentStorageType extends "1.2" ? MergedStatus : SuccessStatus) => Promise; getBaseData: | keyof import("./types").NormalizeROKeyValue>(key: K) => Promise[K]>; setBaseData: | keyof import("./types").NormalizeWOKeyValue>(key: K_1, value: NormalizeWriteKeyValue[K_1]) => Promise; setInteractionData: >(key: K_2, index: number, data: NormalizeInteractionKeyValue[K_2]) => Promise; getInteractionData: >(key: K_3, index: number) => Promise[K_3]>; setObjectiveData: >(key: K_4, index: number, data: NormalizeObjectiveKeyValue[K_4]) => Promise; getObjectiveData: >(key: K_5, index: number) => Promise[K_5]>; getGlobalScoreRaw: () => Promise; getGlobalScoreScaled: () => Promise; getGlobalScoreMin: () => Promise; getGlobalScoreMax: () => Promise; getProgressMeasure: () => Promise; }; export { create as createWrapper };