From 978ac20387ff3f904fc9efa773a96c9f258a2c8e Mon Sep 17 00:00:00 2001 From: Aire-One Date: Sun, 2 Oct 2022 20:55:02 +0200 Subject: [PATCH] fix(types): some issues found in pl definitions --- types/pl.d.tl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/types/pl.d.tl b/types/pl.d.tl index f7ac803..171e19a 100644 --- a/types/pl.d.tl +++ b/types/pl.d.tl @@ -4,11 +4,13 @@ local record pl -- and just reexported in the right file record List - {T} + -- {T} new: function({T}): pl.List - metamethod __call: function(pl.List, {T}): pl.List + metamethod __call: function(any, {T}): pl.List metamethod __concat: function(pl.List, pl.List): pl.List + metamethod __len: function(pl.List): number + metamethod __index: function(pl.List, number): T range: function(number, number, number): pl.List split: function(string, string): pl.List @@ -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}, (function(T): boolean)): pl.List filter: function({T}, (function(T, A): boolean), A): pl.List + foreach: function({ T }, function(T)) foreach: function((function(V, K)), {K: V}) foreach: function((function(V, K, A)), {K: V}, A) foreachi: function((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