Contracts-TS Documentation
    Preparing search index...

    Interface ContractConfig<T>

    Configuration for a Contract

    interface ContractConfig<T> {
        guarded?: boolean;
        name?: string;
        ratified?: boolean;
        replaceable?: boolean;
        test?: (instance: unknown) => instance is RequiredType<T>;
        typeName?: string;
    }

    Type Parameters

    • T

      The Contract deliverable type

    Index

    Properties

    guarded?: boolean

    When guarded is true the Contract throws exception if deliverable is null or undefined The default is true.

    name?: string

    User defined name for this contract. Note: Do not rely on this being a java class name

    the type name

    ratified?: boolean

    When ratified is true the Contract is a RatifiedContract and must comply with RatifiedContract rules.

    replaceable?: boolean

    When replaceable a new binding can replace in an existing one The default is false

    true if replaceable

    test?: (instance: unknown) => instance is RequiredType<T>

    the predefine test to check if instance is of type T

    Type Declaration

      • (instance: unknown): instance is RequiredType<T>
      • Parameters

        • instance: unknown

          the instance to check

        Returns instance is RequiredType<T>

        true if the instance is of type T, false otherwise

    typeName?: string

    The type of deliverable for this contract. Note: Do not rely on this being a java class name

    the type name, null is illegal