// detox-compatible matchers: by.id(), by.text(), by.label(), by.type() // these produce matcher descriptors consumed by element() and expect() export interface Matcher { type: 'id' | 'text' | 'label' | 'type' | 'role' value: string index?: number } export const by = { id(testID: string): Matcher { return { type: 'id', value: testID } }, text(text: string): Matcher { return { type: 'text', value: text } }, label(accessibilityLabel: string): Matcher { return { type: 'label', value: accessibilityLabel } }, type(nativeType: string): Matcher { return { type: 'type', value: nativeType } }, role(accessibilityRole: string): Matcher { return { type: 'role', value: accessibilityRole } }, }