mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 00:52:55 +00:00
feat: migrate to esm
This commit is contained in:
26
packages/core-tools/src/better-ajv-errors.d.ts
vendored
Normal file
26
packages/core-tools/src/better-ajv-errors.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
declare module 'better-ajv-errors' {
|
||||
import type { ErrorObject } from 'ajv';
|
||||
|
||||
export interface IOutputError {
|
||||
start: { line: number; column: number; offset: number };
|
||||
// Optional for required
|
||||
end?: { line: number; column: number; offset: number };
|
||||
error: string;
|
||||
suggestion?: string;
|
||||
}
|
||||
|
||||
export interface IInputOptions {
|
||||
format?: 'cli' | 'js';
|
||||
indent?: number | null;
|
||||
|
||||
/** Raw JSON used when highlighting error location */
|
||||
json?: string | null;
|
||||
}
|
||||
|
||||
export default function <S, T, Options extends IInputOptions>(
|
||||
schema: S,
|
||||
data: T,
|
||||
errors: Array<ErrorObject>,
|
||||
options?: Options
|
||||
): Options extends { format: 'js' } ? Array<IOutputError> : string;
|
||||
}
|
||||
Reference in New Issue
Block a user