fix(types): some issues found in pl definitions
ci/woodpecker/push/lint Pipeline was successful Details
ci/woodpecker/pr/lint Pipeline was successful Details
ci/woodpecker/push/build Pipeline failed Details
ci/woodpecker/pr/build Pipeline failed Details

This commit is contained in:
Aire-One 2022-10-02 20:55:02 +02:00
parent 0efc55445c
commit 978ac20387
1 changed files with 8 additions and 3 deletions

View File

@ -4,11 +4,13 @@ local record pl
-- and just reexported in the right file
record List<T>
{T}
-- {T}
new: function({T}): pl.List<T>
metamethod __call: function<T>(pl.List, {T}): pl.List<T>
metamethod __call: function<T>(any, {T}): pl.List<T>
metamethod __concat: function(pl.List<T>, pl.List<T>): pl.List<T>
metamethod __len: function(pl.List<T>): number
metamethod __index: function(pl.List<T>, number): T
range: function(number, number, number): pl.List<number>
split: function(string, string): pl.List<string>
@ -370,6 +372,8 @@ local record pl
record file
-- TODO copy declarations from other functions
-- this whole module is just renaming of other functions
read: function(string, boolean): string | nil, string
write: function(filename: string, str: string, is_bin: boolean): boolean | nil, string
end
record func
@ -902,6 +906,7 @@ local record pl
filter: function<T>({T}, (function(T): boolean)): pl.List<T>
filter: function<T, A>({T}, (function(T, A): boolean), A): pl.List<T>
foreach: function<T>({ T }, function(T))
foreach: function<K, V>((function(V, K)), {K: V})
foreach: function<K, V, A>((function(V, K, A)), {K: V}, A)
foreachi: function<V>((function(V, number)), {V})
@ -935,7 +940,7 @@ local record pl
'debug'
end
substitute: function(string, table): string
substitute: function(string, table): string, string, string
compile: function(string, {pl.template.CompileOpt: any}): pl.template.CompiledTemplate, string, string
end