From 5ed8700b337d00d0e0ec782e93b97d217a280f7c Mon Sep 17 00:00:00 2001 From: Buds Date: Tue, 9 Jul 2024 00:54:06 +0200 Subject: [PATCH 1/4] documentation and wiki workflow for create create WeakAurasAPI.lua with lua-language-server --- .github/scripts/docs/.gitignore | 5 + .github/scripts/docs/parser.js | 128 ++++++++++++++++++ .../scripts/docs/update-documentation-file.sh | 7 + .github/workflows/documentation-update.yml | 36 +++++ .github/workflows/wiki-api-update.yml | 44 ++++++ WeakAurasOptions/OptionsFrames/TextEditor.lua | 1 + WeakAurasOptions/WeakAurasOptions.toc | 2 + WeakAurasOptions/WeakAurasOptions_Cata.toc | 2 + WeakAurasOptions/WeakAurasOptions_Vanilla.toc | 2 + 9 files changed, 227 insertions(+) create mode 100644 .github/scripts/docs/.gitignore create mode 100644 .github/scripts/docs/parser.js create mode 100644 .github/scripts/docs/update-documentation-file.sh create mode 100644 .github/workflows/documentation-update.yml create mode 100644 .github/workflows/wiki-api-update.yml diff --git a/.github/scripts/docs/.gitignore b/.github/scripts/docs/.gitignore new file mode 100644 index 0000000000..f520577ca3 --- /dev/null +++ b/.github/scripts/docs/.gitignore @@ -0,0 +1,5 @@ +doc.json +output.json +doc.md +*.log +*utf8* \ No newline at end of file diff --git a/.github/scripts/docs/parser.js b/.github/scripts/docs/parser.js new file mode 100644 index 0000000000..6923fb94ae --- /dev/null +++ b/.github/scripts/docs/parser.js @@ -0,0 +1,128 @@ +const fs = require('fs'); +const path = require('path'); +const namespace = "WeakAuras" + +console.log( +`if not WeakAuras.IsLibsOK() then return end +---@type string +local AddonName = ... +---@class OptionsPrivate +local OptionsPrivate = select(2, ...) +local WeakAurasAPI = +{ + Name = "WeakAuras", + Type = "System", + Namespace = "WeakAuras", + Functions = + {` +) + +function isNilable(obj) { + return obj.view.match("nil|\\?") ? "true" : "false" +} + +function wowType(obj) { + if (obj.view.match("string")) { + return "string"; + } + if (obj.view.match("boolean")) { + return "bool"; + } + if (obj.view.match("integer|number")) { + return "number"; + } + if (obj.view === "unknown|nil") { + return "unknown" + } + if (obj.view === "(\"friendly\"|\"hostile\")?") { // I don't know how to handle this alias properly + return "string" + } + return obj.view; +} + +const data = fs.readFileSync(path.join(__dirname, 'doc.json'), { encoding: 'utf8', flags: 'r' }); +const obj = JSON.parse(data); +const allFunctions = new Object; +for (const entry of obj) { + if (entry.name === namespace) { + if (entry.fields) { + for (const field of entry.fields) { + if (field?.extends?.type === "function" && field?.visible === "public") { + const currFunction = new Object; + const args = field?.extends?.args + if (args && args.length > 0) { + currFunction.arguments = new Array; + for (const arg of args) { + currFunction.arguments.push({ name: arg.name, type: wowType(arg), nilable: isNilable(arg)}); + }; + } + const returns = field?.extends?.returns + if (returns && returns.length > 0) { + currFunction.returns = new Array; + for (const ret of returns) { + currFunction.returns.push({ name: ret.name, type: wowType(ret), nilable: isNilable(ret)}) + }; + } + // if there is already a function with this name, we check if the new has more args or returns + if (allFunctions[field.name]) { + const currArgs = currFunction.args ? currFunction.args.length : 0 + const oldArgs = allFunctions[field.name].args ? allFunctions[field.name].length : 0 + const currRets = currFunction.returns ? currFunction.returns.length : 0 + const oldRets = allFunctions[field.name].returns ? allFunctions[field.name].returns.length : 0 + if (currArgs > oldArgs || currRets > oldRets) { + allFunctions[field.name] = currFunction + } + } else { + allFunctions[field.name] = currFunction + } + } + }; + } + } +} + +for (var key in allFunctions) { + const currFunction = allFunctions[key] + console.log(` {`); + console.log(` Name = "${key}",`); + console.log(` Type = "Function",`); + if (currFunction.arguments) { + console.log(""); + console.log(` Arguments =`); + console.log(` {`); + for (const arg of currFunction.arguments) { + console.log(` { Name = "${arg.name}", Type = "${arg.type}", Nilable = ${arg.nilable} },`); + }; + console.log(` },`); + } + if (currFunction.returns) { + console.log(""); + console.log(` Returns =`); + console.log(` {`); + for (const ret of currFunction.returns) { + console.log(` { Name = "${ret.name}", Type = "${ret.type}", Nilable = ${ret.nilable} },`); + }; + console.log(` },`); + } + console.log(` },`); +} + +console.log( +` + }, + Events = + { + }, + Tables = + { + }, +}; +local loaded = false +function OptionsPrivate.LoadDocumentation() + if not loaded then + APIDocumentation:AddDocumentationTable(WeakAurasAPI); + loaded = true + end +end +` +); \ No newline at end of file diff --git a/.github/scripts/docs/update-documentation-file.sh b/.github/scripts/docs/update-documentation-file.sh new file mode 100644 index 0000000000..b93e42f622 --- /dev/null +++ b/.github/scripts/docs/update-documentation-file.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +lua-language-server --doc="." --doc_out_path=".github/scripts/docs" --logpath=".github/scripts/docs" --metapath=".github/scripts/docs" + +# jq '[.[] | select(.name | index("WeakAuras") != -1)]' doc.json > output.json + +node .github/scripts/docs/parser.js > WeakAurasOptions/WeakAurasAPI.lua \ No newline at end of file diff --git a/.github/workflows/documentation-update.yml b/.github/workflows/documentation-update.yml new file mode 100644 index 0000000000..e9840ed754 --- /dev/null +++ b/.github/workflows/documentation-update.yml @@ -0,0 +1,36 @@ +name: Regenerate Type Definitions + +on: + push: + branches: + - main + pull_request_target: + +jobs: + type-definitions-update: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout WeakAuras + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + - name: Set up Homebrew + id: set-up-homebrew + uses: Homebrew/actions/setup-homebrew@master + + - name: Install LuaLS + run: | + brew install lua-language-server + - name: Regenerate Type Definitions + run: | + ./.github/scripts/docs/update-documentation-files.sh + shell: bash + + - name: Push Changes to PR + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Update generated types from ${GITHUB_SHA:0:7}" \ No newline at end of file diff --git a/.github/workflows/wiki-api-update.yml b/.github/workflows/wiki-api-update.yml new file mode 100644 index 0000000000..0137d1e332 --- /dev/null +++ b/.github/workflows/wiki-api-update.yml @@ -0,0 +1,44 @@ +name: Update Wiki Documentation + +on: + push: + branches: + - main + paths: + - WeakAurasOptions/WeakAurasAPI.lua + +jobs: + update-wiki-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout WeakAuras + uses: actions/checkout@v4 + with: + path: WeakAuras + + - name: Checkout WeakAuras Wiki + uses: actions/checkout@v4 + with: + repository: WeakAuras/WeakAuras2.wiki + path: wiki + + - name: Install LuaLS + run: | + brew install lua-language-server + - name: Update Documentation Files + run: | + ./.github/scripts/docs/update-documentation-files.sh + shell: bash + + - name: Copy Documentation Files + run: | + mv .github/scripts/docs/docs.md wiki/API-Documentation.md + shell: bash + + - name: Update Wiki + run: | + cd wiki + git config user.name "${{ github.actor }}" + git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" + git commit -am "Update API Docs from ${GITHUB_SHA:0:7}" || true + git push \ No newline at end of file diff --git a/WeakAurasOptions/OptionsFrames/TextEditor.lua b/WeakAurasOptions/OptionsFrames/TextEditor.lua index b79146178a..aedf2b75a0 100644 --- a/WeakAurasOptions/OptionsFrames/TextEditor.lua +++ b/WeakAurasOptions/OptionsFrames/TextEditor.lua @@ -192,6 +192,7 @@ local function ConstructTextEditor(frame) local originalGetText = editor.editBox.GetText set_scheme() LAAC:enable(editor.editBox) + OptionsPrivate.LoadDocumentation() IndentationLib.enable(editor.editBox, color_scheme, WeakAurasSaved.editor_tab_spaces) local cancel = CreateFrame("Button", nil, group.frame, "UIPanelButtonTemplate") diff --git a/WeakAurasOptions/WeakAurasOptions.toc b/WeakAurasOptions/WeakAurasOptions.toc index 6a38c05b20..1a160b88c8 100644 --- a/WeakAurasOptions/WeakAurasOptions.toc +++ b/WeakAurasOptions/WeakAurasOptions.toc @@ -56,6 +56,8 @@ WeakAurasOptions.lua ConditionOptions.lua AuthorOptions.lua +WeakAurasAPI.lua + OptionsFrames\OptionsFrame.lua # Groups diff --git a/WeakAurasOptions/WeakAurasOptions_Cata.toc b/WeakAurasOptions/WeakAurasOptions_Cata.toc index b071c7d0d2..e0e9b50377 100644 --- a/WeakAurasOptions/WeakAurasOptions_Cata.toc +++ b/WeakAurasOptions/WeakAurasOptions_Cata.toc @@ -56,6 +56,8 @@ WeakAurasOptions.lua ConditionOptions.lua AuthorOptions.lua +WeakAurasAPI.lua + OptionsFrames\OptionsFrame.lua # Groups diff --git a/WeakAurasOptions/WeakAurasOptions_Vanilla.toc b/WeakAurasOptions/WeakAurasOptions_Vanilla.toc index 2aa92bf8eb..fc8d6e85b6 100644 --- a/WeakAurasOptions/WeakAurasOptions_Vanilla.toc +++ b/WeakAurasOptions/WeakAurasOptions_Vanilla.toc @@ -55,6 +55,8 @@ WeakAurasOptions.lua ConditionOptions.lua AuthorOptions.lua +WeakAurasAPI.lua + OptionsFrames\OptionsFrame.lua # Groups From 22b0651890675652ca947184ce23661f20e15f57 Mon Sep 17 00:00:00 2001 From: Buds Date: Tue, 9 Jul 2024 01:02:14 +0200 Subject: [PATCH 2/4] Tag some functions of WeakAuras namespace as private --- WeakAuras/AuraEnvironment.lua | 1 + WeakAuras/GenericTrigger.lua | 3 +++ WeakAuras/Init.lua | 1 + WeakAuras/WeakAuras.lua | 13 +++++++++++++ WeakAurasOptions/WeakAurasOptions.lua | 13 +++++++++++++ WeakAurasTemplates/TriggerTemplates.lua | 1 + 6 files changed, 32 insertions(+) diff --git a/WeakAuras/AuraEnvironment.lua b/WeakAuras/AuraEnvironment.lua index ce7ebfe706..8eed1e393c 100644 --- a/WeakAuras/AuraEnvironment.lua +++ b/WeakAuras/AuraEnvironment.lua @@ -646,6 +646,7 @@ end local function_cache_custom = CreateFunctionCache(exec_env_custom) local function_cache_builtin = CreateFunctionCache(exec_env_builtin) +---@private function WeakAuras.LoadFunction(string) return function_cache_custom:Load(string) end diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index f46a5d193f..fd0d2c6c83 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -844,6 +844,7 @@ function WeakAuras.ScanEvents(event, arg1, arg2, ...) Private.StopProfileSystem("generictrigger " .. system) end +---@private ---@param event string ---@param unit UnitToken ---@param ... any @@ -3445,6 +3446,7 @@ function WeakAuras.GetPlayerReaction(unit) end end +---@private ---@param unit UnitToken function WeakAuras.WatchUnitChange(unit) unit = string.lower(unit) @@ -3761,6 +3763,7 @@ if WeakAuras.IsClassicEra() then queueableSpells = classQueueableSpells[class] local queuedSpellFrame + ---@private function WeakAuras.WatchForQueuedSpell() if not queuedSpellFrame then queuedSpellFrame = CreateFrame("Frame") diff --git a/WeakAuras/Init.lua b/WeakAuras/Init.lua index 5d28ca32f7..b51a1f7b1e 100644 --- a/WeakAuras/Init.lua +++ b/WeakAuras/Init.lua @@ -530,6 +530,7 @@ do end end +---@private function WeakAuras.IsLibsOK() return libsAreOk end diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index 361392cfaf..419fa27bbb 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -95,6 +95,7 @@ WeakAuras.timer = timer local loginQueue = {} local queueshowooc +---@return integer version function WeakAuras.InternalVersion() return internalVersion; end @@ -164,6 +165,7 @@ function Private.LoadOptions(msg) return true; end +---@private function WeakAuras.OpenOptions(msg) if Private.NeedToRepairDatabase() then StaticPopup_Show("WEAKAURAS_CONFIRM_REPAIR", nil, nil, {reason = "downgrade"}) @@ -256,6 +258,7 @@ end if not WeakAuras.IsLibsOK() then return end +---@private function WeakAuras.ToggleMinimap() WeakAurasSaved.minimap.hide = not WeakAurasSaved.minimap.hide if WeakAurasSaved.minimap.hide then @@ -1202,6 +1205,7 @@ do -- Archive stuff return Archivist end + ---@private function WeakAuras.LoadFromArchive(storeType, storeID) local Archive = OpenArchive() return Archive:Load(storeType, storeID) @@ -1472,6 +1476,7 @@ function Private.Pause() paused = true; end +---@private function WeakAuras.Toggle() if(paused) then Private.Resume(); @@ -1484,6 +1489,7 @@ function Private.SquelchingActions() return squelch_actions; end +---@private function WeakAuras.InLoadingScreen() return in_loading_screen; end @@ -2189,6 +2195,7 @@ function WeakAuras.Delete(data) Private.callbacks:Fire("Delete", uid, id, parentUid, parentId) end +---@private function WeakAuras.Rename(data, newid) local oldid = data.id if(data.parent) then @@ -2991,6 +2998,7 @@ function Private.UpdateSoundIcon(data) end end +---@private function WeakAuras.PreAdd(data, snapshot) if not data then return end -- Readd what Compress removed before version 8 @@ -4098,6 +4106,7 @@ end do local hiddenTooltip; + ---@private function WeakAuras.GetHiddenTooltip() if not(hiddenTooltip) then hiddenTooltip = CreateFrame("GameTooltip", "WeakAurasTooltip", nil, "GameTooltipTemplate"); @@ -4173,6 +4182,7 @@ function WeakAuras.GetAuraTooltipInfo(unit, index, filter) end local FrameTimes = {}; +---@private function WeakAuras.ProfileFrames(all) UpdateAddOnCPUUsage(); for name, frame in pairs(Private.frames) do @@ -4186,6 +4196,7 @@ function WeakAuras.ProfileFrames(all) end local DisplayTimes = {}; +---@private function WeakAuras.ProfileDisplays(all) UpdateAddOnCPUUsage(); for id, regionData in pairs(Private.regions) do @@ -4390,6 +4401,7 @@ end Private.dynFrame = dynFrame; +---@private function WeakAuras.RegisterTriggerSystem(types, triggerSystem) for _, v in ipairs(types) do triggerTypes[v] = triggerSystem; @@ -4397,6 +4409,7 @@ function WeakAuras.RegisterTriggerSystem(types, triggerSystem) tinsert(triggerSystems, triggerSystem); end +---@private function WeakAuras.RegisterTriggerSystemOptions(types, func) for _, v in ipairs(types) do Private.triggerTypesOptions[v] = func; diff --git a/WeakAurasOptions/WeakAurasOptions.lua b/WeakAurasOptions/WeakAurasOptions.lua index 1d5e94eb98..55e14665ff 100644 --- a/WeakAurasOptions/WeakAurasOptions.lua +++ b/WeakAurasOptions/WeakAurasOptions.lua @@ -571,6 +571,7 @@ local function OptionsFrame() end end +---@private ---@type fun(msg: string, Private: Private) function WeakAuras.ToggleOptions(msg, Private) if not Private then @@ -613,6 +614,7 @@ function WeakAuras.ToggleOptions(msg, Private) end end +---@private function WeakAuras.HideOptions() if(frame) then frame:Hide() @@ -817,6 +819,7 @@ function OptionsPrivate.DeleteAuras(auras, parents) OptionsPrivate.Private.dynFrame:AddAction("Deleting Auras", co1) end +---@private function WeakAuras.ShowOptions(msg) local firstLoad = not(frame); OptionsPrivate.Private.Pause(); @@ -900,14 +903,17 @@ function OptionsPrivate.UpdateOptions() frame:UpdateOptions() end +---@private function WeakAuras.ClearAndUpdateOptions(id, clearChildren) frame:ClearAndUpdateOptions(id, clearChildren) end +---@private function OptionsPrivate.ClearOptions(id) frame:ClearOptions(id) end +---@private function WeakAuras.FillOptions() frame:FillOptions() end @@ -965,6 +971,7 @@ function OptionsPrivate.ConvertDisplay(data, newType) OptionsPrivate.SortDisplayButtons() end +---@private function WeakAuras.NewDisplayButton(data, massEdit) local id = data.id; OptionsPrivate.Private.ScanForLoads({[id] = true}); @@ -976,6 +983,7 @@ function WeakAuras.NewDisplayButton(data, massEdit) end end +---@private function WeakAuras.UpdateGroupOrders(data) if(data.controlledChildren) then local total = #data.controlledChildren; @@ -1275,6 +1283,7 @@ function OptionsPrivate.IsDisplayPicked(id) end end +---@private function WeakAuras.PickDisplay(id, tab, noHide) frame:PickDisplay(id, tab, noHide) OptionsPrivate.UpdateButtonsScroll() @@ -1679,6 +1688,7 @@ function OptionsPrivate.DropIndicator() return indicator end +---@private function WeakAuras.UpdateThumbnail(data) local id = data.id local button = displayButtons[id] @@ -1900,6 +1910,7 @@ function OptionsPrivate.ResetMoverSizer() end end +---@private function WeakAuras.SetMoverSizer(id) OptionsPrivate.Private.EnsureRegion(id) if OptionsPrivate.Private.regions[id].region.toShow then @@ -1914,6 +1925,7 @@ function WeakAuras.SetMoverSizer(id) end end +---@private function WeakAuras.GetMoverSizerId() return frame.moversizer:GetCurrentId() end @@ -1927,6 +1939,7 @@ local function AddDefaultSubRegions(data) end end +---@private function WeakAuras.NewAura(sourceData, regionType, targetId) local function ensure(t, k, v) return t and k and v and t[k] == v diff --git a/WeakAurasTemplates/TriggerTemplates.lua b/WeakAurasTemplates/TriggerTemplates.lua index 29d792ade9..a836fa4d11 100644 --- a/WeakAurasTemplates/TriggerTemplates.lua +++ b/WeakAurasTemplates/TriggerTemplates.lua @@ -1213,6 +1213,7 @@ local function subTypesFor(item, regionType) return fallbacks end +---@private function WeakAuras.CreateTemplateView(Private, frame) TemplatePrivate.Private = Private From 973bc5d7ac1fe0a3d7187a9a4a884bb85706a102 Mon Sep 17 00:00:00 2001 From: Buds Date: Tue, 9 Jul 2024 01:07:35 +0200 Subject: [PATCH 3/4] workflows housekeeping --- .github/workflows/atlas-update.yml | 2 +- .github/workflows/issues.yml | 2 +- .github/workflows/modelpaths-update.yml | 2 +- .github/workflows/release_notifications.yml | 4 +- .../release_notifications_manual_tests.yml | 123 ------------- .../workflows/release_notifications_setup.md | 166 ------------------ 6 files changed, 5 insertions(+), 294 deletions(-) delete mode 100644 .github/workflows/release_notifications_manual_tests.yml delete mode 100644 .github/workflows/release_notifications_setup.md diff --git a/.github/workflows/atlas-update.yml b/.github/workflows/atlas-update.yml index 4ad78d23b7..178bb81457 100644 --- a/.github/workflows/atlas-update.yml +++ b/.github/workflows/atlas-update.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: jobs: - atlasUpdate: + atlas-update: if: github.repository == 'WeakAuras/WeakAuras2' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index 9c43a3ef15..73b1d2d965 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -5,7 +5,7 @@ on: types: [opened, edited] jobs: - auto_close_issues: + auto-close-issues: runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/modelpaths-update.yml b/.github/workflows/modelpaths-update.yml index 67c26a60b8..389e8b4e93 100644 --- a/.github/workflows/modelpaths-update.yml +++ b/.github/workflows/modelpaths-update.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: jobs: - modelPathsUpdate: + modelpaths-update: if: github.repository == 'WeakAuras/WeakAuras2' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/release_notifications.yml b/.github/workflows/release_notifications.yml index 8125709f0c..eecb78dace 100644 --- a/.github/workflows/release_notifications.yml +++ b/.github/workflows/release_notifications.yml @@ -1,9 +1,9 @@ name: Send Release Notifications +# See https://github.com/WeakAuras/WeakAuras2/wiki/%5BTEAM-INTERNAL%5D-Setting-up-Release-Notification-Hooks + on: workflow_dispatch: - release: - types: [published] jobs: release-notification-output: diff --git a/.github/workflows/release_notifications_manual_tests.yml b/.github/workflows/release_notifications_manual_tests.yml deleted file mode 100644 index f949cc8ae6..0000000000 --- a/.github/workflows/release_notifications_manual_tests.yml +++ /dev/null @@ -1,123 +0,0 @@ -# description of this workflow, can be anything you want -name: Send TEST Release Notifications - -# 'workflow_dispatch' means it will only be manually triggerd via actions menu. -on: - workflow_dispatch: - -# a workflow is built up as jobs, and within these jobs are steps -jobs: - ## We seperate each item into different 'jobs'. The first job will get all the text that we need - ## the subsequent jobs will require the text from the first, and then send it to their approporate channels. - ## This allows us to reun-run specific social media sites seperately incase of errors. - - # "release-notification" is a job, you can name it anything you want - test-release-notification-output: - # we can run our steps on pretty much anything, but the "ubuntu-latest" image is a safe bet - runs-on: ubuntu-latest - - # output documentation: https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs - outputs: - changeLogText: ${{ steps.readChanglog.outputs.text }} - tweetText: ${{ steps.readTweet.outputs.text }} - - # "steps" holds a list of all the steps needed to package and release our AddOn - steps: - # we first have to clone the AddOn project, this is a required step - - name: Clone Project - uses: actions/checkout@v4 - with: - fetch-depth: 0 # gets git history for changelogs - - - name: Hack around https://github.com/actions/checkout/issues/290 - run: | - git fetch --tags --force - - # save the output of the changelog into a variable. - - name: save changelog in variable - uses: Stanzilla/cat@2.0.2 - id: readChanglog - with: - path: .github/scripts/test_files/large_changelog_example.md # use the custom large changelog - - # generate the text for twitter or other social media - - name: Generate Twitter Text - id: twitter_post - # pass in the large changelog into the twitter script. - run: /usr/bin/env python3 .github/scripts/generate_twitter_post.py -c .github/scripts/test_files/large_changelog_example.md - - # save the generated information into a variable. - - name: save twitter post to variable - uses: Stanzilla/cat@2.0.2 - id: readTweet - with: - path: twitter_post.txt - -############### DISCORD #################### - test-discord-release-notification: - # we can run our steps on pretty much anything, but the "ubuntu-latest" image is a safe bet - runs-on: ubuntu-latest - needs: test-release-notification-output - - # specify the environment variables used by the packager, matching the secrets from the project on GitHub - env: - MESSAGE: "TEST NOTIFICATION" - - # "steps" holds a list of all the steps needed to package and release our AddOn - steps: - # using Discord webhook to send release information - - name: Discord Release Webhook Action - uses: tsickert/discord-webhook@v6.0.0 - if: success() - with: - webhook-url: ${{ secrets.RELEASE_WEBHOOK_URL }} - embed-title: ${{ env.MESSAGE }} - embed-url: https://github.com/WeakAuras/WeakAuras2/releases/latest - embed-description: ${{needs.test-release-notification-output.outputs.changeLogText}} - -############### TWITTER #################### - test-twitter-release-notification: - # we can run our steps on pretty much anything, but the "ubuntu-latest" image is a safe bet - runs-on: ubuntu-latest - needs: test-release-notification-output - - # "steps" holds a list of all the steps needed to package and release our AddOn - steps: - - name: Twitter Notification - uses: nearform-actions/github-action-notify-twitter@master - with: - message: ${{needs.test-release-notification-output.outputs.tweetText}} - twitter-app-key: ${{ secrets.TWITTER_API_KEY }} - twitter-app-secret: ${{ secrets.TWITTER_API_KEY_SECRET }} - twitter-access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }} - twitter-access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} - -############### MASTODON #################### - test-mastodon-release-notification: - # we can run our steps on pretty much anything, but the "ubuntu-latest" image is a safe bet - runs-on: ubuntu-latest - needs: test-release-notification-output - - # "steps" holds a list of all the steps needed to package and release our AddOn - steps: - - name: Mastodon Notification - id: mastodon - uses: cbrgm/mastodon-github-action@v2.1.5 - with: - access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }} # access token - url: ${{ secrets.MASTODON_URL }} # https://example.social - message: ${{needs.test-release-notification-output.outputs.tweetText}} - -############### BLUESKY #################### - test-bluesky-release-notification: - # we can run our steps on pretty much anything, but the "ubuntu-latest" image is a safe bet - runs-on: ubuntu-latest - needs: test-release-notification-output - - # "steps" holds a list of all the steps needed to package and release our AddOn - steps: - - uses: myConsciousness/bluesky-post@v5 - with: - text: ${{needs.test-release-notification-output.outputs.tweetText}} - identifier: ${{ secrets.BLUESKY_IDENTIFIER }} - password: ${{ secrets.BLUESKY_PASSWORD }} diff --git a/.github/workflows/release_notifications_setup.md b/.github/workflows/release_notifications_setup.md deleted file mode 100644 index bb473915b3..0000000000 --- a/.github/workflows/release_notifications_setup.md +++ /dev/null @@ -1,166 +0,0 @@ -# Setting up Release Notification Hooks - -## Requirements - -This folder contains a [release_notifications.yml](release_notifications.yml) file that contains workflows for GitHub actions to be able to post an automated message to various social media platforms when a released is published. - -For the most part, this file can work plug-and-play into any repo, you simply need to set up the various GitHub 'secrets' so that the workflow knows where to push the updates to. This page will highlight the required pieces for it to work as well as where to find the keys/tokens to use for your notifications. - -An important part of the yml is the following block: - -```yml -on: - workflow_dispatch: - release: - types: [published] -``` - -where `workflow_dispatch` will tell GitHub Actions that this job can be run manually, allowing you to run it at will, and the `release` portion saying when a GitHub Release is published. This is the part that will automatically run a release is made. - -For this workflow to work, you are required to have the [generate_changelog.sh](../../generate_changelog.sh) script to generate a change log based on the tags during the release process, as well as [generate_twitter_post.py](../scripts/generate_twitter_post.py) to generate a smaller version of the produced changelog to fit within a twitter post. - -With these scripts and [release_notifications.yml](release_notifications.yml) you can have automated messages sent to the various social media channels. - -There is also a [release_notifications_manual_tests.yml](release_notifications_manual_tests.yml) file that is set up in a similar way, but all the 'secrets' are pre-pended with `TEST_`. You can simply omit this file if you don't think you need it, but this allows you to manually run a separate set of tokens/urls to test out the output before you push to your main channels. To use this, follow the below steps, but add `TEST_` to the start of each secret, and that file will push to that instead. - -------- - -## Where to save your 'secrets' - -GitHub has pretty decent [documentation](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) for how the secrets work, but i will give a short explanation here. - -From your repo go to Settings -> Secrets and variables -> Actions: -![secrets and variables](https://i.imgur.com/IR9PDAG.png) - -From here you will see 'Repository secrets'. Here is where you will set up all your tokens and URLs to use for the release notifications. - -![secret examples](https://i.imgur.com/bGXW1uk.png) - -------- - -## API Keys / Tokens for the Notifications - -Each application needs their own set of tokens and urls to push to. - -### Discord - -For Discord, you simply need to set up a webhook to a channel. - -Pick a channel, and hit 'edit channel' -![edit channel](https://i.imgur.com/Gr9llZy.png) - -Integrations -> View Webhooks -![View Webhooks](https://i.imgur.com/hAY1nqt.png) - -Create a new webhook and copy the URL. - -Go to your GitHub secrets and save the URL as: `RELEASE_WEBHOOK_URL` - -### Twitter - -First sign into the Twitter developer portal with the account you want to post with: - -once you have an account set up you can go to the dashboard: - -For a free twitter developer account you can set up a single 'project', create one. -![project](https://i.imgur.com/Jlu4MId.png) - -Once you create the project it will ask you to make an 'app', which will give you API Keys afterwards. Don't worry about these, we are going to regenerate them anyway after the next step. -![app](https://i.imgur.com/3IUNUI3.png) - -Once you get your first set of keys/tokens, go to the 'App Settings'. You can get to it from the dashboard on the left side and clicking the name of your app. Towards the bottom, you want to click 'set up' for user authentication settings. -![app settings](https://i.imgur.com/z7AXpfj.png) - -From here you want to fill out the information the best you can, but the important parts are the two radio buttons at the top: -![radio buttons](https://i.imgur.com/CJPERMY.png) - -'Read and write' are required for your bot to post to Twitter. Set both 'Read and Write' as well as 'Bot' as Type of App, and fill out the rest of the form. The website and callback URL requires `https://` or `http://` at the start to be valid. This will give you a client ID and Client Secret, don't worry about this either, we will regenerate all at once to get everything we need. - -Now, we have everything set up to regenerate the keys and save them. Go back to the dashboard, click your app name and then 'Keys and Tokens' -![keys and tokens](https://i.imgur.com/UvWl0f9.png) - -From here you will see various tokens. You can 'Regenerate' your `API Key and Secret` and save it in a text file for now. You want both `API Key` and `API Key Secret`. - -Next, you want the `Access Token and Secret`. Hit 'Regenerate' and save both `Access Token` and `Access Token Secret`. - -**IMPORTANT:** After you save this information ENSURE that the you see `Created with Read and Write permissions` below it. If write permissions are not granted you will not be able to send messages. - -Finally, go to GitHub Actions Secrets and save the following information: - -```sh -TWITTER_ACCESS_TOKEN -TWITTER_ACCESS_TOKEN_SECRET -TWITTER_API_KEY -TWITTER_API_KEY_SECRET -``` - -### Mastodon - -For Mastodon you only need 2 easy to get items. For the URL you simply provide the URL of the network you're on. For example: - -For the access token you need to make a new application. Go to your Preferences -> Development - and create a new application -![app](https://i.imgur.com/3PW6ztz.png) - -From here you can customize the information you want to give it. -![info](https://i.imgur.com/XGCzmZB.png) - -Simply submit the application and open it up to see your access token -![submit](https://i.imgur.com/GAtF3uo.png) - -```sh -MASTODON_ACCESS_TOKEN -MASTODON_URL # https://mastodon.social -``` - -### Bluesky - -Bluesky only needs 2 items, the handle/identifier to post to (user name or email) and the 'app password'. - -To get the 'app password' go to your bluesky settings and click 'App Passwords' -![app password](https://i.imgur.com/kG8oywU.png) - -Generate a new app password with a unique name and it will generate a key for you to save. -![key](https://i.imgur.com/gn4x2B6.png) - -```sh -BLUESKY_IDENTIFIER # user name or email -BLUESKY_PASSWORD # 'app password' -``` - -------- - -## Running the Workflow - -If you want to test the notifications you can go to ACTIONS and check your workflows -![workflow](https://i.imgur.com/npbcEJ6.png) - -You can use `Send TEST Release Notification` to test it out. Remember, these will use the pre-pended `TEST_` secrets. This will also use a custom changelog found here:[large_changelog_example.md](../scripts/test_files/large_changelog_example.md). - -If for some reason something fails, it is set up in a way to be able to re-run specific notifications. As an example, in this image Mastodon failed. -![failed example](https://i.imgur.com/EXUTZCa.png) - -You can view the error and see if you can fix it with the secrets, if you did a copy/paste error and re-run only the mastodon job. - -When running a test, normally the changelog will not generate a 'highlights' section, which means the tweet will only include a URL to the latest tag. If the tag is the newest commit, it should work normally. - -When you publish a new release with a new tag it will also automatically run, and you can re-run failed jobs as well. - -------- - -## Example Screenshots with TEST Release Info - -Discord - -![example discord](https://i.imgur.com/wWFurie.png) - -Twitter - -![example twitter](https://i.imgur.com/EdTWSCo.png) - -Mastodon - -![example mastodon](https://i.imgur.com/WBPSjye.png) - -Bluesky - -![example bluesky](https://i.imgur.com/nFgWJ7O.png) From bed77da63b81d1a528d4c8dd41ea5c04cc0208d7 Mon Sep 17 00:00:00 2001 From: Buds Date: Tue, 9 Jul 2024 03:09:45 +0200 Subject: [PATCH 4/4] Generated WeakAurasAPI.lua --- WeakAurasOptions/WeakAurasAPI.lua | 1486 +++++++++++++++++++++++++++++ 1 file changed, 1486 insertions(+) create mode 100644 WeakAurasOptions/WeakAurasAPI.lua diff --git a/WeakAurasOptions/WeakAurasAPI.lua b/WeakAurasOptions/WeakAurasAPI.lua new file mode 100644 index 0000000000..43499ac74a --- /dev/null +++ b/WeakAurasOptions/WeakAurasAPI.lua @@ -0,0 +1,1486 @@ +if not WeakAuras.IsLibsOK() then return end +---@type string +local AddonName = ... +---@class OptionsPrivate +local OptionsPrivate = select(2, ...) +local WeakAurasAPI = +{ + Name = "WeakAuras", + Type = "System", + Namespace = "WeakAuras", + Functions = + { + { + Name = "AddCompanionData", + Type = "Function", + + Arguments = + { + { Name = "data", Type = "any", Nilable = false }, + }, + }, + { + Name = "CalculatedGcdDuration", + Type = "Function", + + Returns = + { + { Name = "undefined", Type = "number", Nilable = false }, + }, + }, + { + Name = "CheckForItemBonusId", + Type = "Function", + + Arguments = + { + { Name = "ids", Type = "string", Nilable = false }, + }, + + Returns = + { + { Name = "isItemBonusId", Type = "bool", Nilable = false }, + }, + }, + { + Name = "CheckForItemEquipped", + Type = "Function", + + Arguments = + { + { Name = "itemName", Type = "string", Nilable = false }, + { Name = "specificSlot", Type = "number", Nilable = true }, + }, + + Returns = + { + { Name = "isItemEquipped", Type = "bool", Nilable = true }, + }, + }, + { + Name = "CheckNumericIds", + Type = "Function", + + Arguments = + { + { Name = "loadids", Type = "string", Nilable = false }, + { Name = "currentId", Type = "string", Nilable = false }, + }, + + Returns = + { + { Name = "result", Type = "bool", Nilable = false }, + }, + }, + { + Name = "CheckPvpTalentByIndex", + Type = "Function", + + Arguments = + { + { Name = "index", Type = "number", Nilable = false }, + }, + + Returns = + { + { Name = "hasTalent", Type = "bool", Nilable = false }, + { Name = "talentId", Type = "number", Nilable = true }, + }, + }, + { + Name = "CheckRange", + Type = "Function", + + Arguments = + { + { Name = "unit", Type = "any", Nilable = false }, + { Name = "range", Type = "any", Nilable = false }, + { Name = "operator", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "bool", Nilable = true }, + }, + }, + { + Name = "CheckTalentByIndex", + Type = "Function", + + Arguments = + { + { Name = "index", Type = "number", Nilable = false }, + { Name = "extraOption", Type = "bool", Nilable = true }, + }, + + Returns = + { + { Name = "hasTalent", Type = "bool", Nilable = true }, + }, + }, + { + Name = "CheckTalentId", + Type = "Function", + + Arguments = + { + { Name = "talentId", Type = "number", Nilable = false }, + }, + + Returns = + { + { Name = "hasTalent", Type = "bool", Nilable = false }, + }, + }, + { + Name = "ComposeSorts", + Type = "Function", + + Arguments = + { + { Name = "undefined", Type = "unknown", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "function", Nilable = false }, + }, + }, + { + Name = "CountWagoUpdates", + Type = "Function", + + Returns = + { + { Name = "undefined", Type = "number", Nilable = false }, + }, + }, + { + Name = "DeepMixin", + Type = "Function", + + Arguments = + { + { Name = "dest", Type = "any", Nilable = false }, + { Name = "source", Type = "any", Nilable = false }, + }, + }, + { + Name = "EnsureString", + Type = "Function", + + Arguments = + { + { Name = "input", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "string", Nilable = false }, + }, + }, + { + Name = "GcdSpellName", + Type = "Function", + + Returns = + { + { Name = "name", Type = "string", Nilable = false }, + }, + }, + { + Name = "GetActiveConditions", + Type = "Function", + + Arguments = + { + { Name = "id", Type = "any", Nilable = false }, + { Name = "cloneId", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "unknown", Nilable = false }, + }, + }, + { + Name = "GetActiveStates", + Type = "Function", + + Arguments = + { + { Name = "id", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "unknown", Nilable = false }, + }, + }, + { + Name = "GetActiveTriggers", + Type = "Function", + + Arguments = + { + { Name = "id", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "unknown", Nilable = false }, + }, + }, + { + Name = "GetAuraInstanceTooltipInfo", + Type = "Function", + + Arguments = + { + { Name = "unit", Type = "any", Nilable = false }, + { Name = "auraInstanceId", Type = "any", Nilable = false }, + { Name = "filter", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "string", Nilable = false }, + { Name = "undefined", Type = "string", Nilable = false }, + { Name = "undefined", Type = "number", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + }, + }, + { + Name = "GetAuraTooltipInfo", + Type = "Function", + + Arguments = + { + { Name = "unit", Type = "any", Nilable = false }, + { Name = "index", Type = "any", Nilable = false }, + { Name = "filter", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "string", Nilable = false }, + { Name = "undefined", Type = "number", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + }, + }, + { + Name = "GetBonusIdInfo", + Type = "Function", + + Arguments = + { + { Name = "ids", Type = "string", Nilable = false }, + { Name = "specificSlot", Type = "number", Nilable = true }, + }, + + Returns = + { + { Name = "id", Type = "string", Nilable = true }, + { Name = "itemID", Type = "string", Nilable = true }, + { Name = "itemName", Type = "string", Nilable = true }, + { Name = "icon", Type = "number", Nilable = true }, + { Name = "slot", Type = "number", Nilable = true }, + { Name = "itemSlot", Type = "number", Nilable = true }, + }, + }, + { + Name = "GetCastLatency", + Type = "Function", + + Returns = + { + { Name = "castLatencyF", Type = "number", Nilable = false }, + }, + }, + { + Name = "GetCritChance", + Type = "Function", + + Returns = + { + { Name = "critChance", Type = "number", Nilable = false }, + }, + }, + { + Name = "GetData", + Type = "Function", + + Arguments = + { + { Name = "id", Type = "string", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "unknown", Nilable = false }, + }, + }, + { + Name = "GetEffectiveAttackPower", + Type = "Function", + + Returns = + { + { Name = "result", Type = "number", Nilable = false }, + }, + }, + { + Name = "GetEquipmentSetInfo", + Type = "Function", + + Arguments = + { + { Name = "itemSetName", Type = "any", Nilable = false }, + { Name = "partial", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "number", Nilable = false }, + { Name = "undefined", Type = "number", Nilable = false }, + }, + }, + { + Name = "GetEssenceCooldown", + Type = "Function", + + Arguments = + { + { Name = "essence", Type = "number", Nilable = true }, + }, + + Returns = + { + { Name = "duration", Type = "number", Nilable = true }, + { Name = "expirationTime", Type = "number", Nilable = true }, + { Name = "remaining", Type = "number", Nilable = true }, + { Name = "paused", Type = "bool", Nilable = true }, + { Name = "power", Type = "number", Nilable = true }, + { Name = "total", Type = "number", Nilable = true }, + }, + }, + { + Name = "GetGCDInfo", + Type = "Function", + + Returns = + { + { Name = "duration", Type = "number", Nilable = false }, + { Name = "expirationTime", Type = "number", Nilable = false }, + { Name = "name", Type = "string", Nilable = false }, + { Name = "icon", Type = "string", Nilable = false }, + { Name = "modrate", Type = "number", Nilable = false }, + }, + }, + { + Name = "GetHSVTransition", + Type = "Function", + + Arguments = + { + { Name = "perc", Type = "number", Nilable = false }, + { Name = "r1", Type = "number", Nilable = false }, + { Name = "g1", Type = "number", Nilable = false }, + { Name = "b1", Type = "number", Nilable = false }, + { Name = "a1", Type = "number", Nilable = false }, + { Name = "r2", Type = "number", Nilable = false }, + { Name = "g2", Type = "number", Nilable = false }, + { Name = "b2", Type = "number", Nilable = false }, + { Name = "a2", Type = "number", Nilable = false }, + }, + + Returns = + { + { Name = "r", Type = "number", Nilable = false }, + { Name = "g", Type = "number", Nilable = false }, + { Name = "b", Type = "number", Nilable = false }, + { Name = "a", Type = "number", Nilable = false }, + }, + }, + { + Name = "GetHitChance", + Type = "Function", + + Returns = + { + { Name = "hitChance", Type = "number", Nilable = false }, + }, + }, + { + Name = "GetItemCooldown", + Type = "Function", + + Arguments = + { + { Name = "id", Type = "string", Nilable = false }, + { Name = "showgcd", Type = "bool", Nilable = false }, + }, + + Returns = + { + { Name = "startTime", Type = "number", Nilable = false }, + { Name = "duration", Type = "number", Nilable = false }, + { Name = "enabled", Type = "bool", Nilable = false }, + { Name = "gcdCooldown", Type = "number", Nilable = false }, + }, + }, + { + Name = "GetItemSlotCooldown", + Type = "Function", + + Arguments = + { + { Name = "id", Type = "string", Nilable = false }, + { Name = "showgcd", Type = "bool", Nilable = false }, + }, + + Returns = + { + { Name = "startTime", Type = "number", Nilable = false }, + { Name = "duration", Type = "number", Nilable = false }, + { Name = "enabled", Type = "bool", Nilable = false }, + { Name = "gcdCooldown", Type = "number", Nilable = false }, + }, + }, + { + Name = "GetLegendaryData", + Type = "Function", + + Arguments = + { + { Name = "id", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "string", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = true }, + }, + }, + { + Name = "GetMHTenchInfo", + Type = "Function", + + Returns = + { + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "string", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + }, + }, + { + Name = "GetName", + Type = "Function", + + Arguments = + { + { Name = "name", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "unknown", Nilable = false }, + }, + }, + { + Name = "GetNumSetItemsEquipped", + Type = "Function", + + Arguments = + { + { Name = "setID", Type = "number", Nilable = false }, + }, + + Returns = + { + { Name = "quantity", Type = "number", Nilable = true }, + { Name = "maxQuantity", Type = "number", Nilable = true }, + { Name = "setName", Type = "string", Nilable = true }, + }, + }, + { + Name = "GetOHTenchInfo", + Type = "Function", + + Returns = + { + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "string", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + }, + }, + { + Name = "GetPlayerReaction", + Type = "Function", + + Arguments = + { + { Name = "unit", Type = "UnitToken", Nilable = false }, + }, + + Returns = + { + { Name = "reaction", Type = "string", Nilable = true }, + }, + }, + { + Name = "GetPolarCoordinates", + Type = "Function", + + Arguments = + { + { Name = "x", Type = "any", Nilable = false }, + { Name = "y", Type = "any", Nilable = false }, + { Name = "originX", Type = "any", Nilable = false }, + { Name = "originY", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "number", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + }, + }, + { + Name = "GetQueuedSpell", + Type = "Function", + + Returns = + { + { Name = "spellID", Type = "number", Nilable = true }, + }, + }, + { + Name = "GetRange", + Type = "Function", + + Arguments = + { + { Name = "unit", Type = "any", Nilable = false }, + { Name = "checkVisible", Type = "any", Nilable = false }, + }, + }, + { + Name = "GetRangeTenchInfo", + Type = "Function", + + Returns = + { + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "string", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + }, + }, + { + Name = "GetRegion", + Type = "Function", + + Arguments = + { + { Name = "id", Type = "string", Nilable = false }, + { Name = "cloneId", Type = "string", Nilable = true }, + }, + + Returns = + { + { Name = "undefined", Type = "table|nil", Nilable = true }, + }, + }, + { + Name = "GetRuneCooldown", + Type = "Function", + + Arguments = + { + { Name = "id", Type = "number", Nilable = false }, + }, + + Returns = + { + { Name = "cooldownStart", Type = "number", Nilable = false }, + { Name = "cooldownDuration", Type = "number", Nilable = false }, + }, + }, + { + Name = "GetSpellCharges", + Type = "Function", + + Arguments = + { + { Name = "id", Type = "string", Nilable = false }, + { Name = "ignoreSpellKnown", Type = "bool", Nilable = true }, + { Name = "followoverride", Type = "bool", Nilable = true }, + }, + + Returns = + { + { Name = "charges", Type = "number", Nilable = true }, + { Name = "chargesMax", Type = "number", Nilable = true }, + { Name = "count", Type = "number", Nilable = true }, + { Name = "chargeGainTime", Type = "number", Nilable = true }, + { Name = "chargeLostTime", Type = "number", Nilable = true }, + }, + }, + { + Name = "GetSpellCooldown", + Type = "Function", + + Arguments = + { + { Name = "id", Type = "string", Nilable = false }, + { Name = "ignoreRuneCD", Type = "bool", Nilable = false }, + { Name = "showgcd", Type = "bool", Nilable = false }, + { Name = "ignoreSpellKnown", Type = "bool", Nilable = false }, + { Name = "track", Type = "bool", Nilable = false }, + { Name = "followOverride", Type = "bool", Nilable = false }, + }, + + Returns = + { + { Name = "startTime", Type = "number", Nilable = true }, + { Name = "duration", Type = "number", Nilable = true }, + { Name = "gcdCooldown", Type = "number", Nilable = true }, + { Name = "readyTime", Type = "number", Nilable = true }, + { Name = "modRate", Type = "number", Nilable = true }, + { Name = "paused", Type = "bool", Nilable = true }, + }, + }, + { + Name = "GetSpellCooldownUnified", + Type = "Function", + + Arguments = + { + { Name = "id", Type = "string", Nilable = false }, + { Name = "runeDuration", Type = "number", Nilable = true }, + }, + + Returns = + { + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "number", Nilable = false }, + { Name = "undefined", Type = "number", Nilable = false }, + { Name = "undefined", Type = "bool", Nilable = false }, + { Name = "undefined", Type = "number", Nilable = false }, + { Name = "undefined", Type = "number", Nilable = false }, + { Name = "undefined", Type = "bool", Nilable = false }, + { Name = "undefined", Type = "number", Nilable = false }, + { Name = "undefined", Type = "number", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "number", Nilable = false }, + { Name = "undefined", Type = "number", Nilable = false }, + { Name = "undefined", Type = "number", Nilable = false }, + { Name = "undefined", Type = "bool", Nilable = false }, + }, + }, + { + Name = "GetSpellCost", + Type = "Function", + + Arguments = + { + { Name = "powerTypeToCheck", Type = "number", Nilable = false }, + }, + + Returns = + { + { Name = "cost", Type = "number", Nilable = true }, + }, + }, + { + Name = "GetSwingTimerInfo", + Type = "Function", + + Arguments = + { + { Name = "hand", Type = "string", Nilable = false }, + }, + + Returns = + { + { Name = "duration", Type = "number", Nilable = false }, + { Name = "expirationTime", Type = "number", Nilable = false }, + { Name = "weaponName", Type = "string", Nilable = true }, + { Name = "icon", Type = "number", Nilable = true }, + }, + }, + { + Name = "GetTalentById", + Type = "Function", + + Arguments = + { + { Name = "talentId", Type = "number", Nilable = false }, + }, + + Returns = + { + { Name = "spellName", Type = "string", Nilable = true }, + { Name = "icon", Type = "number", Nilable = true }, + { Name = "spellId", Type = "number", Nilable = true }, + { Name = "rank", Type = "number", Nilable = true }, + }, + }, + { + Name = "GetTriggerStateForTrigger", + Type = "Function", + + Arguments = + { + { Name = "id", Type = "any", Nilable = false }, + { Name = "triggernum", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "table|unknown", Nilable = false }, + }, + }, + { + Name = "GetUniqueCloneId", + Type = "Function", + + Returns = + { + { Name = "cloneId", Type = "number", Nilable = false }, + }, + }, + { + Name = "GetUnitNameplate", + Type = "Function", + + Arguments = + { + { Name = "unit", Type = "any", Nilable = false }, + }, + }, + { + Name = "Import", + Type = "Function", + + Arguments = + { + { Name = "inData", Type = "any", Nilable = false }, + { Name = "target", Type = "any", Nilable = false }, + { Name = "callbackFunc", Type = "any", Nilable = false }, + { Name = "linkedAuras", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "bool", Nilable = true }, + { Name = "undefined", Type = "string", Nilable = true }, + }, + }, + { + Name = "InstanceDifficulty", + Type = "Function", + + Returns = + { + { Name = "difficulty", Type = "string", Nilable = false }, + }, + }, + { + Name = "InstanceType", + Type = "Function", + + Returns = + { + { Name = "instanceType", Type = "string", Nilable = false }, + }, + }, + { + Name = "InstanceTypeRaw", + Type = "Function", + + Returns = + { + { Name = "difficultyID", Type = "number", Nilable = true }, + }, + }, + { + Name = "InternalVersion", + Type = "Function", + + Returns = + { + { Name = "version", Type = "number", Nilable = false }, + }, + }, + { + Name = "InvertSort", + Type = "Function", + + Arguments = + { + { Name = "sortFunc", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "function", Nilable = false }, + }, + }, + { + Name = "IsAuraActive", + Type = "Function", + + Arguments = + { + { Name = "id", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "unknown", Nilable = false }, + }, + }, + { + Name = "IsAuraLoaded", + Type = "Function", + + Arguments = + { + { Name = "id", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "bool", Nilable = false }, + }, + }, + { + Name = "IsCataClassic", + Type = "Function", + + Returns = + { + { Name = "result", Type = "bool", Nilable = false }, + }, + }, + { + Name = "IsCataOrRetail", + Type = "Function", + + Returns = + { + { Name = "result", Type = "bool", Nilable = false }, + }, + }, + { + Name = "IsClassicEra", + Type = "Function", + + Returns = + { + { Name = "result", Type = "bool", Nilable = false }, + }, + }, + { + Name = "IsClassicOrCata", + Type = "Function", + + Returns = + { + { Name = "result", Type = "bool", Nilable = false }, + }, + }, + { + Name = "IsImporting", + Type = "Function", + + Returns = + { + { Name = "undefined", Type = "bool", Nilable = false }, + }, + }, + { + Name = "IsLoginFinished", + Type = "Function", + + Returns = + { + { Name = "undefined", Type = "bool", Nilable = false }, + }, + }, + { + Name = "IsOptionsOpen", + Type = "Function", + + Returns = + { + { Name = "undefined", Type = "bool", Nilable = false }, + }, + }, + { + Name = "IsPaused", + Type = "Function", + + Returns = + { + { Name = "undefined", Type = "bool", Nilable = false }, + }, + }, + { + Name = "IsPlayerSpellOrOverridesAndBaseIsPlayerSpell", + Type = "Function", + + Arguments = + { + { Name = "spell", Type = "string", Nilable = false }, + }, + + Returns = + { + { Name = "result", Type = "bool", Nilable = false }, + }, + }, + { + Name = "IsRetail", + Type = "Function", + + Returns = + { + { Name = "result", Type = "bool", Nilable = false }, + }, + }, + { + Name = "IsSpellInRange", + Type = "Function", + + Arguments = + { + { Name = "spellId", Type = "any", Nilable = false }, + { Name = "unit", Type = "any", Nilable = false }, + }, + }, + { + Name = "IsSpellKnown", + Type = "Function", + + Arguments = + { + { Name = "spell", Type = "string", Nilable = false }, + { Name = "pet", Type = "bool", Nilable = true }, + }, + + Returns = + { + { Name = "result", Type = "bool", Nilable = false }, + }, + }, + { + Name = "IsSpellKnownIncludingPet", + Type = "Function", + + Arguments = + { + { Name = "spell", Type = "string", Nilable = false }, + }, + + Returns = + { + { Name = "result", Type = "bool", Nilable = false }, + }, + }, + { + Name = "IsTWW", + Type = "Function", + + Returns = + { + { Name = "result", Type = "bool", Nilable = false }, + }, + }, + { + Name = "IsUntrackableSoftTarget", + Type = "Function", + + Arguments = + { + { Name = "unit", Type = "UnitToken", Nilable = false }, + }, + + Returns = + { + { Name = "result", Type = "bool", Nilable = true }, + }, + }, + { + Name = "PrintProfile", + Type = "Function", + }, + { + Name = "RaidFlagToIndex", + Type = "Function", + + Arguments = + { + { Name = "flag", Type = "number", Nilable = false }, + }, + + Returns = + { + { Name = "index", Type = "number", Nilable = false }, + }, + }, + { + Name = "ReplaceRaidMarkerSymbols", + Type = "Function", + + Arguments = + { + { Name = "txt", Type = "string", Nilable = false }, + }, + + Returns = + { + { Name = "result", Type = "string", Nilable = false }, + }, + }, + { + Name = "SafeToNumber", + Type = "Function", + + Arguments = + { + { Name = "input", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "number", Type = "number", Nilable = true }, + }, + }, + { + Name = "ScanEvents", + Type = "Function", + + Arguments = + { + { Name = "event", Type = "string", Nilable = false }, + { Name = "arg1", Type = "any", Nilable = false }, + { Name = "arg2", Type = "any", Nilable = false }, + { Name = "undefined", Type = "any", Nilable = false }, + }, + }, + { + Name = "SetModel", + Type = "Function", + + Arguments = + { + { Name = "frame", Type = "any", Nilable = false }, + { Name = "model_path", Type = "any", Nilable = false }, + { Name = "model_fileId", Type = "any", Nilable = false }, + { Name = "isUnit", Type = "any", Nilable = false }, + { Name = "isDisplayInfo", Type = "any", Nilable = false }, + }, + }, + { + Name = "SortAscending", + Type = "Function", + + Arguments = + { + { Name = "path", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "function", Nilable = false }, + }, + }, + { + Name = "SortDescending", + Type = "Function", + + Arguments = + { + { Name = "path", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "function", Nilable = false }, + }, + }, + { + Name = "SortGreaterLast", + Type = "Function", + + Arguments = + { + { Name = "a", Type = "any", Nilable = false }, + { Name = "b", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "bool", Nilable = true }, + }, + }, + { + Name = "SortNilFirst", + Type = "Function", + + Arguments = + { + { Name = "a", Type = "any", Nilable = false }, + { Name = "b", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "bool", Nilable = true }, + }, + }, + { + Name = "SortNilLast", + Type = "Function", + + Arguments = + { + { Name = "a", Type = "any", Nilable = false }, + { Name = "b", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "bool", Nilable = true }, + }, + }, + { + Name = "SortRegionData", + Type = "Function", + + Arguments = + { + { Name = "path", Type = "any", Nilable = false }, + { Name = "sortFunc", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "function", Nilable = false }, + }, + }, + { + Name = "SpellActivationActive", + Type = "Function", + + Arguments = + { + { Name = "id", Type = "string", Nilable = false }, + }, + + Returns = + { + { Name = "overlayGlowActive", Type = "bool", Nilable = false }, + }, + }, + { + Name = "SpellSchool", + Type = "Function", + + Arguments = + { + { Name = "school", Type = "number", Nilable = false }, + }, + + Returns = + { + { Name = "school", Type = "string", Nilable = false }, + }, + }, + { + Name = "StartProfile", + Type = "Function", + + Arguments = + { + { Name = "_", Type = "string", Nilable = false }, + }, + }, + { + Name = "StopProfile", + Type = "Function", + }, + { + Name = "TimeToSeconds", + Type = "Function", + + Arguments = + { + { Name = "val", Type = "string", Nilable = false }, + }, + + Returns = + { + { Name = "result", Type = "number", Nilable = true }, + }, + }, + { + Name = "ToggleProfile", + Type = "Function", + }, + { + Name = "UnitChannelInfo", + Type = "Function", + + Arguments = + { + { Name = "unit", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + { Name = "undefined", Type = "unknown", Nilable = true }, + }, + }, + { + Name = "UnitDetailedThreatSituation", + Type = "Function", + + Arguments = + { + { Name = "unit1", Type = "any", Nilable = false }, + { Name = "unit2", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + }, + }, + { + Name = "UnitExistsFixed", + Type = "Function", + + Arguments = + { + { Name = "unit", Type = "UnitToken", Nilable = false }, + { Name = "smart", Type = "bool", Nilable = true }, + }, + + Returns = + { + { Name = "unitExists", Type = "bool", Nilable = false }, + }, + }, + { + Name = "UnitIsPet", + Type = "Function", + + Arguments = + { + { Name = "unit", Type = "UnitToken", Nilable = false }, + }, + + Returns = + { + { Name = "isPet", Type = "bool", Nilable = false }, + }, + }, + { + Name = "UnitNameWithRealm", + Type = "Function", + + Arguments = + { + { Name = "unit", Type = "UnitToken", Nilable = false }, + }, + + Returns = + { + { Name = "name", Type = "string", Nilable = false }, + { Name = "realm", Type = "string", Nilable = false }, + }, + }, + { + Name = "UnitNameWithRealmCustomName", + Type = "Function", + + Arguments = + { + { Name = "unit", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "undefined", Type = "string", Nilable = false }, + { Name = "undefined", Type = "unknown", Nilable = false }, + }, + }, + { + Name = "UnitRaidRole", + Type = "Function", + + Arguments = + { + { Name = "unit", Type = "UnitToken", Nilable = false }, + }, + + Returns = + { + { Name = "role", Type = "string", Nilable = true }, + }, + }, + { + Name = "UntrackableUnit", + Type = "Function", + + Arguments = + { + { Name = "unit", Type = "UnitToken", Nilable = false }, + }, + + Returns = + { + { Name = "result", Type = "bool", Nilable = false }, + }, + }, + { + Name = "ValidateNumeric", + Type = "Function", + + Arguments = + { + { Name = "info", Type = "any", Nilable = false }, + { Name = "val", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "isNumeric", Type = "bool", Nilable = false }, + }, + }, + { + Name = "ValidateNumericOrPercent", + Type = "Function", + + Arguments = + { + { Name = "info", Type = "any", Nilable = false }, + { Name = "val", Type = "string", Nilable = false }, + }, + + Returns = + { + { Name = "result", Type = "bool", Nilable = false }, + }, + }, + { + Name = "ValidateTime", + Type = "Function", + + Arguments = + { + { Name = "info", Type = "any", Nilable = false }, + { Name = "val", Type = "any", Nilable = false }, + }, + + Returns = + { + { Name = "isTime", Type = "bool", Nilable = false }, + }, + }, + { + Name = "gcdDuration", + Type = "Function", + + Returns = + { + { Name = "duration", Type = "number", Nilable = false }, + }, + }, + { + Name = "prettyPrint", + Type = "Function", + + Arguments = + { + { Name = "undefined", Type = "string", Nilable = false }, + }, + }, + { + Name = "split", + Type = "Function", + + Arguments = + { + { Name = "input", Type = "string", Nilable = false }, + }, + + Returns = + { + { Name = "subStrings", Type = "string", Nilable = false }, + }, + }, + + }, + Events = + { + }, + Tables = + { + }, +}; +local loaded = false +function OptionsPrivate.LoadDocumentation() + if not loaded then + APIDocumentation:AddDocumentationTable(WeakAurasAPI); + loaded = true + end +end +