UNPKG

4.46 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 EditorModified: boolean;
102 Formats: string | null;
103 Hidden: boolean;
104 HtmlSchemaXml: string;
105 Id: string;
106 ImageUrl: string;
107 IncludeRootFolder: boolean;
108 JSLink: string;
109 ListViewXml: string;
110 Method: string | null;
111 MobileDefaultView: boolean;
112 MobileView: boolean;
113 ModerationType: string | null;
114 NewDocumentTemplates: string;
115 OrderedView: boolean;
116 Paged: boolean;
117 PersonalView: boolean;
118 ReadOnlyView: boolean;
119 RequiresClientIntegration: boolean;
120 RowLimit: number;
121 Scope: ViewScope;
122 ServerRelativePath: {
123 DecodedUrl: string;
124 };
125 ServerRelativeUrl: string;
126 StyleId: string | null;
127 TabularView: boolean;
128 Threaded: boolean;
129 Title: string;
130 Toolbar: string;
131 ToolbarTemplateName: string | null;
132 ViewData: string | null;
133 ViewJoins: string | null;
134 ViewProjectedFields: {
135 SchemaXml: string;
136 } | null;
137 ViewQuery: string;
138 ViewType: string;
139 VisualizationInfo: any | null;
140}
141//# sourceMappingURL=types.d.ts.map
\No newline at end of file