2525 {
2626 if (firstRender )
2727 {
28- var domString = await HttpClient .GetStringAsync (" https://wicg.github.io/file-system-access/" );
28+ var domString = await HttpClient .GetStringAsync (" https://wicg.github.io/file-system-access/#idl-index " );
2929
3030 var dom = new HtmlDocument ();
3131 dom .LoadHtml (domString );
4040 var supportedIndex = 0 ;
4141 while (fetchedIndex < fetchedLines .Length || supportedIndex < supportedLines .Length )
4242 {
43+ var color = " pink" ;
4344 if (fetchedIndex == fetchedLines .Length )
4445 {
45- compareLines . Add ( $""" <span style="background-color:blue;">{ supportedLines [ supportedIndex ]}</span> """ ) ;
46+ color = " cyan " ;
4647 supportedIndex ++ ;
48+ fetchedIndex -- ;
4749 }
4850 else if (supportedIndex == supportedLines .Length )
4951 {
50- compareLines .Add ($""" <span style="background-color:orange;">{fetchedLines [fetchedIndex ]}</span>""" );
51- fetchedIndex ++ ;
52+ color = " lemonchiffon" ;
5253 }
5354 else if (fetchedLines [fetchedIndex ].Trim () == supportedLines [supportedIndex ].Trim ())
5455 {
55- compareLines .Add ($""" <span style="background-color:lightgreen;">{fetchedLines [fetchedIndex ]}</span>""" );
56- fetchedIndex ++ ;
56+ color = " lightgreen" ;
5757 supportedIndex ++ ;
5858 }
59- else
60- {
61- compareLines .Add ($""" <span style="background-color:pink;">{fetchedLines [fetchedIndex ]}</span>""" );
62- fetchedIndex ++ ;
63- }
59+ compareLines .Add ($""" <span style="background-color:{color };display:block;min-height:21px;">{fetchedLines [fetchedIndex ++ ]}</span>""" );
6460 }
65- compareText = string .Join (" \n " , compareLines );
61+ compareText = string .Join (" " , compareLines );
6662 StateHasChanged ();
6763 }
6864 }
6965
7066 private const string currentlySupportedWebIDL =
71- @" enum FileSystemPermissionMode {
67+ @" enum FileSystemPermissionMode {
7268 "" read"" ,
7369 "" readwrite""
7470};
@@ -82,78 +78,12 @@ dictionary FileSystemHandlePermissionDescriptor {
8278 FileSystemPermissionMode mode = "" read"" ;
8379};
8480
85- enum FileSystemHandleKind {
86- "" file"" ,
87- "" directory"" ,
88- };
89-
9081[Exposed=(Window,Worker), SecureContext, Serializable]
91- interface FileSystemHandle {
92- readonly attribute FileSystemHandleKind kind;
93- readonly attribute USVString name;
94-
95- Promise<boolean> isSameEntry(FileSystemHandle other);
96-
82+ partial interface FileSystemHandle {
9783 Promise<PermissionState> queryPermission(optional FileSystemHandlePermissionDescriptor descriptor = {});
9884 Promise<PermissionState> requestPermission(optional FileSystemHandlePermissionDescriptor descriptor = {});
9985};
10086
101- dictionary FileSystemCreateWritableOptions {
102- boolean keepExistingData = false;
103- };
104-
105- [Exposed=(Window,Worker), SecureContext, Serializable]
106- interface FileSystemFileHandle : FileSystemHandle {
107- Promise<File> getFile();
108- Promise<FileSystemWritableFileStream> createWritable(optional FileSystemCreateWritableOptions options = {});
109- };
110-
111- dictionary FileSystemGetFileOptions {
112- boolean create = false;
113- };
114-
115- dictionary FileSystemGetDirectoryOptions {
116- boolean create = false;
117- };
118-
119- dictionary FileSystemRemoveOptions {
120- boolean recursive = false;
121- };
122-
123- [Exposed=(Window,Worker), SecureContext, Serializable]
124- interface FileSystemDirectoryHandle : FileSystemHandle {
125- async iterable<USVString, FileSystemHandle>;
126-
127- Promise<FileSystemFileHandle> getFileHandle(USVString name, optional FileSystemGetFileOptions options = {});
128- Promise<FileSystemDirectoryHandle> getDirectoryHandle(USVString name, optional FileSystemGetDirectoryOptions options = {});
129-
130- Promise<undefined> removeEntry(USVString name, optional FileSystemRemoveOptions options = {});
131-
132- Promise<sequence<USVString>?> resolve(FileSystemHandle possibleDescendant);
133- };
134-
135- enum WriteCommandType {
136- "" write"" ,
137- "" seek"" ,
138- "" truncate"" ,
139- };
140-
141- dictionary WriteParams {
142- required WriteCommandType type;
143- unsigned long long? size;
144- unsigned long long? position;
145- (BufferSource or Blob or USVString)? data;
146- };
147-
148- typedef (BufferSource or Blob or USVString or WriteParams) FileSystemWriteChunkType;
149-
150- [Exposed=(Window,Worker), SecureContext]
151- interface FileSystemWritableFileStream : WritableStream {
152- Promise<undefined> write(FileSystemWriteChunkType data);
153- Promise<undefined> seek(unsigned long long position);
154- Promise<undefined> truncate(unsigned long long size);
155- };
156-
15787enum WellKnownDirectory {
15888 "" desktop"" ,
15989 "" documents"" ,
@@ -196,11 +126,6 @@ partial interface Window {
196126 Promise<sequence<FileSystemFileHandle>> showOpenFilePicker(optional OpenFilePickerOptions options = {});
197127 Promise<FileSystemFileHandle> showSaveFilePicker(optional SaveFilePickerOptions options = {});
198128 Promise<FileSystemDirectoryHandle> showDirectoryPicker(optional DirectoryPickerOptions options = {});
199- };
200-
201- [SecureContext]
202- partial interface StorageManager {
203- Promise<FileSystemDirectoryHandle> getDirectory();
204129};" ;
205130
206131}
0 commit comments