mirror of
https://github.com/callstack/agent-device.git
synced 2026-09-14 20:06:34 +08:00
f4f143ced7
* fix: restore helper subpath exports * fix: polish helper subpath typings
24 lines
761 B
TypeScript
24 lines
761 B
TypeScript
export type { FindLocator } from './utils/finders.ts';
|
|
export type { SnapshotNode } from './utils/snapshot.ts';
|
|
export { normalizeRole, normalizeText, parseFindArgs } from './utils/finders.ts';
|
|
|
|
import {
|
|
findBestMatchesByLocator as findBestMatchesByLocatorInternal,
|
|
type FindLocator,
|
|
} from './utils/finders.ts';
|
|
import type { SnapshotNode } from './utils/snapshot.ts';
|
|
|
|
export type FindMatchOptions = {
|
|
requireRect?: boolean;
|
|
};
|
|
|
|
export function findBestMatchesByLocator(
|
|
nodes: SnapshotNode[],
|
|
locator: FindLocator,
|
|
query: string,
|
|
options?: boolean | FindMatchOptions,
|
|
) {
|
|
const matchOptions = typeof options === 'boolean' ? { requireRect: options } : options;
|
|
return findBestMatchesByLocatorInternal(nodes, locator, query, matchOptions);
|
|
}
|