UNPKG

@prismicio/client

Version:

The official JavaScript + TypeScript client library for Prismic

15 lines (14 loc) 459 B
import type { Ref } from "../types/api/ref"; /** * Returns the first ref from a list that passes a filter (a function that * returns true). * * @param refs - A list of refs to search. * @param filter - A function that determines if a ref from the list matches the * criteria. * * @returns The first matching ref. * * @throws If a matching ref cannot be found. */ export declare const findRef: (refs: Ref[], filter: (ref: Ref) => boolean) => Ref;