Function defineSerializers

  • Helper function to define custom serializers for the Xtream client.

    This function provides type checking for serializer configurations and returns a properly structured serializer object that can be passed to the Xtream constructor.

    Type Parameters

    • T extends Partial<Serializers>

    Parameters

    • type: string

      A string identifier for the serializer type (e.g., 'standardized', 'jsonapi')

    • serializers: T & Record<Exclude<keyof T, keyof Serializers>, never>

      An object containing custom serializer functions

    Returns { type: string; serializers: T }

    A configured serializer object ready to use with the Xtream class