diff options
Diffstat (limited to 'types/ltn12.d.tl')
-rw-r--r-- | types/ltn12.d.tl | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/types/ltn12.d.tl b/types/ltn12.d.tl new file mode 100644 index 00000000..cd2375fc --- /dev/null +++ b/types/ltn12.d.tl | |||
@@ -0,0 +1,45 @@ | |||
1 | |||
2 | local record ltn12 | ||
3 | type Filter = function(string): string, string | ||
4 | type Sink = function(string, string): boolean, string | ||
5 | type Source = function(): string, string | ||
6 | |||
7 | type FancySink = function(string, string): boolean, string | FancySink | ||
8 | type FancySource = function(): string, string | FancySource | ||
9 | |||
10 | -- Docs just say returns a truthy value on success | ||
11 | -- Since this value should really only be | ||
12 | -- used to check for truthiness, any seems fine here | ||
13 | type Pump = function(Source, Sink): any, string | ||
14 | |||
15 | record filter | ||
16 | chain: function(Filter, Filter, ...: Filter): Filter | ||
17 | |||
18 | cycle: function(string, string, any): Filter | ||
19 | end | ||
20 | record pump | ||
21 | all: Pump | ||
22 | step: Pump | ||
23 | end | ||
24 | record sink | ||
25 | chain: function(Filter, Sink): Sink | ||
26 | error: function(string): Sink | ||
27 | file: function(FILE, string): Sink | ||
28 | null: function(): Sink | ||
29 | simplify: function(FancySink): Sink | ||
30 | table: function({string}): Sink, {string} | ||
31 | end | ||
32 | record source | ||
33 | cat: function(Source, ...: Source): Source | ||
34 | chain: function(Source, Filter): Source | ||
35 | empty: function(): Source | ||
36 | error: function(string): Source | ||
37 | file: function(FILE): Source | ||
38 | file: function(FILE, string): Source | ||
39 | simplify: function(FancySource): Source | ||
40 | string: function(string): Source | ||
41 | table: function({string}): Source, {string} | ||
42 | end | ||
43 | end | ||
44 | |||
45 | return ltn12 \ No newline at end of file | ||