Skip to content

Commit

Permalink
Fix blockly datetime picker
Browse files Browse the repository at this point in the history
  • Loading branch information
hrajchert committed May 10, 2023
1 parent c7446fc commit e90e0d2
Show file tree
Hide file tree
Showing 8 changed files with 315 additions and 276 deletions.
23 changes: 23 additions & 0 deletions marlowe-playground-client/src/Blockly/Blockly.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { BlockBase, BlockCreate, BlockChange } from "blockly/core/events/events";

export function createBlocklyInstance_ () {
return import("blockly");
};

export type Blockly = Awaited<ReturnType<typeof createBlocklyInstance_>>;
export type Workspace = InstanceType<Blockly["Workspace"]>
export type WorkspaceSvg = InstanceType<Blockly["WorkspaceSvg"]>
export type Block = InstanceType<Blockly["Block"]>

export type TZInfo = {tzOffset: number, offsetString: string}

export function isBlockEvent (event: unknown): event is BlockBase {
return event.hasOwnProperty("blockId");
}

export function isBlockCreateEvent (event: unknown): event is BlockCreate {
return event.hasOwnProperty("type") && event["type"] == "create";
}
export function isBlockChangeEvent (event: unknown): event is BlockChange {
return event.hasOwnProperty("type") && event["type"] == "change";
}
213 changes: 0 additions & 213 deletions marlowe-playground-client/src/Blockly/DateTimeField.js

This file was deleted.

Loading

0 comments on commit e90e0d2

Please sign in to comment.