-module(automata@fsevent).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/automata/fsevent.gleam").
-export([normalize/1, path_to_string/1, path_segments/1, path_is_absolute/1, path_starts_with/2, entry_file/6, entry_directory/4, entry_symlink/4, empty_snapshot/0, from_entries/1, add_entry/2, lookup/2, snapshot_size/1, watch/0, watch_all_ops/0, watch_no_ops/0, watch_op/2, unwatch_op/2, with_ops/2, created/1, written/1, removed/1, chmoded/1, renamed/2, event_path/1, event_ops/1, event_has/2, event_renamed_from/1, diff/3]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
-file("src/automata/fsevent.gleam", 48).
?DOC(" Canonicalise a string into a `NormalizedPath`.\n").
-spec normalize(binary()) -> {ok, automata@fsevent@path:normalized_path()} |
{error, automata@fsevent@ast:fsevent_error()}.
normalize(Path) ->
automata@fsevent@path:normalize(Path).
-file("src/automata/fsevent.gleam", 52).
-spec path_to_string(automata@fsevent@path:normalized_path()) -> binary().
path_to_string(Path) ->
automata@fsevent@path:path_to_string(Path).
-file("src/automata/fsevent.gleam", 56).
-spec path_segments(automata@fsevent@path:normalized_path()) -> list(binary()).
path_segments(Path) ->
automata@fsevent@path:path_segments(Path).
-file("src/automata/fsevent.gleam", 60).
-spec path_is_absolute(automata@fsevent@path:normalized_path()) -> boolean().
path_is_absolute(Path) ->
automata@fsevent@path:path_is_absolute(Path).
-file("src/automata/fsevent.gleam", 64).
-spec path_starts_with(
automata@fsevent@path:normalized_path(),
automata@fsevent@path:normalized_path()
) -> boolean().
path_starts_with(Path, Prefix) ->
automata@fsevent@path:path_starts_with(Path, Prefix).
-file("src/automata/fsevent.gleam", 76).
?DOC(
" Build a `File` entry. `mtime` is unit-less; the differ only checks\n"
" equality, so pick a unit (seconds, milliseconds, nanoseconds, ...)\n"
" and use it consistently across snapshots.\n"
).
-spec entry_file(
automata@fsevent@path:normalized_path(),
integer(),
integer(),
integer(),
gleam@option:option(binary()),
gleam@option:option(binary())
) -> {ok, automata@fsevent@entry:entry()} |
{error, automata@fsevent@ast:fsevent_error()}.
entry_file(Path, Size, Mtime, Mode, Content_hash, File_id) ->
automata@fsevent@entry:entry_file(
Path,
Size,
Mtime,
Mode,
Content_hash,
File_id
).
-file("src/automata/fsevent.gleam", 94).
-spec entry_directory(
automata@fsevent@path:normalized_path(),
integer(),
integer(),
gleam@option:option(binary())
) -> {ok, automata@fsevent@entry:entry()} |
{error, automata@fsevent@ast:fsevent_error()}.
entry_directory(Path, Mtime, Mode, File_id) ->
automata@fsevent@entry:entry_directory(Path, Mtime, Mode, File_id).
-file("src/automata/fsevent.gleam", 108).
-spec entry_symlink(
automata@fsevent@path:normalized_path(),
integer(),
integer(),
gleam@option:option(binary())
) -> {ok, automata@fsevent@entry:entry()} |
{error, automata@fsevent@ast:fsevent_error()}.
entry_symlink(Path, Mtime, Mode, File_id) ->
automata@fsevent@entry:entry_symlink(Path, Mtime, Mode, File_id).
-file("src/automata/fsevent.gleam", 119).
-spec empty_snapshot() -> automata@fsevent@snapshot:snapshot().
empty_snapshot() ->
automata@fsevent@snapshot:empty_snapshot().
-file("src/automata/fsevent.gleam", 123).
-spec from_entries(list(automata@fsevent@entry:entry())) -> {ok,
automata@fsevent@snapshot:snapshot()} |
{error, automata@fsevent@ast:fsevent_error()}.
from_entries(Entries) ->
automata@fsevent@snapshot:from_entries(Entries).
-file("src/automata/fsevent.gleam", 129).
-spec add_entry(
automata@fsevent@snapshot:snapshot(),
automata@fsevent@entry:entry()
) -> {ok, automata@fsevent@snapshot:snapshot()} |
{error, automata@fsevent@ast:fsevent_error()}.
add_entry(Snapshot, Entry) ->
automata@fsevent@snapshot:add_entry(Snapshot, Entry).
-file("src/automata/fsevent.gleam", 136).
-spec lookup(
automata@fsevent@snapshot:snapshot(),
automata@fsevent@path:normalized_path()
) -> gleam@option:option(automata@fsevent@entry:entry()).
lookup(Snapshot, Path) ->
automata@fsevent@snapshot:lookup(Snapshot, Path).
-file("src/automata/fsevent.gleam", 143).
-spec snapshot_size(automata@fsevent@snapshot:snapshot()) -> integer().
snapshot_size(Snapshot) ->
automata@fsevent@snapshot:snapshot_size(Snapshot).
-file("src/automata/fsevent.gleam", 150).
?DOC(" Default `Watch`: subscribed to every op.\n").
-spec watch() -> automata@fsevent@watch:watch().
watch() ->
automata@fsevent@watch:watch().
-file("src/automata/fsevent.gleam", 154).
-spec watch_all_ops() -> automata@fsevent@watch:watch().
watch_all_ops() ->
automata@fsevent@watch:watch_all_ops().
-file("src/automata/fsevent.gleam", 158).
-spec watch_no_ops() -> automata@fsevent@watch:watch().
watch_no_ops() ->
automata@fsevent@watch:watch_no_ops().
-file("src/automata/fsevent.gleam", 162).
-spec watch_op(automata@fsevent@watch:watch(), automata@fsevent@ast:op()) -> automata@fsevent@watch:watch().
watch_op(Watch, Op) ->
automata@fsevent@watch:watch_op(Watch, Op).
-file("src/automata/fsevent.gleam", 166).
-spec unwatch_op(automata@fsevent@watch:watch(), automata@fsevent@ast:op()) -> automata@fsevent@watch:watch().
unwatch_op(Watch, Op) ->
automata@fsevent@watch:unwatch_op(Watch, Op).
-file("src/automata/fsevent.gleam", 170).
-spec with_ops(
automata@fsevent@watch:watch(),
gleam@set:set(automata@fsevent@ast:op())
) -> automata@fsevent@watch:watch().
with_ops(Watch, Ops) ->
automata@fsevent@watch:with_ops(Watch, Ops).
-file("src/automata/fsevent.gleam", 176).
-spec created(automata@fsevent@path:normalized_path()) -> automata@fsevent@event:watch_event().
created(Path) ->
automata@fsevent@event:created(Path).
-file("src/automata/fsevent.gleam", 180).
-spec written(automata@fsevent@path:normalized_path()) -> automata@fsevent@event:watch_event().
written(Path) ->
automata@fsevent@event:written(Path).
-file("src/automata/fsevent.gleam", 184).
-spec removed(automata@fsevent@path:normalized_path()) -> automata@fsevent@event:watch_event().
removed(Path) ->
automata@fsevent@event:removed(Path).
-file("src/automata/fsevent.gleam", 188).
-spec chmoded(automata@fsevent@path:normalized_path()) -> automata@fsevent@event:watch_event().
chmoded(Path) ->
automata@fsevent@event:chmoded(Path).
-file("src/automata/fsevent.gleam", 192).
-spec renamed(
automata@fsevent@path:normalized_path(),
automata@fsevent@path:normalized_path()
) -> automata@fsevent@event:watch_event().
renamed(To, From) ->
automata@fsevent@event:renamed(To, From).
-file("src/automata/fsevent.gleam", 196).
-spec event_path(automata@fsevent@event:watch_event()) -> automata@fsevent@path:normalized_path().
event_path(Event) ->
automata@fsevent@event:event_path(Event).
-file("src/automata/fsevent.gleam", 200).
-spec event_ops(automata@fsevent@event:watch_event()) -> gleam@set:set(automata@fsevent@ast:op()).
event_ops(Event) ->
automata@fsevent@event:event_ops(Event).
-file("src/automata/fsevent.gleam", 204).
-spec event_has(automata@fsevent@event:watch_event(), automata@fsevent@ast:op()) -> boolean().
event_has(Event, Op) ->
automata@fsevent@event:event_has(Event, Op).
-file("src/automata/fsevent.gleam", 208).
-spec event_renamed_from(automata@fsevent@event:watch_event()) -> gleam@option:option(automata@fsevent@path:normalized_path()).
event_renamed_from(Event) ->
automata@fsevent@event:event_renamed_from(Event).
-file("src/automata/fsevent.gleam", 216).
?DOC(
" Compute the events emitted when `prev` is replaced by `curr` under\n"
" the subscription described by `watch`.\n"
).
-spec diff(
automata@fsevent@snapshot:snapshot(),
automata@fsevent@snapshot:snapshot(),
automata@fsevent@watch:watch()
) -> list(automata@fsevent@event:watch_event()).
diff(Prev, Curr, Watch) ->
automata@fsevent@diff:diff(Prev, Curr, Watch).