@zajno/common 2.7.2 → 2.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/cjs/functions/throttle.js +1 -1
  2. package/cjs/functions/throttle.js.map +1 -1
  3. package/cjs/localization/LocalizationManager.js +9 -0
  4. package/cjs/localization/LocalizationManager.js.map +1 -1
  5. package/cjs/localization/index.js +0 -2
  6. package/cjs/localization/index.js.map +1 -1
  7. package/cjs/logger/buffered/buffered.logger.js.map +1 -1
  8. package/cjs/logger/buffered/buffered.memory.js.map +1 -1
  9. package/cjs/logger/empty.js +2 -2
  10. package/cjs/logger/empty.js.map +1 -1
  11. package/cjs/logger/loggable.js +9 -7
  12. package/cjs/logger/loggable.js.map +1 -1
  13. package/cjs/math/arrays.js.map +1 -1
  14. package/cjs/math/object/ops.composite.js.map +1 -1
  15. package/cjs/models/LogicModel.js +6 -6
  16. package/cjs/models/LogicModel.js.map +1 -1
  17. package/cjs/observing/event.js +1 -1
  18. package/cjs/observing/event.js.map +1 -1
  19. package/cjs/observing/event.late.js.map +1 -1
  20. package/cjs/observing/timer.js.map +1 -1
  21. package/cjs/observing/transition.js +177 -0
  22. package/cjs/observing/transition.js.map +1 -0
  23. package/cjs/structures/path/utils.js +4 -0
  24. package/cjs/structures/path/utils.js.map +1 -1
  25. package/cjs/structures/promiseCache.js +9 -9
  26. package/cjs/structures/promiseCache.js.map +1 -1
  27. package/cjs/structures/queue/parallel.js +7 -7
  28. package/cjs/structures/queue/parallel.js.map +1 -1
  29. package/cjs/structures/subscribersMap.js +3 -3
  30. package/cjs/structures/subscribersMap.js.map +1 -1
  31. package/cjs/validation/helpers.js +2 -2
  32. package/cjs/validation/helpers.js.map +1 -1
  33. package/cjs/validation/index.js +1 -1
  34. package/cjs/validation/index.js.map +1 -1
  35. package/cjs/validation/types.js +0 -9
  36. package/cjs/validation/types.js.map +1 -1
  37. package/cjs/validation/validationError.js +12 -0
  38. package/cjs/validation/validationError.js.map +1 -0
  39. package/esm/api/builder.js +1 -0
  40. package/esm/api/builder.js.map +1 -1
  41. package/esm/api/call.config.js +1 -0
  42. package/esm/api/call.config.js.map +1 -1
  43. package/esm/api/call.js +1 -0
  44. package/esm/api/call.js.map +1 -1
  45. package/esm/api/call.types.js +1 -1
  46. package/esm/api/call.types.js.map +1 -1
  47. package/esm/api/endpoint.types.js +1 -1
  48. package/esm/api/endpoint.types.js.map +1 -1
  49. package/esm/api/error.js +1 -0
  50. package/esm/api/error.js.map +1 -1
  51. package/esm/api/extensions/contentType.js +1 -0
  52. package/esm/api/extensions/contentType.js.map +1 -1
  53. package/esm/api/extensions/validation.js +2 -0
  54. package/esm/api/extensions/validation.js.map +1 -1
  55. package/esm/api/logging.js +1 -0
  56. package/esm/api/logging.js.map +1 -1
  57. package/esm/dates/calc.js +1 -0
  58. package/esm/dates/calc.js.map +1 -1
  59. package/esm/dates/format.js +1 -0
  60. package/esm/dates/format.js.map +1 -1
  61. package/esm/dates/period.js +1 -0
  62. package/esm/dates/period.js.map +1 -1
  63. package/esm/fields/update.js +1 -0
  64. package/esm/fields/update.js.map +1 -1
  65. package/esm/functions/assert.js +1 -0
  66. package/esm/functions/assert.js.map +1 -1
  67. package/esm/functions/disposer.js +1 -0
  68. package/esm/functions/disposer.js.map +1 -1
  69. package/esm/functions/throttle.js +2 -1
  70. package/esm/functions/throttle.js.map +1 -1
  71. package/esm/localization/LocalizationManager.js +9 -0
  72. package/esm/localization/LocalizationManager.js.map +1 -1
  73. package/esm/localization/defaults/ValidationErrorsLocalization.js +2 -0
  74. package/esm/localization/defaults/ValidationErrorsLocalization.js.map +1 -1
  75. package/esm/localization/index.js +0 -1
  76. package/esm/localization/index.js.map +1 -1
  77. package/esm/logger/buffered/buffered.logger.js.map +1 -1
  78. package/esm/logger/buffered/buffered.memory.js.map +1 -1
  79. package/esm/logger/empty.js +2 -2
  80. package/esm/logger/empty.js.map +1 -1
  81. package/esm/logger/loggable.js +9 -7
  82. package/esm/logger/loggable.js.map +1 -1
  83. package/esm/math/arrays.js.map +1 -1
  84. package/esm/math/object/ops.composite.js.map +1 -1
  85. package/esm/models/LogicModel.js +6 -6
  86. package/esm/models/LogicModel.js.map +1 -1
  87. package/esm/observing/event.js +1 -1
  88. package/esm/observing/event.js.map +1 -1
  89. package/esm/observing/event.late.js.map +1 -1
  90. package/esm/observing/progressTracker.js +1 -0
  91. package/esm/observing/progressTracker.js.map +1 -1
  92. package/esm/observing/timer.js.map +1 -1
  93. package/esm/observing/transition.js +172 -0
  94. package/esm/observing/transition.js.map +1 -0
  95. package/esm/structures/path/builder.js +1 -1
  96. package/esm/structures/path/builder.js.map +1 -1
  97. package/esm/structures/path/utils.js +4 -0
  98. package/esm/structures/path/utils.js.map +1 -1
  99. package/esm/structures/promiseCache.js +9 -9
  100. package/esm/structures/promiseCache.js.map +1 -1
  101. package/esm/structures/queue/parallel.js +7 -7
  102. package/esm/structures/queue/parallel.js.map +1 -1
  103. package/esm/structures/subscribersMap.js +3 -3
  104. package/esm/structures/subscribersMap.js.map +1 -1
  105. package/esm/validation/helpers.js +1 -1
  106. package/esm/validation/helpers.js.map +1 -1
  107. package/esm/validation/index.js +1 -1
  108. package/esm/validation/index.js.map +1 -1
  109. package/esm/validation/types.js +1 -7
  110. package/esm/validation/types.js.map +1 -1
  111. package/esm/validation/validationError.js +8 -0
  112. package/esm/validation/validationError.js.map +1 -0
  113. package/package.json +1 -1
  114. package/tsconfig.cjs.tsbuildinfo +1 -1
  115. package/tsconfig.esm.tsbuildinfo +1 -1
  116. package/tsconfig.types.tsbuildinfo +1 -1
  117. package/types/api/builder.d.ts +1 -1
  118. package/types/api/call.config.d.ts +1 -1
  119. package/types/api/endpoint.types.d.ts +1 -1
  120. package/types/api/extensions/validation.d.ts +1 -1
  121. package/types/api/logging.d.ts +1 -1
  122. package/types/functions/assert.d.ts +1 -1
  123. package/types/functions/disposer.d.ts +2 -2
  124. package/types/functions/safe.d.ts +1 -1
  125. package/types/localization/LocalizationManager.d.ts +7 -0
  126. package/types/localization/LocalizedValidationErrors.d.ts +1 -1
  127. package/types/localization/index.d.ts +1 -1
  128. package/types/logger/buffered/buffered.logger.d.ts +1 -1
  129. package/types/logger/buffered/buffered.memory.d.ts +2 -2
  130. package/types/logger/console.d.ts +1 -1
  131. package/types/logger/loggable.d.ts +8 -3
  132. package/types/logger/provider.d.ts +1 -1
  133. package/types/logger/types.d.ts +3 -3
  134. package/types/math/arrays.d.ts +1 -1
  135. package/types/math/object/helpers.d.ts +2 -2
  136. package/types/math/object/math.composite.d.ts +3 -3
  137. package/types/math/object/math.d.ts +2 -2
  138. package/types/math/object/ops.composite.d.ts +3 -3
  139. package/types/math/object/ops.d.ts +2 -2
  140. package/types/math/object/types.d.ts +1 -1
  141. package/types/models/Model.d.ts +1 -1
  142. package/types/observing/event.late.d.ts +1 -1
  143. package/types/observing/timer.d.ts +2 -2
  144. package/types/observing/transition.d.ts +40 -0
  145. package/types/structures/path/builder.d.ts +1 -1
  146. package/types/structures/path/utils.d.ts +1 -1
  147. package/types/structures/promiseCache.d.ts +1 -1
  148. package/types/structures/promiseProxy.d.ts +1 -1
  149. package/types/structures/subscribersMap.d.ts +1 -1
  150. package/types/types/deep.d.ts +1 -1
  151. package/types/types/functions.d.ts +1 -1
  152. package/types/types/ident.d.ts +0 -1
  153. package/types/validation/helpers.d.ts +2 -2
  154. package/types/validation/index.d.ts +2 -1
  155. package/types/validation/types.d.ts +1 -5
  156. package/types/validation/validationError.d.ts +5 -0
  157. package/types/validation/wrappers.d.ts +1 -1
