UNPKG

4.72 kBTypeScriptView Raw
1import { _SPCollection, _SPInstance, IDeleteable } from "../spqueryable.js";
2export declare class _Views extends _SPCollection<IViewInfo[]> {
3 /**
4 * Adds a new view to the collection
5 *
6 * @param title The new views's title
7 * @param personalView True if this is a personal view, otherwise false, default = false
8 * @param additionalSettings Will be passed as part of the view creation body
9 */
10 add(Title: string, PersonalView?: boolean, additionalSettings?: Record<string, any>): Promise<IViewAddResult>;
11 /**
12 * Gets a view by guid id
13 *
14 * @param id The GUID id of the view
15 */
16 getById(id: string): IView;
17 /**
18 * Gets a view by title (case-sensitive)
19 *
20 * @param title The case-sensitive title of the view
21 */
22 getByTitle(title: string): IView;
23}
24export interface IViews extends _Views {
25}
26export declare const Views: import("../spqueryable.js").ISPInvokableFactory<IViews>;
27export declare class _View extends _SPInstance<IViewInfo> {
28 delete: (this: import("../spqueryable.js").ISPQueryable<any>) => Promise<void>;
29 get fields(): IViewFields;
30 /**
31 * Updates this view intance with the supplied properties
32 *
33 * @param properties A plain object hash of values to update for the view
34 */
35 update(props: Partial<IViewInfo>): Promise<IViewUpdateResult>;
36 /**
37 * Returns the list view as HTML.
38 *
39 */
40 renderAsHtml(): Promise<string>;
41 /**
42 * Sets the view schema
43 *
44 * @param viewXml The view XML to set
45 */
46 setViewXml(viewXml: string): Promise<void>;
47}
48export interface IView extends _View, IDeleteable {
49}
50export declare const View: import("../spqueryable.js").ISPInvokableFactory<IView>;
51export declare class _ViewFields extends _SPCollection<{
52 Items: string[];
53 SchemaXml: string;
54}> {
55 /**
56 * Gets a value that specifies the XML schema that represents the collection.
57 */
58 getSchemaXml(): Promise<string>;
59 /**
60 * Adds the field with the specified field internal name or display name to the collection.
61 *
62 * @param fieldTitleOrInternalName The case-sensitive internal name or display name of the field to add.
63 */
64 add(fieldTitleOrInternalName: string): Promise<void>;
65 /**
66 * Moves the field with the specified field internal name to the specified position in the collection.
67 *
68 * @param field The case-sensitive internal name of the field to move.
69 * @param index The zero-based index of the new position for the field.
70 */
71 move(field: string, index: number): Promise<void>;
72 /**
73 * Removes all the fields from the collection.
74 */
75 removeAll(): Promise<void>;
76 /**
77 * Removes the field with the specified field internal name from the collection.
78 *
79 * @param fieldInternalName The case-sensitive internal name of the field to remove from the view.
80 */
81 remove(fieldInternalName: string): Promise<void>;
82}
83export interface IViewFields extends _ViewFields {
84}
85export declare const ViewFields: import("../spqueryable.js").ISPInvokableFactory<IViewFields>;
86export interface IViewAddResult {
87 view: IView;
88 data: IViewInfo;
89}
90export interface IViewUpdateResult {
91 view: IView;
92 data: IViewInfo;
93}
94export declare enum ViewScope {
95 DefaultValue = 0,
96 Recursive = 1,
97 RecursiveAll = 2,
98 FilesOnly = 3
99}
100export interface IViewInfo {
101 AssociatedContentTypeId: string | null;
102 CalendarViewStyles: string | null;
103 CustomFormatter: string | null;
104 DefaultView: boolean;
105 DefaultViewForContentType: boolean;
106 EditorModified: boolean;
107 Formats: string | null;
108 Hidden: boolean;
109 HtmlSchemaXml: string;
110 Id: string;
111 ImageUrl: string;
112 IncludeRootFolder: boolean;
113 JSLink: string;
114 ListViewXml: string;
115 Method: string | null;
116 MobileDefaultView: boolean;
117 MobileView: boolean;
118 ModerationType: string | null;
119 NewDocumentTemplates: string;
120 OrderedView: boolean;
121 Paged: boolean;
122 PersonalView: boolean;
123 ReadOnlyView: boolean;
124 RequiresClientIntegration: boolean;
125 RowLimit: number;
126 Scope: ViewScope;
127 ServerRelativePath: {
128 DecodedUrl: string;
129 };
130 ServerRelativeUrl: string;
131 StyleId: string | null;
132 TabularView: boolean;
133 Threaded: boolean;
134 Title: string;
135 Toolbar: string;
136 ToolbarTemplateName: string | null;
137 ViewData: string | null;
138 ViewJoins: string | null;
139 ViewProjectedFields: {
140 SchemaXml: string;
141 } | null;
142 ViewQuery: string;
143 ViewType: string;
144 ViewType2: "KANBAN" | "TILES" | "COMPACTLIST" | "MODERNCALENDAR" | null;
145 VisualizationInfo: any | null;
146}
147//# sourceMappingURL=types.d.ts.map
\No newline at end of file