forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
google-apps-script.ui.d.ts
3628 lines (3564 loc) · 158 KB
/
google-apps-script.ui.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Type definitions for Google Apps Script 2015-11-12
// Project: https://developers.google.com/apps-script/
// Definitions by: motemen <https://github.com/motemen/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="google-apps-script.types.d.ts" />
declare module GoogleAppsScript {
export module UI {
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* An absolute panel positions all of its children absolutely, allowing them to overlap.
*
* Here is an example of how to use this widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* var button = app.createButton("a button");
* var panel = app.createAbsolutePanel();
* // add a widget at position (10, 20)
* panel.add(button, 10, 20);
* app.add(panel);
* return app;
* }
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the AbsolutePanel documentation here.
*/
export interface AbsolutePanel {
add(widget: Widget): AbsolutePanel;
add(widget: Widget, left: Integer, top: Integer): AbsolutePanel;
addStyleDependentName(styleName: string): AbsolutePanel;
addStyleName(styleName: string): AbsolutePanel;
clear(): AbsolutePanel;
getId(): string;
getTag(): string;
getType(): string;
remove(index: Integer): AbsolutePanel;
remove(widget: Widget): AbsolutePanel;
setHeight(height: string): AbsolutePanel;
setId(id: string): AbsolutePanel;
setLayoutData(layout: Object): AbsolutePanel;
setPixelSize(width: Integer, height: Integer): AbsolutePanel;
setSize(width: string, height: string): AbsolutePanel;
setStyleAttribute(attribute: string, value: string): AbsolutePanel;
setStyleAttributes(attributes: Object): AbsolutePanel;
setStyleName(styleName: string): AbsolutePanel;
setStylePrimaryName(styleName: string): AbsolutePanel;
setTag(tag: string): AbsolutePanel;
setTitle(title: string): AbsolutePanel;
setVisible(visible: boolean): AbsolutePanel;
setWidgetPosition(widget: Widget, left: Integer, top: Integer): AbsolutePanel;
setWidth(width: string): AbsolutePanel;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A widget that represents a simple <a> element. That is, a hyperlink to a different page.
*
* By design, these hyperlinks always open in a new page. Links that reload the current page are
* not allowed.
*
* Here is an example of how to use this widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* // Creates a link to your favorite search engine.
* var anchor = app.createAnchor("a link", "http://www.google.com");
* app.add(anchor);
* return app;
* }
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the Anchor documentation here.
*/
export interface Anchor {
addBlurHandler(handler: Handler): Anchor;
addClickHandler(handler: Handler): Anchor;
addFocusHandler(handler: Handler): Anchor;
addKeyDownHandler(handler: Handler): Anchor;
addKeyPressHandler(handler: Handler): Anchor;
addKeyUpHandler(handler: Handler): Anchor;
addMouseDownHandler(handler: Handler): Anchor;
addMouseMoveHandler(handler: Handler): Anchor;
addMouseOutHandler(handler: Handler): Anchor;
addMouseOverHandler(handler: Handler): Anchor;
addMouseUpHandler(handler: Handler): Anchor;
addMouseWheelHandler(handler: Handler): Anchor;
addStyleDependentName(styleName: string): Anchor;
addStyleName(styleName: string): Anchor;
getId(): string;
getTag(): string;
getType(): string;
setAccessKey(accessKey: Char): Anchor;
setDirection(direction: Component): Anchor;
setEnabled(enabled: boolean): Anchor;
setFocus(focus: boolean): Anchor;
setHTML(html: string): Anchor;
setHeight(height: string): Anchor;
setHorizontalAlignment(horizontalAlignment: HorizontalAlignment): Anchor;
setHref(href: string): Anchor;
setId(id: string): Anchor;
setLayoutData(layout: Object): Anchor;
setName(name: string): Anchor;
setPixelSize(width: Integer, height: Integer): Anchor;
setSize(width: string, height: string): Anchor;
setStyleAttribute(attribute: string, value: string): Anchor;
setStyleAttributes(attributes: Object): Anchor;
setStyleName(styleName: string): Anchor;
setStylePrimaryName(styleName: string): Anchor;
setTabIndex(index: Integer): Anchor;
setTag(tag: string): Anchor;
setTarget(target: string): Anchor;
setText(text: string): Anchor;
setTitle(title: string): Anchor;
setVisible(visible: boolean): Anchor;
setWidth(width: string): Anchor;
setWordWrap(wordWrap: boolean): Anchor;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A standard push-button widget.
*
* Here is an example of how to use this widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* // create a button and give it a click handler
* var button = app.createButton("click me!").setId("button");
* button.addClickHandler(app.createServerHandler("handlerFunction"));
* app.add(button);
* return app;
* }
*
* function handlerFunction(eventInfo) {
* var app = UiApp.getActiveApplication();
* app.getElementById("button").setText("I was clicked!");
* return app;
* }
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the Button documentation here.
*/
export interface Button {
addBlurHandler(handler: Handler): Button;
addClickHandler(handler: Handler): Button;
addFocusHandler(handler: Handler): Button;
addKeyDownHandler(handler: Handler): Button;
addKeyPressHandler(handler: Handler): Button;
addKeyUpHandler(handler: Handler): Button;
addMouseDownHandler(handler: Handler): Button;
addMouseMoveHandler(handler: Handler): Button;
addMouseOutHandler(handler: Handler): Button;
addMouseOverHandler(handler: Handler): Button;
addMouseUpHandler(handler: Handler): Button;
addMouseWheelHandler(handler: Handler): Button;
addStyleDependentName(styleName: string): Button;
addStyleName(styleName: string): Button;
getId(): string;
getTag(): string;
getType(): string;
setAccessKey(accessKey: Char): Button;
setEnabled(enabled: boolean): Button;
setFocus(focus: boolean): Button;
setHTML(html: string): Button;
setHeight(height: string): Button;
setId(id: string): Button;
setLayoutData(layout: Object): Button;
setPixelSize(width: Integer, height: Integer): Button;
setSize(width: string, height: string): Button;
setStyleAttribute(attribute: string, value: string): Button;
setStyleAttributes(attributes: Object): Button;
setStyleName(styleName: string): Button;
setStylePrimaryName(styleName: string): Button;
setTabIndex(index: Integer): Button;
setTag(tag: string): Button;
setText(text: string): Button;
setTitle(title: string): Button;
setVisible(visible: boolean): Button;
setWidth(width: string): Button;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A panel that wraps its contents in a border with a caption that appears in the upper left
* corner of the border. This is an implementation of the fieldset HTML element.
*
* Note that this panel can contain at most one direct child widget. To add more children, make the
* child of this panel a different panel that can contain more than one child.
*
* Note also that the placement of the caption in a caption panel will vary slightly from browser to
* browser, so this widget is not a good choice when precise cross-browser layout is needed.
*
* Here is an example of how to use this widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* var panel = app.createCaptionPanel("my caption!");
* panel.add(app.createButton("a button inside..."));
* app.add(panel);
* return app;
* }
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the CaptionPanel documentation here.
*/
export interface CaptionPanel {
add(widget: Widget): CaptionPanel;
addStyleDependentName(styleName: string): CaptionPanel;
addStyleName(styleName: string): CaptionPanel;
clear(): CaptionPanel;
getId(): string;
getTag(): string;
getType(): string;
setCaptionText(text: string): CaptionPanel;
setContentWidget(widget: Widget): CaptionPanel;
setHeight(height: string): CaptionPanel;
setId(id: string): CaptionPanel;
setLayoutData(layout: Object): CaptionPanel;
setPixelSize(width: Integer, height: Integer): CaptionPanel;
setSize(width: string, height: string): CaptionPanel;
setStyleAttribute(attribute: string, value: string): CaptionPanel;
setStyleAttributes(attributes: Object): CaptionPanel;
setStyleName(styleName: string): CaptionPanel;
setStylePrimaryName(styleName: string): CaptionPanel;
setTag(tag: string): CaptionPanel;
setText(text: string): CaptionPanel;
setTitle(title: string): CaptionPanel;
setVisible(visible: boolean): CaptionPanel;
setWidget(widget: Widget): CaptionPanel;
setWidth(width: string): CaptionPanel;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A standard check box widget.
*
* Here is an example of how to use this widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* var handler = app.createServerHandler("change");
* var check = app.createCheckBox("click me").addValueChangeHandler(handler);
* app.add(check);
* return app;
* }
*
* function change() {
* var app = UiApp.getActiveApplication();
* app.add(app.createLabel("The value changed!"));
* return app;
* }
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the CheckBox documentation here.
*/
export interface CheckBox {
addBlurHandler(handler: Handler): CheckBox;
addClickHandler(handler: Handler): CheckBox;
addFocusHandler(handler: Handler): CheckBox;
addKeyDownHandler(handler: Handler): CheckBox;
addKeyPressHandler(handler: Handler): CheckBox;
addKeyUpHandler(handler: Handler): CheckBox;
addMouseDownHandler(handler: Handler): CheckBox;
addMouseMoveHandler(handler: Handler): CheckBox;
addMouseOutHandler(handler: Handler): CheckBox;
addMouseOverHandler(handler: Handler): CheckBox;
addMouseUpHandler(handler: Handler): CheckBox;
addMouseWheelHandler(handler: Handler): CheckBox;
addStyleDependentName(styleName: string): CheckBox;
addStyleName(styleName: string): CheckBox;
addValueChangeHandler(handler: Handler): CheckBox;
getId(): string;
getTag(): string;
getType(): string;
setAccessKey(accessKey: Char): CheckBox;
setEnabled(enabled: boolean): CheckBox;
setFocus(focus: boolean): CheckBox;
setFormValue(formValue: string): CheckBox;
setHTML(html: string): CheckBox;
setHeight(height: string): CheckBox;
setId(id: string): CheckBox;
setLayoutData(layout: Object): CheckBox;
setName(name: string): CheckBox;
setPixelSize(width: Integer, height: Integer): CheckBox;
setSize(width: string, height: string): CheckBox;
setStyleAttribute(attribute: string, value: string): CheckBox;
setStyleAttributes(attributes: Object): CheckBox;
setStyleName(styleName: string): CheckBox;
setStylePrimaryName(styleName: string): CheckBox;
setTabIndex(index: Integer): CheckBox;
setTag(tag: string): CheckBox;
setText(text: string): CheckBox;
setTitle(title: string): CheckBox;
setValue(value: boolean): CheckBox;
setValue(value: boolean, fireEvents: boolean): CheckBox;
setVisible(visible: boolean): CheckBox;
setWidth(width: string): CheckBox;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* An event handler that runs in the user's browser without needing a call back to the server.
* These will, in general, run much faster than ServerHandlers but they are also more
* limited in what they can do.
*
* Any method that accepts a "Handler" parameter can accept a ClientHandler.
*
* If you set validators on a ClientHandler, they will be checked before the handler performs its
* actions. The actions will only be performed if the validators succeed.
*
* If you have multiple ClientHandlers for the same event on the same widget, they will perform
* their actions in the order that they were added.
*
* An example of using client handlers:
*
* function doGet() {
* var app = UiApp.createApplication();
* var button = app.createButton("Say Hello");
*
* // Create a label with the "Hello World!" text and hide it for now
* var label = app.createLabel("Hello World!").setVisible(false);
*
* // Create a new handler that does not require the server.
* // We give the handler two actions to perform on different targets.
* // The first action disables the widget that invokes the handler
* // and the second displays the label.
* var handler = app.createClientHandler()
* .forEventSource().setEnabled(false)
* .forTargets(label).setVisible(true);
*
* // Add our new handler to be invoked when the button is clicked
* button.addClickHandler(handler);
*
* app.add(button);
* app.add(label);
* return app;
* }
*/
export interface ClientHandler {
forEventSource(): ClientHandler;
forTargets(...widgets: Object[]): ClientHandler;
getId(): string;
getTag(): string;
getType(): string;
setEnabled(enabled: boolean): ClientHandler;
setHTML(html: string): ClientHandler;
setId(id: string): ClientHandler;
setStyleAttribute(row: Integer, column: Integer, attribute: string, value: string): ClientHandler;
setStyleAttribute(attribute: string, value: string): ClientHandler;
setStyleAttributes(row: Integer, column: Integer, attributes: Object): ClientHandler;
setStyleAttributes(attributes: Object): ClientHandler;
setTag(tag: string): ClientHandler;
setText(text: string): ClientHandler;
setValue(value: boolean): ClientHandler;
setVisible(visible: boolean): ClientHandler;
validateEmail(widget: Widget): ClientHandler;
validateInteger(widget: Widget): ClientHandler;
validateLength(widget: Widget, min: Integer, max: Integer): ClientHandler;
validateMatches(widget: Widget, pattern: string): ClientHandler;
validateMatches(widget: Widget, pattern: string, flags: string): ClientHandler;
validateNotEmail(widget: Widget): ClientHandler;
validateNotInteger(widget: Widget): ClientHandler;
validateNotLength(widget: Widget, min: Integer, max: Integer): ClientHandler;
validateNotMatches(widget: Widget, pattern: string): ClientHandler;
validateNotMatches(widget: Widget, pattern: string, flags: string): ClientHandler;
validateNotNumber(widget: Widget): ClientHandler;
validateNotOptions(widget: Widget, options: String[]): ClientHandler;
validateNotRange(widget: Widget, min: Number, max: Number): ClientHandler;
validateNotSum(widgets: Widget[], sum: Integer): ClientHandler;
validateNumber(widget: Widget): ClientHandler;
validateOptions(widget: Widget, options: String[]): ClientHandler;
validateRange(widget: Widget, min: Number, max: Number): ClientHandler;
validateSum(widgets: Widget[], sum: Integer): ClientHandler;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A generic component object.
* Implementing classes
*
* NameBrief description
*
* AbsolutePanelAn absolute panel positions all of its children absolutely, allowing them to overlap.
*
* AnchorA widget that represents a simple <a> element.
*
* ButtonA standard push-button widget.
*
* CaptionPanelA panel that wraps its contents in a border with a caption that appears in the upper left
* corner of the border.
*
* ChartA Chart object, which can be embedded into documents, UI elements, or used as a static image.
*
* CheckBoxA standard check box widget.
*
* ClientHandlerAn event handler that runs in the user's browser without needing a call back to the server.
*
* ControlA user interface control object, that drives the data displayed by a DashboardPanel.
*
* DashboardPanelA dashboard is a visual structure that enables the organization and management
* of multiple charts that share the same underlying data.
*
* DateBoxA text box that shows a DatePicker when the user focuses on it.
*
* DatePickerA date picker widget.
*
* DecoratedStackPanelA StackPanel that wraps each item in a 2x3 grid (six box), which allows users to add
* rounded corners.
*
* DecoratedTabBarA TabBar that wraps each tab in a 2x3 grid (six box), which allows users to add rounded corners.
*
* DecoratedTabPanelA TabPanel that uses a DecoratedTabBar with rounded corners.
*
* DecoratorPanelA SimplePanel that wraps its contents in stylized boxes, which can be used to add rounded
* corners to a Widget.
*
* DialogBoxA form of popup that has a caption area at the top and can be dragged by the
* user.
*
* DocsListDialogA "file-open" dialog for Google Drive.
*
* EmbeddedChartRepresents a chart that has been embedded into a Spreadsheet.
*
* FileUploadA widget that wraps the HTML <input type='file'> element.
*
* FlexTableA flexible table that creates cells on demand.
*
* FlowPanelA panel that formats its child widgets using the default HTML layout behavior.
*
* FocusPanelA simple panel that makes its contents focusable, and adds the ability to catch mouse and
* keyboard events.
*
* FormPanelA panel that wraps its contents in an HTML <FORM> element.
*
* GridA rectangular grid that can contain text, html, or a child widget within its cells.
*
* HTMLA widget that contains arbitrary text, which is interpreted as HTML.
*
* HandlerBase interface for client and server handlers.
*
* HiddenRepresents a hidden field for storing data in the user's browser that can be passed back to a
* handler as a "callback element".
*
* HorizontalPanelA panel that lays all of its widgets out in a single horizontal column.
*
* ImageA widget that displays the image at a given URL.
*
* InlineLabelA widget that contains arbitrary text, not interpreted as HTML.
*
* LabelA widget that contains arbitrary text, not interpreted as HTML.
*
* ListBoxA widget that presents a list of choices to the user, either as a list box or
* as a drop-down list.
*
* MenuBarA standard menu bar widget.
*
* MenuItemAn entry in a MenuBar.
*
* MenuItemSeparatorA separator that can be placed in a MenuBar.
*
* PasswordTextBoxA text box that visually masks its input to prevent eavesdropping.
*
* PopupPanelA panel that can "pop up" over other widgets.
*
* PushButtonA normal push button with custom styling.
*
* RadioButtonA mutually-exclusive selection radio button widget.
*
* ResetButtonA standard push-button widget which will automatically reset its enclosing FormPanel if
* any.
*
* ScrollPanelA panel that wraps its contents in a scrollable element.
*
* ServerHandlerAn event handler that runs on the server.
*
* SimpleCheckBoxA simple checkbox widget, with no label.
*
* SimplePanelA panel that can contain only one widget.
*
* SimpleRadioButtonA simple radio button widget, with no label.
*
* SplitLayoutPanelA panel that adds user-positioned splitters between each of its child widgets.
*
* StackPanelA panel that stacks its children vertically, displaying only one at a time,
* with a header for each child which the user can click to display.
*
* SubmitButtonA standard push-button widget which will automatically submit its enclosing FormPanel if
* any.
*
* SuggestBoxA SuggestBox is a text box or text area which displays a
* pre-configured set of selections that match the user's input.
*
* TabBarA horizontal bar of folder-style tabs, most commonly used as part of a TabPanel.
*
* TabPanelA panel that represents a tabbed set of pages, each of which contains another
* widget.
*
* TextAreaA text box that allows multiple lines of text to be entered.
*
* TextBoxA standard single-line text box.
*
* ToggleButtonA ToggleButton is a stylish stateful button which allows the
* user to toggle between up and down states.
*
* TreeA standard hierarchical tree widget.
*
* TreeItemAn item that can be contained within a Tree.
*
* VerticalPanelA panel that lays all of its widgets out in a single vertical column.
*
* WidgetBase interface for UiApp widgets.
*/
export interface Component {
getId(): string;
getType(): string;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A text box that shows a DatePicker when the user focuses on it.
*
* Here is an example of how to use this widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* var handler = app.createServerHandler("change");
* var dateBox = app.createDateBox().addValueChangeHandler(handler).setId("datebox");
* app.add(dateBox);
* return app;
* }
*
* function change(eventInfo) {
* var app = UiApp.getActiveApplication();
* app.add(app.createLabel("The value of the date box changed to " +
* eventInfo.parameter.datebox));
* return app;
* }
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the DateBox documentation here.
*/
export interface DateBox {
addStyleDependentName(styleName: string): DateBox;
addStyleName(styleName: string): DateBox;
addValueChangeHandler(handler: Handler): DateBox;
getId(): string;
getTag(): string;
getType(): string;
hideDatePicker(): DateBox;
setAccessKey(accessKey: Char): DateBox;
setEnabled(enabled: boolean): DateBox;
setFireEventsForInvalid(fireEvents: boolean): DateBox;
setFocus(focus: boolean): DateBox;
setFormat(dateTimeFormat: DateTimeFormat): DateBox;
setHeight(height: string): DateBox;
setId(id: string): DateBox;
setLayoutData(layout: Object): DateBox;
setName(name: string): DateBox;
setPixelSize(width: Integer, height: Integer): DateBox;
setSize(width: string, height: string): DateBox;
setStyleAttribute(attribute: string, value: string): DateBox;
setStyleAttributes(attributes: Object): DateBox;
setStyleName(styleName: string): DateBox;
setStylePrimaryName(styleName: string): DateBox;
setTabIndex(index: Integer): DateBox;
setTag(tag: string): DateBox;
setTitle(title: string): DateBox;
setValue(date: Date): DateBox;
setVisible(visible: boolean): DateBox;
setWidth(width: string): DateBox;
showDatePicker(): DateBox;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A date picker widget.
*
* Here is an example of how to use this widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* var handler = app.createServerHandler("change");
* var picker = app.createDatePicker().addValueChangeHandler(handler).setId("picker");
* app.add(picker);
* return app;
* }
*
* function change(eventInfo) {
* var app = UiApp.getActiveApplication();
* app.add(app.createLabel("The value of the date picker changed to " +
* eventInfo.parameter.picker));
* return app;
* }
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the DatePicker documentation here.
*/
export interface DatePicker {
addStyleDependentName(styleName: string): DatePicker;
addStyleName(styleName: string): DatePicker;
addValueChangeHandler(handler: Handler): DatePicker;
getId(): string;
getTag(): string;
getType(): string;
setCurrentMonth(date: Date): DatePicker;
setHeight(height: string): DatePicker;
setId(id: string): DatePicker;
setLayoutData(layout: Object): DatePicker;
setName(name: string): DatePicker;
setPixelSize(width: Integer, height: Integer): DatePicker;
setSize(width: string, height: string): DatePicker;
setStyleAttribute(attribute: string, value: string): DatePicker;
setStyleAttributes(attributes: Object): DatePicker;
setStyleName(styleName: string): DatePicker;
setStylePrimaryName(styleName: string): DatePicker;
setTag(tag: string): DatePicker;
setTitle(title: string): DatePicker;
setValue(date: Date): DatePicker;
setVisible(visible: boolean): DatePicker;
setWidth(width: string): DatePicker;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* Date and time format constants for widgets such as
* DateBox.
*
* These correspond to the predefined constants from the Google Web Toolkit. You can read
* more about these constants
* here.
*/
export enum DateTimeFormat { ISO_8601, RFC_2822, DATE_FULL, DATE_LONG, DATE_MEDIUM, DATE_SHORT, TIME_FULL, TIME_LONG, TIME_MEDIUM, TIME_SHORT, DATE_TIME_FULL, DATE_TIME_LONG, DATE_TIME_MEDIUM, DATE_TIME_SHORT, DAY, HOUR_MINUTE, HOUR_MINUTE_SECOND, HOUR24_MINUTE, HOUR24_MINUTE_SECOND, MINUTE_SECOND, MONTH, MONTH_ABBR, MONTH_ABBR_DAY, MONTH_DAY, MONTH_NUM_DAY, MONTH_WEEKDAY_DAY, YEAR, YEAR_MONTH, YEAR_MONTH_ABBR, YEAR_MONTH_ABBR_DAY, YEAR_MONTH_DAY, YEAR_MONTH_NUM, YEAR_MONTH_NUM_DAY, YEAR_MONTH_WEEKDAY_DAY, YEAR_QUARTER, YEAR_QUARTER_ABBR }
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A StackPanel that wraps each item in a 2x3 grid (six box), which allows users to add
* rounded corners.
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the DecoratedStackPanel documentation here.
*/
export interface DecoratedStackPanel {
add(widget: Widget): DecoratedStackPanel;
add(widget: Widget, text: string): DecoratedStackPanel;
add(widget: Widget, text: string, asHtml: boolean): DecoratedStackPanel;
addStyleDependentName(styleName: string): DecoratedStackPanel;
addStyleName(styleName: string): DecoratedStackPanel;
clear(): DecoratedStackPanel;
getId(): string;
getTag(): string;
getType(): string;
remove(index: Integer): DecoratedStackPanel;
remove(widget: Widget): DecoratedStackPanel;
setHeight(height: string): DecoratedStackPanel;
setId(id: string): DecoratedStackPanel;
setLayoutData(layout: Object): DecoratedStackPanel;
setPixelSize(width: Integer, height: Integer): DecoratedStackPanel;
setSize(width: string, height: string): DecoratedStackPanel;
setStackText(index: Integer, text: string): DecoratedStackPanel;
setStackText(index: Integer, text: string, asHtml: boolean): DecoratedStackPanel;
setStyleAttribute(attribute: string, value: string): DecoratedStackPanel;
setStyleAttributes(attributes: Object): DecoratedStackPanel;
setStyleName(styleName: string): DecoratedStackPanel;
setStylePrimaryName(styleName: string): DecoratedStackPanel;
setTag(tag: string): DecoratedStackPanel;
setTitle(title: string): DecoratedStackPanel;
setVisible(visible: boolean): DecoratedStackPanel;
setWidth(width: string): DecoratedStackPanel;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A TabBar that wraps each tab in a 2x3 grid (six box), which allows users to add rounded corners.
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the DecoratedTabBar documentation here.
*/
export interface DecoratedTabBar {
addBeforeSelectionHandler(handler: Handler): DecoratedTabBar;
addSelectionHandler(handler: Handler): DecoratedTabBar;
addStyleDependentName(styleName: string): DecoratedTabBar;
addStyleName(styleName: string): DecoratedTabBar;
addTab(title: string): DecoratedTabBar;
addTab(title: string, asHtml: boolean): DecoratedTabBar;
addTab(widget: Widget): DecoratedTabBar;
getId(): string;
getTag(): string;
getType(): string;
selectTab(index: Integer): DecoratedTabBar;
setHeight(height: string): DecoratedTabBar;
setId(id: string): DecoratedTabBar;
setLayoutData(layout: Object): DecoratedTabBar;
setPixelSize(width: Integer, height: Integer): DecoratedTabBar;
setSize(width: string, height: string): DecoratedTabBar;
setStyleAttribute(attribute: string, value: string): DecoratedTabBar;
setStyleAttributes(attributes: Object): DecoratedTabBar;
setStyleName(styleName: string): DecoratedTabBar;
setStylePrimaryName(styleName: string): DecoratedTabBar;
setTabEnabled(index: Integer, enabled: boolean): DecoratedTabBar;
setTabText(index: Integer, text: string): DecoratedTabBar;
setTag(tag: string): DecoratedTabBar;
setTitle(title: string): DecoratedTabBar;
setVisible(visible: boolean): DecoratedTabBar;
setWidth(width: string): DecoratedTabBar;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A TabPanel that uses a DecoratedTabBar with rounded corners.
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the DecoratedTabPanel documentation here.
*/
export interface DecoratedTabPanel {
add(widget: Widget): DecoratedTabPanel;
add(widget: Widget, text: string): DecoratedTabPanel;
add(widget: Widget, text: string, asHtml: boolean): DecoratedTabPanel;
add(widget: Widget, tabWidget: Widget): DecoratedTabPanel;
addBeforeSelectionHandler(handler: Handler): DecoratedTabPanel;
addSelectionHandler(handler: Handler): DecoratedTabPanel;
addStyleDependentName(styleName: string): DecoratedTabPanel;
addStyleName(styleName: string): DecoratedTabPanel;
getId(): string;
getTag(): string;
getType(): string;
selectTab(index: Integer): DecoratedTabPanel;
setAnimationEnabled(animationEnabled: boolean): DecoratedTabPanel;
setHeight(height: string): DecoratedTabPanel;
setId(id: string): DecoratedTabPanel;
setLayoutData(layout: Object): DecoratedTabPanel;
setPixelSize(width: Integer, height: Integer): DecoratedTabPanel;
setSize(width: string, height: string): DecoratedTabPanel;
setStyleAttribute(attribute: string, value: string): DecoratedTabPanel;
setStyleAttributes(attributes: Object): DecoratedTabPanel;
setStyleName(styleName: string): DecoratedTabPanel;
setStylePrimaryName(styleName: string): DecoratedTabPanel;
setTag(tag: string): DecoratedTabPanel;
setTitle(title: string): DecoratedTabPanel;
setVisible(visible: boolean): DecoratedTabPanel;
setWidth(width: string): DecoratedTabPanel;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A SimplePanel that wraps its contents in stylized boxes, which can be used to add rounded
* corners to a Widget.
*
* Note that this panel can contain at most one direct child widget. To add more children, make the
* child of this panel a different panel that can contain more than one child.
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the DecoratorPanel documentation here.
*/
export interface DecoratorPanel {
add(widget: Widget): DecoratorPanel;
addStyleDependentName(styleName: string): DecoratorPanel;
addStyleName(styleName: string): DecoratorPanel;
clear(): DecoratorPanel;
getId(): string;
getTag(): string;
getType(): string;
setHeight(height: string): DecoratorPanel;
setId(id: string): DecoratorPanel;
setLayoutData(layout: Object): DecoratorPanel;
setPixelSize(width: Integer, height: Integer): DecoratorPanel;
setSize(width: string, height: string): DecoratorPanel;
setStyleAttribute(attribute: string, value: string): DecoratorPanel;
setStyleAttributes(attributes: Object): DecoratorPanel;
setStyleName(styleName: string): DecoratorPanel;
setStylePrimaryName(styleName: string): DecoratorPanel;
setTag(tag: string): DecoratorPanel;
setTitle(title: string): DecoratorPanel;
setVisible(visible: boolean): DecoratorPanel;
setWidget(widget: Widget): DecoratorPanel;
setWidth(width: string): DecoratorPanel;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A form of popup that has a caption area at the top and can be dragged by the
* user. Unlike a PopupPanel, calls to setWidth(width) and
* setHeight(height) will set the width and height of the dialog box
* itself, even if a widget has not been added as yet.
*
* In general it's not recommended to add this panel as a child of another widget or of the app
* as that will make it behave like any other inline panel and not act as a popup. Instead, create
* the popup and then use its show() and hide() methods to show and hide it. See
* the example below.
*
* Internally, UiApp widgets are built on top of the
* Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation
* directly. You can find the DialogBox documentation here.
*
* Here is an example showing how to use the dialog box widget:
*
* function doGet() {
* var app = UiApp.createApplication();
* // Create a dialog box.
* var dialog = app.createDialogBox();
* // Set the position and dimensions.
* dialog.setPopupPosition(100, 100).setSize(500, 500);
* // Show the dialog. Note that it does not have to be "added" to the UiInstance.
* dialog.show();
* return app;
* }
*/
export interface DialogBox {
add(widget: Widget): DialogBox;
addAutoHidePartner(partner: Component): DialogBox;
addCloseHandler(handler: Handler): DialogBox;
addStyleDependentName(styleName: string): DialogBox;
addStyleName(styleName: string): DialogBox;
clear(): DialogBox;
getId(): string;
getTag(): string;
getType(): string;
hide(): DialogBox;
setAnimationEnabled(animationEnabled: boolean): DialogBox;
setAutoHideEnabled(enabled: boolean): DialogBox;
setGlassEnabled(enabled: boolean): DialogBox;
setGlassStyleName(styleName: string): DialogBox;
setHTML(html: string): DialogBox;
setHeight(height: string): DialogBox;
setId(id: string): DialogBox;
setLayoutData(layout: Object): DialogBox;
setModal(modal: boolean): DialogBox;
setPixelSize(width: Integer, height: Integer): DialogBox;
setPopupPosition(left: Integer, top: Integer): DialogBox;
setPopupPositionAndShow(a: Component): DialogBox;
setPreviewingAllNativeEvents(previewing: boolean): DialogBox;
setSize(width: string, height: string): DialogBox;
setStyleAttribute(attribute: string, value: string): DialogBox;
setStyleAttributes(attributes: Object): DialogBox;
setStyleName(styleName: string): DialogBox;
setStylePrimaryName(styleName: string): DialogBox;
setTag(tag: string): DialogBox;
setText(text: string): DialogBox;
setTitle(title: string): DialogBox;
setVisible(visible: boolean): DialogBox;
setWidget(widget: Widget): DialogBox;
setWidth(width: string): DialogBox;
show(): DialogBox;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.
* A "file-open" dialog for Google Drive. Unlike most UiApp objects, DocsListDialog
* should not be added to the UiInstance. The
* example below shows how to display a DocsListDialog in the
* new version of Google Sheets.
*
* Note that HTML service offers a similar but superior
* feature, Google Picker. In almost all
* cases, using Google Picker is preferable.
*
* function onOpen() {
* SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
* .createMenu('Custom Menu')
* .addItem('Select file', 'showDialog')
* .addToUi();
* }
*
* function showDialog() {
* // Dummy call to DriveApp to ensure the OAuth dialog requests Google Drive scope, so that the
* // getOAuthToken() call below returns a token with the necessary permissions.
* DriveApp.getRootFolder();
*
* var app = UiApp.createApplication()
* .setWidth(570)
* .setHeight(352);
*
* var serverHandler = app.createServerHandler('pickerHandler');
*
* app.createDocsListDialog()
* .addCloseHandler(serverHandler)
* .addSelectionHandler(serverHandler)
* .setOAuthToken(ScriptApp.getOAuthToken())
* .showDocsPicker();
*
* SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
* .showModalDialog(app,' ');
* }
*
* function pickerHandler(e) {
* var action = e.parameter.eventType;
* var app = UiApp.getActiveApplication();
*
* if (action == 'selection') {
* var doc = e.parameter.items[0];
* var id = doc.id;
* var name = doc.name;
* var url = doc.url;
* app.add(app.createLabel('You picked '));
* app.add(app.createAnchor(name, url));
* app.add(app.createLabel('(ID: ' + id + ').'));
* } else if (action == 'close') {
* app.add(app.createLabel('You clicked "Cancel".'));
* }
*
* return app;
* }
*/
export interface DocsListDialog {
addCloseHandler(handler: Handler): DocsListDialog;
addSelectionHandler(handler: Handler): DocsListDialog;
addView(fileType: FileType): DocsListDialog;
getId(): string;
getType(): string;
setDialogTitle(title: string): DocsListDialog;
setHeight(height: Integer): DocsListDialog;
setInitialView(fileType: FileType): DocsListDialog;
setMultiSelectEnabled(multiSelectEnabled: boolean): DocsListDialog;
setOAuthToken(oAuthToken: string): DocsListDialog;
setWidth(width: Integer): DocsListDialog;
showDocsPicker(): DocsListDialog;
}
/**
*
* Deprecated. The UI service was
*
* deprecated on December 11, 2014. To create user interfaces, use the
* HTML service instead.