8000 blockly.d.ts incorrect types · Issue #5864 · google/blockly · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
blockly.d.ts incorrect types #5864
Closed
Closed
@benjamindamm

Description

@benjamindamm

Thanks for updating blocky to be more compatible with TypeScript so far. The latest version "7.20211209.2" produces now a bunch of errors related to inconsistent typing.

I would love to check out your updated version ;).

Error: node_modules/blockly/blockly.d.ts:2848:9 - error TS2416: Property 'targetConnection' in type 'RenderedConnection' is not assignable to the same property in base type 'Connection'.
Type 'RenderedConnection' is not assignable to type 'Connection'.
The types of 'getSourceBlock().comment' are incompatible between these types.
Type 'Comment | null' is not assignable to type 'string | Comment'.
Type 'null' is not assignable to type 'string | Comment'.

2848 targetConnection: RenderedConnection;
~~~~~~~~~~~~~~~~

Error: node_modules/blockly/blockly.d.ts:2861:18 - error TS2416: Property 'getSourceBlock' in type 'RenderedConnection' is not assignable to the same property in base type 'Connection'.
Type '() => BlockSvg' is not assignable to type '() => Block'.

2861 override getSourceBlock(): BlockSvg;
~~~~~~~~~~~~~~

Error: node_modules/blockly/blockly.d.ts:2867:18 - error TS2416: Property 'targetBlock' in type 'RenderedConnection' is not assignable to the same property in base type 'Connection'.
Type '() => BlockSvg | null' is not assignable to type '() => Block | null'.
Type 'BlockSvg | null' is not assignable to type 'Block | null'.
Type 'BlockSvg' is not assignable to type 'Block'.

2867 override targetBlock(): BlockSvg | null;
~~~~~~~~~~~

Error: node_modules/blockly/blockly.d.ts:13509:18 - error TS2416: Property 'newBlock' in type 'WorkspaceSvg' is not assignable to the same property in base type 'Workspace'.
Type '(prototypeName: string, opt_id?: string | undefined) => BlockSvg' is not assignable to type '(prototypeName: string, opt_id?: string | undefined) => Block'.
Type 'BlockSvg' is not assignable to type 'Block'.

13509 override newBlock(prototypeName: string, opt_id?: string | undefined): BlockSvg;
~~~~~~~~

Error: node_modules/blockly/blockly.d.ts:13899:18 - error TS2416: Property 'getBlockById' in type 'WorkspaceSvg' is not assignable to the same property in base type 'Workspace'.
Type '(id: string) => BlockSvg | null' is not assignable to type '(id: string) => Block | null'.
Type 'BlockSvg | null' is not assignable to type 'Block | null'.

13899 override getBlockById(id: string): BlockSvg | null;
~~~~~~~~~~~~

Error: node_modules/blockly/blockly.d.ts:13907:18 - error TS2416: Property 'getTopBlocks' in type 'WorkspaceSvg' is not assignable to the same property in base type 'Workspace'.
Type '(ordered: boolean) => BlockSvg[]' is not assignable to type '(ordered: boolean) => Block[]'.
Type 'BlockSvg[]' is not assignable to type 'Block[]'.
Type 'BlockSvg' is not assignable to type 'Block'.

13907 override getTopBlocks(ordered: boolean): Array;
~~~~~~~~~~~~

Error: node_modules/blockly/blockly.d.ts:14932:18 - error TS2416: Property 'next' in type 'BasicCursor' is not assignable to the same property in base type 'Cursor'.
Type '() => ASTNode | null' is not assignable to type '() => ASTNode'.
Type 'ASTNode | null' is not assignable to type 'ASTNode'.
Type 'null' is not assignable to type 'ASTNode'.

14932 override next(): ASTNode | null;
~~~~

Error: node_modules/blockly/blockly.d.ts:14941:3m18 - error TS2416: Property 'in' in type 'BasicCursor' is not assignable to the same property in base type 'Cursor'.
Type '() => ASTNode | null' is not assignable to type '() => ASTNode'.
Type 'ASTNode | null' is not assignable to type 'ASTNode'.
Type 'null' is not assignable to type 'ASTNode'.

14941 override in(): ASTNode | null;
~~

Error: node_modules/blockly/blockly.d.ts:14948:18 - error TS2416: Property 'prev' in type 'BasicCursor' is not assignable to the same property in base type 'Cursor'.
Type '() => ASTNode | null' is not assignable to type '() => ASTNode'.
Type 'ASTNode | null' is not assignable to type 'ASTNode'.
Type 'null' is not assignable to type 'ASTNode'.

14948 override prev(): ASTNode | null;
~~~~

Error: node_modules/blockly/blockly.d.ts:14957:18 - error TS2416: Property 'out' in type 'BasicCursor' is not assignable to the same property in base type 'Cursor'.
Type '() => ASTNode | null' is not assignable to type '() => ASTNode'.
Type 'ASTNode | null' is not assignable to type 'ASTNode'.
Type 'null' is not assignable to type 'ASTNode'.

