-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch dart:js and dart:js_util usages to use static interop
- Loading branch information
Showing
8 changed files
with
3,269 additions
and
3,445 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import 'package:js/js.dart'; | ||
|
||
void init() { | ||
highlight?.highlightAll(); | ||
} | ||
|
||
@JS() | ||
@staticInterop | ||
class HighlightJs {} | ||
|
||
extension HighlightJsExtension on HighlightJs { | ||
external void highlightAll(); | ||
} | ||
|
||
@JS('hljs') | ||
external HighlightJs? get highlight; |
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 +1 @@ | ||
469F5B013C1B0324C1F020C95013AC51 | ||
2D8E7D7722AE5937479C00C043788871 |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:js/js.dart'; | ||
import 'package:js/js_util.dart' as js_util; | ||
|
||
@JS() | ||
@staticInterop | ||
class FetchResponse {} | ||
|
||
extension FetchResponseExtension on FetchResponse { | ||
external int get status; | ||
|
||
@JS('text') | ||
external Promise _text(); | ||
Future<String> get text => js_util.promiseToFuture(_text()); | ||
} | ||
|
||
@JS() | ||
@staticInterop | ||
class Promise {} |