import { GmlToJsonOptions } from './parse'; import { GraphJson } from './types'; /** * Options for fetching a dataset. */ export interface FetchDatasetOptions extends GmlToJsonOptions { /** Custom fetch function (for testing or custom environments) */ fetch?: typeof globalThis.fetch; /** File extension to look for in the archive (default: .gml) */ extension?: string; } /** * Result of fetching a dataset, including the graph and metadata about the fetch. */ export interface FetchDatasetResult { /** The converted graph */ graph: GraphJson; /** The filename that was extracted */ filename: string; /** Size of the downloaded archive in bytes */ archiveSize: number; /** Size of the extracted GML content in bytes */ contentSize: number; } /** * Fetch a dataset from a URL, extract GML from zip, and convert to JSON. * * @param url - URL to a zip archive containing a GML file * @param options - Conversion options including metadata * @returns The converted graph and fetch metadata * * @example * ```typescript * const result = await fetchDataset( * 'https://websites.umich.edu/~mejn/netdata/karate.zip', * { * meta: { * name: "Zachary's Karate Club", * description: "Social network of friendships...", * source: "https://websites.umich.edu/~mejn/netdata/", * url: "https://websites.umich.edu/~mejn/netdata/karate.zip", * citation: { authors: ["W. W. Zachary"], title: "...", year: 1977 }, * retrieved: "2024-01-17" * } * } * ); * console.log(result.graph.nodes.length); // 34 * ``` */ export declare const fetchDataset: (url: string, options: FetchDatasetOptions) => Promise; /** * Fetch multiple datasets in parallel. * * @param datasets - Array of [url, options] tuples * @returns Array of fetch results */ export declare const fetchDatasets: (datasets: Array<[string, FetchDatasetOptions]>) => Promise; //# sourceMappingURL=fetch.d.ts.map