Skip to content

Commit d61f4ca

Browse files
authored
fix: Fix errors in TS declarations with blocks and generators (google#6200)
1 parent 7c76208 commit d61f4ca

File tree

9 files changed

+22
-16
lines changed

9 files changed

+22
-16
lines changed

typings/blockly.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,13 +531,13 @@ declare module "core/blocks" {
531531
* A block definition. For now this very lose, but it can potentially
532532
* be refined e.g. by replacing this typedef with a class definition.
533533
*/
534-
export type BlockDefinition = Object;
534+
export type BlockDefinition = any;
535535
/**
536536
* A block definition. For now this very lose, but it can potentially
537537
* be refined e.g. by replacing this typedef with a class definition.
538538
* @typedef {!Object}
539539
*/
540-
export let BlockDefinition: any;
540+
// export let BlockDefinition: any;
541541
/**
542542
* A mapping of block type names to block prototype objects.
543543
* @type {!Object<string,!BlockDefinition>}

typings/blocks.d.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,14 @@
1111

1212
/// <reference path="core.d.ts" />
1313

14-
import * as Blockly from './core';
15-
export = Blockly.Blocks;
14+
export const colour: any;
15+
export const lists: any;
16+
export const logic: any;
17+
export const loops: any;
18+
export const math: any;
19+
export const procedures: any;
20+
export const texts: any;
21+
export const variables: any;
22+
export const variablesDynamic: any;
23+
24+
export const blocks: any;

typings/core.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@
1111

1212
/// <reference path="blockly.d.ts" />
1313

14-
import * as Blockly from 'blockly';
15-
export = Blockly;
14+
export * from 'core/blockly';

typings/dart.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
/// <reference path="core.d.ts" />
1313

1414
import * as Blockly from './core';
15-
declare const dart: Blockly.Generator;
15+
declare const dart: any;
1616
export = dart;

typings/index.d.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
/// <reference path="javascript.d.ts" />
1515
/// <reference path="msg/msg.d.ts" />
1616

17-
import * as Blockly from './core';
18-
import './blocks';
19-
import './javascript';
17+
export * from './core';
18+
export * as libraryBlocks from './blocks';
19+
export const JavaScript: any;
2020
import './msg/msg';
21-
22-
export = Blockly;

typings/javascript.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
/// <reference path="core.d.ts" />
1313

1414
import * as Blockly from './core';
15-
declare const javascript: Blockly.Generator;
15+
declare const javascript: any;
1616
export = javascript;

typings/lua.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
/// <reference path="core.d.ts" />
1313

1414
import * as Blockly from './core';
15-
declare const lua: Blockly.Generator;
15+
declare const lua: any;
1616
export = lua;

typings/php.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
/// <reference path="core.d.ts" />
1313

1414
import * as Blockly from './core';
15-
declare const php: Blockly.Generator;
15+
declare const php: any;
1616
export = php;

typings/python.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
/// <reference path="core.d.ts" />
1313

1414
import * as Blockly from './core';
15-
declare const python: Blockly.Generator;
15+
declare const python: any;
1616
export = python;

0 commit comments

Comments
 (0)