@types/jjv
TypeScript icon, indicating that this package has built-in type declarations

1.0.33 • Public • Published

Installation

npm install --save @types/jjv

Summary

This package contains type definitions for jjv (https://github.com/acornejo/jjv).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jjv.

index.d.ts

declare function jjv(): jjv.Env;

declare namespace jjv {
    interface Errors {
        validation: {
            [property: string]: {
                required?: boolean | undefined;
                type?: string | undefined;
            };
        };
    }

    interface Options {
        checkRequired?: boolean | undefined;
        useDefault?: boolean | undefined;
        useCoerce?: boolean | undefined;
        removeAdditional?: boolean | undefined;
    }

    interface Env {
        defaultOptions: Options;

        addSchema(name: string, schema: Object): void;

        addType(name: string, parse: (input: any) => any): void;
        addFormat(name: string, parse: (input: any) => any): void;
        addCheck(name: string, check: (input: any, comparator: any) => any): void;
        addTypeCoercion(name: string, coerce: (input: any) => any): void;

        validate(name: string, object: any, options?: Options): Errors;
        validate(schema: Object, object: any, options?: Options): Errors;
    }
}

export = jjv;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: none

Credits

These definitions were written by Wim Looman.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/jjv

Weekly Downloads

64

Version

1.0.33

License

MIT

Unpacked Size

4.55 kB

Total Files

5

Last publish

Collaborators

  • types