Skip to content

Commit

Permalink
fix: Fix incorrect declaration of global window for Karma testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud73 committed Jul 4, 2023
1 parent 892bc2f commit 7a1393f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
9 changes: 9 additions & 0 deletions projects/ngx-matomo/src/lib/matomo-injector.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { Inject, Injectable } from '@angular/core';

import { MatomoConfiguration, MATOMO_CONFIGURATION } from './matomo-configuration';

declare global {
/**
* Extend Window interface in order to introduce the Matomo _paq attribute
*/
interface Window {
_paq: any;
}
}

/**
* Service for injecting the Matomo tracker in the application.
* This service shall no longer be used directly within an application.
Expand Down
9 changes: 9 additions & 0 deletions projects/ngx-matomo/src/lib/matomo-tracker.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { Inject, Injectable } from '@angular/core';

import { MATOMO_CONFIGURATION, MatomoConfiguration } from './matomo-configuration';

declare global {
/**
* Extend Window interface in order to introduce the Matomo _paq attribute
*/
interface Window {
_paq: any;
}
}

/**
* Matomo scope
*/
Expand Down
9 changes: 0 additions & 9 deletions projects/ngx-matomo/src/public-api.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
declare global {
/**
* Extend Window interface in order to introduce the Matomo _paq attribute
*/
interface Window {
_paq: any;
}
}

/*
* Public API Surface of ngx-matomo
*/
Expand Down

0 comments on commit 7a1393f

Please sign in to comment.