@@ -1,13 +1,18 @@
1
1
  import { Getter } from '../types/getter.js';
2
- import { Nullable } from '../types/misc.js';
2
+ import type { Nullable } from '../types/misc.js';
3
3
  import type { ILogger, ILoggerFactory } from './types.js';
4
4
  /** Helper base class for storing and using a logger instance. */
5
5
  export declare class Loggable {
6
6
  private _logger;
7
7
  constructor(logger?: ILogger);
8
- protected get logger(): ILogger | null;
9
- setLogger(logger?: Getter<Nullable<ILogger>>): this;
8
+ /** Returns current logger ({@linkcode ILogger}), or {@link EMPTY_LOGGER} if not set via {@linkcode Loggable.setLogger} or {@linkcode Loggable.setLoggerFactory}. */
9
+ protected get logger(): ILogger;
10
+ /** @returns Whether logger has been set */
11
+ protected get hasLogger(): boolean;
12
+ setLogger(logger: Getter<Nullable<ILogger>>): this;
10
13
  setLoggerFactory(factory: ILoggerFactory | null, ...args: Parameters<ILoggerFactory>): this;
14
+ /** Override this method to customize logger name formatting which is used in {@link Loggable._createLogger} */
11
15
  protected getLoggerName(name: string | undefined): string;
16
+ /** Helper for creating a logger instance with factory and params. */
12
17
  protected _createLogger(factory: ILoggerFactory, ...args: Parameters<ILoggerFactory>): ILogger;
13
18
  }
