forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
umbraco-services.d.ts
2394 lines (2152 loc) · 79.3 KB
/
umbraco-services.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 Umbraco v7.2.8
// Project: https://github.com/umbraco
// Definitions by: DeCareSystemsIreland <https://github.com/DeCareSystemsIreland>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="umbraco.d.ts" />
/// <reference path="../angularjs/angular.d.ts" />
declare module umbraco.services {
/**
* @ngdoc service
* @name umbraco.services.angularHelper
* @function
*
* @description
* Some angular helper/extension methods
*/
interface IAngularHelper {
/**
* @ngdoc function
* @name umbraco.services.angularHelper#rejectedPromise
* @methodOf umbraco.services.angularHelper
* @function
*
* @description
* In some situations we need to return a promise as a rejection, normally based on invalid data. This
* is a wrapper to do that so we can save on writing a bit of code.
*
* @param {object} objReject The object to send back with the promise rejection
*/
rejectedPromise(objReject: Object): void;
/**
* @ngdoc function
* @name safeApply
* @methodOf umbraco.services.angularHelper
* @function
*
* @description
* This checks if a digest/apply is already occuring, if not it will force an apply call
*/
safeApply(scope: ng.IScope, fn: Function): void;
/**
* @ngdoc function
* @name getCurrentForm
* @methodOf umbraco.services.angularHelper
* @function
*
* @description
* Returns the current form object applied to the scope or null if one is not found
*/
getCurrentForm(scope: ng.IScope): any;
/**
* @ngdoc function
* @name validateHasForm
* @methodOf umbraco.services.angularHelper
* @function
*
* @description
* This will validate that the current scope has an assigned form object, if it doesn't an exception is thrown, if
* it does we return the form object.
*/
getRequiredCurrentForm(scope: ng.IScope): Object;
/**
* @ngdoc function
* @name getNullForm
* @methodOf umbraco.services.angularHelper
* @function
*
* @description
* Returns a null angular FormController, mostly for use in unit tests
* NOTE: This is actually the same construct as angular uses internally for creating a null form but they don't expose
* any of this publicly to us, so we need to create our own.
*
* @param {string} formName The form name to assign
*/
getNullForm(formName: string): ng.IFormController;
}
/**
* Global State
*/
interface IGlobalState {
showNavigation: boolean;
touchDevice: boolean;
showTray: boolean;
stickyNavigation: any;
navMode: any;
isReady: boolean;
}
/**
* Section State
*/
interface ISectionState {
//The currently active section
currentSection: any;
showSearchResults: boolean;
}
/**
* Tree State
*/
interface ITreeState {
//The currently selected node
selectedNode: any;
//The currently loaded root node reference - depending on the section loaded this could be a section root or a normal root.
//We keep this reference so we can lookup nodes to interact with in the UI via the tree service
currentRootNode: any;
}
/**
* Menu State
*/
interface IMenuState {
//this list of menu items to display
menuActions: any;
//the title to display in the context menu dialog
dialogTitle: string;
//The tree node that the ctx menu is launched for
currentNode: any;
//Whether the menu's dialog is being shown or not
showMenuDialog: boolean;
//Whether the context menu is being shown or not
showMenu: boolean;
}
/**
* State Object
*/
interface IStateObject {
id: number;
parentId: number;
name: string;
}
/**
* @ngdoc service
* @name umbraco.services.appState
* @function
*
* @description
* Tracks the various application state variables when working in the back office, raises events when state changes.
*/
interface IAppState {
/** function to validate and set the state on a state object */
setState(stateObj: IStateObject, key: string, value: any, stateObjName: string): void;
/** function to validate and set the state on a state object */
getState(stateObj: IStateObject, key: string, stateObjName: string): IStateObject;
/**
* @ngdoc function
* @name umbraco.services.angularHelper#getGlobalState
* @methodOf umbraco.services.appState
* @function
*
* @description
* Returns the current global state value by key - we do not return an object reference here - we do NOT want this
* to be publicly mutable and allow setting arbitrary values
*/
getGlobalState(key: string): IGlobalState;
/**
* @ngdoc function
* @name umbraco.services.angularHelper#setGlobalState
* @methodOf umbraco.services.appState
* @function
*
* @description
* Sets a global state value by key
*/
setGlobalState(key: string, value: boolean): void;
/**
* @ngdoc function
* @name umbraco.services.angularHelper#getSectionState
* @methodOf umbraco.services.appState
* @function
*
* @description
* Returns the current section state value by key - we do not return an object here - we do NOT want this
* to be publicly mutable and allow setting arbitrary values
*/
getSectionState(key: string): ISectionState;
/**
* @ngdoc function
* @name umbraco.services.angularHelper#setSectionState
* @methodOf umbraco.services.appState
* @function
*
* @description
* Sets a section state value by key
*/
setSectionState(key: string, value: ISectionState): void;
/**
* @ngdoc function
* @name umbraco.services.angularHelper#getTreeState
* @methodOf umbraco.services.appState
* @function
*
* @description
* Returns the current tree state value by key - we do not return an object here - we do NOT want this
* to be publicly mutable and allow setting arbitrary values
*/
getTreeState(key: string): ITreeState;
/**
* @ngdoc function
* @name umbraco.services.angularHelper#setTreeState
* @methodOf umbraco.services.appState
* @function
*
* @description
* Sets a section state value by key
*/
setTreeState(key: string, value: ITreeState): void;
/**
* @ngdoc function
* @name umbraco.services.angularHelper#getMenuState
* @methodOf umbraco.services.appState
* @function
*
* @description
* Returns the current menu state value by key - we do not return an object here - we do NOT want this
* to be publicly mutable and allow setting arbitrary values
*/
getMenuState(key: string): IStateObject;
/**
* @ngdoc function
* @name umbraco.services.angularHelper#setMenuState
* @methodOf umbraco.services.appState
* @function
*
* @description
* Sets a section state value by key
*/
setMenuState(key: string, value: IMenuState): void;
}
/*Tracks the parent object for complex editors by exposing it as an object reference via editorState.current.entity
* it is possible to modify this object, so should be used with care */
interface IState {
/**
* @ngdoc function
* @name umbraco.services.angularHelper#set
* @methodOf umbraco.services.editorState
* @function
*
* @description
* Sets the current entity object for the currently active editor
* This is only used when implementing an editor with a complex model
* like the content editor, where the model is modified by several
* child controllers.
*/
set(entity: Object): void;
/**
* @ngdoc function
* @name umbraco.services.angularHelper#reset
* @methodOf umbraco.services.editorState
* @function
*
* @description
* Since the editorstate entity is read-only, you cannot set it to null
* only through the reset() method
*/
reset(): void;
/**
* @ngdoc function
* @name umbraco.services.angularHelper#getCurrent
* @methodOf umbraco.services.editorState
* @function
*
* @description
* Returns an object reference to the current editor entity.
* the entity is the root object of the editor.
* EditorState is used by property/parameter editors that need
* access to the entire entity being edited, not just the property/parameter
*
* editorState.current can not be overwritten, you should only read values from it
* since modifying individual properties should be handled by the property editors
*/
getCurrent(): any;
}
/**
* @ngdoc service
* @name umbraco.services.assetsService
*
* @requires $q
* @requires angularHelper
*
* @description
* Promise-based utillity service to lazy-load client-side dependencies inside angular controllers.
*/
interface IAssetsService {
/**
* @ngdoc method
* @name umbraco.services.assetsService#loadCss
* @methodOf umbraco.services.assetsService
*
* @description
* Injects a file as a stylesheet into the document head
*
* @param {String} path path to the css file to load
* @param {Scope} scope optional scope to pass into the loader
* @param {Object} keyvalue collection of attributes to pass to the stylesheet element
* @param {Number} timeout in milliseconds
* @returns {Promise} Promise object which resolves when the file has loaded
*/
loadCss(path: string, scope: ng.IScope, attributes: Object, timeout: number): ng.IPromise<any>;
/**
* @ngdoc method
* @name umbraco.services.assetsService#loadJs
* @methodOf umbraco.services.assetsService
*
* @description
* Injects a file as a javascript into the document
*
* @param {String} path path to the js file to load
* @param {Scope} scope optional scope to pass into the loader
* @param {Object} keyvalue collection of attributes to pass to the script element
* @param {Number} timeout in milliseconds
* @returns {Promise} Promise object which resolves when the file has loaded
*/
loadJs(path: string, scope: ng.IScope, attributes: Object, timeout: number): ng.IPromise<any>;
/**
* @ngdoc method
* @name umbraco.services.assetsService#load
* @methodOf umbraco.services.assetsService
*
* @description
* Injects a collection of files, this can be ONLY js files
*
*
* @param {Array} pathArray string array of paths to the files to load
* @param {Scope} scope optional scope to pass into the loader
* @returns {Promise} Promise object which resolves when all the files has loaded
*/
load(pathArray: string[], scope: ng.IScope): ng.IPromise<any>;
}
/**
* @ngdoc service
* @name umbraco.services.contentEditingHelper
* @description A helper service for most editors, some methods are specific to content/media/member model types but most are used by
* all editors to share logic and reduce the amount of replicated code among editors.
*/
interface IContentEditingHelper {
/**
* @ngdoc method
* @name umbraco.services.contentEditingHelper#getAllProps
* @methodOf umbraco.services.contentEditingHelper
* @function
*
* @description
* Returns all propertes contained for the content item (since the normal model has properties contained inside of tabs)
*/
getAllProps(content: any): any;
/**
* @ngdoc method
* @name umbraco.services.contentEditingHelper#configureButtons
* @methodOf umbraco.services.contentEditingHelper
* @function
*
* @description
* Returns a letter array for buttons, with the primary one first based on content model, permissions and editor state
*/
getAllowedActions(content: any, creating: any): string[];
/**
* @ngdoc method
* @name umbraco.services.contentEditingHelper#getButtonFromAction
* @methodOf umbraco.services.contentEditingHelper
* @function
*
* @description
* Returns a button object to render a button for the tabbed editor
* currently only returns built in system buttons for content and media actions
* returns label, alias, action char and hot-key
*/
getButtonFromAction(ch: string): any;
/**
* @ngdoc method
* @name umbraco.services.contentEditingHelper#reBindChangedProperties
* @methodOf umbraco.services.contentEditingHelper
* @function
*
* @description
* re-binds all changed property values to the origContent object from the savedContent object and returns an array of changed properties.
*/
reBindChangedProperties(origContent: any, savedContent: any): void;
/**
* @ngdoc function
* @name umbraco.services.contentEditingHelper#handleSaveError
* @methodOf umbraco.services.contentEditingHelper
* @function
*
* @description
* A function to handle what happens when we have validation issues from the server side
*/
handleSaveError(...args: any[]): void;
/**
* @ngdoc function
* @name umbraco.services.contentEditingHelper#handleSuccessfulSave
* @methodOf umbraco.services.contentEditingHelper
* @function
*
* @description
* A function to handle when saving a content item is successful. This will rebind the values of the model that have changed
* ensure the notifications are displayed and that the appropriate events are fired. This will also check if we need to redirect
* when we're creating new content.
*/
handleSuccessfulSave(...args: any[]): void;
/**
* @ngdoc function
* @name umbraco.services.contentEditingHelper#redirectToCreatedContent
* @methodOf umbraco.services.contentEditingHelper
* @function
*
* @description
* Changes the location to be editing the newly created content after create was successful.
* We need to decide if we need to redirect to edito mode or if we will remain in create mode.
* We will only need to maintain create mode if we have not fulfilled the basic requirements for creating an entity which is at least having a name.
*/
redirectToCreatedContent(id: number, modelState: any): void;
}
/**
* @ngdoc service
* @name umbraco.services.cropperHelper
* @description A helper object used for dealing with image cropper data
*/
interface ICropperHelper {
/**
* @ngdoc method
* @name umbraco.services.cropperHelper#configuration
* @methodOf umbraco.services.cropperHelper
*
* @description
* Returns a collection of plugins available to the tinyMCE editor
*
*/
configuration(mediaTypeAlias: string): any;
}
/**
* Rendering options
*/
interface IDialogRenderingOptions {
/*the DOM element to inject the modal into, by default set to body*/
container?: HTMLElement;
/*function called when the modal is submitted*/
callback: Function;
/*the url of the template*/
template: string;
/*animation css class, by default set to "fade"*/
animation?: string;
/*modal css class, by default "umb-modal"*/
modalClass?: string;
/*show the modal instantly*/
show?: boolean;
/*load template in an iframe, only needed for serverside templates*/
iframe: boolean;
/*set a width on the modal, only needed for iframes*/
width?: number;
/*strips the modal from any animation and wrappers, used when you want to inject a dialog into an existing container*/
inline?: boolean;
}
/**
* Modal
*/
interface IModal {
}
/**
* Mediapicker dialog options object
*/
interface IMediaPickerOptions {
/*Only display files that have an image file-extension*/
onlyImages: boolean;
/*callback function*/
callback: Function;
}
/**
* Content picker dialog options object
*/
interface IContentPickerOptions {
/*should the picker return one or multiple items*/
multipicker: boolean;
/*callback function*/
callback: Function;
}
/**
* Iconpicker dialog options object
*/
interface IIconPickerOptions {
/*callback function*/
callback: Function;
}
/**
* Linkpicker dialog options object
*/
interface ILinkPickerOptions {
/*callback function*/
callback: Function;
}
/**
* Macropicker dialog options object
*/
interface IMacroPickerOptions {
/*callback function*/
callback: Function;
}
/**
* Member group picker dialog options object
*/
interface IMemberGroupPickerOptions {
/*should the tree pick one or multiple members before returning*/
multiPicker: boolean;
/*callback function*/
callback: Function;
}
/**
* Member picker dialog options object
*/
interface IMemberPickerOptions {
/*should the tree pick one or multiple members before returning*/
multiPicker: boolean;
/*callback function*/
callback: Function;
}
/**
* Property dialog options object
*/
interface IPropertyDialogOptions {
/*callback function*/
callback: Function;
/*editor to use to edit a given value and return on callback*/
editor: string;
/*value sent to the property editor*/
value: Object;
}
/**
* Iconpicker dialog options object
*/
interface ITreePickerOptions {
/*tree section to display*/
section: string;
/*specific tree to display*/
treeAlias: string;
/*should the tree pick one or multiple items before returning*/
multiPicker: boolean;
/*callback function*/
callback: Function;
}
/**
* Dialog options object
*/
interface IDialog {
}
/*
* Application-wide service for handling modals, overlays and dialogs By default it
* injects the passed template url into a div to body of the document And renders it,
* but does also support rendering items in an iframe, incase serverside processing is needed, or its a non-angular page
*/
interface IDialogService {
dialogs?: any[];
/** Internal method that removes all dialogs */
removeAllDialogs(...args: any[]): void;
/** Internal method that closes the dialog properly and cleans up resources */
closeDialog(dialog: IDialog): void;
/** Internal method that handles opening all dialogs */
openDialog(options: IDialogRenderingOptions): IModal;
/**
* @ngdoc method
* @name umbraco.services.dialogService#open
* @methodOf umbraco.services.dialogService
*
* @description
* Opens a modal rendering a given template url.
*
* @param {Object} options rendering options
* @param {DomElement} options.container the DOM element to inject the modal into, by default set to body
* @param {Function} options.callback function called when the modal is submitted
* @param {String} options.template the url of the template
* @param {String} options.animation animation csss class, by default set to "fade"
* @param {String} options.modalClass modal css class, by default "umb-modal"
* @param {Bool} options.show show the modal instantly
* @param {Bool} options.iframe load template in an iframe, only needed for serverside templates
* @param {Int} options.width set a width on the modal, only needed for iframes
* @param {Bool} options.inline strips the modal from any animation and wrappers, used when you want to inject a dialog into an existing container
* @returns {Object} modal object
*/
open(options: IDialogRenderingOptions): IModal;
/**
* @ngdoc method
* @name umbraco.services.dialogService#close
* @methodOf umbraco.services.dialogService
*
* @description
* Closes a specific dialog
* @param {Object} dialog the dialog object to close
* @param {Object} args if specified this object will be sent to any callbacks registered on the dialogs.
*/
close(dialog: IDialog, ...args: any[]): void;
/**
* @ngdoc method
* @name umbraco.services.dialogService#closeAll
* @methodOf umbraco.services.dialogService
*
* @description
* Closes all dialogs
* @param {Object} args if specified this object will be sent to any callbacks registered on the dialogs.
*/
closeAll(...args: any[]): void;
/**
* @ngdoc method
* @name umbraco.services.dialogService#mediaPicker
* @methodOf umbraco.services.dialogService
*
* @description
* Opens a media picker in a modal, the callback returns an array of selected media items
* @param {Object} options mediapicker dialog options object
* @param {Boolean} options.onlyImages Only display files that have an image file-extension
* @param {Function} options.callback callback function
* @returns {Object} modal object
*/
mediaPicker(options: IMediaPickerOptions): IModal;
/**
* @ngdoc method
* @name umbraco.services.dialogService#contentPicker
* @methodOf umbraco.services.dialogService
*
* @description
* Opens a content picker tree in a modal, the callback returns an array of selected documents
* @param {Object} options content picker dialog options object
* @param {Boolean} options.multipicker should the picker return one or multiple items
* @param {Function} options.callback callback function
* @returns {Object} modal object
*/
contentPicker(options: IContentPickerOptions): IModal;
/**
* @ngdoc method
* @name umbraco.services.dialogService#linkPicker
* @methodOf umbraco.services.dialogService
*
* @description
* Opens a link picker tree in a modal, the callback returns a single link
* @param {Object} options content picker dialog options object
* @param {Function} options.callback callback function
* @returns {Object} modal object
*/
linkPicker(options: ILinkPickerOptions): IModal;
/**
* @ngdoc method
* @name umbraco.services.dialogService#macroPicker
* @methodOf umbraco.services.dialogService
*
* @description
* Opens a mcaro picker in a modal, the callback returns a object representing the macro and it's parameters
* @param {Object} options macropicker dialog options object
* @param {Function} options.callback callback function
* @returns {Object} modal object
*/
macroPicker(options: IMacroPickerOptions): IModal;
/**
* @ngdoc method
* @name umbraco.services.dialogService#memberPicker
* @methodOf umbraco.services.dialogService
*
* @description
* Opens a member picker in a modal, the callback returns a object representing the selected member
* @param {Object} options member picker dialog options object
* @param {Boolean} options.multiPicker should the tree pick one or multiple members before returning
* @param {Function} options.callback callback function
* @returns {Object} modal object
*/
memberPicker(options: IMemberPickerOptions): IModal;
/**
* @ngdoc method
* @name umbraco.services.dialogService#memberGroupPicker
* @methodOf umbraco.services.dialogService
*
* @description
* Opens a member group picker in a modal, the callback returns a object representing the selected member
* @param {Object} options member group picker dialog options object
* @param {Boolean} options.multiPicker should the tree pick one or multiple members before returning
* @param {Function} options.callback callback function
* @returns {Object} modal object
*/
memberGroupPicker(options: IMemberGroupPickerOptions): IModal;
/**
* @ngdoc method
* @name umbraco.services.dialogService#iconPicker
* @methodOf umbraco.services.dialogService
*
* @description
* Opens a icon picker in a modal, the callback returns a object representing the selected icon
* @param {Object} options iconpicker dialog options object
* @param {Function} options.callback callback function
* @returns {Object} modal object
*/
iconPicker(options: IIconPickerOptions): IModal;
/**
* @ngdoc method
* @name umbraco.services.dialogService#treePicker
* @methodOf umbraco.services.dialogService
*
* @description
* Opens a tree picker in a modal, the callback returns a object representing the selected tree item
* @param {Object} options iconpicker dialog options object
* @param {String} options.section tree section to display
* @param {String} options.treeAlias specific tree to display
* @param {Boolean} options.multiPicker should the tree pick one or multiple items before returning
* @param {Function} options.callback callback function
* @returns {Object} modal object
*/
treePicker(options: ITreePickerOptions): IModal;
/**
* @ngdoc method
* @name umbraco.services.dialogService#propertyDialog
* @methodOf umbraco.services.dialogService
*
* @description
* Opens a dialog with a chosen property editor in, a value can be passed to the modal, and this value is returned in the callback
* @param {Object} options mediapicker dialog options object
* @param {Function} options.callback callback function
* @param {String} editor editor to use to edit a given value and return on callback
* @param {Object} value value sent to the property editor
* @returns {Object} modal object
*/
propertyDialog(options: IPropertyDialogOptions): IModal;
/**
* @ngdoc method
* @name umbraco.services.dialogService#ysodDialog
* @methodOf umbraco.services.dialogService
* @description
* Opens a dialog to an embed dialog
*/
embedDialog(options: any): void;
/**
* @ngdoc method
* @name umbraco.services.dialogService#ysodDialog
* @methodOf umbraco.services.dialogService
*
* @description
* Opens a dialog to show a custom YSOD
*/
ysodDialog(ysodError: any): void;
}
/** Used to broadcast and listen for global events and allow the ability to add async listeners to the callbacks */
/**
Core app events:
app.ready
app.authenticated
app.notAuthenticated
app.closeDialogs
*/
interface IEventService {
}
/**
* File
*/
interface IFile {
}
/**
* @ngdoc service
* @name umbraco.services.fileManager
* @function
*
* @description
* Used by editors to manage any files that require uploading with the posted data, normally called by property editors
* that need to attach files.
* When a route changes successfully, we ensure that the collection is cleared.
*/
interface IFileManager {
/**
* @ngdoc function
* @name umbraco.services.fileManager#addFiles
* @methodOf umbraco.services.fileManager
* @function
*
* @description
* Attaches files to the current manager for the current editor for a particular property, if an empty array is set
* for the files collection that effectively clears the files for the specified editor.
*/
setFiles(propertyAlias: string, files: IFile[]): void;
/**
* @ngdoc function
* @name umbraco.services.fileManager#getFiles
* @methodOf umbraco.services.fileManager
* @function
*
* @description
* Returns all of the files attached to the file manager
*/
getFiles(): IFile[];
/**
* @ngdoc function
* @name umbraco.services.fileManager#clearFiles
* @methodOf umbraco.services.fileManager
* @function
*
* @description
* Removes all files from the manager
*/
clearFiles(): void;
}
/**
* Model state
*/
interface IModelState {
}
/**
* @ngdoc service
* @name umbraco.services.formHelper
* @function
*
* @description
* A utility class used to streamline how forms are developed, to ensure that validation is check and displayed consistently and to ensure that the correct events
* fire when they need to.
*/
interface IFormHelper {
/**
* @ngdoc function
* @name umbraco.services.formHelper#submitForm
* @methodOf umbraco.services.formHelper
* @function
*
* @description
* Called by controllers when submitting a form - this ensures that all client validation is checked,
* server validation is cleared, that the correct events execute and status messages are displayed.
* This returns true if the form is valid, otherwise false if form submission cannot continue.
*
* @param {object} args An object containing arguments for form submission
*/
submitForm(...args: any[]): void;
/**
* @ngdoc function
* @name umbraco.services.formHelper#submitForm
* @methodOf umbraco.services.formHelper
* @function
*
* @description
* Called by controllers when a form has been successfully submitted. the correct events execute
* and that the notifications are displayed if there are any.
*
* @param {object} args An object containing arguments for form submission
*/
resetForm(...args: any[]): void;
/**
* @ngdoc function
* @name umbraco.services.formHelper#handleError
* @methodOf umbraco.services.formHelper
* @function
*
* @description
* Needs to be called when a form submission fails, this will wire up all server validation errors in ModelState and
* add the correct messages to the notifications. If a server error has occurred this will show a ysod.
*
* @param {object} err The error object returned from the http promise
*/
handleError(err: Object): void;
/**
* @ngdoc function
* @name umbraco.services.formHelper#handleServerValidation
* @methodOf umbraco.services.formHelper
* @function
*
* @description
* This wires up all of the server validation model state so that valServer and valServerField directives work
*
* @param {object} err The error object returned from the http promise
*/
handleServerValidation(modelState: IModelState): void;
}
/**
* History item
*/
interface IHistoryItem {
//css class for the list, ex: "icon-image", "icon-doc"
icon: string;
//route to the editor, ex: "/content/edit/1234"
link: string;
//friendly name for the history listing
name: string;
}
/**
* @ngdoc service
* @name umbraco.services.historyService
*
* @requires $rootScope
* @requires $timeout
* @requires angularHelper
*
* @description
* Service to handle the main application navigation history. Responsible for keeping track
* of where a user navigates to, stores an icon, url and name in a collection, to make it easy
* for the user to go back to a previous editor / action
*
* **Note:** only works with new angular-based editors, not legacy ones
*
* ##usage
* To use, simply inject the historyService into any controller that needs it, and make
* sure the umbraco.services module is accesible - which it should be by default.
*/
interface IHistoryService {
/**
* @ngdoc method
* @name umbraco.services.historyService#add
* @methodOf umbraco.services.historyService
*
* @description
* Adds a given history item to the users history collection.
*
* @param {Object} item the history item
* @param {String} item.icon icon css class for the list, ex: "icon-image", "icon-doc"