From d61f4cad8dffd29293a907fbb68c33dd5108bd64 Mon Sep 17 00:00:00 2001 From: Maribeth Bottorff Date: Wed, 8 Jun 2022 13:39:18 -0700 Subject: [PATCH] fix: Fix errors in TS declarations with blocks and generators (#6200) --- typings/blockly.d.ts | 4 ++-- typings/blocks.d.ts | 13 +++++++++++-- typings/core.d.ts | 3 +-- typings/dart.d.ts | 2 +- typings/index.d.ts | 8 +++----- typings/javascript.d.ts | 2 +- typings/lua.d.ts | 2 +- typings/php.d.ts | 2 +- typings/python.d.ts | 2 +- 9 files changed, 22 insertions(+), 16 deletions(-) diff --git a/typings/blockly.d.ts b/typings/blockly.d.ts index b2fe86e5910..48988290fdd 100644 --- a/typings/blockly.d.ts +++ b/typings/blockly.d.ts @@ -531,13 +531,13 @@ declare module "core/blocks" { * A block definition. For now this very lose, but it can potentially * be refined e.g. by replacing this typedef with a class definition. */ - export type BlockDefinition = Object; + export type BlockDefinition = any; /** * A block definition. For now this very lose, but it can potentially * be refined e.g. by replacing this typedef with a class definition. * @typedef {!Object} */ - export let BlockDefinition: any; + // export let BlockDefinition: any; /** * A mapping of block type names to block prototype objects. * @type {!Object} diff --git a/typings/blocks.d.ts b/typings/blocks.d.ts index 851c08ddd8e..cfbae6bab81 100644 --- a/typings/blocks.d.ts +++ b/typings/blocks.d.ts @@ -11,5 +11,14 @@ /// -import * as Blockly from './core'; -export = Blockly.Blocks; +export const colour: any; +export const lists: any; +export const logic: any; +export const loops: any; +export const math: any; +export const procedures: any; +export const texts: any; +export const variables: any; +export const variablesDynamic: any; + +export const blocks: any; diff --git a/typings/core.d.ts b/typings/core.d.ts index 79d38283410..21501792fe7 100644 --- a/typings/core.d.ts +++ b/typings/core.d.ts @@ -11,5 +11,4 @@ /// -import * as Blockly from 'blockly'; -export = Blockly; +export * from 'core/blockly'; diff --git a/typings/dart.d.ts b/typings/dart.d.ts index e3b27298e14..3979aa3c081 100644 --- a/typings/dart.d.ts +++ b/typings/dart.d.ts @@ -12,5 +12,5 @@ /// import * as Blockly from './core'; -declare const dart: Blockly.Generator; +declare const dart: any; export = dart; diff --git a/typings/index.d.ts b/typings/index.d.ts index fd92cae723f..038acf631bd 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -14,9 +14,7 @@ /// /// -import * as Blockly from './core'; -import './blocks'; -import './javascript'; +export * from './core'; +export * as libraryBlocks from './blocks'; +export const JavaScript: any; import './msg/msg'; - -export = Blockly; diff --git a/typings/javascript.d.ts b/typings/javascript.d.ts index 25241944379..dba476f7a32 100644 --- a/typings/javascript.d.ts +++ b/typings/javascript.d.ts @@ -12,5 +12,5 @@ /// import * as Blockly from './core'; -declare const javascript: Blockly.Generator; +declare const javascript: any; export = javascript; diff --git a/typings/lua.d.ts b/typings/lua.d.ts index 235cfe59211..b58d485869a 100644 --- a/typings/lua.d.ts +++ b/typings/lua.d.ts @@ -12,5 +12,5 @@ /// import * as Blockly from './core'; -declare const lua: Blockly.Generator; +declare const lua: any; export = lua; diff --git a/typings/php.d.ts b/typings/php.d.ts index ce64895f4e5..092d107f3ef 100644 --- a/typings/php.d.ts +++ b/typings/php.d.ts @@ -12,5 +12,5 @@ /// import * as Blockly from './core'; -declare const php: Blockly.Generator; +declare const php: any; export = php; diff --git a/typings/python.d.ts b/typings/python.d.ts index 0ee3f36d11d..beb58fba91b 100644 --- a/typings/python.d.ts +++ b/typings/python.d.ts @@ -12,5 +12,5 @@ /// import * as Blockly from './core'; -declare const python: Blockly.Generator; +declare const python: any; export = python;