-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fs): support providing credentials for both read and read-write
- Loading branch information
Showing
4 changed files
with
33 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export type Flag = FlagRead | FlagReadWrite; | ||
/** Ability to read from a location */ | ||
export type FlagRead = 'r'; | ||
/** Ability to read and write to a location */ | ||
export type FlagReadWrite = 'rw'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
import { FileSystem } from './file.system.js'; | ||
import { Flag } from './flags.js'; | ||
|
||
export interface FileSystemProvider<T extends FileSystem = FileSystem> { | ||
/** find a file system for a given prefix */ | ||
find(prefix: URL): Promise<T | null>; | ||
/** | ||
* find a file system for a given prefix and permissions | ||
* | ||
* @param prefix location to search for | ||
* @param flag Permissions required (Read or ReadWrite) | ||
* | ||
* @returns File System with the required permission, null otherwise | ||
*/ | ||
find(prefix: URL, flag: Flag): Promise<T | null>; | ||
} |