Skip to content

Commit 805f972

Browse files
committed
update API for love2d and lovr
1 parent 7162bc3 commit 805f972

25 files changed

+1195
-1177
lines changed

meta/3rd/love2d/library/love.audio.lua

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function love.audio.setDopplerScale(scale) end
161161
---
162162
---Not all system supports audio effects. Use love.audio.isEffectsSupported to check.
163163
---
164-
---@overload fun(name: string, enabled: boolean):boolean
164+
---@overload fun(name: string, enabled?: boolean):boolean
165165
---@param name string # The name of the effect.
166166
---@param settings {type: love.EffectType, volume: number} # The settings to use for this effect, with the following fields:
167167
---@return boolean success # Whether the effect was successfully created.
@@ -355,7 +355,7 @@ function Source:getDuration(unit) end
355355
---This function returns nil if the effect was applied with no filter settings associated to it.
356356
---
357357
---@param name string # The name of the effect.
358-
---@param filtersettings? table # An optional empty table that will be filled with the filter settings.
358+
---@param filtersettings table # An optional empty table that will be filled with the filter settings.
359359
---@return {volume: number, highgain: number, lowgain: number} filtersettings # The settings for the filter associated to this effect, or nil if the effect is not present in this Source or has no filter associated. The table has the following fields:
360360
function Source:getEffect(name, filtersettings) end
361361

@@ -597,31 +597,31 @@ function Source:tell(unit) end
597597
---
598598
---Sources do not get attenuated.
599599
---
600-
---| '"none"'
600+
---| "none"
601601
---
602602
---Inverse distance attenuation.
603603
---
604-
---| '"inverse"'
604+
---| "inverse"
605605
---
606606
---Inverse distance attenuation. Gain is clamped. In version 0.9.2 and older this is named '''inverse clamped'''.
607607
---
608-
---| '"inverseclamped"'
608+
---| "inverseclamped"
609609
---
610610
---Linear attenuation.
611611
---
612-
---| '"linear"'
612+
---| "linear"
613613
---
614614
---Linear attenuation. Gain is clamped. In version 0.9.2 and older this is named '''linear clamped'''.
615615
---
616-
---| '"linearclamped"'
616+
---| "linearclamped"
617617
---
618618
---Exponential attenuation.
619619
---
620-
---| '"exponent"'
620+
---| "exponent"
621621
---
622622
---Exponential attenuation. Gain is clamped. In version 0.9.2 and older this is named '''exponent clamped'''.
623623
---
624-
---| '"exponentclamped"'
624+
---| "exponentclamped"
625625

626626
---
627627
---The different types of effects supported by love.audio.setEffect.
@@ -630,35 +630,35 @@ function Source:tell(unit) end
630630
---
631631
---Plays multiple copies of the sound with slight pitch and time variation. Used to make sounds sound "fuller" or "thicker".
632632
---
633-
---| '"chorus"'
633+
---| "chorus"
634634
---
635635
---Decreases the dynamic range of the sound, making the loud and quiet parts closer in volume, producing a more uniform amplitude throughout time.
636636
---
637-
---| '"compressor"'
637+
---| "compressor"
638638
---
639639
---Alters the sound by amplifying it until it clips, shearing off parts of the signal, leading to a compressed and distorted sound.
640640
---
641-
---| '"distortion"'
641+
---| "distortion"
642642
---
643643
---Decaying feedback based effect, on the order of seconds. Also known as delay; causes the sound to repeat at regular intervals at a decreasing volume.
644644
---
645-
---| '"echo"'
645+
---| "echo"
646646
---
647647
---Adjust the frequency components of the sound using a 4-band (low-shelf, two band-pass and a high-shelf) equalizer.
648648
---
649-
---| '"equalizer"'
649+
---| "equalizer"
650650
---
651651
---Plays two copies of the sound; while varying the phase, or equivalently delaying one of them, by amounts on the order of milliseconds, resulting in phasing sounds.
652652
---
653-
---| '"flanger"'
653+
---| "flanger"
654654
---
655655
---Decaying feedback based effect, on the order of milliseconds. Used to simulate the reflection off of the surroundings.
656656
---
657-
---| '"reverb"'
657+
---| "reverb"
658658
---
659659
---An implementation of amplitude modulation; multiplies the source signal with a simple waveform, to produce either volume changes, or inharmonic overtones.
660660
---
661-
---| '"ringmodulator"'
661+
---| "ringmodulator"
662662

