import type { PartialDeep } from 'type-fest'; /** * The `flattenConnection` utility transforms a connection object from the Storefront API (for example, [Product-related connections](https://shopify.dev/api/storefront/reference/products/product)) into a flat array of nodes. * The utility works with either `nodes` or `edges.node`. * * If `connection` is null or undefined, will return an empty array instead in production. In development, an error will be thrown. * @publicDocs */ export declare function flattenConnection | PartialDeep | ConnectionEdges | ConnectionNodes>(connection?: ConnectionGeneric): ConnectionGeneric extends { edges: Array<{ node: infer ConnectionBaseType; }>; } | { nodes: Array; } ? ConnectionBaseType[] : ConnectionGeneric extends PartialDeep<{ edges: { node: Array; }; }, { recurseIntoArrays: true; }> | PartialDeep<{ nodes: Array; }, { recurseIntoArrays: true; }> ? PartialDeep : never; type ConnectionEdges = { edges: Array<{ node: unknown; }>; }; type ConnectionNodes = { nodes: Array; }; /** @publicDocs */ export interface ConnectionGenericForDoc { connection?: ConnectionEdges | ConnectionNodes; } /** @publicDocs */ export type FlattenConnectionReturnForDoc = unknown[]; export {};