UNPKG

9.51 kBTypeScriptView Raw
1import { _SPInstance, _SPCollection } from "../spqueryable.js";
2/**
3 * Describes a collection of Form objects
4 *
5 */
6export declare class _TermStore extends _SPInstance<ITermStoreInfo> {
7 /**
8 * Gets the term groups associated with this tenant
9 */
10 get groups(): ITermGroups;
11 /**
12 * Gets the term sets associated with this tenant
13 */
14 get sets(): ITermSets;
15 /**
16 * Allows you to locate terms within the termStore
17 *
18 * @param params Search parameters used to locate the terms, label is required
19 * @returns Array of terms including set information for each term
20 */
21 searchTerm(params: ISearchTermParams): Promise<Required<Pick<ITermInfo, SearchTermPickedProps>>[]>;
22 /**
23 * Update settings for TermStore
24 *
25 * @param props The set or properties to update
26 * @returns The updated term store information
27 */
28 update(props: Partial<Pick<ITermStoreInfo, "defaultLanguageTag" | "languageTags">>): Promise<ITermStoreInfo>;
29}
30export interface ITermStore extends _TermStore {
31}
32export declare const TermStore: import("../spqueryable.js").ISPInvokableFactory<ITermStore>;
33export declare class _TermGroups extends _SPCollection<ITermGroupInfo[]> {
34 /**
35 * Gets a term group by id
36 *
37 * @param id Id of the term group to access
38 */
39 getById(id: string): ITermGroup;
40 /**
41 * Adds a new term group to this store
42 * @param props The set of properties
43 * @returns The information on the create group
44 */
45 add(props: Partial<Omit<ITermGroupInfo, "id" | "createdDateTime" | "lastModifiedDateTime" | "type">>): Promise<ITermGroupInfo>;
46}
47export interface ITermGroups extends _TermGroups {
48}
49export declare const TermGroups: import("../spqueryable.js").ISPInvokableFactory<ITermGroups>;
50export declare class _TermGroup extends _SPInstance<ITermGroupInfo> {
51 /**
52 * Gets the term sets associated with this tenant
53 */
54 get sets(): ITermSets;
55 /**
56 * Deletes this group
57 *
58 * @returns void
59 */
60 delete(): Promise<void>;
61}
62export interface ITermGroup extends _TermGroup {
63}
64export declare const TermGroup: import("../spqueryable.js").ISPInvokableFactory<ITermGroup>;
65export declare class _TermSets extends _SPCollection<ITermSetInfo[]> {
66 /**
67 * Gets a term group by id
68 *
69 * @param id Id of the term group to access
70 */
71 getById(id: string): ITermSet;
72 /**
73 * Adds a new term set to this collection
74 * @param props The set of properties
75 * @returns The information on the create group
76 */
77 add(props: Partial<ITermSetCreateParams>): Promise<ITermGroupInfo>;
78}
79export interface ITermSets extends _TermSets {
80}
81export declare const TermSets: import("../spqueryable.js").ISPInvokableFactory<ITermSets>;
82export declare class _TermSet extends _SPInstance<ITermSetInfo> {
83 /**
84 * Gets all the terms in this set
85 */
86 get terms(): ITerms;
87 get parentGroup(): ITermGroup;
88 get children(): IChildren;
89 get relations(): IRelations;
90 getTermById(id: string): ITerm;
91 /**
92 * Update settings for TermSet
93 *
94 * @param props The set or properties to update
95 * @returns The updated term set information
96 */
97 update(props: Partial<Pick<ITermSetInfo, "localizedNames" | "description" | "properties">>): Promise<ITermSetInfo>;
98 /**
99 * Deletes this group
100 *
101 * @returns void
102 */
103 delete(): Promise<void>;
104 /**
105 * Gets all the terms in this termset in an ordered tree using the appropriate sort ordering
106 * ** This is an expensive operation and you should strongly consider caching the results **
107 *
108 * @param props Optional set of properties controlling how the tree is retrieved.
109 */
110 getAllChildrenAsOrderedTree(props?: Partial<IGetOrderedTreeProps>): Promise<IOrderedTermInfo[]>;
111}
112export interface ITermSet extends _TermSet {
113}
114export declare const TermSet: import("../spqueryable.js").ISPInvokableFactory<ITermSet>;
115export declare class _Children extends _SPCollection<ITermInfo[]> {
116 /**
117 * Adds a new term set to this collection
118 * @param props The set of properties
119 * @returns The information on the create group
120 */
121 add(props: Pick<ITermInfo, "labels">): Promise<ITermInfo>;
122}
123export interface IChildren extends _Children {
124}
125export declare const Children: import("../spqueryable.js").ISPInvokableFactory<IChildren>;
126export declare class _Terms extends _SPCollection<ITermInfo[]> {
127 /**
128 * Gets a term group by id
129 *
130 * @param id Id of the term group to access
131 */
132 getById(id: string): ITerm;
133}
134export interface ITerms extends _Terms {
135}
136export declare const Terms: import("../spqueryable.js").ISPInvokableFactory<ITerms>;
137export declare class _Term extends _SPInstance<ITermInfo> {
138 get children(): IChildren;
139 get relations(): IRelations;
140 get set(): ITermSet;
141 /**
142 * Update settings for TermSet
143 *
144 * @param props The set or properties to update
145 * @returns The updated term set information
146 */
147 update(props: Partial<Pick<ITermInfo, "labels" | "descriptions" | "properties">>): Promise<ITermSetInfo>;
148 /**
149 * Deletes this group
150 *
151 * @returns void
152 */
153 delete(): Promise<void>;
154}
155export interface ITerm extends _Term {
156}
157export declare const Term: import("../spqueryable.js").ISPInvokableFactory<ITerm>;
158export declare class _Relations extends _SPCollection<IRelationInfo[]> {
159 /**
160 * Adds a new relation to this term
161 * @param props The set of properties
162 * @returns The information on the created relation
163 */
164 add(props: Omit<IRelationCreateInfo, "id">): Promise<IRelationCreateInfo>;
165}
166export interface IRelations extends _Relations {
167}
168export declare const Relations: import("../spqueryable.js").ISPInvokableFactory<IRelations>;
169export interface ITermStoreInfo {
170 id: string;
171 name: string;
172 defaultLanguageTag: string;
173 languageTags: string[];
174 administrators?: ITaxonomyUserInfo;
175}
176export interface ITermGroupInfo {
177 id: string;
178 description: string;
179 name: string;
180 displayName: string;
181 createdDateTime: string;
182 lastModifiedDateTime: string;
183 type: string;
184 scope: "global" | "system" | "siteCollection";
185}
186export interface ITermSetInfo {
187 id: string;
188 localizedNames: {
189 name: string;
190 languageTag: string;
191 }[];
192 description: string;
193 createdDateTime: string;
194 customSortOrder: string[];
195 properties?: ITaxonomyProperty[];
196 childrenCount: number;
197 groupId: string;
198 isOpen: boolean;
199 isAvailableForTagging: boolean;
200 contact: string;
201}
202export interface ITermSetCreateParams {
203 localizedNames: {
204 name: string;
205 languageTag: string;
206 }[];
207 description?: string;
208 properties?: ITaxonomyProperty[];
209 /**
210 * When adding a term set using ITermStore.sets parentGroup is required, when adding from ITermGroup.sets parentGroup is not needed
211 */
212 parentGroup?: {
213 id: string;
214 };
215 isOpen?: boolean;
216 isAvailableForTagging?: boolean;
217 contact?: string;
218}
219export interface ITermInfo {
220 childrenCount: number;
221 id: string;
222 labels: {
223 name: string;
224 isDefault: boolean;
225 languageTag: string;
226 }[];
227 createdDateTime: string;
228 customSortOrder?: ITermSortOrderInfo[];
229 lastModifiedDateTime: string;
230 descriptions: {
231 description: string;
232 languageTag: string;
233 }[];
234 properties?: ITaxonomyProperty[];
235 localProperties?: ITaxonomyLocalProperty[];
236 isDeprecated: boolean;
237 isAvailableForTagging: {
238 setId: string;
239 isAvailable: boolean;
240 }[];
241 topicRequested?: boolean;
242 parent?: ITermInfo;
243 set?: ITermSetInfo;
244 relations?: IRelationInfo[];
245 children?: ITermInfo[];
246}
247export interface ISearchTermParams {
248 /**
249 * The term label to search for.
250 */
251 label: string;
252 /**
253 * The setId to scope down the search under a termSet.
254 */
255 setId?: string;
256 /**
257 * The parentTermId to scope down the search under a termSet, under a parent term.
258 */
259 parentTermId?: string;
260 /**
261 * The languageTag to scope down the search to a specific language.
262 */
263 languageTag?: string;
264 /**
265 * Indicates what type of string matching should be performed when searching.
266 */
267 stringMatchOption?: "ExactMatch" | "StartsWith";
268}
269declare type SearchTermPickedProps = "childrenCount" | "createdDateTime" | "descriptions" | "id" | "isAvailableForTagging" | "isDeprecated" | "labels" | "lastModifiedDateTime" | "set";
270export interface ITermSortOrderInfo {
271 setId: string;
272 order: string[];
273}
274export interface IOrderedTermInfo extends ITermInfo {
275 children: ITermInfo[];
276 defaultLabel: string;
277}
278export interface IRelationInfo {
279 id: string;
280 relationType: string;
281}
282export interface IRelationCreateInfo {
283 id: string;
284 relationship: "pin" | "reuse";
285 fromTerm: {
286 id: string;
287 };
288 toTerm: {
289 id: string;
290 };
291 set: {
292 id: string;
293 };
294}
295export interface ITaxonomyUserInfo {
296 user: {
297 displayName: string;
298 email: string;
299 id: string;
300 };
301}
302export interface ITaxonomyProperty {
303 key: string;
304 value: string;
305}
306export interface ITaxonomyLocalProperty {
307 setId: string;
308 properties: ITaxonomyProperty[];
309}
310export interface IGetOrderedTreeProps {
311 retrieveProperties: boolean;
312}
313export {};
314//# sourceMappingURL=types.d.ts.map
\No newline at end of file