663663
---
664664
---The different types of waveforms that can be used with the '''ringmodulator''' EffectType.
@@ -667,19 +667,19 @@ function Source:tell(unit) end
667667
---
668668
---A sawtooth wave, also known as a ramp wave. Named for its linear rise, and (near-)instantaneous fall along time.
669669
---
670-
---| '"sawtooth"'
670+
---| "sawtooth"
671671
---
672672
---A sine wave. Follows a trigonometric sine function.
673673
---
674-
---| '"sine"'
674+
---| "sine"
675675
---
676676
---A square wave. Switches between high and low states (near-)instantaneously.
677677
---
678-
---| '"square"'
678+
---| "square"
679679
---
680680
---A triangle wave. Follows a linear rise and fall that repeats periodically.
681681
---
682-
---| '"triangle"'
682+
---| "triangle"
683683

684684
---
685685
---Types of filters for Sources.
@@ -688,15 +688,15 @@ function Source:tell(unit) end
688688
---
689689
---Low-pass filter. High frequency sounds are attenuated.
690690
---
691-
---| '"lowpass"'
691+
---| "lowpass"
692692
---
693693
---High-pass filter. Low frequency sounds are attenuated.
694694
---
695-
---| '"highpass"'
695+
---| "highpass"
696696
---
697697
---Band-pass filter. Both high and low frequency sounds are attenuated based on the given parameters.
698698
---
699-
---| '"bandpass"'
699+
---| "bandpass"
700700

701701
---
702702
---Types of audio sources.
@@ -707,15 +707,15 @@ function Source:tell(unit) end
707707
---
708708
---The whole audio is decoded.
709709
---
710-
---| '"static"'
710+
---| "static"
711711
---
712712
---The audio is decoded in chunks when needed.
713713
---
714-
---| '"stream"'
714+
---| "stream"
715715
---
716716
---The audio must be manually queued by the user.
717717
---
718-
---| '"queue"'
718+
---| "queue"
719719

720720
---
721721
---Units that represent time.
@@ -724,8 +724,8 @@ function Source:tell(unit) end
724724
---
725725
---Regular seconds.
726726
---
727-
---| '"seconds"'
727+
---| "seconds"
728728
---
729729
---Audio samples.
730730
---
731-
---| '"samples"'
731+
---| "samples"

