arvo-core
    Preparing search index...

    Type Alias IArvoContract<TUri, TType, TVersions, TMetaData>

    Defines the structure of an Arvo contract, including its identifier, type, and versioned schemas.

    type IArvoContract<
        TUri extends string = string,
        TType extends string = string,
        TVersions extends
            Record<
                ArvoSemanticVersion,
                { accepts: z.ZodTypeAny; emits: Record<string, z.ZodTypeAny> },
            > = Record<
            ArvoSemanticVersion,
            { accepts: z.ZodTypeAny; emits: Record<string, z.ZodTypeAny> },
        >,
        TMetaData extends Record<string, any> = Record<string, any>,
    > = {
        description: string | null;
        domain: string | null;
        metadata: TMetaData;
        type: TType;
        uri: TUri;
        versions: TVersions;
    }

    Type Parameters

    • TUri extends string = string

      The unique URI identifier for the contract

    • TType extends string = string

      The event type that the contract's handler accepts

    • TVersions extends Record<
          ArvoSemanticVersion,
          { accepts: z.ZodTypeAny; emits: Record<string, z.ZodTypeAny> },
      > = Record<
          ArvoSemanticVersion,
          { accepts: z.ZodTypeAny; emits: Record<string, z.ZodTypeAny> },
      >

      A record of versioned schemas, mapping semantic versions to their accept/emit schemas

    • TMetaData extends Record<string, any> = Record<string, any>

      Optional metadata type

    Index

    Properties

    description: string | null

    Optional description providing context about the contract or its handler

    domain: string | null

    The domain of the contract handler

    metadata: TMetaData

    The contract metadata

    type: TType

    The event type that this contract's handler accepts

    uri: TUri

    The unique URI identifier for this contract

    versions: TVersions

    A record mapping semantic versions to their corresponding schemas