datasquirel/utils/delete-file.d.ts

47 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

2024-12-06 10:44:26 +00:00
export = deleteFile;
2024-11-08 15:44:31 +00:00
/**
* @typedef {Object} FunctionReturn
* @property {boolean} success - Did the function run successfully?
* @property {{
* urlPath: string,
* urlThumbnailPath: string
2024-12-06 10:44:26 +00:00
* } | null} payload - Payload containing the url for the image and its thumbnail
2024-11-08 15:44:31 +00:00
* @property {string} [msg] - An optional message
*/
/**
2024-12-06 10:44:26 +00:00
* # Delete File via API
2024-11-08 15:44:31 +00:00
* @async
*
* @param {Object} params - Single Param object containing params
* @param {String} params.key - *FULL ACCESS API Key
* @param { string } params.url - File URL
2024-12-06 10:44:26 +00:00
* @param { string | number } [params.user_id]
2024-11-08 15:44:31 +00:00
*
* @returns { Promise<FunctionReturn> } - Image Url
*/
2024-12-06 10:44:26 +00:00
declare function deleteFile({ key, url, user_id }: {
2024-11-08 15:44:31 +00:00
key: string;
url: string;
2024-12-06 10:44:26 +00:00
user_id?: string | number;
2024-11-08 15:44:31 +00:00
}): Promise<FunctionReturn>;
2024-12-06 10:44:26 +00:00
declare namespace deleteFile {
2024-11-08 15:44:31 +00:00
export { FunctionReturn };
}
type FunctionReturn = {
/**
* - Did the function run successfully?
*/
success: boolean;
/**
* - Payload containing the url for the image and its thumbnail
*/
payload: {
urlPath: string;
urlThumbnailPath: string;
2024-12-06 10:44:26 +00:00
} | null;
2024-11-08 15:44:31 +00:00
/**
* - An optional message
*/
msg?: string;
};