Skip to content

Commit

Permalink
fix: update import statements to use type imports
Browse files Browse the repository at this point in the history
  • Loading branch information
liujuping committed Mar 7, 2024
1 parent acb555f commit eb6e80b
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 34 deletions.
2 changes: 1 addition & 1 deletion packages/designer/src/designer/dragon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { setNativeSelection, cursor } from '@alilc/lowcode-utils';
import { INode, Node } from '../document';
import { ISimulatorHost, isSimulatorHost } from '../simulator';
import { IDesigner } from './designer';
import type { IDesigner } from './designer';
import { makeEventsHandler } from '../utils/misc';

export interface ILocateEvent extends IPublicModelLocateEvent {
Expand Down
8 changes: 4 additions & 4 deletions packages/designer/src/designer/setting/setting-entry-type.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IPublicApiSetters, IPublicModelEditor } from '@alilc/lowcode-types';
import { IDesigner } from '../designer';
import { INode } from '../../document';
import { ISettingField } from './setting-field';
import type { IPublicApiSetters, IPublicModelEditor } from '@alilc/lowcode-types';
import type { IDesigner } from '../designer';
import type { INode } from '../../document';
import type { ISettingField } from './setting-field';

export interface ISettingEntry {
readonly designer: IDesigner | undefined;
Expand Down
6 changes: 3 additions & 3 deletions packages/designer/src/designer/setting/setting-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Transducer } from './utils';
import { SettingPropEntry } from './setting-prop-entry';
import { computed, obx, makeObservable, action, untracked, intl } from '@alilc/lowcode-editor-core';
import { cloneDeep, isCustomView, isDynamicSetter, isJSExpression } from '@alilc/lowcode-utils';
import { ISettingTopEntry } from './setting-top-entry';
import type { ISettingTopEntry } from './setting-top-entry';

