@lppedd/di-wise-neo - v0.6.0
    Preparing search index...

    Interface Type<A>

    Type API.

    interface Type<A> {
        name: string;
        inter<B>(typeName: string, B: Type<B>): Type<A & B>;
        union<B>(typeName: string, B: Type<B>): Type<A | B>;
    }

    Type Parameters

    • A
    Index

    Properties

    Methods

    Properties

    name: string

    The name of the type.

    Methods

    • Creates an intersection type from another type.

      Type Parameters

      • B

      Parameters

      • typeName: string
      • B: Type<B>

      Returns Type<A & B>

      const A = createType<A>("A");
      const B = createType<B>("B");

      A.inter("I", B); // => Type<A & B>
    • Creates a union type from another type.

      Type Parameters

      • B

      Parameters

      • typeName: string
      • B: Type<B>

      Returns Type<A | B>

      const A = createType<A>("A");
      const B = createType<B>("B");

      A.union("U", B); // => Type<A | B>