index.d.ts 638 B

123456789101112131415161718
  1. import * as needle from 'needle';
  2. /**
  3. *
  4. * @param data the data to merge into that data which has been staged thus far (with the {@link add} function)
  5. * and then sent to the backend.
  6. */
  7. export declare function addDataAndSend(data: any): Promise<void | {
  8. res: needle.NeedleResponse;
  9. body: any;
  10. }>;
  11. export declare function allowAnalytics(): boolean;
  12. /**
  13. * Adds a key-value pair to the analytics data `metadata` field. This doesn't send the analytics, just stages it for
  14. * sending later (via the {@link addDataAndSend} function).
  15. * @param key
  16. * @param value
  17. */
  18. export declare function add(key: string, value: unknown): void;