import * as dntShim from "../../_dnt.shims.js"; import { Earthstar } from "../../deps.js"; import { IReplicaServerExtension } from "./extension.js"; /** * - `sourceShare`: The share to use as the source of documents. Must have been created by another extension. * - `path`: An optional path prefix for requests. E.g. `/stuff` means a call to `/stuff/blog.md` would fetch `/blog.md` from the replica. * - `indexPath`: A fallback path to use when none is provided. Useful for landing pages. * - `allowOrigins`: A list of origins allowed by CORS, if you want other sites to be able to request content from your replica server. */ export interface ExtensionServeContentOpts { sourceShare: string; path?: string; indexPath?: string; allowedOrigins?: string[]; } /** An extension for exposing the contents of shares, so that you can request documents by their path and have them served over HTTP. Can be used to create wikis, websites, image galleries, and more. */ export declare class ExtensionServeContent implements IReplicaServerExtension { private peer; private path; private replica; private sourceShare; private indexPath; private allowedOrigins; constructor(opts: ExtensionServeContentOpts); register(peer: Earthstar.Peer): Promise; handler(req: dntShim.Request): Promise; }