-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04227ea
commit c013512
Showing
9 changed files
with
391 additions
and
62 deletions.
There are no files selected for viewing
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
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,7 +1,41 @@ | ||
// stub window & document | ||
class StubWindow { | ||
final localStorage = <String, String>{}; | ||
} | ||
class StubDocument { | ||
StubHtml? head; | ||
StubHtml? body; | ||
} | ||
class StubHtml { | ||
final children = <Element>[]; | ||
} | ||
final window = StubWindow(); | ||
final document = StubDocument(); | ||
Iterable<Element> querySelectorAll(String _) => <Element>[]; | ||
|
||
class Platform {} | ||
// stub html elements | ||
class NodeValidatorBuilder { | ||
NodeValidatorBuilder.common(); | ||
allowElement(String _, {Iterable<String>? attributes}) => this; | ||
} | ||
class Element { | ||
Element(); | ||
Element.html(String _, {NodeValidatorBuilder? validator}); | ||
remove() => {}; | ||
addEventListener(String _, EventListener? __) => {}; | ||
removeEventListener(String _, EventListener? __) => {}; | ||
String? className; | ||
} | ||
class DivElement extends Element{ | ||
final children = <Element>[]; | ||
} | ||
|
||
final window = StubWindow(); | ||
// stub events | ||
typedef EventListener = Function(Event event); | ||
class Event {} | ||
class CustomEvent { | ||
final dynamic detail = <dynamic, dynamic>{}; | ||
} | ||
|
||
// others | ||
class Platform {} |
Oops, something went wrong.