import { YamlStringifyOptions } from "./yamlStringify.mjs"; //#region src/testUtils.d.ts type LoggerStoreOptions = { filterKeys?: string[]; rejectKeys?: string[]; splitLongLines?: true; maxLineLengthBeforeSplit?: number; fromLastSnapshot?: boolean; arrays?: 'all' | 'firstAndLast' | 'length' | { firstNItems: number; }; changesOnly?: boolean; useEmojiForBooleans?: boolean; dedupeKey?: string; ignoreMarkersInChanges?: boolean; }; declare function setDefaultLoggerStoreOptions(options: Partial): void; declare function createLoggerStore({ filterKeys: defaultFilterKeys, rejectKeys: defaultRejectKeys, splitLongLines: defaultSplitLongLines, maxLineLengthBeforeSplit: defaultMaxLineLengthBeforeSplit, fromLastSnapshot: defaultFromLastSnapshot, arrays: defaultArrays, changesOnly: defaultChangesOnly, useEmojiForBooleans: defaultUseEmojiForBooleans, dedupeKey: defaultDedupeKey, ignoreMarkersInChanges: defaultIgnoreMarkersInChanges }?: LoggerStoreOptions): { add: (render: Record | readonly Record[]) => void; reset: (keepLastRender?: boolean) => void; getSnapshot: ({ arrays, changesOnly, dedupeKey, filterKeys, rejectKeys, includeLastSnapshotEndMark, splitLongLines, maxLineLengthBeforeSplit, fromLastSnapshot, useEmojiForBooleans, ignoreMarkersInChanges }?: { arrays?: "all" | "firstAndLast" | "length" | { firstNItems: number; }; changesOnly?: boolean; dedupeKey?: string; filterKeys?: string[]; rejectKeys?: string[]; includeLastSnapshotEndMark?: boolean; splitLongLines?: boolean; maxLineLengthBeforeSplit?: number; fromLastSnapshot?: boolean; useEmojiForBooleans?: boolean; ignoreMarkersInChanges?: boolean; }) => string; waitNextLog: (timeout?: number) => Promise; readonly changesSnapshot: string; readonly snapshot: string; readonly snapshotFromLast: string; logsCount: () => number; readonly rendersTime: number[]; addMark: (label: string) => void; }; declare function getResultFn any>(fnGetter: () => T, wrapper?: (...args: any[]) => any): T; declare function waitController(): { wait: Promise; stopWaiting: () => void; stopWaitingAfter: (ms: number) => void; }; /** * Produces a more compact and readable snapshot of a value using yaml. By * default booleans are shown as `✅` and `❌`, use `showBooleansAs` to * disable/configure this. * * Filtering patterns in `rejectKeys` and `filterKeys`: * * - `'prop'` - Only root-level properties named 'prop' * - `'**prop'` - Any property named exactly 'prop' at any level (root or nested) * - `'*.prop'` - Any nested property named 'prop' at second level (excludes * root-level matches) * - `'test.*.prop'` - Any property named 'prop' at second level of 'test' * - `'test.*.test.**prop'` - Any property named 'prop' inside of 'test.*.test' * - `'prop.nested'` - Exact nested property paths like `obj.prop.nested` * - `'prop.**nested'` - All nested properties inside root `prop` with name * `nested` * - `'prop[0]'` - The first item of the `prop` array * - `'prop[*]'` - All items of the `prop` array * - `'prop[0].nested'` - `nested` prop of the first item of the `prop` array * - `'prop[*].nested'` - `nested` prop of all items of the `prop` array * - `'prop[*]**nested'` - all `nested` props of all items of the `prop` array * - `'prop[0-2]'` - The first three items of the `prop` array * - `'prop[4-*]'` - All items of the `prop` array from the fourth index to the * end * - `'prop[0-2].nested.**prop'` - Combining multiple nested patterns is supported * - Root array: * * - `'[0]'` - The first item of the root array * - `'[*]'` - All items of the array * - `'[0].nested'` - `nested` prop of the first item of the array * - `'[*].nested'` - `nested` prop of all items of the array * - `'[*]**nested'` - all `nested` props of all items of the array * - `'[0-2]'` - The first three items of the array * - `'[4-*]'` - All items of the array from the fourth index to the end * - Expanding the patterns with parentheses: * * - `'prop.test.(prop1|prop2|prop3.prop4)'` - Will produce `prop.test.prop1`, * `prop.test.prop2`, and `prop.test.prop3.prop4` * - Array filtering by value: * * - `'users[%name="John"]'` - Filters the `users` with the `name` property equal * to `John` * - `'users[%name="John" | "Jane"]'` - Filters the `users` with the `name` * property equal to `John` or `Jane` * - `'users[%name="John" | "Jane" && %age=20]'` - AND and OR are supported by * using `&&` and `||`, nesting logical operators is not supported yet * - `'users[%config.name="John" | "Jane"]'` - Dot notation is supported * * Check more supported patterns in {@link filterObjectOrArrayKeys} docs. * * @param value - The value to snapshot. * @param options - The options for the snapshot. * @param options.collapseObjects - Whether to collapse objects into a single * line. * @param options.maxLineLength - The maximum length of a line. * @param options.showUndefined - Whether to show undefined values. * @param options.includeErrorStack - Whether `Error` values include `stack` * (default false here; `yamlStringify` alone defaults to true). * @param options.includeErrorCause - Whether `Error` values include `cause` * recursively (default true). * @param options.pickErrorOwnProps - Allowlist of extra `Error` own keys, or a * predicate `(key, value) => boolean`; omit to include all extras. * @param options.showBooleansAs - Whether to show booleans as text, by default * true is `✅` and false is `❌` * @param options.rejectKeys - The keys to reject. * @param options.filterKeys - The keys to filter. * @param options.ignoreProps - The props to ignore. * @param options.replaceValues - Function to replace values at specific paths. * Returns `false` to keep original value or `{newValue}` to replace. * @param options.sortKeys - Sort all keys by a specific order (default: * `simpleValuesFirst`). * @param options.sortPatterns - Sort specific keys by pattern. Use to control * the order of specific properties. The same patterns as `filterKeys` are * supported. * @returns The compact snapshot of the value. */ declare function compactSnapshot(value: unknown, { collapseObjects, maxLineLength, showUndefined, showBooleansAs, includeErrorStack, includeErrorCause, replaceValues, rejectKeys, filterKeys, sortKeys, sortPatterns, ...options }?: YamlStringifyOptions & { showBooleansAs?: boolean | { props?: Record; ignoreProps?: string[]; trueText?: string; falseText?: string; }; replaceValues?: (value: unknown, path: string) => false | { newValue: unknown; }; rejectKeys?: string[] | string; filterKeys?: string[] | string; sortKeys?: 'asc' | 'desc' | 'simpleValuesFirst' | false; sortPatterns?: string[]; }): string; //#endregion export { LoggerStoreOptions, compactSnapshot, createLoggerStore, getResultFn, setDefaultLoggerStoreOptions, waitController };