@langchain/community
Version:
Third-party integrations for LangChain.js
1 lines • 2.36 kB
Source Map (JSON)
{"version":3,"file":"gitbook.d.ts","names":["Document","CheerioWebBaseLoader","GitbookLoaderParams","GitbookLoader","Promise"],"sources":["../../../src/document_loaders/web/gitbook.d.ts"],"sourcesContent":["import { Document } from \"@langchain/core/documents\";\nimport { CheerioWebBaseLoader } from \"./cheerio.js\";\n/**\n * Interface representing the parameters for configuring the\n * GitbookLoader. It has an optional property shouldLoadAllPaths, which\n * indicates whether all paths should be loaded.\n */\ninterface GitbookLoaderParams {\n shouldLoadAllPaths?: boolean;\n}\n/**\n * Class representing a document loader specifically designed for loading\n * documents from Gitbook. It extends the CheerioWebBaseLoader.\n */\nexport declare class GitbookLoader extends CheerioWebBaseLoader {\n webPath: string;\n shouldLoadAllPaths: boolean;\n private readonly baseUrl;\n constructor(webPath: string, params?: GitbookLoaderParams);\n /**\n * Method that scrapes the web document using Cheerio and loads the\n * content based on the value of shouldLoadAllPaths. If shouldLoadAllPaths\n * is true, it calls the loadAllPaths() method to load all paths.\n * Otherwise, it calls the loadPath() method to load a single path.\n * @returns Promise resolving to an array of Document instances.\n */\n load(): Promise<Document[]>;\n /**\n * Private method that loads the content of a single path from the Gitbook\n * web document. It extracts the page content by selecting all elements\n * inside the \"main\" element, filters out empty text nodes, and joins the\n * remaining text nodes with line breaks. It extracts the title by\n * selecting the first \"h1\" element inside the \"main\" element. It creates\n * a Document instance with the extracted page content and metadata\n * containing the source URL and title.\n * @param $ CheerioAPI instance representing the loaded web document.\n * @param url Optional string representing the URL of the web document.\n * @returns Array of Document instances.\n */\n private loadPath;\n private loadAllPaths;\n}\nexport {};\n//# sourceMappingURL=gitbook.d.ts.map"],"mappings":";;;;;;;AACoD;AAapD;;UAPUE,mBAAAA,CAmBUF;EAARI,kBAAAA,CAAAA,EAAAA,OAAAA;;AAZmD;;;;cAA1CD,aAAAA,SAAsBF,oBAAAA;;;;wCAIDC;;;;;;;;UAQ9BE,QAAQJ"}