1 | import { JsonSchema } from '@naturalcycles/js-lib';
|
2 | import type { FastGlobOptions } from '../..';
|
3 | import { AjvSchema, AjvSchemaCfg } from './ajvSchema';
|
4 | /**
|
5 | * Does fs.readFileSync + JSON.parse for ALL files matching the passed `glob` pattern.
|
6 | * E.g `someDir/**\/*.schema.json`
|
7 | *
|
8 | * Returns them as an array of JsonSchema.
|
9 | *
|
10 | * @experimental
|
11 | */
|
12 | export declare function readJsonSchemas(patterns: string | string[], opt?: FastGlobOptions): JsonSchema[];
|
13 | /**
|
14 | * Reads json schemas from given dir (glob pattern).
|
15 | * Creates new AjvSchema for each of them (ajv validates them upon creation).
|
16 | * Passes `schemas` option to ajv, so, schemas may $ref each other and it'll be fine.
|
17 | *
|
18 | * @experimental
|
19 | */
|
20 | export declare function readAjvSchemas(patterns: string | string[], cfg?: AjvSchemaCfg): AjvSchema[];
|