improve config definition in the console plugin (#704)
One user encountered a type problem(https://rrweb.slack.com/archives/C01BYDC5C93/p1631683830050900). It turns out that definition of LogReplayConfig isn't perfect
This commit is contained in:
@@ -19,7 +19,7 @@ export type StringifyOptions = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type LogRecordOptions = {
|
type LogRecordOptions = {
|
||||||
level?: LogLevel[] | undefined;
|
level?: LogLevel[];
|
||||||
lengthThreshold?: number;
|
lengthThreshold?: number;
|
||||||
stringifyOptions?: StringifyOptions;
|
stringifyOptions?: StringifyOptions;
|
||||||
logger?: Logger;
|
logger?: Logger;
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import {
|
|||||||
type ReplayLogger = Partial<Record<LogLevel, (data: LogData) => void>>;
|
type ReplayLogger = Partial<Record<LogLevel, (data: LogData) => void>>;
|
||||||
|
|
||||||
type LogReplayConfig = {
|
type LogReplayConfig = {
|
||||||
level?: LogLevel[] | undefined;
|
level?: LogLevel[];
|
||||||
replayLogger: ReplayLogger | undefined;
|
replayLogger?: ReplayLogger;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';
|
const ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export declare type StringifyOptions = {
|
|||||||
depthOfLimit: number;
|
depthOfLimit: number;
|
||||||
};
|
};
|
||||||
declare type LogRecordOptions = {
|
declare type LogRecordOptions = {
|
||||||
level?: LogLevel[] | undefined;
|
level?: LogLevel[];
|
||||||
lengthThreshold?: number;
|
lengthThreshold?: number;
|
||||||
stringifyOptions?: StringifyOptions;
|
stringifyOptions?: StringifyOptions;
|
||||||
logger?: Logger;
|
logger?: Logger;
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import { LogLevel, LogData } from '../record';
|
|||||||
import { ReplayPlugin } from '../../../types';
|
import { ReplayPlugin } from '../../../types';
|
||||||
declare type ReplayLogger = Partial<Record<LogLevel, (data: LogData) => void>>;
|
declare type ReplayLogger = Partial<Record<LogLevel, (data: LogData) => void>>;
|
||||||
declare type LogReplayConfig = {
|
declare type LogReplayConfig = {
|
||||||
level?: LogLevel[] | undefined;
|
level?: LogLevel[];
|
||||||
replayLogger: ReplayLogger | undefined;
|
replayLogger?: ReplayLogger;
|
||||||
};
|
};
|
||||||
export declare const getReplayConsolePlugin: (options?: LogReplayConfig) => ReplayPlugin;
|
export declare const getReplayConsolePlugin: (options?: LogReplayConfig) => ReplayPlugin;
|
||||||
export {};
|
export {};
|
||||||
|
|||||||
Reference in New Issue
Block a user