forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSharePoint.d.ts
More file actions
11209 lines (10289 loc) · 507 KB
/
SharePoint.d.ts
File metadata and controls
11209 lines (10289 loc) · 507 KB
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 SharePoint 2010 and 2013
// Project: https://github.com/gandjustas/sptypescript
// Definitions by: Stanislav Vyshchepan <http://blog.gandjustas.ru>, Andrey Markeev <http://markeev.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../microsoft-ajax/microsoft.ajax.d.ts" />
declare var _spBodyOnLoadFunctions: Function[];
declare var _spBodyOnLoadFunctionNames: string[];
declare var _spBodyOnLoadCalled: boolean;
declare function ExecuteOrDelayUntilBodyLoaded(initFunc: () => void): void;
declare function ExecuteOrDelayUntilScriptLoaded(func: () => void, depScriptFileName: string): boolean;
declare function ExecuteOrDelayUntilEventNotified(func: Function, eventName: string): boolean;
declare var Strings:any;
declare namespace SP {
export class SOD {
static execute(fileName: string, functionName: string, ...args: any[]): void;
static executeFunc(fileName: string, typeName: string, fn: () => void): void;
static executeOrDelayUntilEventNotified(func: Function, eventName: string): boolean;
static executeOrDelayUntilScriptLoaded(func: () => void, depScriptFileName: string): boolean;
static notifyScriptLoadedAndExecuteWaitingJobs(scriptFileName: string): void;
static notifyEventAndExecuteWaitingJobs(eventName: string, args?: any[]): void;
static registerSod(fileName: string, url: string): void;
static registerSodDep(fileName: string, dependentFileName: string): void;
static loadMultiple(keys: string[], fn: () => void, bSync?: boolean): void;
static delayUntilEventNotified(func: Function, eventName: string): void;
static get_prefetch(): boolean;
static set_prefetch(value: boolean): void;
static get_ribbonImagePrefetchEnabled(): boolean;
static set_ribbonImagePrefetchEnabled(value: boolean): void;
}
export enum ListLevelPermissionMask {
viewListItems,//: 1,
insertListItems,//: 2,
editListItems,//: 4,
deleteListItems,//: 8,
approveItems,//: 16,
openItems,//: 32,
viewVersions,//: 64,
deleteVersions,//: 128,
breakCheckout,//: 256,
managePersonalViews,//: 512,
manageLists//: 2048
}
export class HtmlBuilder {
constructor();
addAttribute(name: string, value: string): void;
addCssClass(cssClassName: string): void;
addCommunitiesCssClass(cssClassName: string): void;
renderBeginTag(tagName: string): void;
renderEndTag(): void;
write(s: string): void;
writeEncoded(s: string): void;
toString(): string;
}
export class ScriptHelpers {
static disableWebpartSelection(context: SPClientTemplates.RenderContext): void;
static getDocumentQueryPairs(): { [index: string]: string; };
static getFieldFromSchema(schema: SPClientTemplates.ListSchema, fieldName: string): SPClientTemplates.FieldSchema;
static getLayoutsPageUrl(pageName: string, webServerRelativeUrl: string): string;
static getListLevelPermissionMask(jsonItem: string): number;
static getTextAreaElementValue(textAreaElement: HTMLTextAreaElement): string;
static getUrlQueryPairs(docUrl: string): { [index: string]: string; };
static getUserFieldProperty(item: ListItem, fieldName: string, propertyName: string): any;
static hasPermission(listPermissionMask: number, listPermission: ListLevelPermissionMask): boolean;
static newGuid(): SP.Guid;
static isNullOrEmptyString(str: string): boolean;
static isNullOrUndefined(obj: any): boolean;
static isNullOrUndefinedOrEmpty(str: string): boolean;
static isUndefined(obj: any): boolean;
static replaceOrAddQueryString(url: string, key: string, value: string): string;
static removeHtml(str: string): string;
static removeStyleChildren(element: HTMLElement): void;
static removeHtmlAndTrimStringWithEllipsis(str: string, maxLength: number): string;
static setTextAreaElementValue(textAreaElement: HTMLTextAreaElement, newValue: string): void;
static truncateToInt(n: number): number;
static urlCombine(path1: string, path2: string): string;
static resizeImageToSquareLength(imgElement: HTMLImageElement, squareLength: number): void;
}
export class PageContextInfo {
static get_siteServerRelativeUrl(): string;
static get_webServerRelativeUrl(): string;
static get_webAbsoluteUrl(): string;
static get_serverRequestPath(): string;
static get_siteAbsoluteUrl(): string;
static get_webTitle(): string;
static get_tenantAppVersion(): string;
static get_webLogoUrl(): string;
static get_webLanguage(): number;
static get_currentLanguage(): number;
static get_pageItemId(): number;
static get_pageListId(): string;
static get_webPermMasks(): { High: number; Low: number; };
static get_currentCultureName(): string;
static get_currentUICultureName(): string;
static get_clientServerTimeDelta(): number;
static get_userLoginName(): string;
static get_webTemplate(): string;
get_pagePersonalizationScope(): string;
}
export class ContextPermissions {
has(perm: number): boolean;
hasPermissions(high: number, low: number): boolean;
fromJson(json: { High: number; Low: number; }): void;
}
export module ListOperation {
export module ViewOperation {
export function getSelectedView(): string;
export function navigateUp(viewId: string): void;
export function refreshView(viewId: string): void;
}
export module Selection {
export function selectListItem(iid: string, bSelect: boolean): void;
export function getSelectedItems(): { id: number; fsObjType: FileSystemObjectType; }[];
export function getSelectedList(): string;
export function getSelectedView(): string;
export function navigateUp(viewId: string): void;
export function deselectAllListItems(iid: string): void;
}
export module Overrides {
export function overrideDeleteConfirmation(listId: string, overrideText: string): void;
}
}
}
/** Register function to rerun on partial update in MDS-enabled site.*/
declare function RegisterModuleInit(scriptFileName: string, initFunc: () => void): void;
/** Provides access to url and query string parts.*/
declare class JSRequest {
/** Query string parts.*/
static QueryString: { [parameter: string]: string; };
/** initializes class.*/
static EnsureSetup(): void;
/** Current file name (after last '/' in url).*/
static FileName: string;
/** Current file path (before last '/' in url).*/
static PathName: string;
}
declare class _spPageContextInfo {
static alertsEnabled: boolean; //true
static allowSilverlightPrompt: string; //"True"
static clientServerTimeDelta: number; //-182
static crossDomainPhotosEnabled: boolean; //true
static currentCultureName: string; //"ru-RU"
static currentLanguage: number; //1049
static currentUICultureName: string; //"ru-RU"
static layoutsUrl: string; //"_layouts/15"
static pageListId: string; //"{06ee6d96-f27f-4160-b6bb-c18f187b18a7}"
static pageItemId: number;
static pagePersonalizationScope: string; //1
static serverRequestPath: string; //"/SPTypeScript/Lists/ConditionalFormattingTasksList/AllItems.aspx"
static siteAbsoluteUrl: string; // "https://gandjustas-7b20d3715e8ed4.sharepoint.com"
static siteClientTag: string; //"0$$15.0.4454.1021"
static siteServerRelativeUrl: string; // "/"
static systemUserKey: string; //"i:0h.f|membership|10033fff84e7cb2b@live.com"
static tenantAppVersion: string; //"0"
static userId: number; //12
static webAbsoluteUrl: string; //"https://gandjustas-7b20d3715e8ed4.sharepoint.com/SPTypeScript"
static webLanguage: number; //1049
static webLogoUrl: string; //"/_layouts/15/images/siteIcon.png?rev=23"
static webPermMasks: { High: number; Low: number; };
static webServerRelativeUrl: string; //"/SPTypeScript"
static webTemplate: string; //"17"
static webTitle: string; //"SPTypeScript"
static webUIVersion: number; //15
}
declare function STSHtmlEncode(value: string): string;
declare function STSHtmlDecode(value: string): string;
declare function AddEvtHandler(element: HTMLElement, event: string, func: EventListener): void;
/** Gets query string parameter */
declare function GetUrlKeyValue(key: string): string;
declare class AjaxNavigate {
update(url: string, updateParts: Object, fullNavigate: boolean, anchorName: string): void;
add_navigate(handler: Function): void;
remove_navigate(handler: Function): void;
submit(formToSubmit: HTMLFormElement): void;
getParam(paramName: string): string;
getSavedFormAction(): string;
get_href(): string;
get_hash(): string;
get_search(): string;
convertMDSURLtoRegularURL(mdsPath: string): string;
}
declare var ajaxNavigate: AjaxNavigate;
declare class Browseris {
firefox: boolean;
firefox36up: boolean;
firefox3up: boolean;
firefox4up: boolean;
ie: boolean;
ie55up: boolean;
ie5up: boolean;
ie7down: boolean;
ie8down: boolean;
ie9down: boolean;
ie8standard: boolean;
ie8standardUp: boolean;
ie9standardUp: boolean;
ipad: boolean;
windowsphone: boolean;
chrome: boolean;
chrome7up: boolean;
chrome8up: boolean;
chrome9up: boolean;
iever: boolean;
mac: boolean;
major: boolean;
msTouch: boolean;
isTouch: boolean;
nav: boolean;
nav6: boolean;
nav6up: boolean;
nav7up: boolean;
osver: boolean;
safari: boolean;
safari125up: boolean;
safari3up: boolean;
verIEFull: boolean;
w3c: boolean;
webKit: boolean;
win: boolean;
win8AppHost: boolean;
win32: boolean;
win64bit: boolean;
winnt: boolean;
armProcessor: boolean
}
declare var browseris: Browseris;
interface ContextInfo extends SPClientTemplates.RenderContext {
AllowGridMode: boolean;
BasePermissions: any;
BaseViewID: any;
CascadeDeleteWarningMessage: string;
ContentTypesEnabled: boolean;
CurrentSelectedItems: boolean;
CurrentUserId: number;
EnableMinorVersions: boolean;
ExternalDataList: boolean;
HasRelatedCascadeLists: boolean;
HttpPath: string;
HttpRoot: string;
LastSelectableRowIdx: number;
LastSelectedItemIID: number;
LastRowIndexSelected: number;
RowFocusTimerID: number;
ListData: any;// SPClientTemplates.ListData_InView | SPClientTemplates.ListData_InForm
ListSchema: SPClientTemplates.ListSchema;
ModerationStatus: number;
PortalUrl: string;
RecycleBinEnabled: number;
SelectAllCbx: HTMLElement;
SendToLocationName: string;
SendToLocationUrl: string;
StateInitDone: boolean;
TableCbxFocusHandler: Function;
TableMouseoverHandler: Function;
TotalListItems: number;
WorkflowsAssociated: boolean;
clvp: any;
ctxId: number;
ctxType: any;
dictSel: any;
displayFormUrl: string;
editFormUrl: string;
imagesPath: string;
inGridMode: boolean;
inGridFullRender: boolean;
isForceCheckout: boolean;
isModerated: boolean;
isPortalTemplate: boolean;
isVersions: boolean;
isWebEditorPreview: boolean;
leavingGridMode: boolean;
loadingAsyncData: boolean;
listBaseType: number;
listName: string;
listTemplate: string;
listUrlDir: string;
newFormUrl: string;
onRefreshFailed: Function;
overrideDeleteConfirmation: string;
overrideFilterQstring: string;
recursiveView: boolean;
rootFolderForDisplay: string;
serverUrl: string;
verEnabled: boolean;
view: string;
queryString: string;
IsClientRendering: boolean;
wpq: string;
rootFolder: string;
IsAppWeb: boolean;
NewWOPIDocumentEnabled: boolean;
NewWOPIDocumentUrl: string;
AllowCreateFolder: boolean;
CanShareLinkForNewDocument: boolean;
noGroupCollapse: boolean;
SiteTemplateId: number;
ExcludeFromOfflineClient: boolean;
}
declare function GetCurrentCtx(): ContextInfo;
declare function SetFullScreenMode(fullscreen: boolean): void;
declare namespace SP {
export enum RequestExecutorErrors {
requestAbortedOrTimedout,
unexpectedResponse,
httpError,
noAppWeb,
domainDoesNotMatch,
noTrustedOrigins,
iFrameLoadError
}
export class RequestExecutor {
constructor(url: string, options?: any);
get_formDigestHandlingEnabled(): boolean;
set_formDigestHandlingEnabled(value: boolean): void;
get_iFrameSourceUrl(): string;
set_iFrameSourceUrl(value: string): void;
executeAsync(requestInfo: RequestInfo): void;
attemptLogin(returnUrl: string, success: (response: ResponseInfo) => void, error?: (response: ResponseInfo, error: RequestExecutorErrors, statusText: string) => void): void;
}
export interface RequestInfo {
url: string;
method?: string;
headers?: { [key: string]: string; };
/** Can be string or bytearray depending on binaryStringRequestBody field */
body?: string | Uint8Array;
binaryStringRequestBody?: boolean;
/** Currently need fix to get ginary response. Details: http://techmikael.blogspot.ru/2013/07/how-to-copy-files-between-sites-using.html */
binaryStringResponseBody?: boolean;
timeout?: number;
success?: (response: ResponseInfo) => void;
error?: (response: ResponseInfo, error: RequestExecutorErrors, statusText: string) => void;
state?: any;
}
export interface ResponseInfo {
statusCode?: number;
statusText?: string;
responseAvailable: boolean;
allResponseHeaders?: string;
headers?: { [key: string]: string; };
contentType?: string;
/** Can be string or bytearray depending on request.binaryStringResponseBody field */
body?: string | Uint8Array;
state?: any;
}
export class ProxyWebRequestExecutor extends Sys.Net.WebRequestExecutor {
constructor(url: string, options?: any);
}
export class ProxyWebRequestExecutorFactory implements SP.IWebRequestExecutorFactory {
constructor(url: string, options?: any);
createWebRequestExecutor(): ProxyWebRequestExecutor;
}
}
interface MQuery {
(selector: string, context?: any): MQueryResultSetElements;
(element: HTMLElement): MQueryResultSetElements;
(object: MQueryResultSetElements): MQueryResultSetElements;
<T>(object: MQueryResultSet<T>): MQueryResultSet<T>;
<T>(object: T): MQueryResultSet<T>;
(elementArray: HTMLElement[]): MQueryResultSetElements;
<T>(array: T[]): MQueryResultSet<T>;
<T>(): MQueryResultSet<T>;
throttle(fn: Function, interval: number, shouldOverrideThrottle: boolean): Function;
extend(target: any, ...objs: any[]): Object;
extend(deep: boolean, target: any, ...objs: any[]): Object;
makeArray<T>(obj: any): any[];
isDefined(obj: any): boolean;
isNotNull(obj: any): boolean;
isUndefined(obj: any): boolean;
isNull(obj: any): boolean;
isUndefinedOrNull(obj: any): boolean;
isDefinedAndNotNull(obj: any): boolean;
isString(obj: any): boolean;
isBoolean(obj: any): boolean;
isFunction(obj: any): boolean;
isArray(obj: any): boolean;
isNode(obj: any): boolean;
isElement(obj: any): boolean;
isMQueryResultSet(obj: any): boolean;
isNumber(obj: any): boolean;
isObject(obj: any): boolean;
isEmptyObject(obj: any): boolean;
ready(callback: () => void): void;
contains(container: HTMLElement, contained: HTMLElement): boolean;
proxy(fn: (...args: any[]) => any, context: any, ...args: any[]): Function;
proxy(context: any, name: string, ...args: any[]): any;
every<T>(obj: T[], fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): boolean;
every<T>(obj: MQueryResultSet<T>, fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): boolean;
every<T>(obj: T[], fn: (elementOfArray: T) => boolean, context?: any): boolean;
every<T>(obj: MQueryResultSet<T>, fn: (elementOfArray: any) => boolean, context?: any): boolean;
some<T>(obj: T[], fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): boolean;
some<T>(obj: MQueryResultSet<T>, fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): boolean;
some<T>(obj: T[], fn: (elementOfArray: T) => boolean, context?: any): boolean;
some<T>(obj: MQueryResultSet<T>, fn: (elementOfArray: T) => boolean, context?: any): boolean;
filter<T>(obj: T[], fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): T[];
filter<T>(obj: MQueryResultSet<T>, fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): MQueryResultSet<T>;
filter<T>(obj: T[], fn: (elementOfArray: T) => boolean, context?: any): T[];
filter<T>(obj: MQueryResultSet<T>, fn: (elementOfArray: T) => boolean, context?: any): MQueryResultSet<T>;
forEach<T>(obj: T[], fn: (elementOfArray: T, indexInArray: number) => void, context?: any): void;
forEach<T>(obj: MQueryResultSet<T>, fn: (elementOfArray: T, indexInArray: number) => void, context?: any): void;
forEach<T>(obj: T[], fn: (elementOfArray: T) => void, context?: any): void;
forEach<T>(obj: MQueryResultSet<T>, fn: (elementOfArray: T) => void, context?: any): void;
map<T, U>(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[];
map<T, U>(array: MQueryResultSet<T>, callback: (elementOfArray: T, indexInArray: number) => U): MQueryResultSet<U>;
map<T, U>(array: T[], callback: (elementOfArray: T) => U): U[];
map<T, U>(array: MQueryResultSet<T>, callback: (elementOfArray: T) => U): MQueryResultSet<U>;
indexOf<T>(obj: T[], object: T, startIndex?: number): number;
lastIndexOf<T>(obj: T[], object: T, startIndex?: number): number;
data(element: HTMLElement, key: string, value: any): any;
data(element: HTMLElement, key: string): any;
data(element: HTMLElement): any;
removeData(element: HTMLElement, name?: string): MQueryResultSetElements;
hasData(element: HTMLElement): boolean;
}
interface MQueryResultSetElements extends MQueryResultSet<HTMLElement> {
append(node: HTMLElement): MQueryResultSetElements;
append(mQuerySet: MQueryResultSetElements): MQueryResultSetElements;
append(html: string): MQueryResultSetElements;
bind(eventType: string, handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
unbind(eventType: string, handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
trigger(eventType: string): MQueryResultSetElements;
one(eventType: string, handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
detach(): MQueryResultSetElements;
find(selector: string): MQueryResultSetElements;
closest(selector: string, context?: any): MQueryResultSetElements;
offset(): { left: number; top: number; };
offset(coordinates: { left: any; top: any; }): MQueryResultSetElements;
filter(selector: string): MQueryResultSetElements;
filter(fn: (elementOfArray: HTMLElement, indexInArray: number) => boolean, context?: any): MQueryResultSetElements;
filter(fn: (elementOfArray: HTMLElement) => boolean, context?: any): MQueryResultSetElements;
not(selector: string): MQueryResultSetElements;
parent(selector?: string): MQueryResultSetElements;
offsetParent(selector?: string): MQueryResultSetElements;
parents(selector?: string): MQueryResultSetElements;
parentsUntil(selector?: string, filter?: string): MQueryResultSetElements;
parentsUntil(element?: HTMLElement, filter?: string): MQueryResultSetElements;
position(): { top: number; left: number; };
attr(attributeName: string): string;
attr(attributeName: string, value: any): MQueryResultSetElements;
attr(map: { [key: string]: any; }): MQueryResultSetElements;
attr(attributeName: string, func: (index: number, attr: any) => any): MQueryResultSetElements;
addClass(classNames: string): MQueryResultSetElements;
removeClass(classNames: string): MQueryResultSetElements;
css(propertyName: string): string;
css(propertyNames: string[]): string;
css(properties: any): MQueryResultSetElements;
css(propertyName: string, value: any): MQueryResultSetElements;
css(propertyName: any, value: any): MQueryResultSetElements;
remove(selector?: string): MQueryResultSetElements;
children(selector?: string): MQueryResultSetElements;
empty(): MQueryResultSetElements;
first(): MQueryResultSetElements;
data(key: string, value: any): MQueryResultSetElements;
data(obj: { [key: string]: any; }): MQueryResultSetElements;
data(key: string): any;
removeData(key: string): MQueryResultSetElements;
map(callback: (elementOfArray: HTMLElement, indexInArray: number) => any): MQueryResultSetElements;
map(callback: (elementOfArray: HTMLElement) => any): MQueryResultSetElements;
blur(): MQueryResultSetElements;
blur(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
change(): MQueryResultSetElements;
change(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
click(): MQueryResultSetElements;
click(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
dblclick(): MQueryResultSetElements;
dblclick(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
error(): MQueryResultSetElements;
error(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
focus(): MQueryResultSetElements;
focus(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
focusin(): MQueryResultSetElements;
focusin(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
focusout(): MQueryResultSetElements;
focusout(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
keydown(): MQueryResultSetElements;
keydown(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
keypress(): MQueryResultSetElements;
keypress(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
keyup(): MQueryResultSetElements;
keyup(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
load(): MQueryResultSetElements;
load(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
mousedown(): MQueryResultSetElements;
mousedown(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
mouseenter(): MQueryResultSetElements;
mouseenter(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
mouseleave(): MQueryResultSetElements;
mouseleave(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
mousemove(): MQueryResultSetElements;
mousemove(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
mouseout(): MQueryResultSetElements;
mouseout(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
mouseover(): MQueryResultSetElements;
mouseover(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
mouseup(): MQueryResultSetElements;
mouseup(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
resize(): MQueryResultSetElements;
resize(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
scroll(): MQueryResultSetElements;
scroll(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
select(): MQueryResultSetElements;
select(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
submit(): MQueryResultSetElements;
submit(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
unload(): MQueryResultSetElements;
unload(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
}
interface MQueryResultSet<T> {
[index: number]: T;
contains(contained: T): boolean;
filter(fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): MQueryResultSet<T>;
filter(fn: (elementOfArray: T) => boolean, context?: any): MQueryResultSet<T>;
every(fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): boolean;
every(fn: (elementOfArray: T) => boolean, context?: any): boolean;
some(fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): boolean;
some(fn: (elementOfArray: T) => boolean, context?: any): boolean;
map(callback: (elementOfArray: T, indexInArray: number) => any): MQueryResultSet<T>;
map(callback: (elementOfArray: T) => any): MQueryResultSet<T>;
forEach(fn: (elementOfArray: T, indexInArray: number) => void, context?: any): void;
forEach(fn: (elementOfArray: T) => void, context?: any): void;
indexOf(object: any, startIndex?: number): number;
lastIndexOf(object: any, startIndex?: number): number;
}
interface MQueryEvent extends Event {
altKey: boolean;
attrChange: number;
attrName: string;
bubbles: boolean;
button: number;
cancelable: boolean;
ctrlKey: boolean;
defaultPrevented: boolean;
detail: number;
eventPhase: number;
newValue: string;
prevValue: string;
relatedNode: HTMLElement;
screenX: number;
screenY: number;
shiftKey: boolean;
view: any;
}
declare var m$: MQuery;
declare class CalloutActionOptions {
/** Text for the action link */
text: string;
tooltip: string;
disabledTooltip: string;
/** Callback that is executed when the action link is clicked.
@param event Standard javascript event object
@param action The action object */
onClickCallback: (event: Event, action: CalloutAction) => any;
/** Callback which returns if the action link is enabled */
isEnabledCallback: (action: CalloutAction) => boolean;
/** Callback which returns if the action link is visible */
isVisibleCallback: (action: CalloutAction) => boolean;
/** Submenu entries for the action. If defined, the action link click will popup the specified menu. */
menuEntries: CalloutActionMenuEntry[];
}
/** Defines a callout action menu entry */
declare class CalloutActionMenuEntry {
/** Creates a callout action menu entry
@param text Text to be displayed as the menu item text
@param onClickCallback Callback that will be fired when the item is clicked
@param wzISrc Url of the icon
@param wzIAlt Alternative text for the icon image
@param wzISeq Sequence for the menu item
@param wzDesc Description of the menu item */
constructor(
text: string,
onClickCallback: (actionMenuEntry: CalloutActionMenuEntry, actionMenuEntryIndex: number) => void,
wzISrc: string,
wzIAlt: string,
wzISeq: number,
wzDesc: string);
}
declare class CalloutActionMenu {
constructor(actionsId: any);
addAction(action: CalloutAction): void;
getActions(): CalloutAction[];
render(): void;
refreshActions(): void;
calculateActionWidth(): void;
}
declare class CalloutAction {
constructor(options: CalloutActionOptions);
getText(): string;
getToolTop(): string;
getDisabledToolTip(): string;
getOnClickCallback(event: any, action: CalloutAction): any;
getIsDisabledCallback(action: CalloutAction): boolean;
getIsVisibleCallback(action: CalloutAction): boolean;
getIsMenu(): boolean;
getMenuEntries(): CalloutActionMenuEntry[];
render(): void;
isEnabled(): boolean;
isVisible(): boolean;
set(options: CalloutActionOptions): void;
}
declare class Callout {
/** Sets options for the callout. Not all options can be changed for the callout after its creation. */
set(options: CalloutOptions): any;
/** Adds event handler to the callout.
@param eventName one of the following: "opened", "opening", "closing", "closed" */
addEventCallback(eventName: string, callback: (callout: Callout) => void): void;
/** Returns the launch point element of the callout. */
getLaunchPoint(): HTMLElement;
/** Returns the ID of the callout. */
getID(): string;
/** Returns the title of the callout. */
getTitle(): string;
/** Returns the contents of the callout. */
getContent(): string;
/** Returns the content element of the callout. */
getContentElement(): HTMLElement;
/** Returns the bounding element defined for the callout during its creation. */
getBoundingBox(): HTMLElement;
/** Returns the content width defined for the callout during its creation. */
getContentWidth(): number;
/** Returns the object that represents open behaivor defined for the callout during its creation. */
getOpenOptions(): CalloutOpenOptions;
/** Returns the beak orientation defined for the callout during its creation. */
getBeakOrientation(): string;
/** Returns the position algorithm function defined for the callout during its creation. */
getPositionAlgorithm(): any;
/** Specifies wherever callout is in "Opened" state */
isOpen(): boolean;
/** Specifies wherever callout is in "Opening" state */
isOpening(): boolean;
/** Specifies wherever callout is in "Opened" or "Opening" state */
isOpenOrOpening(): boolean;
/** Specifies wherever callout is in "Closing" state */
isClosing(): boolean;
/** Specifies wherever callout is in "Closed" state */
isClosed(): boolean;
/** Returns the callout actions menu */
getActionMenu(): CalloutActionMenu;
/** Adds a link to the actions panel in the bottom part of the callout window */
addAction(action: CalloutAction): void;
/** Re-renders the actions menu. Call after the actions menu is changed. */
refreshActions(): void;
/** Display the callout. Animation can be used only for IE9+ */
open(useAnimation: boolean): void;
/** Hide the callout. Animation can be used only for IE9+ */
close(useAnimation: boolean): void;
/** Display if hidden, hide if shown. */
toggle(): void;
/** Do not call this directly. Instead, use CalloutManager.remove */
destroy(): void;
}
declare class CalloutOpenOptions {
/** HTML event name, e.g. "click" */
event: string;
/** Callout will be closed on blur */
closeCalloutOnBlur: boolean;
/** Close button will be shown within the callout window */
showCloseButton: boolean;
}
declare class CalloutOptions {
/** Some unique id for the callout. */
ID: string;
/** Element on that the callout is shown. */
launchPoint: HTMLElement;
/** One of the following: "topBottom" (default) or "leftRight". */
beakOrientation: string;
/** String (HTML allowed) that represents contents of the callout window. */
content: string;
/** Title for the callout */
title: string;
/** HTML element that represents contents of the callout window. */
contentElement: HTMLElement;
/** If defined, callout will be inscribed into the bounding element. */
boundingBox: HTMLElement;
/** Content element's width in pixels. By default = 350. */
contentWidth: number;
/** Defines opening behavior */
openOptions: CalloutOpenOptions;
/** Fires after the callout is rendered but before it is positioned and shown */
onOpeningCallback: (callout: Callout) => void;
/** Fires right after the callout is shown */
onOpenedCallback: (callout: Callout) => void;
/** Fires right before the callout is closed */
onClosingCallback: (callout: Callout) => void;
/** Fires right after the callout is closed */
onClosedCallback: (callout: Callout) => void;
/** Sets the position of the callout during its opening phase. For an example of a position algorithm function, please explore defaultPositionAlgorithm function from the callout.debug.js file */
positionAlgorithm: (callout: Callout) => void;
}
declare class CalloutManager {
/** Creates a new callout */
static createNew(options: CalloutOptions): Callout;
/** Checks if callout with specified ID already exists. If it doesn't, creates it, otherwise returns the existing one. */
static createNewIfNecessary(options: CalloutOptions): Callout;
/** Detaches callout from the launch point and destroys it. */
static remove(callout: Callout): void;
/** Searches for a callout associated with the specified launch point. Throws error if not found. */
static getFromLaunchPoint(launchPoint: HTMLElement): Callout;
/** Searches for a callout associated with the specified launch point. Returns null if not found. */
static getFromLaunchPointIfExists(launchPoint: HTMLElement): Callout;
/** Gets the first launch point within the specified ancestor element, and returns true if the associated with it callout is opened or opening.
If the launch point is not found or the callout is hidden, returns false. */
static containsOneCalloutOpen(ancestor: HTMLElement): boolean;
/** Finds the closest launch point based on the specified descendant element, and returns callout associated with the launch point. */
static getFromCalloutDescendant(descendant: HTMLElement): Callout;
/** Perform some action for each callout on the page. */
static forEach(callback: (callout: Callout) => void): void;
/** Closes all callouts on the page */
static closeAll(): boolean;
/** Returns true if at least one of the defined on page callouts is opened. */
static isAtLeastOneCalloutOpen(): boolean;
/** Returns true if at least one of the defined on page callouts is opened or opening. */
static isAtLeastOneCalloutOn(): boolean;
}
declare namespace SPClientTemplates {
export enum FileSystemObjectType {
Invalid,
File,
Folder,
Web
}
export enum ChoiceFormatType {
Dropdown,
Radio
}
export enum ClientControlMode {
Invalid,
DisplayForm,
EditForm,
NewForm,
View
}
export enum RichTextMode {
Compatible,
FullHtml,
HtmlAsXml,
ThemeHtml
}
export enum UrlFormatType {
Hyperlink,
Image
}
export enum DateTimeDisplayFormat {
DateOnly,
DateTime,
TimeOnly
}
export enum DateTimeCalendarType {
None,
Gregorian,
Japan,
Taiwan,
Korea,
Hijri,
Thai,
Hebrew,
GregorianMEFrench,
GregorianArabic,
GregorianXLITEnglish,
GregorianXLITFrench,
KoreaJapanLunar,
ChineseLunar,
SakaEra,
UmAlQura
}
export enum UserSelectionMode {
PeopleOnly,
PeopleAndGroups
}
/** Represents schema for a Choice field in list form or in list view in grid mode */
export interface FieldSchema_InForm_Choice extends FieldSchema_InForm {
/** List of choices for this field. */
Choices: string[];
/** Display format for the choice field */
FormatType: ChoiceFormatType;
}
/** Represents schema for a Lookup field in list form or in list view in grid mode */
export interface FieldSchema_InForm_Lookup extends FieldSchema_InForm {
/** Specifies if the field allows multiple values */
AllowMultipleValues: boolean;
/** Returns base url for a list display form, e.g. "http://portal/web/_layouts/15/listform.aspx?PageType=4"
You must add "ListId" (Guid of the list) and "ID" (integer Id of the item) parameters in order to use this Url */
BaseDisplayFormUrl: string;
/** Indicates if the field is a dependent lookup */
DependentLookup: boolean;
/** Indicates wherever the lookup list is throttled (contains more items than value of the "List Throttle Limit" setting). */
Throttled: boolean;
/** Returns string representation of a number that represents the current value for the "List Throttle Limit" web application setting.
Only appears if Throttled property is true, i.e. the target lookup list is throttled. */
MaxQueryResult: string;
/** List of choices for this field. */
Choices: { LookupId: number; LookupValue: string; }[];
/** Number of choices. Appears only for Lookup field. */
ChoiceCount: number;
LookupListId: string;
}
/** Represents schema for a DateTime field in list form or in list view in grid mode */
export interface FieldSchema_InForm_DateTime extends FieldSchema_InForm {
/** Type of calendar to use */
CalendarType: DateTimeCalendarType;
/** Display format for DateTime field. */
DisplayFormat: DateTimeDisplayFormat;
/** Indicates wherever current user regional settings specify to display week numbers in day or week views of a calendar.
Only appears for DateTime fields. */
ShowWeekNumber: boolean;
TimeSeparator: string;
TimeZoneDifference: string;
FirstDayOfWeek: number;
FirstWeekOfYear: number;
HijriAdjustment: number;
WorkWeek: string;
LocaleId: string;
LanguageId: string;
MinJDay: number;
MaxJDay: number;
HoursMode24: boolean;
HoursOptions: string[];
}
/** Represents schema for a DateTime field in list form or in list view in grid mode */
export interface FieldSchema_InForm_Geolocation extends FieldSchema_InForm {
BingMapsKey: string;
IsBingMapBlockedInCurrentRegion: boolean;
}
/** Represents schema for a Choice field in list form or in list view in grid mode */
export interface FieldSchema_InForm_MultiChoice extends FieldSchema_InForm {
/** List of choices for this field. */
MultiChoices: string[];
/** Indicates wherever fill-in choice is allowed */
FillInChoice: boolean;
}
/** Represents schema for a Choice field in list form or in list view in grid mode */
export interface FieldSchema_InForm_MultiLineText extends FieldSchema_InForm {
/** Specifies whether rich text formatting can be used in the field */
RichText: boolean;
/** Changes are appended to the existing text. */
AppendOnly: boolean;
/** Rich text mode for the field */
RichTextMode: RichTextMode;
/** Number of lines configured to display */
NumberOfLines: number;
/** A boolean value that specifies whether hyperlinks can be used in this fields. */
AllowHyperlink: boolean;
/** WebPartAdderId for the ScriptEditorWebPart */
ScriptEditorAdderId: string;
}
/** Represents schema for a Number field in list form or in list view in grid mode */
export interface FieldSchema_InForm_Number extends FieldSchema_InForm {
ShowAsPercentage: boolean;
}
/** Represents schema for a Number field in list form or in list view in grid mode */
export interface FieldSchema_InForm_Text extends FieldSchema_InForm {
MaxLength: number;
}
/** Represents schema for a Number field in list form or in list view in grid mode */
export interface FieldSchema_InForm_Url extends FieldSchema_InForm {
DisplayFormat: UrlFormatType;
}
/** Represents schema for a Number field in list form or in list view in grid mode */
export interface FieldSchema_InForm_User extends FieldSchema_InForm {
Presence: boolean;
WithPicture: boolean;
DefaultRender: boolean;
WithPictureDetail: boolean;
/** Server relative Url for ~site/_layouts/listform.aspx */
ListFormUrl: string;
/** Server relative Url for ~site/_layouts/userdisp.aspx */
UserDisplayUrl: string;
EntitySeparator: string;
PictureOnly: boolean;
PictureSize: string;
}
export interface FieldSchema {
/** Specifies if the field can be edited while list view is in the Grid mode */
AllowGridEditing: boolean;
/** String representation of the field type, e.g. "Lookup". Same as SPField.TypeAsString */
FieldType: string;
/** Internal name of the field */
Name: string;
/** For OOTB fields, returns the type of field. For "UserMulti" returns "User", for "LookupMulti" returns "Lookup".
For custom field types, returns base type of the field. */
Type: string;
}
/** Represents field schema in Grid mode and on list forms.
Consider casting objects of this type to more specific field types, e.g. FieldSchemaInForm_Lookup */
export interface FieldSchema_InForm extends FieldSchema {
/** Description for this field. */
Description: string;
/** Direction of the reading order for the field. */
Direction: string;
/** Indicates whether the field is hidden */
Hidden: boolean;
/** Guid of the field */
Id: string;
/** Specifies Input Method Editor (IME) mode bias to use for the field.
The IME enables conversion of keystrokes between languages when one writing system has more characters than can be encoded for the given keyboard. */
IMEMode: any;
/** Specifies if the field is read only */
ReadOnlyField: boolean;
/** Specifies wherever field requires values */
Required: boolean;
RestrictedMode: boolean;
/** Title of the field */
Title: string;