create-mendix-widget-gleam 2.0.13 → 2.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/package.json +5 -1
- package/src/index.mjs +22 -7
- package/src/templates/readme_md.mjs +6 -6
- package/template/docs/glendix_guide.md +204 -1
- package/template/gleam.toml +1 -1
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@command.cache +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@command.cache_inline +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@command.cache_meta +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@cursor.cache +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@cursor.cache_inline +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@cursor.cache_meta +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@event.cache +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@event.cache_inline +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@event.cache_meta +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@internal@consts.cache +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@internal@consts.cache_inline +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@internal@consts.cache_meta +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@stdout.cache +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@stdout.cache_inline +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@stdout.cache_meta +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@style.cache +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@style.cache_inline +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@style.cache_meta +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@terminal.cache +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@terminal.cache_inline +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@terminal.cache_meta +0 -0
- package/tui/build/dev/javascript/etch/etch/command.mjs +479 -0
- package/tui/build/dev/javascript/etch/etch/cursor.mjs +164 -0
- package/tui/build/dev/javascript/etch/etch/event.mjs +2399 -0
- package/tui/build/dev/javascript/etch/etch/internal/consts.mjs +3 -0
- package/tui/build/dev/javascript/etch/etch/stdout.mjs +375 -0
- package/tui/build/dev/javascript/etch/etch/style.mjs +741 -0
- package/tui/build/dev/javascript/etch/etch/terminal.mjs +137 -0
- package/tui/build/dev/javascript/etch/gleam.mjs +1 -0
- package/tui/build/dev/javascript/etch/input/event_ffi.erl +73 -0
- package/tui/build/dev/javascript/etch/input/input_ffi.mjs +192 -0
- package/tui/build/dev/javascript/etch/input/signal_handler.erl +33 -0
- package/tui/build/dev/javascript/etch/terminal/terminal_ffi.erl +22 -0
- package/tui/build/dev/javascript/etch/terminal/terminal_ffi.mjs +37 -0
- package/tui/build/dev/javascript/etch/terminal/tty_state.erl +29 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@application.cache +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@application.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@application.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@atom.cache +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@atom.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@atom.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@charlist.cache +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@charlist.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@charlist.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@node.cache +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@node.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@node.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@port.cache +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@port.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@port.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@process.cache +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@process.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@process.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@reference.cache +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@reference.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@reference.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_erlang/gleam/erlang/application.mjs +38 -0
- package/tui/build/dev/javascript/gleam_erlang/gleam/erlang/atom.mjs +2 -0
- package/tui/build/dev/javascript/gleam_erlang/gleam/erlang/charlist.mjs +1 -0
- package/tui/build/dev/javascript/gleam_erlang/gleam/erlang/node.mjs +12 -0
- package/tui/build/dev/javascript/gleam_erlang/gleam/erlang/port.mjs +1 -0
- package/tui/build/dev/javascript/gleam_erlang/gleam/erlang/process.mjs +161 -0
- package/tui/build/dev/javascript/gleam_erlang/gleam/erlang/reference.mjs +1 -0
- package/tui/build/dev/javascript/gleam_erlang/gleam.mjs +1 -0
- package/tui/build/dev/javascript/gleam_erlang/gleam@erlang@application.erl +43 -0
- package/tui/build/dev/javascript/gleam_erlang/gleam@erlang@atom.erl +94 -0
- package/tui/build/dev/javascript/gleam_erlang/gleam@erlang@charlist.erl +42 -0
- package/tui/build/dev/javascript/gleam_erlang/gleam@erlang@node.erl +80 -0
- package/tui/build/dev/javascript/gleam_erlang/gleam@erlang@port.erl +8 -0
- package/tui/build/dev/javascript/gleam_erlang/gleam@erlang@process.erl +868 -0
- package/tui/build/dev/javascript/gleam_erlang/gleam@erlang@reference.erl +21 -0
- package/tui/build/dev/javascript/gleam_erlang/gleam_erlang_ffi.erl +164 -0
- package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@array.cache +0 -0
- package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@array.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@array.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@promise.cache +0 -0
- package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@promise.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@promise.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@symbol.cache +0 -0
- package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@symbol.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@symbol.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_javascript/gleam/javascript/array.mjs +24 -0
- package/tui/build/dev/javascript/gleam_javascript/gleam/javascript/promise.mjs +105 -0
- package/tui/build/dev/javascript/gleam_javascript/gleam/javascript/symbol.mjs +7 -0
- package/tui/build/dev/javascript/gleam_javascript/gleam.mjs +1 -0
- package/tui/build/dev/javascript/gleam_javascript/gleam_javascript_ffi.mjs +133 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/dict.mjs +710 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/bit_array.mjs +286 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/bool.mjs +295 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/bytes_tree.mjs +225 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/dict.mjs +455 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/dynamic/decode.mjs +993 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/dynamic.mjs +35 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/float.mjs +528 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/function.mjs +6 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/int.mjs +764 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/io.mjs +8 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/list.mjs +3063 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/option.mjs +386 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/order.mjs +166 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/pair.mjs +96 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/result.mjs +448 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/set.mjs +413 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/string.mjs +695 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/string_tree.mjs +128 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam/uri.mjs +1151 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam.mjs +1 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@bit_array.erl +347 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@bool.erl +334 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@bytes_tree.erl +211 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@dict.erl +513 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@dynamic.erl +105 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@dynamic@decode.erl +1114 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@float.erl +711 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@function.erl +18 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@int.erl +972 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@io.erl +76 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@list.erl +2735 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@option.erl +381 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@order.erl +188 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@pair.erl +104 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@result.erl +500 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@set.erl +430 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@string.erl +964 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@string_tree.erl +202 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam@uri.erl +1042 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam_stdlib.erl +534 -0
- package/tui/build/dev/javascript/gleam_stdlib/gleam_stdlib.mjs +1133 -0
- package/tui/build/dev/javascript/gleam_version +1 -0
- package/tui/build/dev/javascript/prelude.mjs +1575 -0
- package/tui/build/dev/javascript/tui/_gleam_artefacts/tui.cache +0 -0
- package/tui/build/dev/javascript/tui/_gleam_artefacts/tui.cache_inline +0 -0
- package/tui/build/dev/javascript/tui/_gleam_artefacts/tui.cache_meta +0 -0
- package/tui/build/dev/javascript/tui/_gleam_artefacts/tui.cache_warnings +0 -0
- package/tui/build/dev/javascript/tui/_gleam_artefacts/tui@prompt.cache +0 -0
- package/tui/build/dev/javascript/tui/_gleam_artefacts/tui@prompt.cache_inline +0 -0
- package/tui/build/dev/javascript/tui/_gleam_artefacts/tui@prompt.cache_meta +0 -0
- package/tui/build/dev/javascript/tui/_gleam_artefacts/tui@prompt.cache_warnings +0 -0
- package/tui/build/dev/javascript/tui/gleam.mjs +1 -0
- package/tui/build/dev/javascript/tui/tui/prompt.mjs +521 -0
- package/tui/build/dev/javascript/tui/tui.mjs +334 -0
- package/tui/build/dev/javascript/tui/tui_ffi.mjs +32 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import * as $int from "../../gleam_stdlib/gleam/int.mjs";
|
|
2
|
+
import * as $consts from "../etch/internal/consts.mjs";
|
|
3
|
+
import { csi, esc } from "../etch/internal/consts.mjs";
|
|
4
|
+
import { CustomType as $CustomType } from "../gleam.mjs";
|
|
5
|
+
import { enter_raw, exit_raw, is_raw_mode, window_size } from "../terminal/terminal_ffi.mjs";
|
|
6
|
+
|
|
7
|
+
export { enter_raw, exit_raw, is_raw_mode, window_size };
|
|
8
|
+
|
|
9
|
+
export class All extends $CustomType {}
|
|
10
|
+
export const ClearType$All = () => new All();
|
|
11
|
+
export const ClearType$isAll = (value) => value instanceof All;
|
|
12
|
+
|
|
13
|
+
export class Purge extends $CustomType {}
|
|
14
|
+
export const ClearType$Purge = () => new Purge();
|
|
15
|
+
export const ClearType$isPurge = (value) => value instanceof Purge;
|
|
16
|
+
|
|
17
|
+
export class FromCursorDown extends $CustomType {}
|
|
18
|
+
export const ClearType$FromCursorDown = () => new FromCursorDown();
|
|
19
|
+
export const ClearType$isFromCursorDown = (value) =>
|
|
20
|
+
value instanceof FromCursorDown;
|
|
21
|
+
|
|
22
|
+
export class FromCursorUp extends $CustomType {}
|
|
23
|
+
export const ClearType$FromCursorUp = () => new FromCursorUp();
|
|
24
|
+
export const ClearType$isFromCursorUp = (value) =>
|
|
25
|
+
value instanceof FromCursorUp;
|
|
26
|
+
|
|
27
|
+
export class CurrentLine extends $CustomType {}
|
|
28
|
+
export const ClearType$CurrentLine = () => new CurrentLine();
|
|
29
|
+
export const ClearType$isCurrentLine = (value) => value instanceof CurrentLine;
|
|
30
|
+
|
|
31
|
+
export class UntilNewLine extends $CustomType {}
|
|
32
|
+
export const ClearType$UntilNewLine = () => new UntilNewLine();
|
|
33
|
+
export const ClearType$isUntilNewLine = (value) =>
|
|
34
|
+
value instanceof UntilNewLine;
|
|
35
|
+
|
|
36
|
+
export class FailedToEnterRawMode extends $CustomType {}
|
|
37
|
+
export const TerminalError$FailedToEnterRawMode = () =>
|
|
38
|
+
new FailedToEnterRawMode();
|
|
39
|
+
export const TerminalError$isFailedToEnterRawMode = (value) =>
|
|
40
|
+
value instanceof FailedToEnterRawMode;
|
|
41
|
+
|
|
42
|
+
export class FailedToExitRawMode extends $CustomType {}
|
|
43
|
+
export const TerminalError$FailedToExitRawMode = () =>
|
|
44
|
+
new FailedToExitRawMode();
|
|
45
|
+
export const TerminalError$isFailedToExitRawMode = (value) =>
|
|
46
|
+
value instanceof FailedToExitRawMode;
|
|
47
|
+
|
|
48
|
+
export class CouldNotGetWindowSize extends $CustomType {}
|
|
49
|
+
export const TerminalError$CouldNotGetWindowSize = () =>
|
|
50
|
+
new CouldNotGetWindowSize();
|
|
51
|
+
export const TerminalError$isCouldNotGetWindowSize = (value) =>
|
|
52
|
+
value instanceof CouldNotGetWindowSize;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Clears the terminal. See [`ClearType`](terminal.html#ClearType).
|
|
56
|
+
* It is prefered not to use this directly. See [`Clear`](command.html#Clear).
|
|
57
|
+
*/
|
|
58
|
+
export function clear(t) {
|
|
59
|
+
if (t instanceof All) {
|
|
60
|
+
return csi + "2J";
|
|
61
|
+
} else if (t instanceof Purge) {
|
|
62
|
+
return csi + "3J";
|
|
63
|
+
} else if (t instanceof FromCursorDown) {
|
|
64
|
+
return csi + "J";
|
|
65
|
+
} else if (t instanceof FromCursorUp) {
|
|
66
|
+
return csi + "1J";
|
|
67
|
+
} else if (t instanceof CurrentLine) {
|
|
68
|
+
return csi + "2K";
|
|
69
|
+
} else {
|
|
70
|
+
return csi + "K";
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Sets terminal title.
|
|
76
|
+
* It is prefered not to use this directly. See [`SetTitle`](command.html#SetTitle).
|
|
77
|
+
*/
|
|
78
|
+
export function set_title(s) {
|
|
79
|
+
return ((esc + "]0;") + s) + "\u{0007}";
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Disable line wrap.
|
|
84
|
+
* It is prefered not to use this directly. See [`DisableLineWrap`](command.html#DisableLineWrap).
|
|
85
|
+
*/
|
|
86
|
+
export function disable_line_wrap() {
|
|
87
|
+
return csi + "?7l";
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Enable line wrap.
|
|
92
|
+
* It is prefered not to use this directly. See [`EnableLineWrap`](command.html#EnableLineWrap).
|
|
93
|
+
*/
|
|
94
|
+
export function enable_line_wrap() {
|
|
95
|
+
return csi + "?7h";
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Scroll N rows up.
|
|
100
|
+
* It is prefered not to use this directly. See [`ScrollUp`](command.html#ScrollUp).
|
|
101
|
+
*/
|
|
102
|
+
export function scroll_up(n) {
|
|
103
|
+
return (csi + $int.to_string(n)) + "S";
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Scroll N rows down.
|
|
108
|
+
* It is prefered not to use this directly. See [`ScrollDown`](command.html#ScrollDown).
|
|
109
|
+
*/
|
|
110
|
+
export function scroll_down(n) {
|
|
111
|
+
return (csi + $int.to_string(n)) + "T";
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Enter alternative screen.
|
|
116
|
+
* It is prefered not to use this directly. See [`EnterAlternative`](command.html#EnterAlternative).
|
|
117
|
+
*/
|
|
118
|
+
export function enter_alternative() {
|
|
119
|
+
return csi + "?1049h";
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Leave alternative screen.
|
|
124
|
+
* It is prefered not to use this directly. See [`LeaveAlternative`](command.html#LeaveAlternative).
|
|
125
|
+
*/
|
|
126
|
+
export function leave_alternative() {
|
|
127
|
+
return csi + "?1049l";
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Set window size. It does not work on most modern terminals
|
|
132
|
+
* due to security issues.
|
|
133
|
+
* It is prefered not to use this directly. See [`SetSize`](command.html#SetSize).
|
|
134
|
+
*/
|
|
135
|
+
export function set_size(x, y) {
|
|
136
|
+
return ((((csi + "8;") + $int.to_string(x)) + ";") + $int.to_string(y)) + "t";
|
|
137
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../prelude.mjs";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
-module(event_ffi).
|
|
2
|
+
|
|
3
|
+
-behaviour(gen_server).
|
|
4
|
+
|
|
5
|
+
-export([start_link/0, poll/1, push/1, read/0, init/1, handle_call/3, handle_cast/2,
|
|
6
|
+
handle_info/2, terminate/2, code_change/3]).
|
|
7
|
+
|
|
8
|
+
start_link() ->
|
|
9
|
+
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
|
|
10
|
+
|
|
11
|
+
poll(TimeoutMs) when is_integer(TimeoutMs), TimeoutMs >= 0 ->
|
|
12
|
+
case whereis(?MODULE) of
|
|
13
|
+
undefined ->
|
|
14
|
+
logger:error("Event server not started. Did you forget to call event.init_event_se"
|
|
15
|
+
"rver()?"),
|
|
16
|
+
exit(event_loop_not_running);
|
|
17
|
+
_Pid ->
|
|
18
|
+
gen_server:call(?MODULE, {poll, TimeoutMs}, TimeoutMs + 50)
|
|
19
|
+
end.
|
|
20
|
+
|
|
21
|
+
read() ->
|
|
22
|
+
case whereis(?MODULE) of
|
|
23
|
+
undefined ->
|
|
24
|
+
logger:error("Event server not started. Did you forget to call event.init_event_se"
|
|
25
|
+
"rver()?"),
|
|
26
|
+
exit(event_loop_not_running);
|
|
27
|
+
_Pid ->
|
|
28
|
+
gen_server:call(?MODULE, read, infinity)
|
|
29
|
+
end.
|
|
30
|
+
|
|
31
|
+
push(Event) ->
|
|
32
|
+
gen_server:cast(?MODULE, {push, Event}).
|
|
33
|
+
|
|
34
|
+
init([]) ->
|
|
35
|
+
gen_event:add_handler(erl_signal_server, signal_handler, self()),
|
|
36
|
+
{ok, {queue:new(), none}}.
|
|
37
|
+
|
|
38
|
+
handle_call({poll, _Timeout}, _From, {Q, Waiter}) ->
|
|
39
|
+
case queue:out(Q) of
|
|
40
|
+
{empty, _} ->
|
|
41
|
+
{reply, none, {Q, Waiter}};
|
|
42
|
+
{{value, Ev}, Q2} ->
|
|
43
|
+
{reply, {some, Ev}, {Q2, Waiter}}
|
|
44
|
+
end;
|
|
45
|
+
handle_call(read, From, {Q, none}) ->
|
|
46
|
+
case queue:out(Q) of
|
|
47
|
+
{empty, _} ->
|
|
48
|
+
{noreply, {Q, From}};
|
|
49
|
+
{{value, Ev}, Q2} ->
|
|
50
|
+
{reply, {some, Ev}, {Q2, none}}
|
|
51
|
+
end;
|
|
52
|
+
handle_call(read, From, {Q, Waiter}) ->
|
|
53
|
+
gen_server:reply(From, none),
|
|
54
|
+
{reply, ok, {Q, Waiter}};
|
|
55
|
+
handle_call(_Other, _From, State) ->
|
|
56
|
+
{reply, ok, State}.
|
|
57
|
+
|
|
58
|
+
handle_cast({push, Ev}, {Q, none}) ->
|
|
59
|
+
{noreply, {queue:in(Ev, Q), none}};
|
|
60
|
+
handle_cast({push, Ev}, {Q, Waiter}) ->
|
|
61
|
+
gen_server:reply(Waiter, {some, Ev}),
|
|
62
|
+
{noreply, {Q, none}};
|
|
63
|
+
handle_cast(_Other, State) ->
|
|
64
|
+
{noreply, State}.
|
|
65
|
+
|
|
66
|
+
terminate(_Reason, _State) ->
|
|
67
|
+
ok.
|
|
68
|
+
|
|
69
|
+
code_change(_OldVsn, State, _Extra) ->
|
|
70
|
+
{ok, State}.
|
|
71
|
+
|
|
72
|
+
handle_info(_Info, State) ->
|
|
73
|
+
{noreply, State}.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { None, Some } from "../../gleam_stdlib/gleam/option.mjs";
|
|
2
|
+
import { Ok, Error } from "../gleam.mjs";
|
|
3
|
+
import { FailedToParseEvent, Resize } from "../etch/event.mjs";
|
|
4
|
+
import { window_size } from "../terminal/terminal_ffi.mjs";
|
|
5
|
+
let queue = [];
|
|
6
|
+
|
|
7
|
+
let resolvers = [];
|
|
8
|
+
|
|
9
|
+
export function get_chars(str) {
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
|
+
const wasRaw = !!process.stdin.isRaw;
|
|
12
|
+
try {
|
|
13
|
+
process.stdin.resume();
|
|
14
|
+
} catch {}
|
|
15
|
+
const onData = (data) => {
|
|
16
|
+
cleanup();
|
|
17
|
+
const buf = Buffer.isBuffer(data)
|
|
18
|
+
? data
|
|
19
|
+
: Buffer.from(String(data), "utf8");
|
|
20
|
+
let end = buf.length;
|
|
21
|
+
if (end > 0 && buf[end - 1] === 0x0a) {
|
|
22
|
+
// LF
|
|
23
|
+
end--;
|
|
24
|
+
if (end > 0 && buf[end - 1] === 0x0d) {
|
|
25
|
+
// CR
|
|
26
|
+
end--;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
resolve(Array.from(buf.slice(0, end)));
|
|
30
|
+
};
|
|
31
|
+
const onEnd = () => {
|
|
32
|
+
cleanup();
|
|
33
|
+
resolve([]);
|
|
34
|
+
};
|
|
35
|
+
const onError = (err) => {
|
|
36
|
+
cleanup();
|
|
37
|
+
reject(err);
|
|
38
|
+
};
|
|
39
|
+
function cleanup() {
|
|
40
|
+
process.stdin.off("data", onData);
|
|
41
|
+
process.stdin.off("end", onEnd);
|
|
42
|
+
process.stdin.off("error", onError);
|
|
43
|
+
try {
|
|
44
|
+
process.stdin.pause();
|
|
45
|
+
} catch {}
|
|
46
|
+
try {
|
|
47
|
+
if (!wasRaw && process.stdin.isRaw) process.stdin.setRawMode(false);
|
|
48
|
+
} catch {}
|
|
49
|
+
}
|
|
50
|
+
process.stdin.on("data", onData);
|
|
51
|
+
process.stdin.on("end", onEnd);
|
|
52
|
+
process.stdin.on("error", onError);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function push(event) {
|
|
57
|
+
if (resolvers.length > 0) {
|
|
58
|
+
const resolve = resolvers.shift();
|
|
59
|
+
resolve(new Some(event));
|
|
60
|
+
} else {
|
|
61
|
+
queue.push(new Some(event));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function poll(timeout_ms) {
|
|
66
|
+
if (queue.length > 0) {
|
|
67
|
+
return Promise.resolve(queue.shift());
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return new Promise((resolve) => {
|
|
71
|
+
const timer = setTimeout(() => {
|
|
72
|
+
const index = resolvers.indexOf(resolver);
|
|
73
|
+
if (index !== -1) {
|
|
74
|
+
resolvers.splice(index, 1);
|
|
75
|
+
}
|
|
76
|
+
resolve(new None());
|
|
77
|
+
}, timeout_ms);
|
|
78
|
+
|
|
79
|
+
const resolver = (event) => {
|
|
80
|
+
clearTimeout(timer);
|
|
81
|
+
resolve(new Some(event));
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
resolvers.push(resolver);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function read() {
|
|
89
|
+
if (queue.length > 0) {
|
|
90
|
+
return Promise.resolve(queue.shift());
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return new Promise((resolve) => {
|
|
94
|
+
resolvers.push(resolve);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function get_cursor_position() {
|
|
99
|
+
return new Promise((resolve, reject) => {
|
|
100
|
+
const wasRaw = !!process.stdin.isRaw;
|
|
101
|
+
try {
|
|
102
|
+
process.stdin.resume();
|
|
103
|
+
} catch {}
|
|
104
|
+
if (!process.stdin.isRaw) {
|
|
105
|
+
process.stdin.setRawMode(true);
|
|
106
|
+
}
|
|
107
|
+
const onData = (data) => {
|
|
108
|
+
const buf = Buffer.isBuffer(data)
|
|
109
|
+
? data
|
|
110
|
+
: Buffer.from(String(data), "utf8");
|
|
111
|
+
|
|
112
|
+
const str = buf.toString("utf8");
|
|
113
|
+
const cursorMatch = str.match(/^\x1b\[(\d+);(\d+)R/);
|
|
114
|
+
if (cursorMatch) {
|
|
115
|
+
cleanup();
|
|
116
|
+
resolve(new Ok([parseInt(cursorMatch[1]), parseInt(cursorMatch[2])]));
|
|
117
|
+
} else {
|
|
118
|
+
cleanup();
|
|
119
|
+
resolve(
|
|
120
|
+
new Error(new FailedToParseEvent("Could not get cursor position")),
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
function cleanup() {
|
|
125
|
+
process.stdin.off("data", onData);
|
|
126
|
+
try {
|
|
127
|
+
process.stdin.pause();
|
|
128
|
+
} catch {}
|
|
129
|
+
try {
|
|
130
|
+
if (!wasRaw && process.stdin.isRaw) process.stdin.setRawMode(false);
|
|
131
|
+
} catch {}
|
|
132
|
+
}
|
|
133
|
+
process.stdin.on("data", onData);
|
|
134
|
+
process.stdout.write("\x1b[6n");
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function get_keyboard_enhancement_flags_code() {
|
|
139
|
+
return new Promise((resolve, reject) => {
|
|
140
|
+
const wasRaw = !!process.stdin.isRaw;
|
|
141
|
+
try {
|
|
142
|
+
process.stdin.resume();
|
|
143
|
+
} catch {}
|
|
144
|
+
if (!process.stdin.isRaw) {
|
|
145
|
+
process.stdin.setRawMode(true);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const onData = (data) => {
|
|
149
|
+
const buf = Buffer.isBuffer(data)
|
|
150
|
+
? data
|
|
151
|
+
: Buffer.from(String(data), "utf8");
|
|
152
|
+
|
|
153
|
+
const str = buf.toString("utf8");
|
|
154
|
+
|
|
155
|
+
if (str.startsWith("\x1b[?") && str.endsWith("u")) {
|
|
156
|
+
cleanup();
|
|
157
|
+
const flagsStr = str.slice(3);
|
|
158
|
+
resolve(new Ok(flagsStr));
|
|
159
|
+
} else {
|
|
160
|
+
cleanup();
|
|
161
|
+
resolve(
|
|
162
|
+
new Error(new FailedToParseEvent("Could not get enhancement flags")),
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
function cleanup() {
|
|
168
|
+
process.stdin.off("data", onData);
|
|
169
|
+
try {
|
|
170
|
+
process.stdin.pause();
|
|
171
|
+
} catch {}
|
|
172
|
+
try {
|
|
173
|
+
if (!wasRaw && process.stdin.isRaw) process.stdin.setRawMode(false);
|
|
174
|
+
} catch {}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
process.stdin.on("data", onData);
|
|
178
|
+
process.stdout.write("\x1b[?u");
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export function handle_sigwinch() {
|
|
183
|
+
process.on("SIGWINCH", () => {
|
|
184
|
+
const size = window_size();
|
|
185
|
+
if (size instanceof Ok) {
|
|
186
|
+
const [columns, rows] = size["0"];
|
|
187
|
+
push(new Ok(new Resize(columns, rows)));
|
|
188
|
+
} else {
|
|
189
|
+
push(new Error(new CouldNotGetWindowSize()));
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
-module(signal_handler).
|
|
2
|
+
|
|
3
|
+
-behaviour(gen_event).
|
|
4
|
+
|
|
5
|
+
-export([init/1, handle_event/2, handle_info/2, code_change/3, terminate/2,
|
|
6
|
+
handle_call/2]).
|
|
7
|
+
|
|
8
|
+
init(Subject) ->
|
|
9
|
+
ok = os:set_signal(sigwinch, handle),
|
|
10
|
+
{ok, Subject}.
|
|
11
|
+
|
|
12
|
+
handle_event(sigwinch, State) ->
|
|
13
|
+
case terminal_ffi:window_size() of
|
|
14
|
+
{ok, {Cols, Rows}} ->
|
|
15
|
+
event_ffi:push({ok, {resize, Cols, Rows}});
|
|
16
|
+
_ ->
|
|
17
|
+
event_ffi:push({error, could_not_get_window_size})
|
|
18
|
+
end,
|
|
19
|
+
{ok, State};
|
|
20
|
+
handle_event(_Event, State) ->
|
|
21
|
+
{ok, State}.
|
|
22
|
+
|
|
23
|
+
handle_info(_Info, State) ->
|
|
24
|
+
{ok, State}.
|
|
25
|
+
|
|
26
|
+
handle_call(_, State) ->
|
|
27
|
+
{ok, State}.
|
|
28
|
+
|
|
29
|
+
terminate(_Reason, _State) ->
|
|
30
|
+
ok.
|
|
31
|
+
|
|
32
|
+
code_change(_Old, State, _Extra) ->
|
|
33
|
+
{ok, State}.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
-module(terminal_ffi).
|
|
2
|
+
|
|
3
|
+
-export([enter_raw/0, exit_raw/0, window_size/0]).
|
|
4
|
+
|
|
5
|
+
enter_raw() ->
|
|
6
|
+
shell:start_interactive({noshell, raw}).
|
|
7
|
+
|
|
8
|
+
exit_raw() ->
|
|
9
|
+
shell:start_interactive(noshell).
|
|
10
|
+
|
|
11
|
+
window_size() ->
|
|
12
|
+
case io:columns() of
|
|
13
|
+
{ok, Cols} ->
|
|
14
|
+
case io:rows() of
|
|
15
|
+
{ok, Rows} ->
|
|
16
|
+
{ok, {Cols, Rows}};
|
|
17
|
+
_ ->
|
|
18
|
+
{error, could_not_get_window_size}
|
|
19
|
+
end;
|
|
20
|
+
_ ->
|
|
21
|
+
{error, could_not_get_window_size}
|
|
22
|
+
end.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Ok, Error } from "../gleam.mjs";
|
|
2
|
+
import {
|
|
3
|
+
FailedToEnterRawMode,
|
|
4
|
+
FailedToExitRawMode,
|
|
5
|
+
CouldNotGetWindowSize,
|
|
6
|
+
} from "../etch/terminal.mjs";
|
|
7
|
+
|
|
8
|
+
export function enter_raw() {
|
|
9
|
+
try {
|
|
10
|
+
process.stdin.setRawMode(true);
|
|
11
|
+
return new Ok(undefined);
|
|
12
|
+
} catch (error) {
|
|
13
|
+
return new Error(new FailedToEnterRawMode());
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function exit_raw() {
|
|
18
|
+
try {
|
|
19
|
+
process.stdin.setRawMode(false);
|
|
20
|
+
return new Ok(undefined);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
return new Error(new FailedToExitRawMode());
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function is_raw_mode() {
|
|
27
|
+
return process.stdin.isRaw;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function window_size() {
|
|
31
|
+
const cols = process.stdout.columns;
|
|
32
|
+
const rows = process.stdout.rows;
|
|
33
|
+
if (cols === undefined || rows === undefined) {
|
|
34
|
+
return new Error(new CouldNotGetWindowSize());
|
|
35
|
+
}
|
|
36
|
+
return new Ok([cols, rows]);
|
|
37
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
-module(tty_state).
|
|
2
|
+
|
|
3
|
+
-export([init/0, set_raw/1, is_raw_mode/0]).
|
|
4
|
+
|
|
5
|
+
init() ->
|
|
6
|
+
case ets:whereis(tty_state) of
|
|
7
|
+
undefined ->
|
|
8
|
+
ets:new(tty_state, [named_table, public, set]),
|
|
9
|
+
ets:insert(tty_state, {raw_mode, false});
|
|
10
|
+
_ ->
|
|
11
|
+
ok
|
|
12
|
+
end.
|
|
13
|
+
|
|
14
|
+
set_raw(IsRaw) ->
|
|
15
|
+
case ets:whereis(tty_state) of
|
|
16
|
+
undefined ->
|
|
17
|
+
ets:new(tty_state, [named_table, public, set]);
|
|
18
|
+
_ ->
|
|
19
|
+
ok
|
|
20
|
+
end,
|
|
21
|
+
ets:insert(tty_state, {raw_mode, IsRaw}).
|
|
22
|
+
|
|
23
|
+
is_raw_mode() ->
|
|
24
|
+
case ets:lookup(tty_state, raw_mode) of
|
|
25
|
+
[{raw_mode, true}] ->
|
|
26
|
+
true;
|
|
27
|
+
_ ->
|
|
28
|
+
false
|
|
29
|
+
end.
|
|
Binary file
|
package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@application.cache_inline
ADDED
|
Binary file
|
package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@application.cache_meta
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@charlist.cache_inline
ADDED
|
Binary file
|
package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@charlist.cache_meta
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@process.cache_inline
ADDED
|
Binary file
|
package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@process.cache_meta
ADDED
|
Binary file
|
|
Binary file
|
package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@reference.cache_inline
ADDED
|
Binary file
|
package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@reference.cache_meta
ADDED
|
Binary file
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CustomType as $CustomType } from "../../gleam.mjs";
|
|
2
|
+
import * as $node from "../../gleam/erlang/node.mjs";
|
|
3
|
+
|
|
4
|
+
export class Normal extends $CustomType {}
|
|
5
|
+
export const StartType$Normal = () => new Normal();
|
|
6
|
+
export const StartType$isNormal = (value) => value instanceof Normal;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The application is distributed and started at the current node because of
|
|
10
|
+
* a takeover from Node, either because Erlang's `application:takeover/2`
|
|
11
|
+
* function has been called, or because the current node has higher priority
|
|
12
|
+
* than the previous node.
|
|
13
|
+
*/
|
|
14
|
+
export class Takeover extends $CustomType {
|
|
15
|
+
constructor(previous) {
|
|
16
|
+
super();
|
|
17
|
+
this.previous = previous;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export const StartType$Takeover = (previous) => new Takeover(previous);
|
|
21
|
+
export const StartType$isTakeover = (value) => value instanceof Takeover;
|
|
22
|
+
export const StartType$Takeover$previous = (value) => value.previous;
|
|
23
|
+
export const StartType$Takeover$0 = (value) => value.previous;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The application is distributed and started at the current node because of
|
|
27
|
+
* a failover from the previous node.
|
|
28
|
+
*/
|
|
29
|
+
export class Failover extends $CustomType {
|
|
30
|
+
constructor(previous) {
|
|
31
|
+
super();
|
|
32
|
+
this.previous = previous;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export const StartType$Failover = (previous) => new Failover(previous);
|
|
36
|
+
export const StartType$isFailover = (value) => value instanceof Failover;
|
|
37
|
+
export const StartType$Failover$previous = (value) => value.previous;
|
|
38
|
+
export const StartType$Failover$0 = (value) => value.previous;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CustomType as $CustomType } from "../../gleam.mjs";
|
|
2
|
+
import * as $atom from "../../gleam/erlang/atom.mjs";
|
|
3
|
+
|
|
4
|
+
export class FailedToConnect extends $CustomType {}
|
|
5
|
+
export const ConnectError$FailedToConnect = () => new FailedToConnect();
|
|
6
|
+
export const ConnectError$isFailedToConnect = (value) =>
|
|
7
|
+
value instanceof FailedToConnect;
|
|
8
|
+
|
|
9
|
+
export class LocalNodeIsNotAlive extends $CustomType {}
|
|
10
|
+
export const ConnectError$LocalNodeIsNotAlive = () => new LocalNodeIsNotAlive();
|
|
11
|
+
export const ConnectError$isLocalNodeIsNotAlive = (value) =>
|
|
12
|
+
value instanceof LocalNodeIsNotAlive;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|