function getSettingFieldCollectorKey(parent: ISettingTopEntry | ISettingField, config: IPublicTypeFieldConfig) {
let cur = parent;
Expand All @@ -28,8 +28,6 @@ function getSettingFieldCollectorKey(parent: ISettingTopEntry | ISettingField, c
return path.join('.');
}

export interface ISettingField extends SettingField {}

export class SettingField extends SettingPropEntry {
readonly isSettingField = true;

Expand Down Expand Up @@ -273,3 +271,5 @@ export class SettingField extends SettingPropEntry {
export function isSettingField(obj: any): obj is ISettingField {
return obj && obj.isSettingField;
}

export type ISettingField = typeof SettingField;
12 changes: 6 additions & 6 deletions packages/designer/src/designer/setting/setting-prop-entry.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { obx, computed, makeObservable, runInAction, IEventBus, createModuleEventBus } from '@alilc/lowcode-editor-core';
import { GlobalEvent, IPublicApiSetters, IPublicModelEditor, IPublicModelSettingField, IPublicTypeFieldExtraProps, IPublicTypeSetValueOptions } from '@alilc/lowcode-types';
import { uniqueId, isJSExpression } from '@alilc/lowcode-utils';
import { ISettingEntry } from './setting-entry-type';
import { INode } from '../../document';
import { uniqueId, isJSExpression, isSettingField } from '@alilc/lowcode-utils';
import type { ISettingEntry } from './setting-entry-type';
import type { INode } from '../../document';
import type { IComponentMeta } from '../../component-meta';
import { IDesigner } from '../designer';
import { ISettingTopEntry } from './setting-top-entry';
import { ISettingField, isSettingField } from './setting-field';
import type { IDesigner } from '../designer';
import type { ISettingTopEntry } from './setting-top-entry';
import type { ISettingField } from './setting-field';

export interface ISettingPropEntry extends ISettingEntry {
readonly isGroup: boolean;
Expand Down
9 changes: 5 additions & 4 deletions packages/designer/src/designer/setting/setting-top-entry.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { IPublicTypeCustomView, IPublicModelEditor, IPublicModelSettingTopEntry, IPublicApiSetters } from '@alilc/lowcode-types';
import { isCustomView } from '@alilc/lowcode-utils';
import { computed, IEventBus, createModuleEventBus, obx, makeObservable } from '@alilc/lowcode-editor-core';
import { ISettingEntry } from './setting-entry-type';
import { ISettingField, SettingField } from './setting-field';
import { INode } from '../../document';
import { SettingField } from './setting-field';
import type { ISettingEntry } from './setting-entry-type';
import type { ISettingField } from './setting-field';
import type { INode } from '../../document';
import type { IComponentMeta } from '../../component-meta';
import { IDesigner } from '../designer';
import type { IDesigner } from '../designer';

function generateSessionId(nodes: INode[]) {
return nodes
Expand Down
6 changes: 3 additions & 3 deletions packages/designer/src/document/document-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ import {
isDragNodeDataObject,
isNode,
} from '@alilc/lowcode-utils';
import { IProject } from '../project';
import { ISimulatorHost } from '../simulator';
import type { IProject } from '../project';
import type { ISimulatorHost } from '../simulator';
import type { IComponentMeta } from '../component-meta';
import { IDesigner, IHistory } from '../designer';
import type { IDesigner, IHistory } from '../designer';
import { insertChildren, insertChild, IRootNode } from './node/node';
import type { INode } from './node/node';
import { Selection, ISelection } from './selection';
Expand Down
2 changes: 1 addition & 1 deletion packages/designer/src/document/document-view.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component } from 'react';
import classNames from 'classnames';
import { observer } from '@alilc/lowcode-editor-core';
import { DocumentModel, IDocumentModel } from './document-model';
import type { IDocumentModel } from './document-model';
import { BuiltinSimulatorHostView } from '../builtin-simulator';

@observer
Expand Down
2 changes: 1 addition & 1 deletion packages/designer/src/document/history.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { reaction, untracked, IEventBus, createModuleEventBus } from '@alilc/lowcode-editor-core';
import { IPublicTypeNodeSchema, IPublicModelHistory, IPublicTypeDisposable } from '@alilc/lowcode-types';
import { Logger } from '@alilc/lowcode-utils';
import { IDocumentModel } from '../designer';
import type { IDocumentModel } from '../designer';

const logger = new Logger({ level: 'warn', bizName: 'history' });

Expand Down
10 changes: 5 additions & 5 deletions packages/designer/src/document/node/node-children.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { obx, computed, makeObservable, IEventBus, createModuleEventBus } from '@alilc/lowcode-editor-core';
import { Node, INode } from './node';
import type { INode } from './node';
import { IPublicTypeNodeData, IPublicModelNodeChildren, IPublicEnumTransformStage, IPublicTypeDisposable } from '@alilc/lowcode-types';
import { shallowEqual, compatStage, isNodeSchema } from '@alilc/lowcode-utils';
import { foreachReverse } from '../../utils/tree';
import { NodeRemoveOptions } from '../../types';

export interface IOnChangeOptions {
type: string;
node: Node;
node: INode;
}

export class NodeChildren implements Omit<IPublicModelNodeChildren<INode>,
Expand Down Expand Up @@ -80,7 +80,7 @@ export class NodeChildren implements Omit<IPublicModelNodeChildren<INode>,
const originChildren = this.children.slice();
this.children.forEach((child) => child.internalSetParent(null));

const children = new Array<Node>(data.length);
const children = new Array<INode>(data.length);
for (let i = 0, l = data.length; i < l; i++) {
const child = originChildren[i];
const item = data[i];
Expand Down Expand Up @@ -169,14 +169,14 @@ export class NodeChildren implements Omit<IPublicModelNodeChildren<INode>,
if (node.isParentalNode) {
foreachReverse(
node.children!,
(subNode: Node) => {
(subNode: INode) => {
subNode.remove(useMutator, purge, options);
},
(iterable, idx) => (iterable as NodeChildren).get(idx),
);
foreachReverse(
node.slots,
(slotNode: Node) => {
(slotNode: INode) => {
slotNode.remove(useMutator, purge);
},
(iterable, idx) => (iterable as [])[idx],
Expand Down
6 changes: 3 additions & 3 deletions packages/designer/src/document/node/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import {
IBaseModelNode,
} from '@alilc/lowcode-types';
import { compatStage, isDOMText, isJSExpression, isNode, isNodeSchema } from '@alilc/lowcode-utils';
import { ISettingTopEntry } from '@alilc/lowcode-designer';
import type { ISettingTopEntry } from '@alilc/lowcode-designer';
import { Props, getConvertedExtraKey, IProps } from './props/props';
import type { IDocumentModel } from '../document-model';
import { NodeChildren, INodeChildren } from './node-children';
import { IProp, Prop } from './props/prop';
import type { IProp } from './props/prop';
import type { IComponentMeta } from '../../component-meta';
import { ExclusiveGroup, isExclusiveGroup } from './exclusive-group';
import type { IExclusiveGroup } from './exclusive-group';
Expand Down Expand Up @@ -495,7 +495,7 @@ export class Node<Schema extends IPublicTypeNodeSchema = IPublicTypeNodeSchema>
}
}

internalSetSlotFor(slotFor: Prop | null | undefined) {
internalSetSlotFor(slotFor: IProp | null | undefined) {
this._slotFor = slotFor;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Component, MouseEvent, Fragment, ReactNode } from 'react';
import { shallowIntl, observer, obx, engineConfig, runInAction } from '@alilc/lowcode-editor-core';
import { createContent, isJSSlot, isSetterConfig, shouldUseVariableSetter } from '@alilc/lowcode-utils';
import { createContent, isJSSlot, isSetterConfig, shouldUseVariableSetter, isSettingField } from '@alilc/lowcode-utils';
import { Skeleton, Stage } from '@alilc/lowcode-editor-skeleton';
import { IPublicApiSetters, IPublicTypeCustomView, IPublicTypeDynamicProps } from '@alilc/lowcode-types';
import { ISettingEntry, IComponentMeta, ISettingField, isSettingField, ISettingTopEntry } from '@alilc/lowcode-designer';
import type { ISettingEntry, IComponentMeta, ISettingField, ISettingTopEntry } from '@alilc/lowcode-designer';
import { createField } from '../field';
import PopupService, { PopupPipe } from '../popup';
import { SkeletonContext } from '../../context';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { Tab, Breadcrumb } from '@alifd/next';
import { Title, observer, Editor, obx, globalContext, engineConfig, makeObservable } from '@alilc/lowcode-editor-core';
import { ISettingField, INode } from '@alilc/lowcode-designer';
import type { ISettingField, INode } from '@alilc/lowcode-designer';
import classNames from 'classnames';
import { SettingsMain } from './main';
import { SettingsPane } from './settings-pane';
Expand Down

0 comments on commit eb6e80b

Please sign in to comment.