/** * `readAsVisitor(fetcher, params)`, for a plugin's PUBLIC route (the search, * the comparison): the rows of a table as a visitor is served them. The read * goes through the table route's handler without the server-call marker, so * the visitor row policy applies — only published posts, only active * products, never a hidden column — exactly as for the storefront's own * reads. The fetcher's `fetchData` would read as the server does: every row. */ export declare const VISITOR_READ_SOURCE = "// The rows as a visitor is served them: the table route's own policy applies.\nasync function readAsVisitor(fetcher, params) {\n const req = { query: params, method: 'GET', headers: {}, cookies: {} }\n let status = 200\n let result = null\n const res = {\n status: (code) => {\n status = code\n return res\n },\n json: (data) => {\n result = data\n return res\n },\n setHeader: () => res,\n }\n await fetcher.handler(req, res)\n if (status !== 200 || !result || !result.success) {\n throw new Error((result && result.error) || 'The rows could not be read')\n }\n return result.data\n}"; //# sourceMappingURL=visitor-read-source.d.ts.map