1 module spasm.bindings.console;
2 
3 import spasm.types;
4 @safe:
5 nothrow:
6 
7 struct console {
8   nothrow:
9   static:
10   void assert_(T1)(bool condition /* = false */, scope auto ref T1 data) {
11     Handle _handle_data = getOrCreateHandle(data);
12     console_assert(condition, _handle_data);
13     dropHandle!(T1)(_handle_data);
14   }
15   void clear()() {
16     console_clear();
17   }
18   void debug_(T0)(scope auto ref T0 data) {
19     Handle _handle_data = getOrCreateHandle(data);
20     console_debug(_handle_data);
21     dropHandle!(T0)(_handle_data);
22   }
23   void error(T0)(scope auto ref T0 data) {
24     Handle _handle_data = getOrCreateHandle(data);
25     console_error(_handle_data);
26     dropHandle!(T0)(_handle_data);
27   }
28   void info(T0)(scope auto ref T0 data) {
29     Handle _handle_data = getOrCreateHandle(data);
30     console_info(_handle_data);
31     dropHandle!(T0)(_handle_data);
32   }
33   void log(T0)(scope auto ref T0 data) {
34     Handle _handle_data = getOrCreateHandle(data);
35     console_log(_handle_data);
36     dropHandle!(T0)(_handle_data);
37   }
38   void table(T0)(scope auto ref T0 tabularData, scope ref Sequence!(string) properties) {
39     Handle _handle_tabularData = getOrCreateHandle(tabularData);
40     console_table(_handle_tabularData, properties.handle);
41     dropHandle!(T0)(_handle_tabularData);
42   }
43   void table(T0)(scope auto ref T0 tabularData) {
44     Handle _handle_tabularData = getOrCreateHandle(tabularData);
45     console_table_0(_handle_tabularData);
46     dropHandle!(T0)(_handle_tabularData);
47   }
48   void trace(T0)(scope auto ref T0 data) {
49     Handle _handle_data = getOrCreateHandle(data);
50     console_trace(_handle_data);
51     dropHandle!(T0)(_handle_data);
52   }
53   void warn(T0)(scope auto ref T0 data) {
54     Handle _handle_data = getOrCreateHandle(data);
55     console_warn(_handle_data);
56     dropHandle!(T0)(_handle_data);
57   }
58   void dir(T0, T1)(scope auto ref T0 item, scope auto ref Optional!(T1) options) if (isTOrPointer!(T1, JsObject)) {
59     Handle _handle_item = getOrCreateHandle(item);
60     console_dir(_handle_item, !options.empty, options.front.handle);
61     dropHandle!(T0)(_handle_item);
62   }
63   void dir(T0)(scope auto ref T0 item) {
64     Handle _handle_item = getOrCreateHandle(item);
65     console_dir_0(_handle_item);
66     dropHandle!(T0)(_handle_item);
67   }
68   void dirxml(T0)(scope auto ref T0 data) {
69     Handle _handle_data = getOrCreateHandle(data);
70     console_dirxml(_handle_data);
71     dropHandle!(T0)(_handle_data);
72   }
73   void count()(string label /* = "default" */) {
74     console_count(label);
75   }
76   void count()() {
77     console_count_0();
78   }
79   void countReset()(string label /* = "default" */) {
80     console_countReset(label);
81   }
82   void countReset()() {
83     console_countReset_0();
84   }
85   void group(T0)(scope auto ref T0 data) {
86     Handle _handle_data = getOrCreateHandle(data);
87     console_group(_handle_data);
88     dropHandle!(T0)(_handle_data);
89   }
90   void groupCollapsed(T0)(scope auto ref T0 data) {
91     Handle _handle_data = getOrCreateHandle(data);
92     console_groupCollapsed(_handle_data);
93     dropHandle!(T0)(_handle_data);
94   }
95   void groupEnd()() {
96     console_groupEnd();
97   }
98   void time()(string label /* = "default" */) {
99     console_time(label);
100   }
101   void time()() {
102     console_time_0();
103   }
104   void timeLog(T1)(string label /* = "default" */, scope auto ref T1 data) {
105     Handle _handle_data = getOrCreateHandle(data);
106     console_timeLog(label, _handle_data);
107     dropHandle!(T1)(_handle_data);
108   }
109   void timeEnd()(string label /* = "default" */) {
110     console_timeEnd(label);
111   }
112   void timeEnd()() {
113     console_timeEnd_0();
114   }
115 }
116 
117 
118 extern (C) void console_assert(bool, Handle);
119 extern (C) void console_clear();
120 extern (C) void console_debug(Handle);
121 extern (C) void console_error(Handle);
122 extern (C) void console_info(Handle);
123 extern (C) void console_log(Handle);
124 extern (C) void console_table(Handle, Handle);
125 extern (C) void console_table_0(Handle);
126 extern (C) void console_trace(Handle);
127 extern (C) void console_warn(Handle);
128 extern (C) void console_dir(Handle, bool, Handle);
129 extern (C) void console_dir_0(Handle);
130 extern (C) void console_dirxml(Handle);
131 extern (C) void console_count(string);
132 extern (C) void console_count_0();
133 extern (C) void console_countReset(string);
134 extern (C) void console_countReset_0();
135 extern (C) void console_group(Handle);
136 extern (C) void console_groupCollapsed(Handle);
137 extern (C) void console_groupEnd();
138 extern (C) void console_time(string);
139 extern (C) void console_time_0();
140 extern (C) void console_timeLog(string, Handle);
141 extern (C) void console_timeEnd(string);
142 extern (C) void console_timeEnd_0();