Skip to content

Commit

Permalink
Rename RawEvent to Event
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaust committed Jan 12, 2024
1 parent 151c6df commit d6da17f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions plugins/fs/guest-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1100,16 +1100,16 @@ interface DebouncedWatchOptions extends WatchOptions {
/**
* @since 2.0.0
*/
type RawEvent = {
type: RawEventKind;
type Event = {
type: EventKind;
paths: string[];
attrs: unknown;
};

/**
* @since 2.0.0
*/
type RawEventKind =
type EventKind =
| "any "
| {
access?: unknown;
Expand Down Expand Up @@ -1141,7 +1141,7 @@ async function unwatch(rid: number): Promise<void> {
*/
async function watch(
paths: string | string[] | URL | URL[],
cb: (event: RawEvent) => void,
cb: (event: Event) => void,
options?: DebouncedWatchOptions,
): Promise<UnwatchFn> {
const opts = {
Expand All @@ -1158,7 +1158,7 @@ async function watch(
}
}

const onEvent = new Channel<RawEvent>();
const onEvent = new Channel<Event>();
onEvent.onmessage = cb;

const rid: number = await invoke("plugin:fs|watch", {
Expand All @@ -1179,7 +1179,7 @@ async function watch(
*/
async function watchImmediate(
paths: string | string[] | URL | URL[],
cb: (event: RawEvent) => void,
cb: (event: Event) => void,
options?: WatchOptions,
): Promise<UnwatchFn> {
const opts = {
Expand All @@ -1196,7 +1196,7 @@ async function watchImmediate(
}
}

const onEvent = new Channel<RawEvent>();
const onEvent = new Channel<Event>();
onEvent.onmessage = cb;

const rid: number = await invoke("plugin:fs|watch", {
Expand Down Expand Up @@ -1227,7 +1227,7 @@ export type {
FileInfo,
WatchOptions,
DebouncedWatchOptions,
RawEvent,
Event,
UnwatchFn,
};

Expand Down

0 comments on commit d6da17f

Please sign in to comment.