UNPKG

7.17 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}
23export interface ITermStore extends _TermStore {
24}
25export declare const TermStore: import("../spqueryable.js").ISPInvokableFactory<ITermStore>;
26export declare class _TermGroups extends _SPCollection<ITermGroupInfo[]> {
27 /**
28 * Gets a term group by id
29 *
30 * @param id Id of the term group to access
31 */
32 getById(id: string): ITermGroup;
33}
34export interface ITermGroups extends _TermGroups {
35}
36export declare const TermGroups: import("../spqueryable.js").ISPInvokableFactory<ITermGroups>;
37export declare class _TermGroup extends _SPInstance<ITermGroupInfo> {
38 /**
39 * Gets the term sets associated with this tenant
40 */
41 get sets(): ITermSets;
42}
43export interface ITermGroup extends _TermGroup {
44}
45export declare const TermGroup: import("../spqueryable.js").ISPInvokableFactory<ITermGroup>;
46export declare class _TermSets extends _SPCollection<ITermSetInfo[]> {
47 /**
48 * Gets a term group by id
49 *
50 * @param id Id of the term group to access
51 */
52 getById(id: string): ITermSet;
53}
54export interface ITermSets extends _TermSets {
55}
56export declare const TermSets: import("../spqueryable.js").ISPInvokableFactory<ITermSets>;
57export declare class _TermSet extends _SPInstance<ITermSetInfo> {
58 /**
59 * Gets all the terms in this set
60 */
61 get terms(): ITerms;
62 get parentGroup(): ITermGroup;
63 get children(): IChildren;
64 get relations(): IRelations;
65 getTermById(id: string): ITerm;
66 /**
67 * Gets all the terms in this termset in an ordered tree using the appropriate sort ordering
68 * ** This is an expensive operation and you should strongly consider caching the results **
69 *
70 * @param props Optional set of properties controlling how the tree is retrieved.
71 */
72 getAllChildrenAsOrderedTree(props?: Partial<IGetOrderedTreeProps>): Promise<IOrderedTermInfo[]>;
73}
74export interface ITermSet extends _TermSet {
75}
76export declare const TermSet: import("../spqueryable.js").ISPInvokableFactory<ITermSet>;
77export declare class _Children extends _SPCollection<ITermInfo[]> {
78}
79export interface IChildren extends _Children {
80}
81export declare const Children: import("../spqueryable.js").ISPInvokableFactory<IChildren>;
82export declare class _Terms extends _SPCollection<ITermInfo[]> {
83 /**
84 * Gets a term group by id
85 *
86 * @param id Id of the term group to access
87 */
88 getById(id: string): ITerm;
89}
90export interface ITerms extends _Terms {
91}
92export declare const Terms: import("../spqueryable.js").ISPInvokableFactory<ITerms>;
93export declare class _Term extends _SPInstance<ITermInfo> {
94 get children(): IChildren;
95 get relations(): IRelations;
96 get set(): ITermSet;
97}
98export interface ITerm extends _Term {
99}
100export declare const Term: import("../spqueryable.js").ISPInvokableFactory<ITerm>;
101export declare class _Relations extends _SPCollection<IRelationInfo[]> {
102 /**
103 * Gets a term group by id
104 *
105 * @param id Id of the term group to access
106 */
107 getById(id: string): IRelation;
108}
109export interface IRelations extends _Relations {
110}
111export declare const Relations: import("../spqueryable.js").ISPInvokableFactory<IRelations>;
112export declare class _Relation extends _SPInstance<IRelationInfo> {
113 get fromTerm(): ITerm;
114 get toTerm(): ITerm;
115 get set(): ITermSet;
116}
117export interface IRelation extends _Relation {
118}
119export declare const Relation: import("../spqueryable.js").ISPInvokableFactory<IRelation>;
120export interface ITermStoreInfo {
121 id: string;
122 name: string;
123 defaultLanguageTag: string;
124 languageTags: string[];
125 administrators?: ITaxonomyUserInfo;
126}
127export interface ITermGroupInfo {
128 id: string;
129 description: string;
130 name: string;
131 displayName: string;
132 createdDateTime: string;
133 lastModifiedDateTime: string;
134 type: string;
135 scope: "global" | "system" | "siteCollection";
136}
137export interface ITermSetInfo {
138 id: string;
139 localizedNames: {
140 name: string;
141 languageTag: string;
142 }[];
143 description: string;
144 createdDateTime: string;
145 customSortOrder: string[];
146 properties?: ITaxonomyProperty[];
147 childrenCount: number;
148 groupId: string;
149 isOpen: boolean;
150 isAvailableForTagging: boolean;
151 contact: string;
152}
153export interface ITermInfo {
154 childrenCount: number;
155 id: string;
156 labels: {
157 name: string;
158 isDefault: boolean;
159 languageTag: string;
160 }[];
161 createdDateTime: string;
162 customSortOrder?: ITermSortOrderInfo[];
163 lastModifiedDateTime: string;
164 descriptions: {
165 description: string;
166 languageTag: string;
167 }[];
168 properties?: ITaxonomyProperty[];
169 localProperties?: ITaxonomyLocalProperty[];
170 isDeprecated: boolean;
171 isAvailableForTagging: {
172 setId: string;
173 isAvailable: boolean;
174 }[];
175 topicRequested?: boolean;
176 parent?: ITermInfo;
177 set?: ITermSetInfo;
178 relations?: IRelationInfo[];
179 children?: ITermInfo[];
180}
181export interface ISearchTermParams {
182 /**
183 * The term label to search for.
184 */
185 label: string;
186 /**
187 * The setId to scope down the search under a termSet.
188 */
189 setId?: string;
190 /**
191 * The parentTermId to scope down the search under a termSet, under a parent term.
192 */
193 parentTermId?: string;
194 /**
195 * The languageTag to scope down the search to a specific language.
196 */
197 languageTag?: string;
198 /**
199 * Indicates what type of string matching should be performed when searching.
200 */
201 stringMatchOption?: "ExactMatch" | "StartsWith";
202}
203declare type SearchTermPickedProps = "childrenCount" | "createdDateTime" | "descriptions" | "id" | "isAvailableForTagging" | "isDeprecated" | "labels" | "lastModifiedDateTime" | "set";
204export interface ITermSortOrderInfo {
205 setId: string;
206 order: string[];
207}
208export interface IOrderedTermInfo extends ITermInfo {
209 children: ITermInfo[];
210 defaultLabel: string;
211}
212export interface IRelationInfo {
213 id: string;
214 relationType: string;
215}
216export interface ITaxonomyUserInfo {
217 user: {
218 displayName: string;
219 email: string;
220 id: string;
221 };
222}
223export interface ITaxonomyProperty {
224 key: string;
225 value: string;
226}
227export interface ITaxonomyLocalProperty {
228 setId: string;
229 properties: ITaxonomyProperty[];
230}
231export interface IGetOrderedTreeProps {
232 retrieveProperties: boolean;
233}
234export {};
235//# sourceMappingURL=types.d.ts.map
\No newline at end of file