-
Notifications
You must be signed in to change notification settings - Fork 434
/
ltn12.d.tl
45 lines (39 loc) · 1.4 KB
/
ltn12.d.tl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
local record ltn12
type Filter = function(string): string, string
type Sink = function(string, string): boolean, string
type Source = function(): string, string
type FancySink = function(string, string): boolean, string | FancySink
type FancySource = function(): string, string | FancySource
-- Docs just say returns a truthy value on success
-- Since this value should really only be
-- used to check for truthiness, any seems fine here
type Pump = function(Source, Sink): any, string
record filter
chain: function(Filter, Filter, ...: Filter): Filter
cycle: function(string, string, any): Filter
end
record pump
all: Pump
step: Pump
end
record sink
chain: function(Filter, Sink): Sink
error: function(string): Sink
file: function(FILE, string): Sink
null: function(): Sink
simplify: function(FancySink): Sink
table: function({string}): Sink, {string}
end
record source
cat: function(Source, ...: Source): Source
chain: function(Source, Filter): Source
empty: function(): Source
error: function(string): Source
file: function(FILE): Source
file: function(FILE, string): Source
simplify: function(FancySource): Source
string: function(string): Source
table: function({string}): Source, {string}
end
end
return ltn12