@@ -23,6 +23,18 @@ export type Resource = {
2323 review_count : number ;
2424 review_average : number ;
2525} ;
26+ export type BatchChange = {
27+ field : string ;
28+ type : string ;
29+ value : string ;
30+ search : string | undefined ;
31+ } ;
32+ export type BatchEdit = {
33+ batch_id : number ;
34+ created_at : number ;
35+ completed_at : number ;
36+ errors : Map < string , string [ ] > ;
37+ } ;
2638/**
2739 * @typedef {object } BasicResource
2840 * @property {number } resource_id
@@ -50,6 +62,20 @@ export type Resource = {
5062 * @property {number } review_count
5163 * @property {number } review_average
5264 */
65+ /**
66+ * @typedef {object } BatchChange
67+ * @property {string } field
68+ * @property {string } type
69+ * @property {string } value
70+ * @property {string|undefined } search
71+ */
72+ /**
73+ * @typedef {object } BatchEdit
74+ * @property {number } batch_id
75+ * @property {number } created_at
76+ * @property {number } completed_at
77+ * @property {Map<string, Array<string>> } errors
78+ */
5379/** A helper type for resource-related API endpoints. */
5480export class ResourcesHelper {
5581 constructor ( wrapper : any ) ;
@@ -141,6 +167,20 @@ export class ResourcesHelper {
141167 * @param {string } tagLine The updated content of the tag line, or undefined.
142168 */
143169 modify ( resourceId : number , title : string , description : string , tagLine : string ) : Promise < any > ;
170+ /** Batch edit resource fields for resources you own.
171+ *
172+ * @param {Array<number> } resourceIds The identifiers of the resources.
173+ * @param {Array<BatchChange> } changes A list of changes to make.
174+ *
175+ * @return {number } A batch edit identifier.
176+ */
177+ batchModify ( resourceIds : Array < number > , changes : Array < BatchChange > ) : number ;
178+ /** Fetch the status of a batch edit.
179+ *
180+ * @param {number } batchId The identifier of the batch edit.
181+ * @return {BatchEdit } A raw data object.
182+ */
183+ batchStatus ( batchId : number ) : BatchEdit ;
144184 /** Access download-related helper functions.
145185 *
146186 * @return {DownloadsHelper } A newly-constructed download helper instance.
0 commit comments