Payload: T extends WithSchema
    ? S extends Schema
        ? WithPayload<Omit<T, "schema"> & { schema: S }>
        : WithPayload<T>
    : T extends object
        ? S extends Schema
            ? WithPayload<T & { schema: S }>
            : WithPayload<T & PayloadFields>
        : WithPayload<{ schema: S extends Schema ? S : Schema }>

Type Parameters