mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
Add type annotations (#396)
* Add type annotations
* Replace `StateCommand` with `Command`
* Revert "Replace `StateCommand` with `Command`"
This reverts commit 2dfc2d34e4.
* Fix the return value
This commit is contained in:
@@ -32,16 +32,16 @@ mode.subscribe(value => {
|
||||
currentMode = value;
|
||||
});
|
||||
|
||||
function createCmdHandler(el) {
|
||||
function createCmdHandler(el: PyRepl): StateCommand {
|
||||
// Creates a codemirror cmd handler that calls the el.evaluate when an event
|
||||
// triggers that specific cmd
|
||||
const toggleCheckbox: StateCommand = ({ state, dispatch }) => {
|
||||
return el.evaluate(state);
|
||||
return () => {
|
||||
void el.evaluate();
|
||||
return true;
|
||||
};
|
||||
return toggleCheckbox;
|
||||
}
|
||||
|
||||
let initialTheme;
|
||||
let initialTheme: string;
|
||||
function getEditorTheme(el: BaseEvalElement): string {
|
||||
if (initialTheme) {
|
||||
return initialTheme;
|
||||
|
||||
Reference in New Issue
Block a user