Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordizzy <diosmosis@users.noreply.github.com>2021-10-11 06:36:30 +0300
committerGitHub <noreply@github.com>2021-10-11 06:36:30 +0300
commitcb717535f16686a1e7202a6377dc9273bab35ab1 (patch)
treee8283e642de185118d0ee6674bcc40b2f3df0fc4 /plugins/CoreVue/types/index.d.ts
parent94c4db44b96e9ca9bc01a4c610183d9ce1537695 (diff)
[Vue] migrate piwik service and test (#18106)
Diffstat (limited to 'plugins/CoreVue/types/index.d.ts')
-rw-r--r--plugins/CoreVue/types/index.d.ts59
1 files changed, 43 insertions, 16 deletions
diff --git a/plugins/CoreVue/types/index.d.ts b/plugins/CoreVue/types/index.d.ts
index 3291b42ad8..3d197e85e2 100644
--- a/plugins/CoreVue/types/index.d.ts
+++ b/plugins/CoreVue/types/index.d.ts
@@ -1,16 +1,11 @@
-interface PiwikGlobal {
- timezoneOffset: number;
- addCustomPeriod: <T>(name: string, periodClass: T) => void;
- shouldPropagateTokenAuth: boolean;
- token_auth: string;
- idSite: string|number;
- period: string;
- currentDateString: string;
-}
-
-let piwik: PiwikGlobal;
+/*!
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
-function _pk_translate(translationStringId: string, values: string[]): string;
+import { IAngularStatic } from 'angular';
/**
* global ajax queue
@@ -42,10 +37,6 @@ interface GlobalAjaxQueue extends Array<XMLHttpRequest|null> {
abort();
}
-interface Window {
- globalAjaxQueue: GlobalAjaxQueue;
-}
-
interface PiwikPopoverGlobal {
isOpen();
}
@@ -66,3 +57,39 @@ interface BroadcastGlobal {
}
let broadcast: BroadcastGlobal;
+
+interface PiwikGlobal {
+ timezoneOffset: number;
+ addCustomPeriod: (name: string, periodClass: any) => void;
+ shouldPropagateTokenAuth: boolean;
+ token_auth: string;
+ idSite: string|number;
+ siteName: string;
+ period?: string;
+ currentDateString?: string;
+ startDateString?: string;
+ endDateString?: string;
+ userCapabilities: string[];
+ piwik_url: string;
+ helper: PiwikHelperGlobal;
+ broadcast: BroadcastGlobal;
+
+ updatePeriodParamsFromUrl(): void;
+ updateDateInTitle(date: string, period: string): void;
+ hasUserCapability(capability: string): boolean;
+}
+
+let piwik: PiwikGlobal;
+
+// add the objects to Window so we can access them through window if needed
+declare global {
+ interface Window {
+ angular: IAngularStatic;
+ globalAjaxQueue: GlobalAjaxQueue;
+ piwik: PiwikGlobal;
+ piwikHelper: PiwikHelperGlobal;
+ broadcast: BroadcastGlobal;
+
+ _pk_translate(translationStringId: string, values: string[]): string;
+ }
+}