mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
* google-apps-script: Fix changeType in onChange * google-apps-script: Improve getFont* and setFont*
106 lines
2.7 KiB
TypeScript
106 lines
2.7 KiB
TypeScript
// Type definitions for Google Apps Script 2019-04-02
|
|
// Project: https://developers.google.com/apps-script/
|
|
// Definitions by: PopGoesTheWza <https://github.com/PopGoesTheWza>
|
|
// oshliaer <https://github.com/oshliaer>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
/// <reference path="google-apps-script.script.d.ts" />
|
|
/// <reference path="google-apps-script.spreadsheet.d.ts" />
|
|
/// <reference path="google-apps-script.slides.d.ts" />
|
|
|
|
declare namespace GoogleAppsScript {
|
|
/**
|
|
* Google Apps Script Events
|
|
* @see https://developers.google.com/apps-script/guides/triggers/events
|
|
*/
|
|
namespace Events {
|
|
// Internal interfaces
|
|
interface AppsScriptEvent {
|
|
authMode: Script.AuthMode;
|
|
triggerUid: string;
|
|
user: Base.User;
|
|
}
|
|
|
|
interface AppsScriptHttpRequestEvent {
|
|
parameter: object;
|
|
contextPath: string;
|
|
contentLength: number;
|
|
queryString: string;
|
|
parameters: object;
|
|
}
|
|
|
|
interface AppsScriptHttpRequestEventPostData {
|
|
length: number;
|
|
type: string;
|
|
contents: string;
|
|
name: string;
|
|
}
|
|
|
|
// External interfaces
|
|
interface SheetsOnOpen extends AppsScriptEvent {
|
|
source: Spreadsheet.Spreadsheet;
|
|
}
|
|
|
|
type SheetsOnChangeChangeType =
|
|
| 'EDIT'
|
|
| 'INSERT_ROW'
|
|
| 'INSERT_COLUMN'
|
|
| 'REMOVE_ROW'
|
|
| 'REMOVE_COLUMN'
|
|
| 'INSERT_GRID'
|
|
| 'REMOVE_GRID'
|
|
| 'FORMAT'
|
|
| 'OTHER';
|
|
interface SheetsOnChange extends AppsScriptEvent {
|
|
changeType: SheetsOnChangeChangeType;
|
|
}
|
|
|
|
interface SheetsOnEdit extends AppsScriptEvent {
|
|
oldValue: string;
|
|
range: Spreadsheet.Range;
|
|
source: Spreadsheet.Spreadsheet;
|
|
value: string;
|
|
}
|
|
|
|
interface SheetsOnFormSubmit extends AppsScriptEvent {
|
|
namedValues: { [key: string]: string[]; };
|
|
range: Spreadsheet.Range;
|
|
values: string[];
|
|
}
|
|
|
|
interface FormsOnFormSubmit extends AppsScriptEvent {
|
|
response: Forms.FormResponse;
|
|
source: Forms.Form;
|
|
}
|
|
|
|
interface DocsOnOpen extends AppsScriptEvent {
|
|
source: Document.Document;
|
|
}
|
|
|
|
interface SlidesOnOpen extends AppsScriptEvent {
|
|
source: Slides.Presentation;
|
|
}
|
|
|
|
interface FormsOnOpen extends AppsScriptEvent {
|
|
source: Forms.Form;
|
|
}
|
|
|
|
// TODO: Is there a `user` attribute?
|
|
interface CalendarEventUpdated extends AppsScriptEvent {
|
|
calendarId: string;
|
|
}
|
|
|
|
interface AddonOnInstall {
|
|
authMode: Script.AuthMode;
|
|
}
|
|
|
|
// tslint:disable-next-line: no-empty-interface
|
|
interface DoGet extends AppsScriptHttpRequestEvent {
|
|
}
|
|
|
|
interface DoPost extends AppsScriptHttpRequestEvent {
|
|
postData: AppsScriptHttpRequestEventPostData;
|
|
}
|
|
}
|
|
}
|