onReadDirectoryRequested property

EventStream<OnReadDirectoryRequestedEvent> get onReadDirectoryRequested

Raised when contents of a directory at directoryPath are requested. The results must be returned in chunks by calling the successCallback several times. In case of an error, errorCallback must be called.

Implementation

EventStream<OnReadDirectoryRequestedEvent> get onReadDirectoryRequested =>
    $js.chrome.fileSystemProvider.onReadDirectoryRequested.asStream(($c) => (
          $js.ReadDirectoryRequestedOptions options,
          $js.EntriesCallback successCallback,
          $js.ProviderErrorCallback errorCallback,
        ) {
          return $c(OnReadDirectoryRequestedEvent(
            options: ReadDirectoryRequestedOptions.fromJS(options),
            successCallback: (List<EntryMetadata> entries, bool hasMore) {
              //ignore: avoid_dynamic_calls
              (successCallback as Function)(
                  entries.toJSArray((e) => e.toJS), hasMore);
            },
            errorCallback: (ProviderError error) {
              //ignore: avoid_dynamic_calls
              (errorCallback as Function)(error.toJS);
            },
          ));
        }.toJS);