UNPKG

@codeplaydata/datasus

Version:

This application decompress the datasus micro data and serve as a gateway class.

31 lines (30 loc) 1.32 kB
import { FTPClient } from "../../infra/ftp/FTPClient.js"; import { Subset } from "../../core/Subset.js"; /** * Generic gateway for accessing the DATASUS public FTP. * * This abstract class provides a common list and downloads operations from a base * path (PATH) using an injected FTP client. Specific strategies (e.g., SIA, * SIH, etc.) should extend this class. */ export declare abstract class DATASUSGenericFTPGateway<S extends Subset> { readonly client: FTPClient; readonly PATH: string; /** * @param client FTP client implementation. * @param PATH Base path on the FTP where dataset files are located. */ constructor(client: FTPClient, PATH: string); /** * Lists files under the base directory applying optional filters for states and period. * @param input Subset (src) and, optionally, states and period (YYYY-MM). * @param display 'full' returns the full FTP entry objects, 'short' returns only filenames. */ list(input: S, display?: 'full' | 'short'): Promise<any>; /** * Downloads a file from the FTP using the configured PATH as base. * @param file Remote filename (relative to PATH). * @param dest Optional local path; if not provided, uses the same filename. */ get(file: string, dest?: string): Promise<any>; }