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.
|
|
|
|
//
|
2024-03-05 13:35:48 +00:00
|
|
|
// TODO: could be worth reconciling with: /documentation/grist-data-format.md.
|
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,
|
|
|
|
}
|