onGetCapabilityRequested property

EventStream<OnGetCapabilityRequestedEvent> get onGetCapabilityRequested

Event fired when print manager requests printer capabilities. |printerId|: Unique ID of the printer whose capabilities are requested. |resultCallback|: Callback to return device capabilities in CDD format. The receiving listener must call callback exectly once.

Implementation

EventStream<OnGetCapabilityRequestedEvent> get onGetCapabilityRequested =>
    $js.chrome.printerProvider.onGetCapabilityRequested.asStream(($c) => (
          String printerId,
          $js.CapabilitiesCallback resultCallback,
        ) {
          return $c(OnGetCapabilityRequestedEvent(
            printerId: printerId,
            resultCallback: (Map capabilities) {
              //ignore: avoid_dynamic_calls
              (resultCallback as Function)(capabilities.jsify()!);
            },
          ));
        });