-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefinitions.lua
100 lines (89 loc) · 8.22 KB
/
definitions.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---@meta
---@class ModuleConfig : table
---@field moduleName string
---@field lapModule LibAddonProfilesModule
---@field dropdownOptions fun(index: number): table
---@field copyFunc fun() | nil
---@field sortIndex number | nil
---@class RefreshHook : table
---@field tableFunc fun() : table The target table that we want to hook functions on
---@field functionNames table<number, string> The names of the functions that we want to hook
---@class LibAddonProfilesModule : table
---@field moduleName string The name of the module. This should be the same as the AddOn name but can be different if the AddOn has multiple modules.
---@field wagoId string | nil X-Wago-ID for the AddOn. If the addon is not on Wago, this should be "none". If the module is a sub-module of an AddOn, this should be nil. If this is a baseline wow feature this should be "baseline".
---@field oldestSupported string | nil The last version of the AddOn that was tested with this library.
---@field addonNames table<number, string> | nil The names of the AddOn modules. First entry is used to check if the AddOn can be enabled. Is a list to load all dependencies for modular AddOns.
---@field conflictingAddons table<number, string> | nil A list of AddOns that conflict with this AddOn. Used in the intro wizard to disable conflicting AddOns.
---@field icon number | string The icon to use for the module
---@field slash string
---@field needReloadOnImport boolean If the AddOn needs to be reloaded after importing a profile
---@field needProfileKey boolean If importing a profilestring needs a profileKey that is not otherwise encoded in the profileString. Was used by the import anything function, might need again
---@field preventRename boolean For AddOns that have only global profiles, used in the intro wizard
---@field willOverrideProfile boolean If the profile will override the current profile when imported. Also for AddOns that only have global profiles
---@field nonNativeProfileString boolean If the profileString generated by this library is not the same as the profileString used by the AddOn or if the AddOn does not have the concept of profile strings.
---@field needSpecialInterface boolean If this module needs a special interface to define exports (e.g. WeakAuras)
---@field isLoaded fun(self: LibAddonProfilesModule) : boolean Check if the AddOn is loaded
---@field isUpdated fun(self: LibAddonProfilesModule) : boolean Check if the AddOn is updated
---@field needsInitialization fun(self: LibAddonProfilesModule) : boolean Some AddOns need to be initialized before we can access certain interals like the profiles and / or profile keys
---@field openConfig fun(self: LibAddonProfilesModule) : nil Open the AddOn config window
---@field closeConfig fun(self: LibAddonProfilesModule) : nil Close the AddOn config window
---@field getProfileKeys? fun(self: LibAddonProfilesModule,) : table<string, any> A list of profile keys. The values can be anything. If the function is not defined the module has global profiles or no profiles.
---@field getCurrentProfileKey? fun(self: LibAddonProfilesModule,) : string The profile key of the profile that is active on the current character. If the function is not defined the module has global or no profiles.
---@field getProfileAssignments? fun(self: LibAddonProfilesModule) : table<string, string> | nil The key should be in format "Playername - RealmName". The value should be the profile key. A nil return value means that the profile not character specific and can not be directly retrieved. Use WagoUI db to get the profile key. If the function is not defined the module has global profiles.
---@field isDuplicate fun(self: LibAddonProfilesModule, profileKey: string) : boolean Check if a profile with the given key already exists
---@field setProfile? fun(self: LibAddonProfilesModule, profileKey: string) Set the profile to the given profile key. If the function is not defined the module has global profiles or no profiles.
---@field testImport fun(self: LibAddonProfilesModule, profileString: string, profileKey: string | nil, profileData: table| nil, rawData: table | nil, moduleName: string | nil) : string | table | nil Test the profile string to see if it can be imported. Return the profile key if it can, nil otherwise. Tests profileData, rawData, and moduleName if they are provided, otherwise decodes the profileString and tests that.
---@field importProfile fun(self: LibAddonProfilesModule, profileString: string, profileKey: string, fromIntro: boolean) : nil Import the profile string. Does nothing if the module has global profiles.
---@field exportProfile fun(self: LibAddonProfilesModule, profileKey: string | table) : string | table | nil Export the profile string. If the function returns a table it will contain multiple profile strings.
---@field exportOptions table<any, any> | nil A table of options that can be used to customize the export. The options are used in the exportProfile function.
---@field setExportOptions? fun(self: LibAddonProfilesModule, options: table) : nil Set the export options. The options are used in the exportProfile function.
---@field exportGroup? fun(self: LibAddonProfilesModule, profileKey: string, blockedIds: table<string> | nil) : string | nil For modules that have a group of export strings, export a single export string of that group. (e.g. WeakAuras)
---@field areProfileStringsEqual fun(self: LibAddonProfilesModule, profileStringA: string | nil, profileStringB: string | nil , tableA : table | nil, tableB : table | nil) : areEqual: boolean, changedEntries: table | nil, removedEntries: table | nil Deep compare two profile strings or two tables.
---@field refreshHookList table<number, RefreshHook> | nil Defines what functions should be hooked when wanting to monitor additions / deletions of profiles and changes to the currently active profile key.
---@field getCollectedWagoIds? fun(self: LibAddonProfilesModule) : table<string, string> Returns a list of collected Wago IDs.
---@class AddonResolutionEntry
---@field value string
---@field displayNameLong string
---@field displayNameShort string
---@field width number | nil
---@field height number | nil
---@field defaultEnabled boolean
---@class AddonResolutions
---@field entries table<number, AddonResolutionEntry>
---@field defaultValue string
---@class LibDeflateAsync
---@field CompressDeflate fun(self: LibDeflateAsync, input: string, options: table): string
---@field EncodeForPrint fun(self: LibDeflateAsync, input: string): string)
---@field EncodeForWoWAddonChannel fun(self: LibDeflateAsync, input: string): string
---@field DecodeForPrint fun(self: LibDeflateAsync, input: string): string
---@field DecodeForWoWAddonChannel fun(self: LibDeflateAsync, input: string): string
---@field DecompressDeflate fun(self: LibDeflateAsync, input: string): string
---@class LibCompress
---@field Decompress fun(self: LibCompress, input: string): string
---@field GetAddonEncodeTable fun(self: LibCompress): table
---@field CompressHuffman fun(self: LibCompress, input: string): string
---@field DecompressHuffman fun(self: LibCompress, input: string): string
---@class AceSerializer-3.0Async
---@field Serialize fun(self: AceSerializer-3.0Async, input: any): string
---@field Deserialize fun(self: AceSerializer-3.0Async, input: string): boolean, table | nil
---@class LibSerialize
---@field SerializeAsyncEx fun(self:LibSerialize, configForLS: table | nil, inTable: table) : function
---@field DeserializeAsync fun(self:LibSerialize, serialized: string) : function
---@class LibAsync : table
---@field GetHandler fun(self, config: LibAsyncConfig | nil) : LibAsyncHandler
---@class LibAsyncConfig
---@field type "everyFrame" The type of handler to create.
---@field maxTime number The maximum time in milliseconds to spend on a single update.
---@field maxTimeCombat number The maximum time in milliseconds to spend on a single update while in dungeon combat.
---@field errorHandler fun(msg: string, stacktrace?: string, name?: string) The error handler to use when a coroutine errors.
---@class LibAsyncHandler
---@field size number
---@field frame table
---@field update table
---@field CancelAsync fun(self, name: string)
---@field Async fun(self, func: function, name: string, singleton: boolean)
---@class IntroImportState
---@field checked boolean
---@field profileMetadata table
---@field profileKey string
---@field profile string