import { BeforeSendFn, KnownEventName } from '../types'; /** * Return a `before_send` hook that samples by distinct ID. * A given ID sends either all its events or none. A rate of 0.5 keeps roughly * half of distinct IDs, not half of each ID's events. * * Import it from `posthog-js/customizations` and pass it to `before_send`. * * @example * ```ts * import { sampleByDistinctId } from 'posthog-js/customizations' * * posthog.init('', { before_send: sampleByDistinctId(0.4) }) * ``` * * @param percent Fraction of IDs to keep, from 0 (none) to 1 (all). */ export declare function sampleByDistinctId(percent: number): BeforeSendFn; /** * Return a `before_send` hook that samples by session ID. * A given session sends either all its events or none. A rate of 0.5 keeps * roughly half of sessions, not half of each session's events. * * Import it from `posthog-js/customizations` and pass it to `before_send`. * * @example * ```ts * import { sampleBySessionId } from 'posthog-js/customizations' * * posthog.init('', { before_send: sampleBySessionId(0.25) }) * ``` * * @param percent Fraction of sessions to keep, from 0 (none) to 1 (all). */ export declare function sampleBySessionId(percent: number): BeforeSendFn; /** * Return a `before_send` hook that samples events with the listed names. * Other events are kept. Sampling applies to individual events. * * Import it from `posthog-js/customizations` and pass it to `before_send`. * * @param eventNames Event names to sample. * @param percent Fraction of matching events to keep, from 0 (none) to 1 (all). */ export declare function sampleByEvent(eventNames: (KnownEventName | string)[], percent: number): BeforeSendFn; export declare const printAndDropEverything: BeforeSendFn;