@@ -4,7 +4,7 @@ import type { ILogger, ILoggerFactory } from './types.js';
4
4
  export declare class LoggerProvider extends Loggable {
5
5
  private _factory;
6
6
  constructor(nameFormatter?: (name: string | undefined) => string, logger?: ILogger);
7
- get logger(): ILogger | null;
7
+ get logger(): ILogger;
8
8
  get factory(): ILoggerFactory | null;
9
9
  setLoggerFactory(factory: ILoggerFactory | null, ...args: Parameters<ILoggerFactory>): this;
10
10
  createLogger(...args: Parameters<ILoggerFactory>): ILogger | null;
@@ -1,9 +1,9 @@
1
1
  import type { Getter } from '../types/getter.js';
2
2
  export type LoggerFunction = (...args: any[]) => void;
3
3
  export interface ILogger {
4
- log: LoggerFunction;
5
- warn: LoggerFunction;
6
- error: LoggerFunction;
4
+ readonly log: LoggerFunction;
5
+ readonly warn: LoggerFunction;
6
+ readonly error: LoggerFunction;
7
7
  }
8
8
  export interface ILoggerSwitchable {
9
9
  enable(): void;
@@ -1,4 +1,4 @@
1
- import { Comparator, Getter, Nullable, Predicate } from '../types/index.js';
1
+ import { Comparator, Getter, type Nullable, type Predicate } from '../types/index.js';
2
2
  /** type-safe `Array.isArray` wrapper */
3
3
  export declare function isArray<T>(value: any): value is T[];
4
4
  export declare function arrayCompareG<T>(arr: ReadonlyArray<T> | null | undefined, cond: (current: T, previous: T | null) => boolean): T | null;
@@ -1,5 +1,5 @@
1
- import { DeepReadonly, DeepReadonlyPartial } from '../../types/deep.js';
2
- import { BasePair, IObjectOps, NumKey } from './types.js';
1
+ import type { DeepReadonly, DeepReadonlyPartial } from '../../types/deep.js';
2
+ import type { BasePair, IObjectOps, NumKey } from './types.js';
3
3
  export declare function _getValue<T extends object, TKey extends NumKey<T> = NumKey<T>>(o: DeepReadonlyPartial<T>, key: TKey): T[TKey] | null;
4
4
  export declare function _getInnerValue<T extends object, TKey extends string & keyof T>(o: DeepReadonly<T>, key: TKey): DeepReadonly<T[TKey]>;
5
5
  export declare function _getInnerValue<T extends object, TKey extends string & keyof T>(o: DeepReadonly<T> | number, key: TKey): DeepReadonly<T[TKey]> | number;
@@ -1,7 +1,7 @@
1
- import { AnyObject } from '../../types/index.js';
2
- import { DeepReadonly } from '../../types/deep.js';
1
+ import type { AnyObject } from '../../types/index.js';
2
+ import type { DeepReadonly } from '../../types/deep.js';
3
3
  import { CompositeObjectOps } from './ops.composite.js';
4
- import { AbsOptions, IObjectMath, MathPairsMap, RoundOptions } from './types.js';
4
+ import type { AbsOptions, IObjectMath, MathPairsMap, RoundOptions } from './types.js';
5
5
  export declare class CompositeObjectMath<T extends AnyObject> extends CompositeObjectOps<T> implements IObjectMath<T> {
6
6
  private readonly _math;
7
7
  constructor(innerMath: MathPairsMap<T>);
@@ -1,6 +1,6 @@
1
- import { DeepReadonly, DeepReadonlyPartial } from '../../types/deep.js';
1
+ import type { DeepReadonly, DeepReadonlyPartial } from '../../types/deep.js';
2
2
  import { ObjectOps } from './ops.js';
3
- import { AbsOptions, DELETE_TYPE, IObjectMath, NumKey, RoundOptions } from './types.js';
3
+ import type { AbsOptions, DELETE_TYPE, IObjectMath, NumKey, RoundOptions } from './types.js';
4
4
  export declare class ObjectMath<T extends object> extends ObjectOps<T> implements IObjectMath<T> {
5
5
  getTotal(o: DeepReadonlyPartial<T>): number;
6
6
  contains(base: DeepReadonly<T>, target: DeepReadonly<T>): boolean;
@@ -1,6 +1,6 @@
1
- import { AnyObject } from '../../types/index.js';
2
- import { DeepReadonly } from '../../types/deep.js';
3
- import { IObjectOps, OpsPairsMap } from './types.js';
1
+ import type { AnyObject } from '../../types/index.js';
2
+ import type { DeepReadonly } from '../../types/deep.js';
3
+ import type { IObjectOps, OpsPairsMap } from './types.js';
4
4
  export declare class CompositeObjectOps<T extends AnyObject> implements IObjectOps<T> {
5
5
  readonly Empty: Readonly<T>;
6
6
  private readonly _ops;
@@ -1,6 +1,6 @@
1
1
  import { SkipCondition, SkipOptions } from '../../fields/skip.js';
2
- import { AnyObject, DeepPartial, DeepReadonly, Predicate } from '../../types/index.js';
3
- import { IObjectOps, NumKey } from './types.js';
2
+ import type { AnyObject, DeepPartial, DeepReadonly, Predicate } from '../../types/index.js';
3
+ import type { IObjectOps, NumKey } from './types.js';
4
4
  type Keys<T extends AnyObject> = NumKey<T>[];
5
5
  export declare class ObjectOps<T extends AnyObject> implements IObjectOps<T> {
6
6
  readonly keys: Keys<T>;
@@ -1,4 +1,4 @@
1
- import { AnyObject, DeepReadonly, TypedKeys } from '../../types/index.js';
1
+ import type { AnyObject, DeepReadonly, TypedKeys } from '../../types/index.js';
2
2
  export type NumKey<T extends AnyObject> = TypedKeys<T, number>;
3
3
  export type AbsOptions = false | 'remove' | 'zero';
4
4
  export type RoundOptions = 'floor' | 'ceil' | 'round';
@@ -1,6 +1,6 @@
1
1
  import type { IResetableModel, IValueModel } from './types.js';
2
2
  import { Getter } from '../types/getter.js';
3
- import { Nullable } from '../types/misc.js';
3
+ import type { Nullable } from '../types/misc.js';
4
4
  export declare class Model<T> implements IValueModel<Nullable<T>>, IResetableModel {
5
5
  private _value;
6
6
  private readonly _defaultValue;
@@ -1,4 +1,4 @@
1
- import { Event, EventHandler } from './event.js';
1
+ import { Event, type EventHandler } from './event.js';
2
2
  /**
3
3
  * One-time event that can be triggered only once, but listeners will be notified at the time of event or subscription, if it happens later.
4
4
  *
@@ -1,5 +1,5 @@
1
- import { IDisposable } from '../functions/disposer.js';
2
- import { EventHandler, IEvent } from './event.js';
1
+ import type { IDisposable } from '../functions/disposer.js';
2
+ import { type EventHandler, type IEvent } from './event.js';
3
3
  export type TimerState = {
4
4
  timer: Timer;
5
5
  elapsed: number;
@@ -0,0 +1,40 @@
1
+ import { type IEvent } from './event.js';
2
+ import type { DisposeFunction, IDisposable } from '../functions/disposer.js';
3
+ import { Getter } from '../types/getter.js';
4
+ import type { Nullable } from '../types/misc.js';
5
+ import { Loggable } from '../logger/loggable.js';
6
+ export type TransitionReaction<T> = (getter: Getter<T>, handler: (v: T) => any) => DisposeFunction;
7
+ export declare class TransitionObserver<T> extends Loggable implements IDisposable {
8
+ protected readonly reaction: TransitionReaction<T>;
9
+ private _event;
10
+ private _getter;
11
+ private _filter;
12
+ private _disposer;
13
+ private _prev;
14
+ private _from;
15
+ private _to;
16
+ private _cb;
17
+ private _fireOnce;
18
+ private _promise;
19
+ private _promiseReject;
20
+ constructor(reaction: TransitionReaction<T>, getter?: () => T);
21
+ get event(): IEvent<T>;
22
+ get currentValue(): Nullable<T>;
23
+ get isObserving(): boolean;
24
+ private get isPromising();
25
+ observe(getter: () => T): this;
26
+ from(from: Getter<T>): this;
27
+ to(to: Getter<T>): this;
28
+ filter(filter: (next: T, prev: Nullable<T>) => boolean): this;
29
+ cb(cb: (v: Nullable<T>) => any): this;
30
+ forceCall(): this;
31
+ fireOnce(enable?: boolean): this;
32
+ forceCheck(): boolean;
33
+ andForceCheck(): this;
34
+ getPromise(timeout?: number | null): Promise<Nullable<T>>;
35
+ reverse(): TransitionObserver<T>;
36
+ dispose: () => void;
37
+ private _checkValue;
38
+ private _finishPromise;
39
+ }
40
+ export declare function waitFor<T>(reaction: TransitionReaction<T>, current: () => T, toBe: T): Promise<Nullable<T>>;
@@ -1,4 +1,4 @@
1
- import { BaseInput, CombineBuilders, SwitchBuilder } from './types.js';
1
+ import type { BaseInput, CombineBuilders, SwitchBuilder } from './types.js';
2
2
  export type * from './types.js';
3
3
  export type { TemplateTransform } from './types.helpers.js';
4
4
  /** Tagged template literal to create a path builder */
@@ -1,4 +1,4 @@
1
- import { Nullable } from '../../types/misc.js';
1
+ import type { Nullable } from '../../types/misc.js';
2
2
  export declare function indexTrim(str: string | null | undefined, ch: string): string;
3
3
  export type CombineOptions = {
4
4
  noTrim?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { Loggable } from '../logger/loggable.js';
2
- import { IMapModel, IValueModel } from '../models/types.js';
2
+ import type { IMapModel, IValueModel } from '../models/types.js';
3
3
  export type DeferredGetter<T> = {
4
4
  readonly current: T | null | undefined;
5
5
  readonly promise: Promise<T | null>;
@@ -1,5 +1,5 @@
1
1
  import { LazyPromise } from '../lazy/promise.js';
2
- import { AnyObject, FunctionKeys, StringKeys } from '../types/index.js';
2
+ import type { AnyObject, FunctionKeys, StringKeys } from '../types/index.js';
3
3
  declare const PromiseGetter = "__promise";
4
4
  type AllowedFnKeys<T extends AnyObject> = FunctionKeys<T, any[], void>;
5
5
  type PromiseProxy<T extends AnyObject, TKeys extends StringKeys<T> = StringKeys<T>, TFnKeys = never, TWrap extends object = object> = {
@@ -1,4 +1,4 @@
1
- import { IDisposable } from '../functions/disposer.js';
1
+ import { type IDisposable } from '../functions/disposer.js';
2
2
  import { Loggable } from '../logger/loggable.js';
3
3
  type Unsub = () => void;
4
4
  export declare class SubscribersMap extends Loggable implements IDisposable {
@@ -1,4 +1,4 @@
1
- import { AnyFunction } from './misc.js';
1
+ import type { AnyFunction } from './misc.js';
2
2
  export type DeepReadonly<T> = T extends Array<infer U> ? ReadonlyArray<DeepReadonly<U>> : (T extends AnyFunction ? T : (T extends object ? {
3
3
  readonly [P in keyof T]: DeepReadonly<T[P]>;
4
4
  } : T));
@@ -1,4 +1,4 @@
1
- import { AnyFunction } from './misc.js';
1
+ import type { AnyFunction } from './misc.js';
2
2
  export type TypedFn<A extends unknown[], R> = (...args: A) => R;
3
3
  export type Asyncify<T> = {
4
4
  [P in keyof T]: T[P] extends TypedFn<unknown[], Promise<unknown>> ? T[P] : (T[P] extends TypedFn<infer A, infer R> ? (...args: A) => Promise<R> : T[P]);
@@ -2,4 +2,3 @@ export type Ident<T, K extends keyof any = string> = T & {
2
2
  id: K;
3
3
  };
4
4
  export type IdentAny = Ident<object>;
5
- export default Ident;
@@ -1,6 +1,6 @@
1
- import { AnyObject } from '../types/index.js';
1
+ import type { AnyObject } from '../types/index.js';
2
2
  import { ValidationErrors } from './ValidationErrors.js';
3
- import { ValidationConfig, ValidationResults, ValidationVoid, ValidatorFunction, ValidatorFunctionAsync } from './types.js';
3
+ import type { ValidationConfig, ValidationResults, ValidationVoid, ValidatorFunction, ValidatorFunctionAsync } from './types.js';
4
4
  export declare function createShouldBeEqualTo<T = string>(getter: () => T): ValidatorFunction<T>;
5
5
  export declare function throwNotOk(result: ValidationErrors, message?: string): void;
6
6
  export declare function validateObject<T extends AnyObject, TErrors = ValidationErrors>(obj: T, validators: ValidationConfig<T, TErrors>, onlyTruthy?: boolean, context?: T): ValidationResults<T, TErrors>;
@@ -1,5 +1,6 @@
1
1
  export * from './ValidationErrors.js';
2
- export * from './types.js';
2
+ export * from './validationError.js';
3
+ export type * from './types.js';
3
4
  export * from './validators.js';
4
5
  export * from './wrappers.js';
5
6
  export * from './helpers.js';
@@ -1,4 +1,4 @@
1
- import { ValidationErrors } from './ValidationErrors.js';
1
+ import { type ValidationErrors } from './ValidationErrors.js';
2
2
  export type ValidatorFunction<T = string, TErrors = ValidationErrors, TContext = any> = (val: T, ctx?: TContext) => TErrors;
3
3
  export type ValidatorFunctionAsync<T = string, TErrors = ValidationErrors, TContext = any> = (val: T, ctx?: TContext) => Promise<TErrors>;
4
4
  export type ValidationConfig<T, TErrors> = {
@@ -8,10 +8,6 @@ export type ValidationResults<T, TErrors> = {
8
8
  [P in keyof T]?: TErrors;
9
9
  };
10
10
  export type WrapperFunction = (val: ValidatorFunction) => ValidatorFunction;
11
- export declare class ValidationError<TErrors = ValidationErrors> extends Error {
12
- readonly code: TErrors;
13
- constructor(message: string, code: TErrors);
14
- }
15
11
  export interface ValidationVoid {
16
12
  readonly error?: string | null | undefined;
17
13
  validate(): Promise<boolean>;
@@ -0,0 +1,5 @@
1
+ import type { ValidationErrors } from './ValidationErrors.js';
2
+ export declare class ValidationError<TErrors = ValidationErrors> extends Error {
3
+ readonly code: TErrors;
4
+ constructor(message: string, code: TErrors);
5
+ }
@@ -1,4 +1,4 @@
1
- import { ValidatorFunction } from './types.js';
1
+ import type { ValidatorFunction } from './types.js';
2
2
  export declare const Wrappers: {
3
3
  required<T = string>(validator: ValidatorFunction<T>): ValidatorFunction<T>;
4
4
  notRequired<T = string>(validator: ValidatorFunction<T>): ValidatorFunction<T>;