-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
52 lines (46 loc) · 1.41 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/// <reference types="google-apps-script" />
declare namespace GoogleAppsScript {
namespace Menus {
enum DocTypes {
SPREADSHEET = "spreadsheet",
PRESENTATION = "presentation",
FORM = "form",
DOCUMENT = "document",
}
enum ItemTypes {
MENU = "menu",
ITEM = "item",
SEPARATOR = "separator",
}
interface ItemOptions {
title: string;
type?: ItemTypes;
items?: ItemOptions[];
action: string;
}
interface BuildMenuOptions {
title: string;
docType?: DocTypes;
items?: (ItemOptions | { type: ItemTypes.SEPARATOR })[];
append?: boolean;
ui?: GoogleAppsScript.Base.Ui;
}
interface MenuApp {
DocTypes: typeof DocTypes;
ItemTypes: typeof ItemTypes;
buildMenu: (
options: BuildMenuOptions
) => GoogleAppsScript.Base.Menu | null;
createSeparatorItem: () => { type: ItemTypes.SEPARATOR };
createActionItem: (
title: string,
action: (...args: any[]) => any
) => {
type: ItemTypes.ITEM;
title: string;
action: string;
};
}
}
}
declare var MenuApp: GoogleAppsScript.Menus.MenuApp;