import { TacoFileParserName } from '../enums/taco-file-parser'; /** * Represents an input type for handlers, allowing flexibility between basic and file-based inputs. * * @typedef {Object} HandlerInput * @template Data - The type of data that the handler input can carry. * @property {BasicHandlerInput | FileBasedHandlerInput} input - The actual handler input, which can be either basic or file-based. * * @example * ```ts * // Usage with basic handler input * const basicHandlerInputObj: HandlerInput = { * fetcher: 'my-fetcher', * parser: 'my-parser', * data: [], * } * * // Usage with file-based handler input * const fileBasedHandlerInputObj: HandlerInput = { * fetcher: 'my-fetcher', * parser: // "taco:excel-file-parser" | "taco:csv-file-parser" | "taco:parquet-file-parser" | "taco:data-file-parser", * data: [], * name: 'table-name', * } * ``` */ export type HandlerInput = BasicHandlerInput | FileBasedHandlerInput | IngestorHandlerInput; /** * The object type sent by the connector app to handlers. * * The object is used to perform data extraction. * */ export interface BasicHandlerInput { /** File name of connector authenticator */ auth?: string; /** File name of connector fetcher */ fetcher: string; /** File name of connector parser */ parser: string; /** Arbitrary data sent to the connector fetcher */ data: Data; } export declare function isBasicHandlerInput(input: unknown): input is BasicHandlerInput; /** * The object type sent by the connector app to handlers for data source with large data. */ export interface FileBasedHandlerInput extends BasicHandlerInput { /** Built-in parser name */ parser: TacoFileParserName; /** Identifier of source object, will be used as table name */ name: string; } export declare function isFileBasedHandlerInput(input: unknown): input is FileBasedHandlerInput; export interface IngestorHandlerInput { ingestor: string; data: Data; } export declare function isIngestorHandlerInput(input: unknown): input is IngestorHandlerInput; export declare function isValidHandlerInput(input: unknown): input is HandlerInput;