diff --git a/CHANGELOG.md b/CHANGELOG.md index 81cc667..e4cfc2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.0 + +- Fix the package to work with Dart 3.5 & Flutter 3.24 + ## 0.3.1 - Expose `EventStream` class. diff --git a/analysis_options.yaml b/analysis_options.yaml index 488f679..60086cf 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -14,6 +14,8 @@ linter: cast_nullable_to_non_nullable: true close_sinks: true conditional_uri_does_not_exist: true + # TODO: enable this lint + # invalid_runtime_check_with_js_interop_types: true no_adjacent_strings_in_list: true no_default_cases: true no_leading_underscores_for_local_identifiers: true @@ -28,4 +30,4 @@ linter: unnecessary_parenthesis: true unnecessary_statements: true unsafe_html: true - use_raw_strings: true + use_raw_strings: true \ No newline at end of file diff --git a/lib/action.dart b/lib/action.dart index 9b69293..6d3abdc 100644 --- a/lib/action.dart +++ b/lib/action.dart @@ -141,7 +141,7 @@ class ChromeAction { EventStream get onClicked => $js.chrome.action.onClicked.asStream(($c) => ($js_tabs.Tab tab) { return $c(Tab.fromJS(tab)); - }); + }.toJS); } class TabDetails { diff --git a/lib/alarms.dart b/lib/alarms.dart index c90cc00..54a9fda 100644 --- a/lib/alarms.dart +++ b/lib/alarms.dart @@ -88,7 +88,7 @@ class ChromeAlarms { EventStream get onAlarm => $js.chrome.alarms.onAlarm.asStream(($c) => ($js.Alarm alarm) { return $c(Alarm.fromJS(alarm)); - }); + }.toJS); } class Alarm { diff --git a/lib/audio.dart b/lib/audio.dart index 8bf7686..8b45dce 100644 --- a/lib/audio.dart +++ b/lib/audio.dart @@ -87,7 +87,7 @@ class ChromeAudio { $js.chrome.audio.onLevelChanged .asStream(($c) => ($js.LevelChangedEvent event) { return $c(LevelChangedEvent.fromJS(event)); - }); + }.toJS); /// Fired when the mute state of the audio input or output changes. /// Note that mute state is system-wide and the new value applies to every @@ -96,7 +96,7 @@ class ChromeAudio { $js.chrome.audio.onMuteChanged .asStream(($c) => ($js.MuteChangedEvent event) { return $c(MuteChangedEvent.fromJS(event)); - }); + }.toJS); /// Fired when audio devices change, either new devices being added, or /// existing devices being removed. @@ -107,7 +107,7 @@ class ChromeAudio { .cast<$js.AudioDeviceInfo>() .map((e) => AudioDeviceInfo.fromJS(e)) .toList()); - }); + }.toJS); } /// Type of stream an audio device provides. diff --git a/lib/bookmarks.dart b/lib/bookmarks.dart index 20a7104..1f4b796 100644 --- a/lib/bookmarks.dart +++ b/lib/bookmarks.dart @@ -162,7 +162,7 @@ class ChromeBookmarks { id: id, bookmark: BookmarkTreeNode.fromJS(bookmark), )); - }); + }.toJS); /// Fired when a bookmark or folder is removed. When a folder is removed /// recursively, a single notification is fired for the folder, and none for @@ -176,7 +176,7 @@ class ChromeBookmarks { id: id, removeInfo: OnRemovedRemoveInfo.fromJS(removeInfo), )); - }); + }.toJS); /// Fired when a bookmark or folder changes. **Note:** Currently, only title /// and url changes trigger this. @@ -189,7 +189,7 @@ class ChromeBookmarks { id: id, changeInfo: OnChangedChangeInfo.fromJS(changeInfo), )); - }); + }.toJS); /// Fired when a bookmark or folder is moved to a different parent folder. EventStream get onMoved => @@ -201,7 +201,7 @@ class ChromeBookmarks { id: id, moveInfo: OnMovedMoveInfo.fromJS(moveInfo), )); - }); + }.toJS); /// Fired when the children of a folder have changed their order due to the /// order being sorted in the UI. This is not called as a result of a move(). @@ -214,7 +214,7 @@ class ChromeBookmarks { id: id, reorderInfo: OnChildrenReorderedReorderInfo.fromJS(reorderInfo), )); - }); + }.toJS); /// Fired when a bookmark import session is begun. Expensive observers should /// ignore onCreated updates until onImportEnded is fired. Observers should @@ -222,13 +222,13 @@ class ChromeBookmarks { EventStream get onImportBegan => $js.chrome.bookmarks.onImportBegan.asStream(($c) => () { return $c(null); - }); + }.toJS); /// Fired when a bookmark import session is ended. EventStream get onImportEnded => $js.chrome.bookmarks.onImportEnded.asStream(($c) => () { return $c(null); - }); + }.toJS); } /// Indicates the reason why this node is unmodifiable. The [managed] value diff --git a/lib/browser_action.dart b/lib/browser_action.dart index 2399f80..2aa5cbe 100644 --- a/lib/browser_action.dart +++ b/lib/browser_action.dart @@ -115,7 +115,7 @@ class ChromeBrowserAction { EventStream get onClicked => $js.chrome.browserAction.onClicked.asStream(($c) => ($js_tabs.Tab tab) { return $c(Tab.fromJS(tab)); - }); + }.toJS); } typedef ColorArray = List; diff --git a/lib/certificate_provider.dart b/lib/certificate_provider.dart index f938ae5..c10e668 100644 --- a/lib/certificate_provider.dart +++ b/lib/certificate_provider.dart @@ -78,7 +78,7 @@ class ChromeCertificateProvider { $js.chrome.certificateProvider.onCertificatesUpdateRequested .asStream(($c) => ($js.CertificatesUpdateRequest request) { return $c(CertificatesUpdateRequest.fromJS(request)); - }); + }.toJS); /// This event fires every time the browser needs to sign a message using a /// certificate provided by this extension via [setCertificates]. @@ -89,7 +89,7 @@ class ChromeCertificateProvider { $js.chrome.certificateProvider.onSignatureRequested .asStream(($c) => ($js.SignatureRequest request) { return $c(SignatureRequest.fromJS(request)); - }); + }.toJS); /// This event fires every time the browser requests the current list of /// certificates provided by this extension. The extension must call @@ -115,7 +115,7 @@ class ChromeCertificateProvider { .toList()); }); }); - }); + }.toJS); /// This event fires every time the browser needs to sign a message using /// a certificate provided by this extension in reply to an @@ -137,7 +137,7 @@ class ChromeCertificateProvider { (reportCallback as Function)(signature?.toJS); }, )); - }); + }.toJS); } /// Types of supported cryptographic signature algorithms. diff --git a/lib/commands.dart b/lib/commands.dart index a06f9be..96742a7 100644 --- a/lib/commands.dart +++ b/lib/commands.dart @@ -46,7 +46,7 @@ class ChromeCommands { command: command, tab: tab?.let(Tab.fromJS), )); - }); + }.toJS); } class Command { diff --git a/lib/context_menus.dart b/lib/context_menus.dart index dfd6e5b..67cc06c 100644 --- a/lib/context_menus.dart +++ b/lib/context_menus.dart @@ -121,7 +121,7 @@ class ChromeContextMenus { info: OnClickData.fromJS(info), tab: tab?.let(Tab.fromJS), )); - }); + }.toJS); } /// The different contexts a menu can appear in. Specifying 'all' is equivalent diff --git a/lib/cookies.dart b/lib/cookies.dart index 5a65994..5d3c05d 100644 --- a/lib/cookies.dart +++ b/lib/cookies.dart @@ -78,7 +78,7 @@ class ChromeCookies { EventStream get onChanged => $js.chrome.cookies.onChanged .asStream(($c) => ($js.OnChangedChangeInfo changeInfo) { return $c(OnChangedChangeInfo.fromJS(changeInfo)); - }); + }.toJS); } /// A cookie's 'SameSite' state diff --git a/lib/debugger.dart b/lib/debugger.dart index 9d87e7f..9bb63c5 100644 --- a/lib/debugger.dart +++ b/lib/debugger.dart @@ -98,7 +98,7 @@ class ChromeDebugger { method: method, params: params?.toDartMap(), )); - }); + }.toJS); /// Fired when browser terminates debugging session for the tab. This happens /// when either the tab is being closed or Chrome DevTools is being invoked @@ -112,7 +112,7 @@ class ChromeDebugger { source: Debuggee.fromJS(source), reason: DetachReason.fromJS(reason), )); - }); + }.toJS); } /// Target type. diff --git a/lib/declarative_content.dart b/lib/declarative_content.dart index 7dc4c17..6ec5ef0 100644 --- a/lib/declarative_content.dart +++ b/lib/declarative_content.dart @@ -26,7 +26,7 @@ class ChromeDeclarativeContent { EventStream get onPageChanged => $js.chrome.declarativeContent.onPageChanged.asStream(($c) => () { return $c(null); - }); + }.toJS); } enum PageStateMatcherInstanceType { diff --git a/lib/declarative_net_request.dart b/lib/declarative_net_request.dart index 85d8841..a558f64 100644 --- a/lib/declarative_net_request.dart +++ b/lib/declarative_net_request.dart @@ -280,7 +280,7 @@ class ChromeDeclarativeNetRequest { $js.chrome.declarativeNetRequest.onRuleMatchedDebug .asStream(($c) => ($js.MatchedRuleInfoDebug info) { return $c(MatchedRuleInfoDebug.fromJS(info)); - }); + }.toJS); } /// This describes the resource type of the network request. diff --git a/lib/devtools_inspected_window.dart b/lib/devtools_inspected_window.dart index 3625a82..f626f85 100644 --- a/lib/devtools_inspected_window.dart +++ b/lib/devtools_inspected_window.dart @@ -91,7 +91,7 @@ class ChromeDevtoolsInspectedWindow { $js.chrome.devtools.inspectedWindow.onResourceAdded .asStream(($c) => ($js.Resource resource) { return $c(Resource.fromJS(resource)); - }); + }.toJS); /// Fired when a new revision of the resource is committed (e.g. user saves an /// edited version of the resource in the Developer Tools). @@ -105,7 +105,7 @@ class ChromeDevtoolsInspectedWindow { resource: Resource.fromJS(resource), content: content, )); - }); + }.toJS); } class Resource { diff --git a/lib/devtools_network.dart b/lib/devtools_network.dart index f4b6a39..a10765d 100644 --- a/lib/devtools_network.dart +++ b/lib/devtools_network.dart @@ -42,13 +42,13 @@ class ChromeDevtoolsNetwork { $js.chrome.devtools.network.onRequestFinished .asStream(($c) => ($js.Request request) { return $c(Request.fromJS(request)); - }); + }.toJS); /// Fired when the inspected window navigates to a new page. EventStream get onNavigated => $js.chrome.devtools.network.onNavigated.asStream(($c) => (String url) { return $c(url); - }); + }.toJS); } class Request { diff --git a/lib/devtools_panels.dart b/lib/devtools_panels.dart index f02f8c1..d8884b3 100644 --- a/lib/devtools_panels.dart +++ b/lib/devtools_panels.dart @@ -124,7 +124,7 @@ class ElementsPanel { EventStream get onSelectionChanged => _wrapped.onSelectionChanged.asStream(($c) => () { return $c(null); - }); + }.toJS); } class SourcesPanel { @@ -156,7 +156,7 @@ class SourcesPanel { EventStream get onSelectionChanged => _wrapped.onSelectionChanged.asStream(($c) => () { return $c(null); - }); + }.toJS); } class ExtensionPanel { @@ -199,18 +199,18 @@ class ExtensionPanel { action: action, queryString: queryString, )); - }); + }.toJS); /// Fired when the user switches to the panel. EventStream get onShown => _wrapped.onShown.asStream(($c) => (JSObject window) { return $c(window); - }); + }.toJS); /// Fired when the user switches away from the panel. EventStream get onHidden => _wrapped.onHidden.asStream(($c) => () { return $c(null); - }); + }.toJS); } class ExtensionSidebarPane { @@ -277,13 +277,13 @@ class ExtensionSidebarPane { EventStream get onShown => _wrapped.onShown.asStream(($c) => (JSObject window) { return $c(window); - }); + }.toJS); /// Fired when the sidebar pane becomes hidden as a result of the user /// switching away from the panel that hosts the sidebar pane. EventStream get onHidden => _wrapped.onHidden.asStream(($c) => () { return $c(null); - }); + }.toJS); } class Button { @@ -316,7 +316,7 @@ class Button { /// Fired when the button is clicked. EventStream get onClicked => _wrapped.onClicked.asStream(($c) => () { return $c(null); - }); + }.toJS); } class ExtensionPanelOnSearchEvent { diff --git a/lib/devtools_recorder.dart b/lib/devtools_recorder.dart index e0af3f9..ea3adad 100644 --- a/lib/devtools_recorder.dart +++ b/lib/devtools_recorder.dart @@ -113,10 +113,10 @@ class RecorderView { /// Fired when the view is shown. EventStream get onShown => _wrapped.onShown.asStream(($c) => () { return $c(null); - }); + }.toJS); /// Fired when the view is hidden. EventStream get onHidden => _wrapped.onHidden.asStream(($c) => () { return $c(null); - }); + }.toJS); } diff --git a/lib/downloads.dart b/lib/downloads.dart index 359701a..8fdf1fc 100644 --- a/lib/downloads.dart +++ b/lib/downloads.dart @@ -185,7 +185,7 @@ class ChromeDownloads { EventStream get onCreated => $js.chrome.downloads.onCreated .asStream(($c) => ($js.DownloadItem downloadItem) { return $c(DownloadItem.fromJS(downloadItem)); - }); + }.toJS); /// Fires with the `downloadId` when a download is erased from /// history. @@ -194,7 +194,7 @@ class ChromeDownloads { EventStream get onErased => $js.chrome.downloads.onErased.asStream(($c) => (int downloadId) { return $c(downloadId); - }); + }.toJS); /// When any of a [DownloadItem]'s properties except /// `bytesReceived` and `estimatedEndTime` changes, @@ -203,7 +203,7 @@ class ChromeDownloads { EventStream get onChanged => $js.chrome.downloads.onChanged .asStream(($c) => ($js.DownloadDelta downloadDelta) { return $c(DownloadDelta.fromJS(downloadDelta)); - }); + }.toJS); /// During the filename determination process, extensions will be given the /// opportunity to override the target [DownloadItem.filename]. Each @@ -238,7 +238,7 @@ class ChromeDownloads { (suggest as Function)(suggestion?.toJS); }, )); - }); + }.toJS); } ///
uniquify
diff --git a/lib/extension.dart b/lib/extension.dart index 32f19da..5f8376e 100644 --- a/lib/extension.dart +++ b/lib/extension.dart @@ -136,7 +136,7 @@ class ChromeExtension { sender: MessageSender.fromJS(sender), sendResponse: sendResponse, )); - }); + }.toJS); /// Fired when a request is sent from another extension. EventStream get onRequestExternal => @@ -150,7 +150,7 @@ class ChromeExtension { sender: MessageSender.fromJS(sender), sendResponse: sendResponse, )); - }); + }.toJS); } /// The type of extension view. diff --git a/lib/file_browser_handler.dart b/lib/file_browser_handler.dart index 98a2bbb..a2a1905 100644 --- a/lib/file_browser_handler.dart +++ b/lib/file_browser_handler.dart @@ -32,7 +32,7 @@ class ChromeFileBrowserHandler { id: id, details: FileHandlerExecuteEventDetails.fromJS(details), )); - }); + }.toJS); } class FileHandlerExecuteEventDetails { diff --git a/lib/file_system_provider.dart b/lib/file_system_provider.dart index ddbf867..0cc733b 100644 --- a/lib/file_system_provider.dart +++ b/lib/file_system_provider.dart @@ -126,7 +126,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when metadata of a file or a directory at `entryPath` /// is requested. The metadata must be returned with the @@ -149,7 +149,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when a list of actions for a set of files or directories at /// `entryPaths` is requested. All of the returned actions must @@ -174,7 +174,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when contents of a directory at `directoryPath` are /// requested. The results must be returned in chunks by calling the @@ -198,7 +198,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when opening a file at `filePath` is requested. If the /// file does not exist, then the operation must fail. Maximum number of @@ -220,7 +220,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when opening a file previously opened with /// `openRequestId` is requested to be closed. @@ -241,7 +241,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when reading contents of a file opened previously with /// `openRequestId` is requested. The results must be returned in @@ -264,7 +264,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when creating a directory is requested. The operation must fail /// with the EXISTS error if the target directory already exists. @@ -288,7 +288,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when deleting an entry is requested. If `recursive` is /// true, and the entry is a directory, then all of the entries inside @@ -310,7 +310,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when creating a file is requested. If the file already exists, /// then `errorCallback` must be called with the @@ -332,7 +332,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when copying an entry (recursively if a directory) is requested. /// If an error occurs, then `errorCallback` must be called. @@ -353,7 +353,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when moving an entry (recursively if a directory) is requested. /// If an error occurs, then `errorCallback` must be called. @@ -374,7 +374,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when truncating a file to a desired length is requested. /// If an error occurs, then `errorCallback` must be called. @@ -395,7 +395,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when writing contents to a file opened previously with /// `openRequestId` is requested. @@ -416,7 +416,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when aborting an operation with `operationRequestId` /// is requested. The operation executed with `operationRequestId` @@ -442,7 +442,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when showing a configuration dialog for `fileSystemId` /// is requested. If it's handled, the @@ -465,7 +465,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when showing a dialog for mounting a new file system is requested. /// If the extension/app is a file handler, then this event shouldn't be @@ -488,7 +488,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when setting a new directory watcher is requested. If an error /// occurs, then `errorCallback` must be called. @@ -509,7 +509,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when the watcher should be removed. If an error occurs, then /// `errorCallback` must be called. @@ -530,7 +530,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); /// Raised when executing an action for a set of files or directories is\ /// requested. After the action is completed, `successCallback` @@ -552,7 +552,7 @@ class ChromeFileSystemProvider { (errorCallback as Function)(error.toJS); }, )); - }); + }.toJS); } /// Error codes used by providing extensions in response to requests as well diff --git a/lib/font_settings.dart b/lib/font_settings.dart index 597969b..d2e0ac6 100644 --- a/lib/font_settings.dart +++ b/lib/font_settings.dart @@ -124,14 +124,14 @@ class ChromeFontSettings { $js.chrome.fontSettings.onFontChanged .asStream(($c) => ($js.OnFontChangedDetails details) { return $c(OnFontChangedDetails.fromJS(details)); - }); + }.toJS); /// Fired when the default font size setting changes. EventStream get onDefaultFontSizeChanged => $js.chrome.fontSettings.onDefaultFontSizeChanged .asStream(($c) => ($js.OnDefaultFontSizeChangedDetails details) { return $c(OnDefaultFontSizeChangedDetails.fromJS(details)); - }); + }.toJS); /// Fired when the default fixed font size setting changes. EventStream @@ -139,14 +139,14 @@ class ChromeFontSettings { .chrome.fontSettings.onDefaultFixedFontSizeChanged .asStream(($c) => ($js.OnDefaultFixedFontSizeChangedDetails details) { return $c(OnDefaultFixedFontSizeChangedDetails.fromJS(details)); - }); + }.toJS); /// Fired when the minimum font size setting changes. EventStream get onMinimumFontSizeChanged => $js.chrome.fontSettings.onMinimumFontSizeChanged .asStream(($c) => ($js.OnMinimumFontSizeChangedDetails details) { return $c(OnMinimumFontSizeChangedDetails.fromJS(details)); - }); + }.toJS); } /// An ISO 15924 script code. The default, or global, script is represented by diff --git a/lib/gcm.dart b/lib/gcm.dart index a291ccb..6ddbccc 100644 --- a/lib/gcm.dart +++ b/lib/gcm.dart @@ -60,7 +60,7 @@ class ChromeGcm { EventStream get onMessage => $js.chrome.gcm.onMessage.asStream(($c) => ($js.OnMessageMessage message) { return $c(OnMessageMessage.fromJS(message)); - }); + }.toJS); /// Fired when a FCM server had to delete messages sent by an app server to /// the application. See [Lifetime of a @@ -69,13 +69,13 @@ class ChromeGcm { EventStream get onMessagesDeleted => $js.chrome.gcm.onMessagesDeleted.asStream(($c) => () { return $c(null); - }); + }.toJS); /// Fired when it was not possible to send a message to the FCM server. EventStream get onSendError => $js.chrome.gcm.onSendError.asStream(($c) => ($js.OnSendErrorError error) { return $c(OnSendErrorError.fromJS(error)); - }); + }.toJS); } class OnMessageMessage { diff --git a/lib/history.dart b/lib/history.dart index f8f60dc..24815c3 100644 --- a/lib/history.dart +++ b/lib/history.dart @@ -72,7 +72,7 @@ class ChromeHistory { EventStream get onVisited => $js.chrome.history.onVisited.asStream(($c) => ($js.HistoryItem result) { return $c(HistoryItem.fromJS(result)); - }); + }.toJS); /// Fired when one or more URLs are removed from the history service. When /// all visits have been removed the URL is purged from history. @@ -80,7 +80,7 @@ class ChromeHistory { $js.chrome.history.onVisitRemoved .asStream(($c) => ($js.OnVisitRemovedRemoved removed) { return $c(OnVisitRemovedRemoved.fromJS(removed)); - }); + }.toJS); } /// The [transition type](#transition_types) for this visit from its referrer. diff --git a/lib/identity.dart b/lib/identity.dart index af99351..346751f 100644 --- a/lib/identity.dart +++ b/lib/identity.dart @@ -155,7 +155,7 @@ class ChromeIdentity { account: AccountInfo.fromJS(account), signedIn: signedIn, )); - }); + }.toJS); } enum AccountStatus { diff --git a/lib/idle.dart b/lib/idle.dart index 0cb28aa..d068ccf 100644 --- a/lib/idle.dart +++ b/lib/idle.dart @@ -56,7 +56,7 @@ class ChromeIdle { EventStream get onStateChanged => $js.chrome.idle.onStateChanged.asStream(($c) => ($js.IdleState newState) { return $c(IdleState.fromJS(newState)); - }); + }.toJS); } enum IdleState { diff --git a/lib/input_ime.dart b/lib/input_ime.dart index 933f2ee..841fea8 100644 --- a/lib/input_ime.dart +++ b/lib/input_ime.dart @@ -162,28 +162,28 @@ class ChromeInputIme { engineId: engineID, screen: ScreenType.fromJS(screen), )); - }); + }.toJS); /// This event is sent when an IME is deactivated. It signals that the IME /// will no longer be receiving onKeyPress events. EventStream get onDeactivated => $js.chrome.input.ime.onDeactivated.asStream(($c) => (String engineId) { return $c(engineId); - }); + }.toJS); /// This event is sent when focus enters a text box. It is sent to all /// extensions that are listening to this event, and enabled by the user. EventStream get onFocus => $js.chrome.input.ime.onFocus.asStream(($c) => ($js.InputContext context) { return $c(InputContext.fromJS(context)); - }); + }.toJS); /// This event is sent when focus leaves a text box. It is sent to all /// extensions that are listening to this event, and enabled by the user. EventStream get onBlur => $js.chrome.input.ime.onBlur.asStream(($c) => (int contextId) { return $c(contextId); - }); + }.toJS); /// This event is sent when the properties of the current InputContext change, /// such as the the type. It is sent to all extensions that are listening to @@ -192,7 +192,7 @@ class ChromeInputIme { $js.chrome.input.ime.onInputContextUpdate .asStream(($c) => ($js.InputContext context) { return $c(InputContext.fromJS(context)); - }); + }.toJS); /// Fired when a key event is sent from the operating system. The event will /// be sent to the extension if this extension owns the active IME. The @@ -211,7 +211,7 @@ class ChromeInputIme { keyData: KeyboardEvent.fromJS(keyData), requestId: requestId, )); - }); + }.toJS); /// This event is sent if this extension owns the active IME. EventStream get onCandidateClicked => @@ -225,7 +225,7 @@ class ChromeInputIme { candidateId: candidateID, button: MouseButton.fromJS(button), )); - }); + }.toJS); /// Called when the user selects a menu item EventStream get onMenuItemActivated => @@ -237,7 +237,7 @@ class ChromeInputIme { engineId: engineID, name: name, )); - }); + }.toJS); /// Called when the editable string around caret is changed or when the caret /// position is moved. The text length is limited to 100 characters for each @@ -252,13 +252,13 @@ class ChromeInputIme { surroundingInfo: OnSurroundingTextChangedSurroundingInfo.fromJS( surroundingInfo), )); - }); + }.toJS); /// This event is sent when chrome terminates ongoing text input session. EventStream get onReset => $js.chrome.input.ime.onReset.asStream(($c) => (String engineId) { return $c(engineId); - }); + }.toJS); /// This event is sent when a button in an assistive window is clicked. EventStream @@ -267,7 +267,7 @@ class ChromeInputIme { ($c) => ($js.OnAssistiveWindowButtonClickedDetails details) { return $c( OnAssistiveWindowButtonClickedDetails.fromJS(details)); - }); + }.toJS); } enum KeyboardEventType { diff --git a/lib/instance_id.dart b/lib/instance_id.dart index 222ad53..ab6d9cf 100644 --- a/lib/instance_id.dart +++ b/lib/instance_id.dart @@ -72,7 +72,7 @@ class ChromeInstanceId { EventStream get onTokenRefresh => $js.chrome.instanceId.onTokenRefresh.asStream(($c) => () { return $c(null); - }); + }.toJS); } class GetTokenParams { diff --git a/lib/login_state.dart b/lib/login_state.dart index d179e67..bb5a735 100644 --- a/lib/login_state.dart +++ b/lib/login_state.dart @@ -41,7 +41,7 @@ class ChromeLoginState { $js.chrome.loginState.onSessionStateChanged .asStream(($c) => ($js.SessionState sessionState) { return $c(SessionState.fromJS(sessionState)); - }); + }.toJS); } enum ProfileType { diff --git a/lib/management.dart b/lib/management.dart index d362600..a3bf040 100644 --- a/lib/management.dart +++ b/lib/management.dart @@ -171,25 +171,25 @@ class ChromeManagement { $js.chrome.management.onInstalled .asStream(($c) => ($js.ExtensionInfo info) { return $c(ExtensionInfo.fromJS(info)); - }); + }.toJS); /// Fired when an app or extension has been uninstalled. EventStream get onUninstalled => $js.chrome.management.onUninstalled.asStream(($c) => (String id) { return $c(id); - }); + }.toJS); /// Fired when an app or extension has been enabled. EventStream get onEnabled => $js.chrome.management.onEnabled .asStream(($c) => ($js.ExtensionInfo info) { return $c(ExtensionInfo.fromJS(info)); - }); + }.toJS); /// Fired when an app or extension has been disabled. EventStream get onDisabled => $js.chrome.management.onDisabled .asStream(($c) => ($js.ExtensionInfo info) { return $c(ExtensionInfo.fromJS(info)); - }); + }.toJS); } /// These are all possible app launch types. diff --git a/lib/notifications.dart b/lib/notifications.dart index 709117f..2d45037 100644 --- a/lib/notifications.dart +++ b/lib/notifications.dart @@ -103,13 +103,13 @@ class ChromeNotifications { notificationId: notificationId, byUser: byUser, )); - }); + }.toJS); /// The user clicked in a non-button area of the notification. EventStream get onClicked => $js.chrome.notifications.onClicked .asStream(($c) => (String notificationId) { return $c(notificationId); - }); + }.toJS); /// The user pressed a button in the notification. EventStream get onButtonClicked => @@ -121,7 +121,7 @@ class ChromeNotifications { notificationId: notificationId, buttonIndex: buttonIndex, )); - }); + }.toJS); /// The user changes the permission level. As of Chrome 47, only ChromeOS /// has UI that dispatches this event. @@ -129,7 +129,7 @@ class ChromeNotifications { $js.chrome.notifications.onPermissionLevelChanged .asStream(($c) => ($js.PermissionLevel level) { return $c(PermissionLevel.fromJS(level)); - }); + }.toJS); /// The user clicked on a link for the app's notification settings. As of /// Chrome 47, only ChromeOS has UI that dispatches this event. @@ -137,7 +137,7 @@ class ChromeNotifications { EventStream get onShowSettings => $js.chrome.notifications.onShowSettings.asStream(($c) => () { return $c(null); - }); + }.toJS); } enum TemplateType { diff --git a/lib/omnibox.dart b/lib/omnibox.dart index 685a712..3cbe3b9 100644 --- a/lib/omnibox.dart +++ b/lib/omnibox.dart @@ -50,7 +50,7 @@ class ChromeOmnibox { EventStream get onInputStarted => $js.chrome.omnibox.onInputStarted.asStream(($c) => () { return $c(null); - }); + }.toJS); /// User has changed what is typed into the omnibox. EventStream get onInputChanged => @@ -62,7 +62,7 @@ class ChromeOmnibox { text: text, suggest: suggest, )); - }); + }.toJS); /// User has accepted what is typed into the omnibox. EventStream get onInputEntered => @@ -74,19 +74,19 @@ class ChromeOmnibox { text: text, disposition: OnInputEnteredDisposition.fromJS(disposition), )); - }); + }.toJS); /// User has ended the keyword input session without accepting the input. EventStream get onInputCancelled => $js.chrome.omnibox.onInputCancelled.asStream(($c) => () { return $c(null); - }); + }.toJS); /// User has deleted a suggested result. EventStream get onDeleteSuggestion => $js.chrome.omnibox.onDeleteSuggestion.asStream(($c) => (String text) { return $c(text); - }); + }.toJS); } /// The style type. diff --git a/lib/page_action.dart b/lib/page_action.dart index 667d488..5526c01 100644 --- a/lib/page_action.dart +++ b/lib/page_action.dart @@ -78,7 +78,7 @@ class ChromePageAction { EventStream get onClicked => $js.chrome.pageAction.onClicked.asStream(($c) => ($js_tabs.Tab tab) { return $c(Tab.fromJS(tab)); - }); + }.toJS); } /// Pixel data for an image. Must be an ImageData object (for example, from a diff --git a/lib/permissions.dart b/lib/permissions.dart index 0bed59e..2a72dea 100644 --- a/lib/permissions.dart +++ b/lib/permissions.dart @@ -63,13 +63,13 @@ class ChromePermissions { EventStream get onAdded => $js.chrome.permissions.onAdded .asStream(($c) => ($js.Permissions permissions) { return $c(Permissions.fromJS(permissions)); - }); + }.toJS); /// Fired when access to permissions has been removed from the extension. EventStream get onRemoved => $js.chrome.permissions.onRemoved .asStream(($c) => ($js.Permissions permissions) { return $c(Permissions.fromJS(permissions)); - }); + }.toJS); } class Permissions { diff --git a/lib/printer_provider.dart b/lib/printer_provider.dart index d45a744..521a06f 100644 --- a/lib/printer_provider.dart +++ b/lib/printer_provider.dart @@ -35,7 +35,7 @@ class ChromePrinterProvider { (resultCallback as Function)(printerInfo.toJSArray((e) => e.toJS)); }); - }); + }.toJS); /// Event fired when print manager requests information about a USB device /// that may be a printer. @@ -61,7 +61,7 @@ class ChromePrinterProvider { (resultCallback as Function)(printerInfo?.toJS); }, )); - }); + }.toJS); /// Event fired when print manager requests printer capabilities. /// |printerId|: Unique ID of the printer whose capabilities are requested. @@ -81,7 +81,7 @@ class ChromePrinterProvider { (resultCallback as Function)(capabilities.jsify()!); }, )); - }); + }.toJS); /// Event fired when print manager requests printing. /// |printJob|: The printing request parameters. @@ -99,7 +99,7 @@ class ChromePrinterProvider { (resultCallback as Function)(result.toJS); }, )); - }); + }.toJS); } /// Error codes returned in response to [onPrintRequested] event. diff --git a/lib/printing.dart b/lib/printing.dart index 5e94f41..397a54d 100644 --- a/lib/printing.dart +++ b/lib/printing.dart @@ -84,7 +84,7 @@ class ChromePrinting { jobId: jobId, status: JobStatus.fromJS(status), )); - }); + }.toJS); } /// The status of [submitJob] request. diff --git a/lib/printing_metrics.dart b/lib/printing_metrics.dart index e35b41a..57650e4 100644 --- a/lib/printing_metrics.dart +++ b/lib/printing_metrics.dart @@ -39,7 +39,7 @@ class ChromePrintingMetrics { $js.chrome.printingMetrics.onPrintJobFinished .asStream(($c) => ($js.PrintJobInfo jobInfo) { return $c(PrintJobInfo.fromJS(jobInfo)); - }); + }.toJS); } /// The source of the print job. diff --git a/lib/processes.dart b/lib/processes.dart index 8c76f95..f7a90a8 100644 --- a/lib/processes.dart +++ b/lib/processes.dart @@ -71,7 +71,7 @@ class ChromeProcesses { EventStream get onUpdated => $js.chrome.processes.onUpdated.asStream(($c) => (JSAny processes) { return $c(processes.toDartMap()); - }); + }.toJS); /// Fired each time the Task Manager updates its process statistics, /// providing the dictionary of updated Process objects, indexed by process @@ -86,7 +86,7 @@ class ChromeProcesses { $js.chrome.processes.onUpdatedWithMemory .asStream(($c) => (JSAny processes) { return $c(processes.toDartMap()); - }); + }.toJS); /// Fired each time a process is created, providing the corrseponding Process /// object. @@ -95,7 +95,7 @@ class ChromeProcesses { EventStream get onCreated => $js.chrome.processes.onCreated.asStream(($c) => ($js.Process process) { return $c(Process.fromJS(process)); - }); + }.toJS); /// Fired each time a process becomes unresponsive, providing the /// corrseponding Process object. @@ -105,7 +105,7 @@ class ChromeProcesses { EventStream get onUnresponsive => $js.chrome.processes.onUnresponsive .asStream(($c) => ($js.Process process) { return $c(Process.fromJS(process)); - }); + }.toJS); /// Fired each time a process is terminated, providing the type of exit. /// |processId|: The ID of the process that exited. @@ -124,7 +124,7 @@ class ChromeProcesses { exitType: exitType, exitCode: exitCode, )); - }); + }.toJS); } /// The types of the browser processes. diff --git a/lib/proxy.dart b/lib/proxy.dart index ad284a9..543ac04 100644 --- a/lib/proxy.dart +++ b/lib/proxy.dart @@ -32,7 +32,7 @@ class ChromeProxy { $js.chrome.proxy.onProxyError .asStream(($c) => ($js.OnProxyErrorDetails details) { return $c(OnProxyErrorDetails.fromJS(details)); - }); + }.toJS); } enum Scheme { diff --git a/lib/runtime.dart b/lib/runtime.dart index 3500d0b..1148da7 100644 --- a/lib/runtime.dart +++ b/lib/runtime.dart @@ -247,7 +247,7 @@ class ChromeRuntime { EventStream get onStartup => $js.chrome.runtime.onStartup.asStream(($c) => () { return $c(null); - }); + }.toJS); /// Fired when the extension is first installed, when the extension is updated /// to a new version, and when Chrome is updated to a new version. @@ -255,7 +255,7 @@ class ChromeRuntime { $js.chrome.runtime.onInstalled .asStream(($c) => ($js.OnInstalledDetails details) { return $c(OnInstalledDetails.fromJS(details)); - }); + }.toJS); /// Sent to the event page just before it is unloaded. This gives the /// extension opportunity to do some clean up. Note that since the page is @@ -266,13 +266,13 @@ class ChromeRuntime { EventStream get onSuspend => $js.chrome.runtime.onSuspend.asStream(($c) => () { return $c(null); - }); + }.toJS); /// Sent after onSuspend to indicate that the app won't be unloaded after all. EventStream get onSuspendCanceled => $js.chrome.runtime.onSuspendCanceled.asStream(($c) => () { return $c(null); - }); + }.toJS); /// Fired when an update is available, but isn't installed immediately because /// the app is currently running. If you do nothing, the update will be @@ -288,41 +288,41 @@ class ChromeRuntime { $js.chrome.runtime.onUpdateAvailable .asStream(($c) => ($js.OnUpdateAvailableDetails details) { return $c(OnUpdateAvailableDetails.fromJS(details)); - }); + }.toJS); /// Fired when a Chrome update is available, but isn't installed immediately /// because a browser restart is required. EventStream get onBrowserUpdateAvailable => $js.chrome.runtime.onBrowserUpdateAvailable.asStream(($c) => () { return $c(null); - }); + }.toJS); /// Fired when a connection is made from either an extension process or a /// content script (by [runtime.connect]). EventStream get onConnect => $js.chrome.runtime.onConnect.asStream(($c) => ($js.Port port) { return $c(Port.fromJS(port)); - }); + }.toJS); /// Fired when a connection is made from another extension (by /// [runtime.connect]), or from an externally connectable web site. EventStream get onConnectExternal => $js.chrome.runtime.onConnectExternal.asStream(($c) => ($js.Port port) { return $c(Port.fromJS(port)); - }); + }.toJS); /// Fired when a connection is made from a user script from this extension. EventStream get onUserScriptConnect => $js.chrome.runtime.onUserScriptConnect.asStream(($c) => ($js.Port port) { return $c(Port.fromJS(port)); - }); + }.toJS); /// Fired when a connection is made from a native application. Currently only /// supported on Chrome OS. EventStream get onConnectNative => $js.chrome.runtime.onConnectNative.asStream(($c) => ($js.Port port) { return $c(Port.fromJS(port)); - }); + }.toJS); /// Fired when a message is sent from either an extension process (by /// [runtime.sendMessage]) or a content script (by [tabs.sendMessage]). @@ -337,7 +337,7 @@ class ChromeRuntime { sender: MessageSender.fromJS(sender), sendResponse: sendResponse, )); - }); + }.toJS); /// Fired when a message is sent from another extension/app (by /// [runtime.sendMessage]). Cannot be used in a content script. @@ -352,7 +352,7 @@ class ChromeRuntime { sender: MessageSender.fromJS(sender), sendResponse: sendResponse, )); - }); + }.toJS); /// Fired when a message is sent from a user script associated with the same /// extension. @@ -367,7 +367,7 @@ class ChromeRuntime { sender: MessageSender.fromJS(sender), sendResponse: sendResponse, )); - }); + }.toJS); /// Fired when an app or the device that it runs on needs to be restarted. The /// app should close all its windows at its earliest convenient time to let @@ -378,7 +378,7 @@ class ChromeRuntime { $js.chrome.runtime.onRestartRequired .asStream(($c) => ($js.OnRestartRequiredReason reason) { return $c(OnRestartRequiredReason.fromJS(reason)); - }); + }.toJS); } /// The operating system Chrome is running on. @@ -636,7 +636,7 @@ class Port { EventStream get onDisconnect => _wrapped.onDisconnect.asStream(($c) => ($js.Port port) { return $c(Port.fromJS(port)); - }); + }.toJS); /// This event is fired when $(ref:Port.postMessage postMessage) is called by /// the other end of the port. @@ -649,7 +649,7 @@ class Port { message: message.dartify()!, port: Port.fromJS(port), )); - }); + }.toJS); } class MessageSender { diff --git a/lib/sessions.dart b/lib/sessions.dart index fd6e3e3..a00486f 100644 --- a/lib/sessions.dart +++ b/lib/sessions.dart @@ -60,7 +60,7 @@ class ChromeSessions { EventStream get onChanged => $js.chrome.sessions.onChanged.asStream(($c) => () { return $c(null); - }); + }.toJS); } class Filter { diff --git a/lib/src/internal_helpers.dart b/lib/src/internal_helpers.dart index f596f0c..0be01ac 100644 --- a/lib/src/internal_helpers.dart +++ b/lib/src/internal_helpers.dart @@ -82,14 +82,14 @@ extension JSChoiceExtension on T { extension EventStreamExtension on js.Event { EventStream asStream( - Function Function(void Function(T)) callbackFactory) { + JSFunction Function(void Function(T)) callbackFactory) { return EventStream(this, callbackFactory); } } class EventStream extends Stream { final js.Event _target; - final Function Function(void Function(T)) _callbackFactory; + final JSFunction Function(void Function(T)) _callbackFactory; EventStream(this._target, this._callbackFactory); @@ -116,8 +116,8 @@ class _EventStreamSubscription implements StreamSubscription { late final JSFunction _callback; _EventStreamSubscription(this._target, this._onData, - Function Function(dynamic Function(T)) callbackFactory) { - _callback = allowInterop(callbackFactory(_wrapZone(_addData))).toJS; + JSFunction Function(dynamic Function(T)) callbackFactory) { + _callback = callbackFactory(_wrapZone(_addData)); _tryResume(); } diff --git a/lib/storage.dart b/lib/storage.dart index 1189a07..6766842 100644 --- a/lib/storage.dart +++ b/lib/storage.dart @@ -47,7 +47,7 @@ class ChromeStorage { changes: changes.toDartMap(), areaName: areaName, )); - }); + }.toJS); } /// The storage area's access level. @@ -192,7 +192,7 @@ class StorageArea { EventStream get onChanged => _wrapped.onChanged.asStream(($c) => (JSAny changes) { return $c(changes.toDartMap()); - }); + }.toJS); } class StorageSync extends StorageArea { diff --git a/lib/system_display.dart b/lib/system_display.dart index 7891806..43d9e0e 100644 --- a/lib/system_display.dart +++ b/lib/system_display.dart @@ -197,7 +197,7 @@ class ChromeSystemDisplay { EventStream get onDisplayChanged => $js.chrome.system.display.onDisplayChanged.asStream(($c) => () { return $c(null); - }); + }.toJS); } /// Layout position, i.e. edge of parent that the display is attached to. diff --git a/lib/system_storage.dart b/lib/system_storage.dart index 970f8bb..b3ea5fc 100644 --- a/lib/system_storage.dart +++ b/lib/system_storage.dart @@ -57,13 +57,13 @@ class ChromeSystemStorage { $js.chrome.system.storage.onAttached .asStream(($c) => ($js.StorageUnitInfo info) { return $c(StorageUnitInfo.fromJS(info)); - }); + }.toJS); /// Fired when a removable storage is detached from the system. EventStream get onDetached => $js.chrome.system.storage.onDetached.asStream(($c) => (String id) { return $c(id); - }); + }.toJS); } enum StorageUnitType { diff --git a/lib/tab_capture.dart b/lib/tab_capture.dart index 48f159e..18172b9 100644 --- a/lib/tab_capture.dart +++ b/lib/tab_capture.dart @@ -86,7 +86,7 @@ class ChromeTabCapture { $js.chrome.tabCapture.onStatusChanged .asStream(($c) => ($js.CaptureInfo info) { return $c(CaptureInfo.fromJS(info)); - }); + }.toJS); } enum TabCaptureState { diff --git a/lib/tab_groups.dart b/lib/tab_groups.dart index 64b1b28..8017a03 100644 --- a/lib/tab_groups.dart +++ b/lib/tab_groups.dart @@ -75,13 +75,13 @@ class ChromeTabGroups { EventStream get onCreated => $js.chrome.tabGroups.onCreated.asStream(($c) => ($js.TabGroup group) { return $c(TabGroup.fromJS(group)); - }); + }.toJS); /// Fired when a group is updated. EventStream get onUpdated => $js.chrome.tabGroups.onUpdated.asStream(($c) => ($js.TabGroup group) { return $c(TabGroup.fromJS(group)); - }); + }.toJS); /// Fired when a group is moved within a window. Move events are still fired /// for the individual tabs within the group, as well as for the group itself. @@ -90,14 +90,14 @@ class ChromeTabGroups { EventStream get onMoved => $js.chrome.tabGroups.onMoved.asStream(($c) => ($js.TabGroup group) { return $c(TabGroup.fromJS(group)); - }); + }.toJS); /// Fired when a group is closed, either directly by the user or automatically /// because it contained zero tabs. EventStream get onRemoved => $js.chrome.tabGroups.onRemoved.asStream(($c) => ($js.TabGroup group) { return $c(TabGroup.fromJS(group)); - }); + }.toJS); } /// The group's color. diff --git a/lib/tabs.dart b/lib/tabs.dart index 4e28e4c..c2bb62e 100644 --- a/lib/tabs.dart +++ b/lib/tabs.dart @@ -408,7 +408,7 @@ class ChromeTabs { EventStream get onCreated => $js.chrome.tabs.onCreated.asStream(($c) => ($js.Tab tab) { return $c(Tab.fromJS(tab)); - }); + }.toJS); /// Fired when a tab is updated. EventStream get onUpdated => @@ -422,7 +422,7 @@ class ChromeTabs { changeInfo: OnUpdatedChangeInfo.fromJS(changeInfo), tab: Tab.fromJS(tab), )); - }); + }.toJS); /// Fired when a tab is moved within a window. Only one move event is fired, /// representing the tab the user directly moved. Move events are not fired @@ -438,7 +438,7 @@ class ChromeTabs { tabId: tabId, moveInfo: OnMovedMoveInfo.fromJS(moveInfo), )); - }); + }.toJS); /// Fires when the selected tab in a window changes. EventStream get onSelectionChanged => @@ -450,7 +450,7 @@ class ChromeTabs { tabId: tabId, selectInfo: OnSelectionChangedSelectInfo.fromJS(selectInfo), )); - }); + }.toJS); /// Fires when the selected tab in a window changes. Note that the tab's URL /// may not be set at the time this event fired, but you can listen to @@ -464,7 +464,7 @@ class ChromeTabs { tabId: tabId, selectInfo: OnActiveChangedSelectInfo.fromJS(selectInfo), )); - }); + }.toJS); /// Fires when the active tab in a window changes. Note that the tab's URL may /// not be set at the time this event fired, but you can listen to onUpdated @@ -473,21 +473,21 @@ class ChromeTabs { $js.chrome.tabs.onActivated .asStream(($c) => ($js.OnActivatedActiveInfo activeInfo) { return $c(OnActivatedActiveInfo.fromJS(activeInfo)); - }); + }.toJS); /// Fired when the highlighted or selected tabs in a window changes. EventStream get onHighlightChanged => $js.chrome.tabs.onHighlightChanged .asStream(($c) => ($js.OnHighlightChangedSelectInfo selectInfo) { return $c(OnHighlightChangedSelectInfo.fromJS(selectInfo)); - }); + }.toJS); /// Fired when the highlighted or selected tabs in a window changes. EventStream get onHighlighted => $js.chrome.tabs.onHighlighted .asStream(($c) => ($js.OnHighlightedHighlightInfo highlightInfo) { return $c(OnHighlightedHighlightInfo.fromJS(highlightInfo)); - }); + }.toJS); /// Fired when a tab is detached from a window; for example, because it was /// moved between windows. @@ -500,7 +500,7 @@ class ChromeTabs { tabId: tabId, detachInfo: OnDetachedDetachInfo.fromJS(detachInfo), )); - }); + }.toJS); /// Fired when a tab is attached to a window; for example, because it was /// moved between windows. @@ -513,7 +513,7 @@ class ChromeTabs { tabId: tabId, attachInfo: OnAttachedAttachInfo.fromJS(attachInfo), )); - }); + }.toJS); /// Fired when a tab is closed. EventStream get onRemoved => @@ -525,7 +525,7 @@ class ChromeTabs { tabId: tabId, removeInfo: OnRemovedRemoveInfo.fromJS(removeInfo), )); - }); + }.toJS); /// Fired when a tab is replaced with another tab due to prerendering or /// instant. @@ -538,14 +538,14 @@ class ChromeTabs { addedTabId: addedTabId, removedTabId: removedTabId, )); - }); + }.toJS); /// Fired when a tab is zoomed. EventStream get onZoomChange => $js.chrome.tabs.onZoomChange .asStream(($c) => ($js.OnZoomChangeZoomChangeInfo zoomChangeInfo) { return $c(OnZoomChangeZoomChangeInfo.fromJS(zoomChangeInfo)); - }); + }.toJS); } /// The tab's loading status. diff --git a/lib/tts.dart b/lib/tts.dart index 2d362ce..255d63f 100644 --- a/lib/tts.dart +++ b/lib/tts.dart @@ -81,7 +81,7 @@ class ChromeTts { EventStream get onEvent => $js.chrome.tts.onEvent.asStream(($c) => ($js.TtsEvent event) { return $c(TtsEvent.fromJS(event)); - }); + }.toJS); } enum EventType { diff --git a/lib/tts_engine.dart b/lib/tts_engine.dart index d530bfa..3014474 100644 --- a/lib/tts_engine.dart +++ b/lib/tts_engine.dart @@ -73,7 +73,7 @@ class ChromeTtsEngine { options: SpeakOptions.fromJS(options), sendTtsEvent: sendTtsEvent, )); - }); + }.toJS); /// Called when the user makes a call to tts.speak() and one of the voices /// from this extension's manifest is the first to match the options object. @@ -94,7 +94,7 @@ class ChromeTtsEngine { sendTtsAudio: sendTtsAudio, sendError: sendError, )); - }); + }.toJS); /// Fired when a call is made to tts.stop and this extension may be in the /// middle of speaking. If an extension receives a call to onStop and speech @@ -103,7 +103,7 @@ class ChromeTtsEngine { EventStream get onStop => $js.chrome.ttsEngine.onStop.asStream(($c) => () { return $c(null); - }); + }.toJS); /// Optional: if an engine supports the pause event, it should pause the /// current utterance being spoken, if any, until it receives a resume event @@ -111,7 +111,7 @@ class ChromeTtsEngine { EventStream get onPause => $js.chrome.ttsEngine.onPause.asStream(($c) => () { return $c(null); - }); + }.toJS); /// Optional: if an engine supports the pause event, it should also support /// the resume event, to continue speaking the current utterance, if any. Note @@ -119,7 +119,7 @@ class ChromeTtsEngine { EventStream get onResume => $js.chrome.ttsEngine.onResume.asStream(($c) => () { return $c(null); - }); + }.toJS); } enum VoiceGender { diff --git a/lib/types.dart b/lib/types.dart index 6c47eb7..37ae748 100644 --- a/lib/types.dart +++ b/lib/types.dart @@ -101,7 +101,7 @@ class ChromeSetting { EventStream get onChange => _wrapped.onChange.asStream(($c) => ($js.OnChangeDetails details) { return $c(OnChangeDetails.fromJS(details)); - }); + }.toJS); } class GetCallbackDetails { diff --git a/lib/usb.dart b/lib/usb.dart index 5565cf5..f36fc16 100644 --- a/lib/usb.dart +++ b/lib/usb.dart @@ -288,14 +288,14 @@ class ChromeUsb { EventStream get onDeviceAdded => $js.chrome.usb.onDeviceAdded.asStream(($c) => ($js.Device device) { return $c(Device.fromJS(device)); - }); + }.toJS); /// Event generated when a device is removed from the system. See /// [onDeviceAdded] for which events are delivered. EventStream get onDeviceRemoved => $js.chrome.usb.onDeviceRemoved.asStream(($c) => ($js.Device device) { return $c(Device.fromJS(device)); - }); + }.toJS); } /// Direction, Recipient, RequestType, and TransferType all map to their diff --git a/lib/vpn_provider.dart b/lib/vpn_provider.dart index 9fc41cc..ceadaf9 100644 --- a/lib/vpn_provider.dart +++ b/lib/vpn_provider.dart @@ -87,7 +87,7 @@ class ChromeVpnProvider { message: PlatformMessage.fromJS(message), error: error, )); - }); + }.toJS); /// Triggered when an IP packet is received via the tunnel for the VPN /// session owned by the extension. @@ -96,7 +96,7 @@ class ChromeVpnProvider { $js.chrome.vpnProvider.onPacketReceived .asStream(($c) => (JSArrayBuffer data) { return $c(data.toDart); - }); + }.toJS); /// Triggered when a configuration created by the extension is removed by the /// platform. @@ -104,7 +104,7 @@ class ChromeVpnProvider { EventStream get onConfigRemoved => $js.chrome.vpnProvider.onConfigRemoved.asStream(($c) => (String id) { return $c(id); - }); + }.toJS); /// Triggered when a configuration is created by the platform for the /// extension. @@ -122,7 +122,7 @@ class ChromeVpnProvider { name: name, data: data.toDartMap(), )); - }); + }.toJS); /// Triggered when there is a UI event for the extension. UI events are /// signals from the platform that indicate to the app that a UI dialog @@ -138,7 +138,7 @@ class ChromeVpnProvider { event: UIEvent.fromJS(event), id: id, )); - }); + }.toJS); } /// The enum is used by the platform to notify the client of the VPN session diff --git a/lib/web_authentication_proxy.dart b/lib/web_authentication_proxy.dart index 5c76516..b1988b7 100644 --- a/lib/web_authentication_proxy.dart +++ b/lib/web_authentication_proxy.dart @@ -114,7 +114,7 @@ class ChromeWebAuthenticationProxy { $js.chrome.webAuthenticationProxy.onRemoteSessionStateChange .asStream(($c) => () { return $c(null); - }); + }.toJS); /// Fires when a WebAuthn `navigator.credentials.create()` call /// occurs. The extension must supply a response by calling @@ -124,7 +124,7 @@ class ChromeWebAuthenticationProxy { $js.chrome.webAuthenticationProxy.onCreateRequest .asStream(($c) => ($js.CreateRequest requestInfo) { return $c(CreateRequest.fromJS(requestInfo)); - }); + }.toJS); /// Fires when a WebAuthn navigator.credentials.get() call occurs. The /// extension must supply a response by calling @@ -134,7 +134,7 @@ class ChromeWebAuthenticationProxy { $js.chrome.webAuthenticationProxy.onGetRequest .asStream(($c) => ($js.GetRequest requestInfo) { return $c(GetRequest.fromJS(requestInfo)); - }); + }.toJS); /// Fires when a /// `PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()` @@ -145,7 +145,7 @@ class ChromeWebAuthenticationProxy { $js.chrome.webAuthenticationProxy.onIsUvpaaRequest .asStream(($c) => ($js.IsUvpaaRequest requestInfo) { return $c(IsUvpaaRequest.fromJS(requestInfo)); - }); + }.toJS); /// Fires when a `onCreateRequest` or `onGetRequest` /// event is canceled (because the WebAuthn request was aborted by the @@ -157,7 +157,7 @@ class ChromeWebAuthenticationProxy { $js.chrome.webAuthenticationProxy.onRequestCanceled .asStream(($c) => (int requestId) { return $c(requestId); - }); + }.toJS); } class IsUvpaaRequest { diff --git a/lib/web_navigation.dart b/lib/web_navigation.dart index 03555f1..b763b14 100644 --- a/lib/web_navigation.dart +++ b/lib/web_navigation.dart @@ -49,7 +49,7 @@ class ChromeWebNavigation { $js.chrome.webNavigation.onBeforeNavigate .asStream(($c) => ($js.OnBeforeNavigateDetails details) { return $c(OnBeforeNavigateDetails.fromJS(details)); - }); + }.toJS); /// Fired when a navigation is committed. The document (and the resources it /// refers to, such as images and subframes) might still be downloading, but @@ -59,7 +59,7 @@ class ChromeWebNavigation { $js.chrome.webNavigation.onCommitted .asStream(($c) => ($js.OnCommittedDetails details) { return $c(OnCommittedDetails.fromJS(details)); - }); + }.toJS); /// Fired when the page's DOM is fully constructed, but the referenced /// resources may not finish loading. @@ -67,7 +67,7 @@ class ChromeWebNavigation { $js.chrome.webNavigation.onDOMContentLoaded .asStream(($c) => ($js.OnDomContentLoadedDetails details) { return $c(OnDomContentLoadedDetails.fromJS(details)); - }); + }.toJS); /// Fired when a document, including the resources it refers to, is completely /// loaded and initialized. @@ -75,7 +75,7 @@ class ChromeWebNavigation { $js.chrome.webNavigation.onCompleted .asStream(($c) => ($js.OnCompletedDetails details) { return $c(OnCompletedDetails.fromJS(details)); - }); + }.toJS); /// Fired when an error occurs and the navigation is aborted. This can happen /// if either a network error occurred, or the user aborted the navigation. @@ -83,7 +83,7 @@ class ChromeWebNavigation { $js.chrome.webNavigation.onErrorOccurred .asStream(($c) => ($js.OnErrorOccurredDetails details) { return $c(OnErrorOccurredDetails.fromJS(details)); - }); + }.toJS); /// Fired when a new window, or a new tab in an existing window, is created to /// host a navigation. @@ -91,7 +91,7 @@ class ChromeWebNavigation { $js.chrome.webNavigation.onCreatedNavigationTarget .asStream(($c) => ($js.OnCreatedNavigationTargetDetails details) { return $c(OnCreatedNavigationTargetDetails.fromJS(details)); - }); + }.toJS); /// Fired when the reference fragment of a frame was updated. All future /// events for that frame will use the updated URL. @@ -100,7 +100,7 @@ class ChromeWebNavigation { .chrome.webNavigation.onReferenceFragmentUpdated .asStream(($c) => ($js.OnReferenceFragmentUpdatedDetails details) { return $c(OnReferenceFragmentUpdatedDetails.fromJS(details)); - }); + }.toJS); /// Fired when the contents of the tab is replaced by a different (usually /// previously pre-rendered) tab. @@ -108,7 +108,7 @@ class ChromeWebNavigation { $js.chrome.webNavigation.onTabReplaced .asStream(($c) => ($js.OnTabReplacedDetails details) { return $c(OnTabReplacedDetails.fromJS(details)); - }); + }.toJS); /// Fired when the frame's history was updated to a new URL. All future events /// for that frame will use the updated URL. @@ -116,7 +116,7 @@ class ChromeWebNavigation { $js.chrome.webNavigation.onHistoryStateUpdated .asStream(($c) => ($js.OnHistoryStateUpdatedDetails details) { return $c(OnHistoryStateUpdatedDetails.fromJS(details)); - }); + }.toJS); } /// Cause of the navigation. The same transition types as defined in the history diff --git a/lib/web_request.dart b/lib/web_request.dart index f1a4b93..5a6e7b7 100644 --- a/lib/web_request.dart +++ b/lib/web_request.dart @@ -40,7 +40,7 @@ class ChromeWebRequest { $js.chrome.webRequest.onBeforeRequest .asStream(($c) => ($js.OnBeforeRequestDetails details) { return $c(OnBeforeRequestDetails.fromJS(details)); - }); + }.toJS); /// Fired before sending an HTTP request, once the request headers are /// available. This may occur after a TCP connection is made to the server, @@ -49,7 +49,7 @@ class ChromeWebRequest { $js.chrome.webRequest.onBeforeSendHeaders .asStream(($c) => ($js.OnBeforeSendHeadersDetails details) { return $c(OnBeforeSendHeadersDetails.fromJS(details)); - }); + }.toJS); /// Fired just before a request is going to be sent to the server /// (modifications of previous onBeforeSendHeaders callbacks are visible by @@ -58,14 +58,14 @@ class ChromeWebRequest { $js.chrome.webRequest.onSendHeaders .asStream(($c) => ($js.OnSendHeadersDetails details) { return $c(OnSendHeadersDetails.fromJS(details)); - }); + }.toJS); /// Fired when HTTP response headers of a request have been received. EventStream get onHeadersReceived => $js.chrome.webRequest.onHeadersReceived .asStream(($c) => ($js.OnHeadersReceivedDetails details) { return $c(OnHeadersReceivedDetails.fromJS(details)); - }); + }.toJS); /// Fired when an authentication failure is received. The listener has three /// options: it can provide authentication credentials, it can cancel the @@ -83,7 +83,7 @@ class ChromeWebRequest { details: OnAuthRequiredDetails.fromJS(details), asyncCallback: asyncCallback, )); - }); + }.toJS); /// Fired when the first byte of the response body is received. For HTTP /// requests, this means that the status line and response headers are @@ -92,28 +92,28 @@ class ChromeWebRequest { $js.chrome.webRequest.onResponseStarted .asStream(($c) => ($js.OnResponseStartedDetails details) { return $c(OnResponseStartedDetails.fromJS(details)); - }); + }.toJS); /// Fired when a server-initiated redirect is about to occur. EventStream get onBeforeRedirect => $js.chrome.webRequest.onBeforeRedirect .asStream(($c) => ($js.OnBeforeRedirectDetails details) { return $c(OnBeforeRedirectDetails.fromJS(details)); - }); + }.toJS); /// Fired when a request is completed. EventStream get onCompleted => $js.chrome.webRequest.onCompleted .asStream(($c) => ($js.OnCompletedDetails details) { return $c(OnCompletedDetails.fromJS(details)); - }); + }.toJS); /// Fired when an error occurs. EventStream get onErrorOccurred => $js.chrome.webRequest.onErrorOccurred .asStream(($c) => ($js.OnErrorOccurredDetails details) { return $c(OnErrorOccurredDetails.fromJS(details)); - }); + }.toJS); /// Fired when an extension's proposed modification to a network request is /// ignored. This happens in case of conflicts with other extensions. @@ -121,7 +121,7 @@ class ChromeWebRequest { $js.chrome.webRequest.onActionIgnored .asStream(($c) => ($js.OnActionIgnoredDetails details) { return $c(OnActionIgnoredDetails.fromJS(details)); - }); + }.toJS); } enum ResourceType { diff --git a/lib/windows.dart b/lib/windows.dart index 04501ef..2c0227d 100644 --- a/lib/windows.dart +++ b/lib/windows.dart @@ -94,13 +94,13 @@ class ChromeWindows { EventStream get onCreated => $js.chrome.windows.onCreated.asStream(($c) => ($js.Window window) { return $c(Window.fromJS(window)); - }); + }.toJS); /// Fired when a window is removed (closed). EventStream get onRemoved => $js.chrome.windows.onRemoved.asStream(($c) => (int windowId) { return $c(windowId); - }); + }.toJS); /// Fired when the currently focused window changes. Returns /// `chrome.windows.WINDOW_ID_NONE` if all Chrome windows have lost focus. @@ -109,14 +109,14 @@ class ChromeWindows { EventStream get onFocusChanged => $js.chrome.windows.onFocusChanged.asStream(($c) => (int windowId) { return $c(windowId); - }); + }.toJS); /// Fired when a window has been resized; this event is only dispatched when /// the new bounds are committed, and not for in-progress changes. EventStream get onBoundsChanged => $js.chrome.windows.onBoundsChanged.asStream(($c) => ($js.Window window) { return $c(Window.fromJS(window)); - }); + }.toJS); } /// The type of browser window this is. In some circumstances a window may not diff --git a/pubspec.lock b/pubspec.lock index e312f06..5b3ded4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,26 +5,31 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" + sha256: "45cfa8471b89fb6643fe9bf51bd7931a76b8f5ec2d65de4fb176dba8d4f22c77" url: "https://pub.dev" source: hosted - version: "67.0.0" + version: "73.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.2" analyzer: dependency: "direct dev" description: name: analyzer - sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" + sha256: "4959fec185fe70cce007c57e9ab6983101dbe593d2bf8bbfb4453aaec0cf470a" url: "https://pub.dev" source: hosted - version: "6.4.1" + version: "6.8.0" archive: dependency: transitive description: name: archive - sha256: ecf4273855368121b1caed0d10d4513c7241dfc813f7d3c8933b36622ae9b265 + sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d url: "https://pub.dev" source: hosted - version: "3.5.1" + version: "3.6.1" args: dependency: transitive description: @@ -69,10 +74,10 @@ packages: dependency: transitive description: name: build_daemon - sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" + sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" url: "https://pub.dev" source: hosted - version: "4.0.1" + version: "4.0.2" build_resolvers: dependency: transitive description: @@ -85,18 +90,18 @@ packages: dependency: "direct dev" description: name: build_runner - sha256: "3ac61a79bfb6f6cc11f693591063a7f19a7af628dc52f141743edac5c16e8c22" + sha256: dd09dd4e2b078992f42aac7f1a622f01882a8492fef08486b27ddde929c19f04 url: "https://pub.dev" source: hosted - version: "2.4.9" + version: "2.4.12" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "4ae8ffe5ac758da294ecf1802f2aff01558d8b1b00616aa7538ea9a8a5d50799" + sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 url: "https://pub.dev" source: hosted - version: "7.3.0" + version: "7.3.2" built_collection: dependency: transitive description: @@ -149,10 +154,10 @@ packages: dependency: "direct dev" description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" convert: dependency: transitive description: @@ -165,10 +170,10 @@ packages: dependency: transitive description: name: coverage - sha256: "3945034e86ea203af7a056d98e98e42a5518fff200d6e8e6647e1886b07e936e" + sha256: "576aaab8b1abdd452e0f656c3e73da9ead9d7880e15bdc494189d9c1a1baf0db" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.0" crypto: dependency: transitive description: @@ -197,18 +202,18 @@ packages: dependency: transitive description: name: fetch_api - sha256: c0a76bfd84d4bc5a0733ab8b9fcee268d5069228790a6dd71fc2a6d1049223cc + sha256: "97f46c25b480aad74f7cc2ad7ccba2c5c6f08d008e68f95c1077286ce243d0e6" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.2.0" fetch_client: dependency: "direct dev" description: name: fetch_client - sha256: "0b935eff9dfa84fb56bddadaf020c9aa61f02cbd6fa8dad914d6d343a838936d" + sha256: "9666ee14536778474072245ed5cba07db81ae8eb5de3b7bf4a2d1e2c49696092" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" file: dependency: transitive description: @@ -253,10 +258,10 @@ packages: dependency: transitive description: name: graphs - sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" html: dependency: transitive description: @@ -269,10 +274,10 @@ packages: dependency: "direct dev" description: name: http - sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" + sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" http_methods: dependency: transitive description: @@ -293,10 +298,10 @@ packages: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "40f592dd352890c3b60fec1b68e786cefb9603e05ff303dbc4dda49b304ecdf4" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.0" intl: dependency: transitive description: @@ -353,6 +358,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + macros: + dependency: transitive + description: + name: macros + sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + url: "https://pub.dev" + source: hosted + version: "0.1.2-main.4" markdown: dependency: transitive description: @@ -429,10 +442,10 @@ packages: dependency: transitive description: name: platform - sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" + sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" url: "https://pub.dev" source: hosted - version: "3.1.4" + version: "3.1.5" pool: dependency: transitive description: @@ -478,26 +491,26 @@ packages: dependency: transitive description: name: pubspec_parse - sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8 url: "https://pub.dev" source: hosted - version: "1.2.3" + version: "1.3.0" puppeteer: dependency: "direct dev" description: name: puppeteer - sha256: "37293a2379ec5d022b7af6e5967304e74c69ebf7b72925b965a3c1ff9ccd9a4c" + sha256: de3f921154e5d336b14cdc05b674ac3db5701a5338f3cb0042868a5146f16e67 url: "https://pub.dev" source: hosted - version: "3.10.0" + version: "3.12.0" shelf: dependency: "direct dev" description: name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.4.2" shelf_packages_handler: dependency: transitive description: @@ -526,10 +539,10 @@ packages: dependency: transitive description: name: shelf_web_socket - sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + sha256: "073c147238594ecd0d193f3456a5fe91c4b0abbcc68bf5cd95b36c4e194ac611" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "2.0.0" source_gen: dependency: transitive description: @@ -598,10 +611,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" term_glyph: dependency: transitive description: @@ -614,26 +627,26 @@ packages: dependency: "direct dev" description: name: test - sha256: d11b55850c68c1f6c0cf00eabded4e66c4043feaf6c0d7ce4a36785137df6331 + sha256: "713a8789d62f3233c46b4a90b174737b2c04cb6ae4500f2aa8b1be8f03f5e67f" url: "https://pub.dev" source: hosted - version: "1.25.5" + version: "1.25.8" test_api: dependency: transitive description: name: test_api - sha256: "2419f20b0c8677b2d67c8ac4d1ac7372d862dc6c460cdbb052b40155408cd794" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.1" + version: "0.7.3" test_core: dependency: transitive description: name: test_core - sha256: "4d070a6bc36c1c4e89f20d353bfd71dc30cdf2bd0e14349090af360a029ab292" + sha256: "12391302411737c176b0b5d6491f466b0dd56d4763e347b6714efbaa74d7953d" url: "https://pub.dev" source: hosted - version: "0.6.2" + version: "0.6.5" timing: dependency: transitive description: @@ -654,10 +667,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "7475cb4dd713d57b6f7464c0e13f06da0d535d8b2067e188962a59bac2cf280b" + sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc url: "https://pub.dev" source: hosted - version: "14.2.2" + version: "14.2.4" watcher: dependency: transitive description: @@ -670,18 +683,26 @@ packages: dependency: "direct dev" description: name: web - sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 + url: "https://pub.dev" + source: hosted + version: "1.0.0" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.1.6" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: "58c6666b342a38816b2e7e50ed0f1e261959630becd4c879c4f26bfa14aa5a42" + sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f" url: "https://pub.dev" source: hosted - version: "2.4.5" + version: "3.0.1" webkit_inspection_protocol: dependency: transitive description: @@ -707,4 +728,4 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=3.3.1 <4.0.0" + dart: ">=3.5.0-259.0.dev <4.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index cd7d7f6..b207cbb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,9 +1,9 @@ name: chrome_extension -version: 0.3.1 +version: 0.4.0 description: A library for accessing the `chrome.*` APIs available in Chrome extensions. homepage: https://github.com/xvrh/chrome_extension.dart environment: - sdk: '^3.3.1' + sdk: '^3.5.0' funding: - https://www.buymeacoffee.com/xvrh diff --git a/tool/generator/code_generator.dart b/tool/generator/code_generator.dart index 6778ea6..234406d 100644 --- a/tool/generator/code_generator.dart +++ b/tool/generator/code_generator.dart @@ -462,7 +462,7 @@ class DartApiGenerator extends _GeneratorBase { ]) ..body = Block.of([ refer(r'$c').call([completeParameter]).returned.statement - ])).closure.code).closure + ])).closure.code).closure.property('toJS') ]).code ..lambda = true ..type = MethodType.getter);