From fba19fd8871af3c152985d3b91ac45e0170f404c Mon Sep 17 00:00:00 2001 From: undefined Date: Wed, 1 Mar 2023 12:48:06 +0800 Subject: [PATCH] ui: fix types --- packages/ui-default/components/scratchpad/index.tsx | 2 +- packages/ui-default/entry.js | 2 -- packages/ui-default/typed.d.ts | 5 +++++ 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 packages/ui-default/typed.d.ts diff --git a/packages/ui-default/components/scratchpad/index.tsx b/packages/ui-default/components/scratchpad/index.tsx index 33f0460c9..842f2b00b 100644 --- a/packages/ui-default/components/scratchpad/index.tsx +++ b/packages/ui-default/components/scratchpad/index.tsx @@ -13,7 +13,7 @@ import ScratchpadPretest from './ScratchpadPretestContainer'; import ScratchpadRecords from './ScratchpadRecordsContainer'; import ScratchpadToolbar from './ScratchpadToolbarContainer'; -function buildNestedPane([a, ...panes], mode = 'horizontal') { +function buildNestedPane([a, ...panes], mode: 'horizontal' | 'vertical' = 'horizontal') { const elements = [ a, ...panes.filter((p) => p.props.visible), diff --git a/packages/ui-default/entry.js b/packages/ui-default/entry.js index bafbe8f18..c96d9233a 100644 --- a/packages/ui-default/entry.js +++ b/packages/ui-default/entry.js @@ -1,5 +1,4 @@ import $ from 'jquery'; -import * as bus from './bus'; window.Hydro = { extraPages: [], @@ -7,7 +6,6 @@ window.Hydro = { utils: {}, node_modules: {}, version: process.env.VERSION, - bus, }; window.externalModules = {}; window.lazyModuleResolver = {}; diff --git a/packages/ui-default/typed.d.ts b/packages/ui-default/typed.d.ts new file mode 100644 index 000000000..f47674d71 --- /dev/null +++ b/packages/ui-default/typed.d.ts @@ -0,0 +1,5 @@ +declare module '*.svg?react' { + import { ComponentType } from 'react' + const content: ComponentType + export default content + } \ No newline at end of file