Skip to content

Commit

Permalink
Add full type definition for EventKind
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaust committed Jan 13, 2024
1 parent d6da17f commit 0890c2d
Showing 1 changed file with 51 additions and 12 deletions.
63 changes: 51 additions & 12 deletions plugins/fs/guest-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1110,20 +1110,59 @@ type Event = {
* @since 2.0.0
*/
type EventKind =
| "any "
| {
access?: unknown;
}
| {
create?: unknown;
}
| {
modify?: unknown;
}
| "any"
| { access: EventKindAccess }
| { create: EventKindCreate }
| { modify: EventKindModify }
| { remove: EventKindRemove }
| "other";

/**
* @since 2.0.0
*/
type EventKindAccess =
| { kind: "any" }
| { kind: "close"; mode: "any" | "execute" | "read" | "write" | "other" }
| { kind: "open"; mode: "any" | "execute" | "read" | "write" | "other" }
| { kind: "other" };

/**
* @since 2.0.0
*/
type EventKindCreate =
| { kind: "any" }
| { kind: "file" }
| { kind: "folder" }
| { kind: "other" };

/**
* @since 2.0.0
*/
type EventKindModify =
| { kind: "any" }
| { kind: "data"; mode: "any" | "size" | "content" | "other" }
| {
remove?: unknown;
kind: "metadata";
mode:
| "any"
| "access-time"
| "write-time"
| "permissions"
| "ownership"
| "extended"
| "other";
}
| "other";
| { kind: "name"; mode: "any" | "to" | "from" | "both" | "other" }
| { kind: "other" };

/**
* @since 2.0.0
*/
type EventKindRemove =
| { kind: "any" }
| { kind: "file" }
| { kind: "folder" }
| { kind: "other" };

/**
* @since 2.0.0
Expand Down

0 comments on commit 0890c2d

Please sign in to comment.