UNPKG

ngx-matomo-client

Version:

Matomo (fka. Piwik) client for Angular applications

92 lines (83 loc) 4.83 kB
import * as i0 from '@angular/core'; import { InjectionToken, AfterViewInit, ElementRef, ModuleWithProviders } from '@angular/core'; import { MatomoFeature } from 'ngx-matomo-client/core'; interface MatomoFormAnalyticsConfiguration { disabled?: boolean; loadScript?: boolean | string; autoScan?: boolean; autoScanDelay?: number; } declare const MATOMO_FORM_ANALYTICS_CONFIGURATION: InjectionToken<MatomoFormAnalyticsConfiguration>; declare class TrackFormFieldDirective implements AfterViewInit { private readonly elementRef; private readonly form; private initialized; set matomoIgnore(ignore: boolean); set matomoTrackFormField(name: string | null | undefined); ngAfterViewInit(): void; track(): void; static ɵfac: i0.ɵɵFactoryDeclaration<TrackFormFieldDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<TrackFormFieldDirective, "[matomoTrackFormField]", ["matomoTrackFormField"], { "matomoIgnore": { "alias": "matomoIgnore"; "required": false; }; "matomoTrackFormField": { "alias": "matomoTrackFormField"; "required": false; }; }, {}, never, never, true, never>; static ngAcceptInputType_matomoIgnore: unknown; } declare class TrackFormDirective implements AfterViewInit { private readonly elementRef; private readonly tracker; private initialized; /** If true, will track a conversion after form submit */ trackConversionOnSubmit: boolean; set matomoIgnore(ignore: boolean); set matomoTrackForm(name: string | null | undefined); constructor(); ngAfterViewInit(): void; track(): void; trackSubmit(): void; trackConversion(): void; trackFormConversionOnSubmit(): void; static ɵfac: i0.ɵɵFactoryDeclaration<TrackFormDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<TrackFormDirective, "[matomoTrackForm]", ["matomoTrackForm"], { "trackConversionOnSubmit": { "alias": "trackConversionOnSubmit"; "required": false; }; "matomoIgnore": { "alias": "matomoIgnore"; "required": false; }; "matomoTrackForm": { "alias": "matomoTrackForm"; "required": false; }; }, {}, never, never, true, never>; static ngAcceptInputType_trackConversionOnSubmit: unknown; static ngAcceptInputType_matomoIgnore: unknown; } declare class TrackFormsDirective implements AfterViewInit { private readonly elementRef; private readonly tracker; ngAfterViewInit(): void; scan(): void; trackSubmit(element: Element | ElementRef<Element>): void; trackConversion(element: Element | ElementRef<Element>): void; static ɵfac: i0.ɵɵFactoryDeclaration<TrackFormsDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<TrackFormsDirective, "[matomoTrackForms]", ["matomoTrackForms"], {}, {}, never, never, true, never>; } declare const MATOMO_FORM_ANALYTICS_DIRECTIVES: readonly [typeof TrackFormDirective, typeof TrackFormsDirective, typeof TrackFormFieldDirective]; declare class MatomoFormAnalyticsModule { private readonly formAnalytics; constructor(); static forRoot(config?: MatomoFormAnalyticsConfiguration): ModuleWithProviders<MatomoFormAnalyticsModule>; static ɵfac: i0.ɵɵFactoryDeclaration<MatomoFormAnalyticsModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<MatomoFormAnalyticsModule, never, [typeof TrackFormDirective, typeof TrackFormsDirective, typeof TrackFormFieldDirective], [typeof TrackFormDirective, typeof TrackFormsDirective, typeof TrackFormFieldDirective]>; static ɵinj: i0.ɵɵInjectorDeclaration<MatomoFormAnalyticsModule>; } /** Enable automatic page views tracking */ declare function withFormAnalytics(config?: MatomoFormAnalyticsConfiguration): MatomoFeature; interface MatomoFormAnalyticsInstance { isFormAnalyticsEnabled(): boolean; disableFormAnalytics(): void; setTrackingTimer(delayInMilliSeconds: number): void; } declare class MatomoFormAnalytics { private readonly delegate; disableFormAnalytics(): void; enableFormAnalytics(): void; enableDebugMode(): void; setTrackingTimer(delayInMilliSeconds: number): void; scanForForms(root?: Element | ElementRef): void; trackForm(formElement: Element | ElementRef): void; trackFormSubmit(formElement: Element | ElementRef): void; trackFormConversion(formElementOrName: Element | ElementRef | string, formId?: string): void; isFormAnalyticsEnabled(): Promise<boolean>; static ɵfac: i0.ɵɵFactoryDeclaration<MatomoFormAnalytics, never>; static ɵprov: i0.ɵɵInjectableDeclaration<MatomoFormAnalytics>; } export { MATOMO_FORM_ANALYTICS_CONFIGURATION, MATOMO_FORM_ANALYTICS_DIRECTIVES, MatomoFormAnalytics, MatomoFormAnalyticsModule, TrackFormDirective, TrackFormFieldDirective, TrackFormsDirective, withFormAnalytics }; export type { MatomoFormAnalyticsConfiguration, MatomoFormAnalyticsInstance };