diff --git a/types/index.d.ts b/types/index.d.ts index dc93d32..8b27386 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -11,7 +11,7 @@ type AjvCompile = (schema: AnySchema, _meta?: boolean) => AnyValidateFunction type SharedCompilerOptions = { onCreate?: (ajvInstance: Ajv) => void; - plugins?: Plugin[]; + plugins?: (Plugin | [Plugin, unknown])[]; } type BuildAjvJtdCompilerFromPool = (externalSchemas: { [key: string]: AnySchema | AnySchema[] }, options?: SharedCompilerOptions & { mode: 'JTD'; customOptions?: JTDOptions }) => AjvCompile diff --git a/types/index.test-d.ts b/types/index.test-d.ts index 617d10e..f29e3ad 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -238,7 +238,19 @@ expectType(AjvReference) expectType(ajv) expectType(options) return ajv - } + }, + [ + (ajv) => { + expectType(ajv) + return ajv + }, ['keyword1', 'keyword2'] + ], + [ + (ajv) => { + expectType(ajv) + return ajv + }, [{ key: 'value' }] + ], ] }) expectAssignable(compiler)