14957 override out(): ASTNode | null;
~~~

Error: node_modules/blockly/blockly.d.ts:15133:9 - error TS2416: Property 'workspace' in type 'BlockSvg' is not assignable to the same property in base type 'Block'.
Type 'WorkspaceSvg' is not assignable to type 'Workspace'.
Types of property 'getTopBlocks' are incompatible.
Type '(ordered: boolean) => BlockSvg[]' is not assignable to type '(ordered: boolean) => Block[]'.

15133 workspace: WorkspaceSvg;
~~~~~~~~~

Error: node_modules/blockly/blockly.d.ts:15135:9 - error TS2416: Property 'outputConnection' in type 'BlockSvg' is not assignable to the same property in base type 'Block'.
Type 'RenderedConnection' is not assignable to type 'Connection'.

15135 outputConnection: RenderedConnection;
~~~~~~~~~~~~~~~~

Error: node_modules/blockly/blockly.d.ts:15137:9 - error TS2416: Property 'nextConnection' in type 'BlockSvg' is not assignable to the same property in base type 'Block'.
Type 'RenderedConnection' is not assignable to type 'Connection'.

15137 nextConnection: RenderedConnection;
~~~~~~~~~~~~~~

Error: node_modules/blockly/blockly.d.ts:15139:9 - error TS2416: Property 'previousConnection' in type 'BlockSvg' is not assignable to the same property in base type 'Block'.
Type 'RenderedConnection' is not assignable to type 'Connection'.

15139 previousConnection: RenderedConnection;
~~~~~~~~~~~~~~~~~~

Error: node_modules/blockly/blockly.d.ts:15396:9 - error TS2416: Property 'comment' in type 'BlockSvg' is not assignable to the same property in base type 'Block'.
Type 'Comment | null' is not assignable to type 'string | Comment'.

15396 comment: Comment | null;
~~~~~~~

Error: node_modules/blockly/blockly.d.ts:15538:9 - error TS2416: Property 'getConnections_' in type 'BlockSvg' is not assignable to the same property in base type 'Block'.
Type '(all: boolean) => RenderedConnection[]' is not assignable to type '(_all: boolean) => Connection[]'.
Type 'RenderedConnection[]' is not assignable to type 'Connection[]'.
Type 'RenderedConnection' is not assignable to type 'Connection'.

15538 getConnections_(all: boolean): Array;
~~~~~~~~~~~~~~~

Error: node_modules/blockly/blockly.d.ts:15549:18 - error TS2416: Property 'lastConnectionInStack' in type 'BlockSvg' is not assignable to the same property in base type 'Block'.
Type '(ignoreShadows: boolean) => RenderedConnection | null' is not assignable to type '(ignoreShadows: boolean) => Connection | null'.
Type 'RenderedConnection | null' is not assignable to type 'Connection | null'.
Type 'RenderedConnection' is not assignable to type 'Connection'.

15549 override lastConnectionInStack(ignoreShadows: boolean): RenderedConnection | null;
~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/blockly/blockly.d.ts:15561:18 - error TS2416: Property 'getMatchingConnection' in type 'BlockSvg' is not assignable to the same property in base type 'Block'.
Type '(otherBlock: Block, conn: Connection) => RenderedConnection | null' is not assignable to type '(otherBlock: Block, conn: Connection) => Connection | null'.
Type 'RenderedConnection | null' is not assignable to type 'Connection | null'.

15561 override getMatchingConnection(otherBlock: Block, conn: Connection): RenderedConnection | null;
~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/blockly/blockly.d.ts:15568:19 - error TS2416: Property 'makeConnection_' in type 'BlockSvg' is not assignable to the same property in base type 'Block'.
Type '(type: number) => RenderedConnection' is not assignable to type '(type: number) => Connection'.
Type 'RenderedConnection' is not assignable to type 'Connection'.

15568 protected makeConnection_(type: number): RenderedConnection;
~~~~~~~~~~~~~~~

Error: node_modules/blockly/blockly.d.ts:15596:18 - error TS2416: Property 'getParent' in type 'BlockSvg' is not assignable to the same property in base type 'Block'.
Type '() => BlockSvg | null' is not assignable to type '() => Block | null'.
Type 'BlockSvg | null' is not assignable to type 'Block | null'.

15596 override getParent(): BlockSvg | null;
~~~~~~~~~

Error: node_modules/blockly/blockly.d.ts:15603:18 - error TS2416: Property 'getRootBlock' in type 'BlockSvg' is not assignable to the same property in base type 'Block'.
Type '() => BlockSvg' is not assignable to type '() => Block'.
Type 'BlockSvg' is not assignable to type 'Block'.

15603 override getRootBlock(): BlockSvg;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0