From 2b70116b944dec1a6946c4aa1a2c8aa0d07667a6 Mon Sep 17 00:00:00 2001 From: V1K1NGbg Date: Thu, 1 Aug 2024 12:40:10 +0300 Subject: started api + slight changes to manifest and rockspec --- src/luarocks/type/manifest.tl | 3 ++- src/luarocks/type/rockspec.tl | 3 ++- src/luarocks/upload/api.tl | 4 ++-- src/luarocks/upload/multipart.tl | 8 ++++---- src/luarocks/vendor/dkjson.d.tl | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/luarocks/type/manifest.tl b/src/luarocks/type/manifest.tl index 043366ea..f8d53b42 100644 --- a/src/luarocks/type/manifest.tl +++ b/src/luarocks/type/manifest.tl @@ -1,4 +1,5 @@ -local type_manifest = {} +local record type_manifest +end local type_check = require("luarocks.type_check") diff --git a/src/luarocks/type/rockspec.tl b/src/luarocks/type/rockspec.tl index 0b3cf31f..8595f4a9 100644 --- a/src/luarocks/type/rockspec.tl +++ b/src/luarocks/type/rockspec.tl @@ -1,4 +1,5 @@ -local type_rockspec = {} +local record type_rockspec +end local type_check = require("luarocks.type_check") diff --git a/src/luarocks/upload/api.tl b/src/luarocks/upload/api.tl index 7c643c43..fd837fd8 100644 --- a/src/luarocks/upload/api.tl +++ b/src/luarocks/upload/api.tl @@ -90,9 +90,9 @@ function Api:method(...) return res end -function Api.raw_method(self: Api, path, ...) --! path, ... type +function Api.raw_method(self: Api, path: string, ...) --! path, ... type self:check_version() - local url = tostring(self.config.server) .. "/api/" .. tostring(cfg.upload.api_version) .. "/" .. tostring(self.config.key) .. "/" .. tostring(path) + local url = tostring(self.config.server) .. "/api/" .. tostring(cfg.upload.api_version) .. "/" .. tostring(self.config.key) .. "/" .. path return self:request(url, ...) end diff --git a/src/luarocks/upload/multipart.tl b/src/luarocks/upload/multipart.tl index 0ba8ab8a..d6a5c012 100644 --- a/src/luarocks/upload/multipart.tl +++ b/src/luarocks/upload/multipart.tl @@ -105,12 +105,12 @@ function multipart.encode(params: TableMap): string, string --! "\r\n", "--", boundary, "--", "\r\n" }), boundary end -function multipart.new_file(fname, mime) - local self = {} +function multipart.new_file(fname: string, mime: string): File --! TEMP + local self: File = {} setmetatable(self, { __index = File }) - self.__class = File + self.__class = File --! self.fname = fname - self.mimetype = mime + self.mimetype = mime --TEMP return self end diff --git a/src/luarocks/vendor/dkjson.d.tl b/src/luarocks/vendor/dkjson.d.tl index dbe94e70..4dee43d3 100644 --- a/src/luarocks/vendor/dkjson.d.tl +++ b/src/luarocks/vendor/dkjson.d.tl @@ -15,7 +15,7 @@ local record dkjson end encode: function({string:any}, JsonState): string - decode: function(string, number, any, table): {string:any} + decode: function(string, ?number, ?any, ?table): {string:any} null: table -- cgit v1.2.3-55-g6feb