import type { SavePackageOptions } from "@frictionless-ts/dataset"; import type { DatasetPlugin } from "@frictionless-ts/dataset"; import type { Dialect, Package, Resource, Schema } from "@frictionless-ts/metadata"; import type { DialectOptions, InferDialectOptions } from "./dialect/index.ts"; import type { InferSchemaOptions, SchemaOptions } from "./schema/index.ts"; import type { Table } from "./table/index.ts"; export type LoadTableOptions = InferDialectOptions & InferSchemaOptions & { denormalized?: boolean; }; export type SaveTableOptions = DialectOptions & SchemaOptions & { path: string; format?: string; dialect?: Dialect; schema?: Schema; overwrite?: boolean; }; export interface TablePlugin extends DatasetPlugin { savePackage?(dataPackage: Package, options: SavePackageOptions & { plugins?: TablePlugin[]; }): Promise<{ path?: string; } | undefined>; inferDialect?(resource: Partial, options?: InferDialectOptions): Promise; inferSchema?(resource: Partial, options?: InferSchemaOptions): Promise; loadTable?(resource: Partial, options?: LoadTableOptions): Promise; saveTable?(table: Table, options: SaveTableOptions): Promise; }