(core) updates from grist-core

This commit is contained in:
Paul Fitzpatrick
2023-03-20 09:46:37 -04:00
16 changed files with 1455 additions and 179 deletions

View File

@@ -370,7 +370,7 @@ export interface UserAPI {
}
/**
* Parameters for the download CSV and XLSX endpoint (/download/csv & /download/csv).
* Parameters for the download CSV and XLSX endpoint (/download/table-schema & /download/csv & /download/csv).
*/
export interface DownloadDocParams {
tableId: string;
@@ -418,6 +418,7 @@ export interface DocAPI {
getDownloadUrl(template?: boolean): string;
getDownloadXlsxUrl(params?: DownloadDocParams): string;
getDownloadCsvUrl(params: DownloadDocParams): string;
getDownloadTableSchemaUrl(params: DownloadDocParams): string;
/**
* Exports current document to the Google Drive as a spreadsheet file. To invoke this method, first
* acquire "code" via Google Auth Endpoint (see ShareMenu.ts for an example).
@@ -920,6 +921,11 @@ export class DocAPIImpl extends BaseAPI implements DocAPI {
return this._url + '/download/csv?' + encodeQueryParams({...params});
}
public getDownloadTableSchemaUrl(params: DownloadDocParams) {
// We spread `params` to work around TypeScript being overly cautious.
return this._url + '/download/table-schema?' + encodeQueryParams({...params});
}
public async sendToDrive(code: string, title: string): Promise<{url: string}> {
const url = new URL(`${this._url}/send-to-drive`);
url.searchParams.append('title', title);

View File

@@ -0,0 +1,11 @@
import {NumberFormatOptions} from 'app/common/NumberFormat';
export interface WidgetOptions extends NumberFormatOptions {
textColor?: 'string';
fillColor?: 'string';
alignment?: 'left' | 'center' | 'right';
dateFormat?: string;
timeFormat?: string;
widget?: 'HyperLink';
choices?: Array<string>;
}