//#region src/types/paths.d.ts interface PublicWildcardSegment { readonly any: true; } interface PublicRecursiveWildcardSegment { readonly anyDepth: true; } type PathSegments = readonly (string | number | RegExp | IgnorePathSegment | PublicWildcardSegment | PublicRecursiveWildcardSegment)[]; interface FunctionCensorContext { readonly matchedPath: PathSegments; /** * The path segments of the rule that produced this redaction. * When an inherited policy is active (e.g. a parent key rule with `retainStructure: true`), * this reflects the ancestor rule's key or path — not the current node's own key. */ readonly rulePath: PathSegments; readonly rootInput: unknown; readonly terminalKey?: string | number; } type Censor = string | ((value: unknown, context: FunctionCensorContext) => unknown); type RegexPathSegment = RegExp; interface IgnorePathSegment { readonly ignore: string | number | RegexPathSegment; } type StructuredPathSegment = string | number | RegexPathSegment | IgnorePathSegment; type StructuredPathSelector = readonly StructuredPathSegment[]; type PathSelector = string | StructuredPathSelector; interface PathRule { readonly path: PathSelector; readonly censor?: Censor; readonly remove?: boolean; readonly retainStructure?: boolean; readonly replaceStringByLength?: boolean; } type PathEntry = PathSelector | PathRule; //#endregion //#region src/types/diagnostics.d.ts interface DiagnosticEvent { readonly details?: Record; readonly event: string; readonly message: string; readonly path: string; readonly valueType: string; } type DiagnosticSink = (event: DiagnosticEvent) => void; interface DiagnosticsOptions { readonly sink?: DiagnosticSink; } //#endregion //#region src/types/ignored-value-types.d.ts interface IgnoredValueTypesOption { readonly bigint?: boolean; readonly Date?: boolean; readonly Error?: boolean; readonly Map?: boolean; readonly RegExp?: boolean; readonly Set?: boolean; readonly URL?: boolean; } //#endregion //#region src/types/transformers.d.ts type Transformer = (value: unknown) => unknown; interface CustomConstructorTransformerRegistration { readonly constructor: abstract new (...args: never[]) => object; readonly transformers: readonly Transformer[]; } interface TransformersByType { readonly bigint?: readonly Transformer[]; readonly object?: readonly Transformer[]; } interface TransformersByConstructor { readonly Date?: readonly Transformer[]; readonly Error?: readonly Transformer[]; readonly Map?: readonly Transformer[]; readonly RegExp?: readonly Transformer[]; readonly Set?: readonly Transformer[]; readonly URL?: readonly Transformer[]; readonly custom?: readonly CustomConstructorTransformerRegistration[]; } interface TransformersOption { readonly byType?: TransformersByType; readonly byConstructor?: TransformersByConstructor; readonly fallback?: readonly Transformer[]; } //#endregion //#region src/types/config.d.ts type SerialiseOption = boolean | ((value: unknown) => string); interface KeyRule { readonly key: string | RegExp; readonly fuzzyKeyMatch?: boolean; readonly caseSensitiveKeyMatch?: boolean; readonly censor?: Censor; readonly remove?: boolean; readonly retainStructure?: boolean; readonly replaceStringByLength?: boolean; } type KeySelector = string | RegExp | KeyRule; type StringTest = RegExp | SubstringRule; type ValueTypeName = 'string' | 'number' | 'bigint' | 'boolean' | 'object' | 'function' | 'symbol' | 'undefined'; interface SubstringRule { readonly pattern: RegExp; readonly replacer: (value: string, pattern: RegExp) => string; } interface DeepRedactOptions { readonly caseSensitiveKeyMatch?: boolean; readonly censor?: Censor; readonly diagnostics?: DiagnosticsOptions; readonly fuzzyKeyMatch?: boolean; readonly keys?: readonly KeySelector[]; readonly maxDepth?: number; readonly maxNodes?: number; readonly paths?: readonly PathEntry[]; readonly remove?: boolean; readonly retainStructure?: boolean; readonly serialise?: SerialiseOption; readonly stringTests?: readonly StringTest[]; readonly transformers?: TransformersOption; readonly types?: readonly ValueTypeName[]; readonly ignoredValueTypes?: IgnoredValueTypesOption; readonly replaceStringByLength?: boolean; } //#endregion //#region src/types/public.d.ts type Redactor = (value: unknown) => unknown; type RedactorFactory = (options?: DeepRedactOptions) => Redactor; //#endregion export { StructuredPathSelector as A, PathRule as C, PublicWildcardSegment as D, PublicRecursiveWildcardSegment as E, RegexPathSegment as O, PathEntry as S, PathSelector as T, DiagnosticSink as _, KeySelector as a, FunctionCensorContext as b, SubstringRule as c, Transformer as d, TransformersByConstructor as f, DiagnosticEvent as g, IgnoredValueTypesOption as h, KeyRule as i, StructuredPathSegment as k, ValueTypeName as l, TransformersOption as m, RedactorFactory as n, SerialiseOption as o, TransformersByType as p, DeepRedactOptions as r, StringTest as s, Redactor as t, CustomConstructorTransformerRegistration as u, DiagnosticsOptions as v, PathSegments as w, IgnorePathSegment as x, Censor as y };