Files
ghostgram/submodules/TelegramCore/Sources/SplitTest.swift
T
ichmagmaus111andClaude Opus 5.5 0622057a4f Ghostgram: open-source release
Ghostgram for iOS, rebuilt from scratch on Telegram iOS 13.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 17:57:09 +01:00

31 lines
816 B
Swift

import Foundation
import Postbox
public protocol SplitTestEvent: RawRepresentable where RawValue == String {
}
public protocol SplitTestConfiguration {
static var defaultValue: Self { get }
}
public protocol SplitTest {
associatedtype Configuration: SplitTestConfiguration
associatedtype Event: SplitTestEvent
var postbox: Postbox { get }
var bucket: String? { get }
var configuration: Configuration { get }
init(postbox: Postbox, bucket: String?, configuration: Configuration)
}
extension SplitTest {
public func addEvent(_ event: Self.Event, data: JSON = []) {
if let bucket = self.bucket {
//TODO: merge additional data
_internal_addAppLogEvent(postbox: self.postbox, type: event.rawValue, data: ["bucket": bucket])
}
}
}