Add typedef for Share type

This commit is contained in:
Max Berger
2026-03-07 22:20:22 +01:00
parent 36dc9c2599
commit 23fcd2927e
2 changed files with 24 additions and 6 deletions

View File

@@ -426,11 +426,28 @@ export function discover_server_features(user, password, callback) {
);
}
/**
* @typedef {Object} Share
* @property {string} ShareType
* @property {string} PathOrToken
* @property {string} PathMapped
* @property {string} Owner
* @property {string} User
* @property {string} Permissions
* @property {boolean} EnabledByOwner
* @property {boolean} EnabledByUser
* @property {boolean} HiddenByOwner
* @property {boolean} HiddenByUser
* @property {number} TimestampCreated
* @property {number} TimestampUpdated
* @property {string} Properties
*/
/**
* @param {string} user
* @param {string} password
* @param {Collection} collection
* @param {function(object):void} callback
* @param {function(Array<Share>):void} callback
*/
export function reload_sharing_list(user, password, collection, callback) {
call_sharing_api(
@@ -439,7 +456,8 @@ export function reload_sharing_list(user, password, collection, callback) {
"all/list",
{ PathMapped: collection.href },
function (response) {
callback(JSON.parse(response));
let parsed = JSON.parse(response);
callback(parsed["Content"] || []);
},
);
}