meta/3rd/love2d/library/love.data.lua

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ love.data = {}
99
---
1010
---Compresses a string or data using a specific compression algorithm.
1111
---
12-
---@overload fun(container: love.ContainerType, format: love.CompressedDataFormat, data: love.Data, level: number):love.CompressedData|string
12+
---@overload fun(container: love.ContainerType, format: love.CompressedDataFormat, data: love.Data, level?: number):love.CompressedData|string
1313
---@param container love.ContainerType # What type to return the compressed data as.
1414
---@param format love.CompressedDataFormat # The format to use when compressing the string.
1515
---@param rawstring string # The raw (un-compressed) string to compress.
@@ -40,7 +40,7 @@ function love.data.decompress(container, compressedData) end
4040
---
4141
---Encode Data or a string to a Data or string in one of the EncodeFormats.
4242
---
43-
---@overload fun(container: love.ContainerType, format: love.EncodeFormat, sourceData: love.Data, linelength: number):love.ByteData|string
43+
---@overload fun(container: love.ContainerType, format: love.EncodeFormat, sourceData: love.Data, linelength?: number):love.ByteData|string
4444
---@param container love.ContainerType # What type to return the encoded data as.
4545
---@param format love.EncodeFormat # The format of the output data.
4646
---@param sourceString string # The raw data to encode.
@@ -71,7 +71,7 @@ function love.data.hash(hashFunction, string) end
7171
---
7272
---Data:getPointer along with LuaJIT's FFI can be used to manipulate the contents of the ByteData object after it has been created.
7373
---
74-
---@overload fun(Data: love.Data, offset: number, size: number):love.ByteData
74+
---@overload fun(Data: love.Data, offset?: number, size?: number):love.ByteData
7575
---@overload fun(size: number):love.ByteData
7676
---@param datastring string # The byte string to copy.
7777
---@return love.ByteData bytedata # The new Data object.
@@ -103,7 +103,7 @@ function love.data.pack(container, format, v1, ...) end
103103
---
104104
---This function behaves the same as Lua 5.3's string.unpack.
105105
---
106-
---@overload fun(format: string, data: love.Data, pos: number):number|boolean|string, number|boolean|string, number
106+
---@overload fun(format: string, data: love.Data, pos?: number):number|boolean|string, number|boolean|string, number
107107
---@param format string # A string determining how the values were packed. Follows the rules of Lua 5.3's string.pack format strings.
108108
---@param datastring string # A string containing the packed (serialized) data.
109109
---@param pos? number # Where to start reading in the string. Negative values can be used to read relative from the end of the string.
@@ -140,19 +140,19 @@ function CompressedData:getFormat() end
140140
---
141141
---The LZ4 compression format. Compresses and decompresses very quickly, but the compression ratio is not the best. LZ4-HC is used when compression level 9 is specified. Some benchmarks are available here.
142142
---
143-
---| '"lz4"'
143+
---| "lz4"
144144
---
145145
---The zlib format is DEFLATE-compressed data with a small bit of header data. Compresses relatively slowly and decompresses moderately quickly, and has a decent compression ratio.
146146
---
147-
---| '"zlib"'
147+
---| "zlib"
148148
---
149149
---The gzip format is DEFLATE-compressed data with a slightly larger header than zlib. Since it uses DEFLATE it has the same compression characteristics as the zlib format.
150150
---
151-
---| '"gzip"'
151+
---| "gzip"
152152
---
153153
---Raw DEFLATE-compressed data (no header).
154154
---
155-
---| '"deflate"'
155+
---| "deflate"
156156

157157
---
158158
---Return type of various data-returning functions.
@@ -161,11 +161,11 @@ function CompressedData:getFormat() end
161161
---
162162
---Return type is ByteData.
163163
---
164-
---| '"data"'
164+
---| "data"
165165
---
166166
---Return type is string.
167167
---
168-
---| '"string"'
168+
---| "string"
169169

170170
---
171171
---Encoding format used to encode or decode data.
@@ -174,11 +174,11 @@ function CompressedData:getFormat() end
174174
---
175175
---Encode/decode data as base64 binary-to-text encoding.
176176
---
177-
---| '"base64"'
177+
---| "base64"
178178
---
179179
---Encode/decode data as hexadecimal string.
180180
---
181-
---| '"hex"'
181+
---| "hex"
182182

183183
---
184184
---Hash algorithm of love.data.hash.
@@ -187,24 +187,24 @@ function CompressedData:getFormat() end
187187
---
188188
---MD5 hash algorithm (16 bytes).
189189
---
190-
---| '"md5"'
190+
---| "md5"
191191
---
192192
---SHA1 hash algorithm (20 bytes).
193193
---
194-
---| '"sha1"'
194+
---| "sha1"
195195
---
196196
---SHA2 hash algorithm with message digest size of 224 bits (28 bytes).
197197
---
198-
---| '"sha224"'
198+
---| "sha224"
199199
---
200200
---SHA2 hash algorithm with message digest size of 256 bits (32 bytes).
201201
---
202-
---| '"sha256"'
202+
---| "sha256"
203203
---
204204
---SHA2 hash algorithm with message digest size of 384 bits (48 bytes).
205205
---
206-
---| '"sha384"'
206+
---| "sha384"
207207
---
208208
---SHA2 hash algorithm with message digest size of 512 bits (64 bytes).
209209
---
210-
---| '"sha512"'
210+
---| "sha512"

0 commit comments

Comments
 (0)