@@ -39,6 +39,8 @@ export interface IRoktLauncher {
3939 selectPlacements : ( options : IRoktSelectPlacementsOptions ) => Promise < IRoktSelection > ;
4040 hashAttributes : ( attributes : IRoktPartnerAttributes ) => Promise < Record < string , string > > ;
4141 use : < T = any > ( name : string ) => Promise < T > ;
42+ getVersion : ( ) => Promise < string > ;
43+ terminate : ( ) => Promise < void > ;
4244}
4345
4446export interface IRoktMessage {
@@ -63,6 +65,8 @@ export interface IRoktKit {
6365 hashAttributes : ( attributes : IRoktPartnerAttributes ) => Promise < Record < string , string > > ;
6466 selectPlacements : ( options : IRoktSelectPlacementsOptions ) => Promise < IRoktSelection > ;
6567 setExtensionData < T > ( extensionData : IRoktPartnerExtensionData < T > ) : void ;
68+ terminate : ( ) => Promise < void > ;
69+ getVersion : ( ) => Promise < string > ;
6670 use : < T = any > ( name : string ) => Promise < T > ;
6771 launcherOptions ?: Dictionary < any > ;
6872}
@@ -265,6 +269,30 @@ export default class RoktManager {
265269 }
266270 }
267271
272+ public terminate ( ) : Promise < void > {
273+ if ( ! this . isReady ( ) ) {
274+ return this . deferredCall < void > ( 'terminate' , { } ) ;
275+ }
276+
277+ try {
278+ return this . kit . terminate ( ) ;
279+ } catch ( error ) {
280+ return Promise . reject ( error instanceof Error ? error : new Error ( 'Error terminating' ) ) ;
281+ }
282+ }
283+
284+ public getVersion ( ) : Promise < string > {
285+ if ( ! this . isReady ( ) ) {
286+ return this . deferredCall < string > ( 'getVersion' , { } ) ;
287+ }
288+
289+ try {
290+ return this . kit . launcher . getVersion ( ) ;
291+ } catch ( error ) {
292+ return Promise . reject ( error instanceof Error ? error : new Error ( 'Error getting the version' ) ) ;
293+ }
294+ }
295+
268296 public getLocalSessionAttributes ( ) : LocalSessionAttributes {
269297 return this . store . getLocalSessionAttributes ( ) ;
270298 }
0 commit comments