-
Notifications
You must be signed in to change notification settings - Fork 7
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
Showing
8 changed files
with
315 additions
and
276 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
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"; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.