forked from jbaroudi/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
umbraco-resources.d.ts
1739 lines (1633 loc) · 57.2 KB
/
umbraco-resources.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="../angularjs/angular.d.ts" />
declare module umbraco.resources{
/**
* ResourcePromise object
* The success callback returns the data which will be resolved by the deferred object.
* The error callback returns an object containing: {errorMsg: errorMessage, data: originalData, status: status }
*/
export interface IResourcePromise {
errorMsg: string;
data: any;
status: number;
}
/**
* Can be Ascending or Descending - Default: Ascending
*/
enum Direction {
Ascending,
Descending
}
/**
* Property to order items by, default: `SortOrder`
*/
enum OrderItemsBy {
SortOrder
}
/**
* @ngdoc service
* @name umbraco.resources.authResource
* @description
* This Resource perfomrs actions to common authentication tasks for the Umbraco backoffice user
*
* @requires $q
* @requires $http
* @requires umbRequestHelper
* @requires angularHelper
*/
interface IAuthResource{
/**
* @ngdoc method
* @name umbraco.resources.authResource#performLogin
* @methodOf umbraco.resources.authResource
*
* @description
* Logs the Umbraco backoffice user in if the credentials are good
*
* ##usage
* <pre>
* authResource.performLogin(login, password)
* .then(function(data) {
* //Do stuff for login...
* });
* </pre>
* @param {string} login Username of backoffice user
* @param {string} password Password of backoffice user
* @returns {Promise} resourcePromise object
*
*/
performLogin(username: string, password: string): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.authResource#performLogout
* @methodOf umbraco.resources.authResource
*
* @description
* Logs out the Umbraco backoffice user
*
* ##usage
* <pre>
* authResource.performLogout()
* .then(function(data) {
* //Do stuff for logging out...
* });
* </pre>
* @returns {Promise} resourcePromise object
*
*/
performLogout(): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.authResource#getCurrentUser
* @methodOf umbraco.resources.authResource
*
* @description
* Sends a request to the server to get the current user details, will return a 401 if the user is not logged in
*
* ##usage
* <pre>
* authResource.getCurrentUser()
* .then(function(data) {
* //Do stuff for fetching the current logged in Umbraco backoffice user
* });
* </pre>
* @returns {Promise} resourcePromise object
*
*/
getCurrentUser(): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.authResource#isAuthenticated
* @methodOf umbraco.resources.authResource
*
* @description
* Checks if the user is logged in or not - does not return 401 or 403
*
* ##usage
* <pre>
* authResource.isAuthenticated()
* .then(function(data) {
* //Do stuff to check if user is authenticated
* });
* </pre>
* @returns {Promise} resourcePromise object
*
*/
isAuthenticated(): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.authResource#getRemainingTimeoutSeconds
* @methodOf umbraco.resources.authResource
*
* @description
* Gets the user's remaining seconds before their login times out
*
* ##usage
* <pre>
* authResource.getRemainingTimeoutSeconds()
* .then(function(data) {
* //Number of seconds is returned
* });
* </pre>
* @returns {Promise} resourcePromise object
*
*/
getRemainingTimeoutSeconds(): ng.IPromise<IResourcePromise>;
}
/**
* @ngdoc service
* @name umbraco.resources.contentResource
* @description Handles all transactions of content data
* from the angular application to the Umbraco database, using the Content WebApi controller
*
* all methods returns a resource promise async, so all operations won't complete untill .then() is completed.
*
* @requires $q
* @requires $http
* @requires umbDataFormatter
* @requires umbRequestHelper
*
* ##usage
* To use, simply inject the contentResource into any controller or service that needs it, and make
* sure the umbraco.resources module is accesible - which it should be by default.
*
* <pre>
* contentResource.getById(1234)
* .then(function(data) {
* $scope.content = data;
* });
* </pre>
**/
interface IContentResource{
/**
* @ngdoc method
* @name umbraco.resources.contentResource#sort
* @methodOf umbraco.resources.contentResource
*
* @description
* Sorts all children below a given parent node id, based on a collection of node-ids
*
* ##usage
* <pre>
* var ids = [123,34533,2334,23434];
* contentResource.sort({ parentId: 1244, sortedIds: ids })
* .then(function() {
* $scope.complete = true;
* });
* </pre>
* @param {Object} args arguments object
* @param {Int} args.parentId the ID of the parent node
* @param {Array} options.sortedIds array of node IDs as they should be sorted
* @returns {Promise} resourcePromise object.
*
*/
sort(...args: any[]): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.contentResource#move
* @methodOf umbraco.resources.contentResource
*
* @description
* Moves a node underneath a new parentId
*
* ##usage
* <pre>
* contentResource.move({ parentId: 1244, id: 123 })
* .then(function() {
* alert("node was moved");
* }, function(err){
* alert("node didnt move:" + err.data.Message);
* });
* </pre>
* @param {Object} args arguments object
* @param {Int} args.id the ID of the node to move
* @param {Int} args.parentId the ID of the parent node to move to
* @returns {Promise} resourcePromise object.
*
*/
move(...args: any[]): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.contentResource#copy
* @methodOf umbraco.resources.contentResource
*
* @description
* Copies a node underneath a new parentId
*
* ##usage
* <pre>
* contentResource.copy({ parentId: 1244, id: 123 })
* .then(function() {
* alert("node was copied");
* }, function(err){
* alert("node wasnt copy:" + err.data.Message);
* });
* </pre>
* @param {Object} args arguments object
* @param {Int} args.id the ID of the node to copy
* @param {Int} args.parentId the ID of the parent node to copy to
* @param {Boolean} args.relateToOriginal if true, relates the copy to the original through the relation api
* @returns {Promise} resourcePromise object.
*
*/
copy(...args: any[]): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.contentResource#unPublish
* @methodOf umbraco.resources.contentResource
*
* @description
* Unpublishes a content item with a given Id
*
* ##usage
* <pre>
* contentResource.unPublish(1234)
* .then(function() {
* alert("node was unpulished");
* }, function(err){
* alert("node wasnt unpublished:" + err.data.Message);
* });
* </pre>
* @param {Int} id the ID of the node to unpublish
* @returns {Promise} resourcePromise object.
*
*/
unPublish(id: number): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.contentResource#emptyRecycleBin
* @methodOf umbraco.resources.contentResource
*
* @description
* Empties the content recycle bin
*
* ##usage
* <pre>
* contentResource.emptyRecycleBin()
* .then(function() {
* alert('its empty!');
* });
* </pre>
*
* @returns {Promise} resourcePromise object.
*
*/
emptyRecycleBin(): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.contentResource#deleteById
* @methodOf umbraco.resources.contentResource
*
* @description
* Deletes a content item with a given id
*
* ##usage
* <pre>
* contentResource.deleteById(1234)
* .then(function() {
* alert('its gone!');
* });
* </pre>
*
* @param {Int} id id of content item to delete
* @returns {Promise} resourcePromise object.
*
*/
deleteById(id: number): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.contentResource#getById
* @methodOf umbraco.resources.contentResource
*
* @description
* Gets a content item with a given id
*
* ##usage
* <pre>
* contentResource.getById(1234)
* .then(function(content) {
* var myDoc = content;
* alert('its here!');
* });
* </pre>
*
* @param {Int} id id of content item to return
* @returns {Promise} resourcePromise object containing the content item.
*
*/
getById(id: number): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.contentResource#getByIds
* @methodOf umbraco.resources.contentResource
*
* @description
* Gets an array of content items, given a collection of ids
*
* ##usage
* <pre>
* contentResource.getByIds( [1234,2526,28262])
* .then(function(contentArray) {
* var myDoc = contentArray;
* alert('they are here!');
* });
* </pre>
*
* @param {Array} ids ids of content items to return as an array
* @returns {Promise} resourcePromise object containing the content items array.
*
*/
getByIds(ids: number[]): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.contentResource#getScaffold
* @methodOf umbraco.resources.contentResource
*
* @description
* Returns a scaffold of an empty content item, given the id of the content item to place it underneath and the content type alias.
*
* - Parent Id must be provided so umbraco knows where to store the content
* - Content Type alias must be provided so umbraco knows which properties to put on the content scaffold
*
* The scaffold is used to build editors for content that has not yet been populated with data.
*
* ##usage
* <pre>
* contentResource.getScaffold(1234, 'homepage')
* .then(function(scaffold) {
* var myDoc = scaffold;
* myDoc.name = "My new document";
*
* contentResource.publish(myDoc, true)
* .then(function(content){
* alert("Retrieved, updated and published again");
* });
* });
* </pre>
*
* @param {Int} parentId id of content item to return
* @param {String} alias contenttype alias to base the scaffold on
* @returns {Promise} resourcePromise object containing the content scaffold.
*
*/
getScaffold(parentId: number, alias: string): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.contentResource#getNiceUrl
* @methodOf umbraco.resources.contentResource
*
* @description
* Returns a url, given a node ID
*
* ##usage
* <pre>
* contentResource.getNiceUrl(id)
* .then(function(url) {
* alert('its here!');
* });
* </pre>
*
* @param {Int} id Id of node to return the public url to
* @returns {Promise} resourcePromise object containing the url.
*
*/
getNiceUrl(id: number): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.contentResource#getChildren
* @methodOf umbraco.resources.contentResource
*
* @description
* Gets children of a content item with a given id
*
* ##usage
* <pre>
* contentResource.getChildren(1234, {pageSize: 10, pageNumber: 2})
* .then(function(contentArray) {
* var children = contentArray;
* alert('they are here!');
* });
* </pre>
*
* @param {Int} parentid id of content item to return children of
* @param {Object} options optional options object
* @param {Int} options.pageSize if paging data, number of nodes per page, default = 0
* @param {Int} options.pageNumber if paging data, current page index, default = 0
* @param {String} options.filter if provided, query will only return those with names matching the filter
* @param {String} options.orderDirection can be `Ascending` or `Descending` - Default: `Ascending`
* @param {String} options.orderBy property to order items by, default: `SortOrder`
* @returns {Promise} resourcePromise object containing an array of content items.
*
*/
getChildren(parentId: number, options?: { pageSize: number; pageNumber: number; filter: string; orderDirection: Direction; orderBy: OrderItemsBy }): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.contentResource#hasPermission
* @methodOf umbraco.resources.contentResource
*
* @description
* Returns true/false given a permission char to check against a nodeID
* for the current user
*
* ##usage
* <pre>
* contentResource.hasPermission('p',1234)
* .then(function() {
* alert('You are allowed to publish this item');
* });
* </pre>
*
* @param {String} permission char representing the permission to check
* @param {Int} id id of content item to delete
* @returns {Promise} resourcePromise object.
*
*/
checkPermission(permission: string, id: number): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.contentResource#save
* @methodOf umbraco.resources.contentResource
*
* @description
* Saves changes made to a content item to its current version, if the content item is new, the isNew paramater must be passed to force creation
* if the content item needs to have files attached, they must be provided as the files param and passed seperately
*
*
* ##usage
* <pre>
* contentResource.getById(1234)
* .then(function(content) {
* content.name = "I want a new name!";
* contentResource.save(content, false)
* .then(function(content){
* alert("Retrieved, updated and saved again");
* });
* });
* </pre>
*
* @param {Object} content The content item object with changes applied
* @param {Bool} isNew set to true to create a new item or to update an existing
* @param {Array} files collection of files for the document
* @returns {Promise} resourcePromise object containing the saved content item.
*
*/
save(content: IContentResource, isNew: boolean, files: any[]): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.contentResource#publish
* @methodOf umbraco.resources.contentResource
*
* @description
* Saves and publishes changes made to a content item to a new version, if the content item is new, the isNew paramater must be passed to force creation
* if the content item needs to have files attached, they must be provided as the files param and passed seperately
*
*
* ##usage
* <pre>
* contentResource.getById(1234)
* .then(function(content) {
* content.name = "I want a new name, and be published!";
* contentResource.publish(content, false)
* .then(function(content){
* alert("Retrieved, updated and published again");
* });
* });
* </pre>
*
* @param {Object} content The content item object with changes applied
* @param {Bool} isNew set to true to create a new item or to update an existing
* @param {Array} files collection of files for the document
* @returns {Promise} resourcePromise object containing the saved content item.
*
*/
publish(content: IContentResource, isNew: boolean, files: any[]): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.contentResource#sendToPublish
* @methodOf umbraco.resources.contentResource
*
* @description
* Saves changes made to a content item, and notifies any subscribers about a pending publication
*
* ##usage
* <pre>
* contentResource.getById(1234)
* .then(function(content) {
* content.name = "I want a new name, and be published!";
* contentResource.sendToPublish(content, false)
* .then(function(content){
* alert("Retrieved, updated and notication send off");
* });
* });
* </pre>
*
* @param {Object} content The content item object with changes applied
* @param {Bool} isNew set to true to create a new item or to update an existing
* @param {Array} files collection of files for the document
* @returns {Promise} resourcePromise object containing the saved content item.
*
*/
sendToPublish(content: IContentResource, isNew: boolean, files: any[]): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.contentResource#publishByid
* @methodOf umbraco.resources.contentResource
*
* @description
* Publishes a content item with a given ID
*
* ##usage
* <pre>
* contentResource.publishById(1234)
* .then(function(content) {
* alert("published");
* });
* </pre>
*
* @param {Int} id The ID of the conten to publish
* @returns {Promise} resourcePromise object containing the published content item.
*
*/
publishById(id: number): ng.IPromise<IResourcePromise>;
}
/**
* @ngdoc service
* @name umbraco.resources.contentTypeResource
* @description Loads in data for content types
**/
interface IContentTypeResource{
/**
* @ngdoc method
* @name umbraco.resources.contentTypeResource#getAllowedTypes
* @methodOf umbraco.resources.contentTypeResource
*
* @description
* Returns a list of allowed content types underneath a content item with a given ID
*
* ##usage
* <pre>
* contentTypeResource.getAllowedTypes(1234)
* .then(function(array) {
* $scope.type = type;
* });
* </pre>
* @param {Int} contentId id of the content item to retrive allowed child types for
* @returns {Promise} resourcePromise object.
*
*/
getAllowedTypes(contentId: number): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.contentTypeResource#getAllPropertyTypeAliases
* @methodOf umbraco.resources.contentTypeResource
*
* @description
* Returns a list of defined property type aliases
*
* @returns {Promise} resourcePromise object.
*
*/
getAllPropertyTypeAliases(): ng.IPromise<IResourcePromise>;
}
/**
* @ngdoc service
* @name umbraco.resources.currentUserResource
* @description Used for read/updates for the currently logged in user
*
*
**/
interface ICurrentUserResource{
/**
* @ngdoc method
* @name umbraco.resources.currentUserResource#changePassword
* @methodOf umbraco.resources.currentUserResource
*
* @description
* Changes the current users password
*
* @returns {Promise} resourcePromise object containing the user array.
*
*/
changePassword(changePasswordArgs: any): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.currentUserResource#getMembershipProviderConfig
* @methodOf umbraco.resources.currentUserResource
*
* @description
* Gets the configuration of the user membership provider which is used to configure the change password form
*/
getMembershipProviderConfig(): any;
}
/**
* @ngdoc service
* @name umbraco.resources.dashboardResource
* @description Handles loading the dashboard manifest
**/
interface IDashboardResource{
/**
* @ngdoc method
* @name umbraco.resources.dashboardResource#getDashboard
* @methodOf umbraco.resources.dashboardResource
*
* @description
* Retrieves the dashboard configuration for a given section
*
* @param {string} section Alias of section to retrieve dashboard configuraton for
* @returns {Promise} resourcePromise object containing the user array.
*
*/
getDashboard(section: string): ng.IPromise<IResourcePromise>;
}
/**
* @ngdoc service
* @name umbraco.resources.dataTypeResource
* @description Loads in data for data types
**/
interface IDataTypeResource{
/**
* @ngdoc method
* @name umbraco.resources.dataTypeResource#getPreValues
* @methodOf umbraco.resources.dataTypeResource
*
* @description
* Retrieves available prevalues for a given data type + editor
*
* ##usage
* <pre>
* dataTypeResource.getPrevalyes("Umbraco.MediaPicker", 1234)
* .then(function(prevalues) {
* alert('its gone!');
* });
* </pre>
*
* @param {String} editorAlias string alias of editor type to retrive prevalues configuration for
* @param {Int} id id of datatype to retrieve prevalues for
* @returns {Promise} resourcePromise object.
*
*/
getPreValues(editorAlias: string, dataTypeId: number): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.dataTypeResource#getById
* @methodOf umbraco.resources.dataTypeResource
*
* @description
* Gets a data type item with a given id
*
* ##usage
* <pre>
* dataTypeResource.getById(1234)
* .then(function() {
* alert('its gone!');
* });
* </pre>
*
* @param {Int} id id of data type to retrieve
* @returns {Promise} resourcePromise object.
*
*/
getById(id: number): ng.IPromise<IResourcePromise>;
getAll() : any;
/**
* @ngdoc method
* @name umbraco.resources.contentResource#getScaffold
* @methodOf umbraco.resources.contentResource
*
* @description
* Returns a scaffold of an empty data type item
*
* The scaffold is used to build editors for data types that has not yet been populated with data.
*
* ##usage
* <pre>
* dataTypeResource.getScaffold()
* .then(function(scaffold) {
* var myType = scaffold;
* myType.name = "My new data type";
*
* dataTypeResource.save(myType, myType.preValues, true)
* .then(function(type){
* alert("Retrieved, updated and saved again");
* });
* });
* </pre>
*
* @returns {Promise} resourcePromise object containing the data type scaffold.
*
*/
getScaffold(): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.dataTypeResource#deleteById
* @methodOf umbraco.resources.dataTypeResource
*
* @description
* Deletes a data type with a given id
*
* ##usage
* <pre>
* dataTypeResource.deleteById(1234)
* .then(function() {
* alert('its gone!');
* });
* </pre>
*
* @param {Int} id id of content item to delete
* @returns {Promise} resourcePromise object.
*
*/
deleteById(id: number): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.dataTypeResource#save
* @methodOf umbraco.resources.dataTypeResource
*
* @description
* Saves or update a data type
*
* @param {Object} dataType data type object to create/update
* @param {Array} preValues collection of prevalues on the datatype
* @param {Bool} isNew set to true if type should be create instead of updated
* @returns {Promise} resourcePromise object.
*
*/
save(dataType: Object, preValues: any[], isNew: boolean): ng.IPromise<IResourcePromise>;
}
/**
* @ngdoc service
* @name umbraco.resources.entityResource
* @description Loads in basic data for all entities
*
* ##What is an entity?
* An entity is a basic **read-only** representation of an Umbraco node. It contains only the most
* basic properties used to display the item in trees, lists and navigation.
*
* ##What is the difference between entity and content/media/etc...?
* the entity only contains the basic node data, name, id and guid, whereas content
* nodes fetched through the content service also contains additional all of the content property data, etc..
* This is the same principal for all entity types. Any user that is logged in to the back office will have access
* to view the basic entity information for all entities since the basic entity information does not contain sensitive information.
*
* ##Entity object types?
* You need to specify the type of object you want returned.
*
* The core object types are:
*
* - Document
* - Media
* - Member
* - Template
* - DocumentType
* - MediaType
* - MemberType
* - Macro
* - User
* - Language
* - Domain
* - DataType
**/
interface IEntityResource{
/**
* @ngdoc method
* @name umbraco.resources.entityResource#getPath
* @methodOf umbraco.resources.entityResource
*
* @description
* Returns a path, given a node ID and type
*
* ##usage
* <pre>
* entityResource.getPath(id)
* .then(function(pathArray) {
* alert('its here!');
* });
* </pre>
*
* @param {Int} id Id of node to return the public url to
* @param {string} type Object type name
* @returns {Promise} resourcePromise object containing the url.
*
*/
getPath(id: number, type: string): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.entityResource#getById
* @methodOf umbraco.resources.entityResource
*
* @description
* Gets an entity with a given id
*
* ##usage
* <pre>
* //get media by id
* entityResource.getEntityById(0, "Media")
* .then(function(ent) {
* var myDoc = ent;
* alert('its here!');
* });
* </pre>
*
* @param {Int} id id of entity to return
* @param {string} type Object type name
* @returns {Promise} resourcePromise object containing the entity.
*
*/
getById(id: number, type: string): ng.IPromise<IResourcePromise>;
getByQuery(query: string, nodeContextId: number|string, type: string): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.entityResource#getByIds
* @methodOf umbraco.resources.entityResource
*
* @description
* Gets an array of entities, given a collection of ids
*
* ##usage
* <pre>
* //Get templates for ids
* entityResource.getEntitiesByIds( [1234,2526,28262], "Template")
* .then(function(templateArray) {
* var myDoc = contentArray;
* alert('they are here!');
* });
* </pre>
*
* @param {Array} ids ids of entities to return as an array
* @param {string} type type name
* @returns {Promise} resourcePromise object containing the entity array.
*
*/
getByIds(ids: number[], type: string): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.entityResource#getEntityById
* @methodOf umbraco.resources.entityResource
*
* @description
* Gets an entity with a given id
*
* ##usage
* <pre>
*
* //Only return media
* entityResource.getAll("Media")
* .then(function(ent) {
* var myDoc = ent;
* alert('its here!');
* });
* </pre>
*
* @param {string} type Object type name
* @param {string} postFilter optional filter expression which will execute a dynamic where clause on the server
* @param {string} postFilterParams optional parameters for the postFilter expression
* @returns {Promise} resourcePromise object containing the entity.
*
*/
getAll(type: string, postFilter: string, postFilterParams: string): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.entityResource#getAncestors
* @methodOf umbraco.resources.entityResource
*
* @description
* Gets ancestor entities for a given item
*
*
* @param {string} type Object type name
* @returns {Promise} resourcePromise object containing the entity.
*
*/
getAncestors(id: number, type: string): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.entityResource#getAncestors
* @methodOf umbraco.resources.entityResource
*
* @description
* Gets children entities for a given item
*
*
* @param {string} type Object type name
* @returns {Promise} resourcePromise object containing the entity.
*
*/
getChildren(id: number, type: string): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.entityResource#searchMedia
* @methodOf umbraco.resources.entityResource
*
* @description
* Gets an array of entities, given a lucene query and a type
*
* ##usage
* <pre>
* entityResource.search("news", "Media")
* .then(function(mediaArray) {
* var myDoc = mediaArray;
* alert('they are here!');
* });
* </pre>
*
* @param {String} Query search query
* @param {String} Type type of conten to search
* @returns {Promise} resourcePromise object containing the entity array.
*
*/
search(query: string, type: string, searchFrom: any, canceler: any): ng.IPromise<IResourcePromise>;
/**
* @ngdoc method
* @name umbraco.resources.entityResource#searchAll
* @methodOf umbraco.resources.entityResource
*
* @description