tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[feat] Better FsScope Event informations

Open OrIOg opened this issue 2 years ago • 1 comments

Describe the problem

Using FsScope Event when using the persisted-scope plugin(monorepo), I found the event data a bit lacking. We are only given the allowed/forbidden path.

Describe the solution you'd like

It would be useful to also get other information like:

  • Is it a file, a directory ?
  • In the case of a directory, is it recursive ?

An idea would be:

#[derive(Debug, Clone)]
pub enum FsEvent {
  /// A path has been allowed.
  PathAllowed(FsEventData),
  /// A path has been forbidden.
  PathForbidden(FsEventData),
}

struct FsEventData {
  path: PathBuf
  target: TargetType
}

enum TargetType {
  File,
  // isRecursive ?
  Directory(bool)
}

But I might be forgetting something that could be useful to add.

I'll be happy to help for this feature

Alternatives considered

No response

Additional context

No response

OrIOg avatar Dec 19 '22 23:12 OrIOg