JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1164
  • Score
    100M100P100Q115207F
  • License MIT

TypeScript definitions for JJV

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@types/jjv) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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

    // Type definitions for JJV v1.0.2
    // Project: https://github.com/acornejo/jjv
    // Definitions by: Wim Looman <https://github.com/Nemo157>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    
    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: Fri, 15 Sep 2023 20:36:37 GMT
    • Dependencies: none
    • Global values: none

    Credits

    These definitions were written by Wim Looman.