UNPKG

@wirequery/wirequery-js-core

Version:
37 lines (36 loc) 1.39 kB
import type { RecordPlugin } from '@rrweb/types'; export type InitiatorType = 'audio' | 'beacon' | 'body' | 'css' | 'early-hint' | 'embed' | 'fetch' | 'frame' | 'iframe' | 'icon' | 'image' | 'img' | 'input' | 'link' | 'navigation' | 'object' | 'ping' | 'script' | 'track' | 'video' | 'xmlhttprequest'; type NetworkRecordOptions = { initiatorTypes?: InitiatorType[]; ignoreRequestFn?: (data: NetworkRequest) => boolean; recordHeaders?: boolean | { request: boolean; response: boolean; }; recordBody?: boolean | string[] | { request: boolean | string[]; response: boolean | string[]; }; recordInitialRequests?: boolean; }; type Headers = Record<string, string>; type Body = string | Document | Blob | ArrayBufferView | ArrayBuffer | FormData | URLSearchParams | ReadableStream<Uint8Array> | null; type NetworkRequest = { url: string; method?: string; initiatorType: InitiatorType; status?: number; startTime: number; endTime: number; requestHeaders?: Headers; requestBody?: Body; responseHeaders?: Headers; responseBody?: Body; }; export type NetworkData = { requests: NetworkRequest[]; isInitial?: boolean; }; export declare const NETWORK_PLUGIN_NAME = "rrweb/network@1"; export declare const getRecordNetworkPlugin: (options?: NetworkRecordOptions) => RecordPlugin; export {};