From 1613dafc397b561c1933492cba6079a7c95bb865 Mon Sep 17 00:00:00 2001 From: Mizah Date: Sun, 17 Nov 2024 14:23:44 +0200 Subject: [PATCH] Added docs to z-index generator. --- packages/frontend/src/os.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 41b4dc3c0f..716d7a0b56 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -153,12 +153,23 @@ export const popups = ref<{ events: Record; }[]>([]); +/** + * An object containing z-index values for different priority levels. + */ const zIndexes = { veryLow: 500000, low: 1000000, middle: 2000000, high: 3000000, }; + +/** + * Claims a z-index value for a given priority level. + * Increments the z-index value for the specified priority by 100 and returns the new value. + * + * @param {keyof typeof zIndexes} [priority='low'] - The priority level for which to claim a z-index. + * @returns {number} The new z-index value for the specified priority. + */ export function claimZIndex(priority: keyof typeof zIndexes = 'low'): number { zIndexes[priority] += 100; return zIndexes[priority];