2020-07-21 13:20:51 +00:00
|
|
|
/**
|
|
|
|
* Common definitions for Grist plugin APIs.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2022-05-24 20:22:41 +00:00
|
|
|
* Metadata and data for a table.
|
2020-07-21 13:20:51 +00:00
|
|
|
*/
|
|
|
|
export interface GristTable {
|
2022-05-24 20:22:41 +00:00
|
|
|
// This is documenting what is currently returned by the core plugins. Capitalization
|
|
|
|
// is python-style.
|
|
|
|
//
|
|
|
|
// TODO: could be worth reconciling with: https://phab.getgrist.com/w/grist_data_format/.
|
2020-07-21 13:20:51 +00:00
|
|
|
table_name: string | null; // currently allow names to be null
|
|
|
|
column_metadata: GristColumn[];
|
|
|
|
table_data: any[][];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GristTables {
|
|
|
|
tables: GristTable[];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Metadata about a single column.
|
|
|
|
*/
|
|
|
|
export interface GristColumn {
|
|
|
|
id: string;
|
|
|
|
type: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum APIType {
|
|
|
|
ImportSourceAPI,
|
|
|
|
ImportProcessorAPI,
|
|
|
|
ParseOptionsAPI,
|
|
|
|
ParseFileAPI,
|
|
|
|
}
|