initialize.d.ts 1.1 KB

1234567891011121314151617181920212223242526
  1. import './_version.js';
  2. interface GoogleAnalyticsInitializeOptions {
  3. cacheName?: string;
  4. parameterOverrides?: {
  5. [paramName: string]: string;
  6. };
  7. hitFilter?: (params: URLSearchParams) => void;
  8. }
  9. /**
  10. * @param {Object=} [options]
  11. * @param {Object} [options.cacheName] The cache name to store and retrieve
  12. * analytics.js. Defaults to the cache names provided by `workbox-core`.
  13. * @param {Object} [options.parameterOverrides]
  14. * [Measurement Protocol parameters](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters),
  15. * expressed as key/value pairs, to be added to replayed Google Analytics
  16. * requests. This can be used to, e.g., set a custom dimension indicating
  17. * that the request was replayed.
  18. * @param {Function} [options.hitFilter] A function that allows you to modify
  19. * the hit parameters prior to replaying
  20. * the hit. The function is invoked with the original hit's URLSearchParams
  21. * object as its only argument.
  22. *
  23. * @memberof module:workbox-google-analytics
  24. */
  25. declare const initialize: (options?: GoogleAnalyticsInitializeOptions) => void;
  26. export { initialize, };