UNPKG

@gensx/storage

Version:

Cloud storage, blobs, sqlite, and vector database providers/hooks for GenSX.

1 lines 986 B
{"version":3,"file":"useSearch.cjs","sources":["@gensx/storage/../../../../src/search/useSearch.ts"],"sourcesContent":["import { SearchClient } from \"./searchClient.js\";\nimport { Namespace, SearchStorageOptions } from \"./types.js\";\n\n/**\n * Hook to access a search namespace\n * @param name The name of the namespace to access\n * @param options Optional configuration properties for the search namespace\n * @returns A promise that resolves to a namespace object for the given name\n */\nexport async function useSearch(\n name: string,\n options: SearchStorageOptions = {},\n): Promise<Namespace> {\n const client = new SearchClient(options);\n const namespace = await client.getNamespace(name);\n return namespace;\n}\n"],"names":["SearchClient"],"mappings":";;;;;;;;;;AAGA;;;;;AAKG;AACI,eAAe,SAAS,CAC7B,IAAY,EACZ,UAAgC,EAAE,EAAA;AAElC,IAAA,MAAM,MAAM,GAAG,IAAIA,yBAAY,CAAC,OAAO,CAAC;IACxC,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC;AACjD,IAAA,OAAO,SAAS;AAClB;;;;"}