@rsdoctor/components 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Alert/change.d.ts +3 -0
- package/dist/components/Alert/ecma-version-check.d.ts +2 -0
- package/dist/components/Alert/file-relation.d.ts +3 -0
- package/dist/components/Alert/package-relation.d.ts +16 -0
- package/dist/components/Alert/types.d.ts +33 -0
- package/dist/components/Alert/view.d.ts +4 -0
- package/dist/components/Alerts/bundle-alert.d.ts +14 -0
- package/dist/components/Alerts/bundle.d.ts +11 -0
- package/dist/components/Alerts/collapse-cross-chunks.d.ts +6 -0
- package/dist/components/Alerts/collapse.d.ts +6 -0
- package/dist/components/Alerts/compile.d.ts +10 -0
- package/dist/components/Alerts/index.d.ts +3 -0
- package/dist/components/Alerts/list.d.ts +4 -0
- package/dist/components/Alerts/overlay.d.ts +26 -0
- package/dist/components/Badge/index.d.ts +21 -0
- package/dist/components/Card/diff.d.ts +24 -0
- package/dist/components/Card/index.d.ts +9 -0
- package/dist/components/Card/size.d.ts +22 -0
- package/dist/components/Card/statistic.d.ts +10 -0
- package/dist/components/Charts/TimelineCharts/index.d.ts +13 -0
- package/dist/components/Charts/TreeMap.d.ts +23 -0
- package/dist/components/Charts/TreeMap.mjs +1 -1
- package/dist/components/Charts/TreeMap.mjs.map +1 -1
- package/dist/components/Charts/bootstrap.d.ts +5 -0
- package/dist/components/Charts/common.d.ts +15 -0
- package/dist/components/Charts/constants.d.ts +19 -0
- package/dist/components/Charts/done.d.ts +5 -0
- package/dist/components/Charts/index.d.ts +10 -0
- package/dist/components/Charts/loader.d.ts +4 -0
- package/dist/components/Charts/minify.d.ts +5 -0
- package/dist/components/Charts/treemap_module.css +1 -1
- package/dist/components/Charts/treemap_module.css.map +1 -1
- package/dist/components/Charts/types.d.ts +61 -0
- package/dist/components/Charts/utils.d.ts +13 -0
- package/dist/components/Configuration/builder.d.ts +13 -0
- package/dist/components/Configuration/index.d.ts +1 -0
- package/dist/components/FileTree/index.d.ts +5 -0
- package/dist/components/Form/keyword.d.ts +14 -0
- package/dist/components/Keyword/index.d.ts +6 -0
- package/dist/components/Layout/builder-select.d.ts +2 -0
- package/dist/components/Layout/constants.d.ts +1 -0
- package/dist/components/Layout/header.d.ts +3 -0
- package/dist/components/Layout/index.d.ts +5 -0
- package/dist/components/Layout/menus.d.ts +8 -0
- package/dist/components/Layout/progress.d.ts +8 -0
- package/dist/components/Loader/Analysis/files.d.ts +9 -0
- package/dist/components/Loader/Analysis/index.d.ts +11 -0
- package/dist/components/Loader/executions.d.ts +9 -0
- package/dist/components/Manifest/api.d.ts +34 -0
- package/dist/components/Manifest/data.d.ts +8 -0
- package/dist/components/Manifest/index.d.ts +2 -0
- package/dist/components/Opener/code.d.ts +20 -0
- package/dist/components/Opener/index.d.ts +2 -0
- package/dist/components/Opener/vscode.d.ts +11 -0
- package/dist/components/Overall/DataSummary.d.ts +8 -0
- package/dist/components/Overall/bundle.d.ts +11 -0
- package/dist/components/Overall/compile.d.ts +5 -0
- package/dist/components/Overall/help-center.d.ts +1 -0
- package/dist/components/Overall/index.d.ts +3 -0
- package/dist/components/Overall/overview.d.ts +8 -0
- package/dist/components/Overall/project.d.ts +7 -0
- package/dist/components/Plugins/webpack.d.ts +18 -0
- package/dist/components/Resolver/analysis.d.ts +15 -0
- package/dist/components/Select/index.d.ts +18 -0
- package/dist/components/Status/failed.d.ts +9 -0
- package/dist/components/Status/index.d.ts +1 -0
- package/dist/components/TextDrawer/duplicate.d.ts +17 -0
- package/dist/components/TextDrawer/index.d.ts +12 -0
- package/dist/components/Title/index.d.ts +15 -0
- package/dist/components/base/CodeViewer/index.d.ts +5 -0
- package/dist/components/base/CodeViewer/interface.d.ts +45 -0
- package/dist/components/base/CodeViewer/useCodeDrawer.d.ts +9 -0
- package/dist/components/base/CodeViewer/utils.d.ts +18 -0
- package/dist/components/base/DiffViewer/index.d.ts +5 -0
- package/dist/components/base/DiffViewer/interface.d.ts +47 -0
- package/dist/components/base/DiffViewer/useDiffDrawer.d.ts +9 -0
- package/dist/components/base/DiffViewer/utils.d.ts +7 -0
- package/dist/components/base/index.d.ts +5 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/config.d.ts +19 -0
- package/dist/constants.d.ts +50 -0
- package/dist/index.d.ts +3 -0
- package/dist/pages/BundleSize/components/asset.d.ts +26 -0
- package/dist/pages/BundleSize/components/cards.d.ts +7 -0
- package/dist/pages/BundleSize/components/index.d.ts +16 -0
- package/dist/pages/BundleSize/components/search-modal.d.ts +8 -0
- package/dist/pages/BundleSize/config.d.ts +6 -0
- package/dist/pages/BundleSize/constants.d.ts +5 -0
- package/dist/pages/BundleSize/index.d.ts +3 -0
- package/dist/pages/ModuleAnalyze/chunks.d.ts +6 -0
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.d.ts +15 -0
- package/dist/pages/ModuleAnalyze/constants.d.ts +7 -0
- package/dist/pages/ModuleAnalyze/dependency.d.ts +9 -0
- package/dist/pages/ModuleAnalyze/fileTree.d.ts +10 -0
- package/dist/pages/ModuleAnalyze/index.d.ts +15 -0
- package/dist/pages/ModuleAnalyze/utils/hooks.d.ts +21 -0
- package/dist/pages/ModuleAnalyze/utils/index.d.ts +3 -0
- package/dist/pages/ModuleResolve/constants.d.ts +3 -0
- package/dist/pages/ModuleResolve/index.d.ts +3 -0
- package/dist/pages/Overall/constants.d.ts +3 -0
- package/dist/pages/Overall/index.d.ts +9 -0
- package/dist/pages/Overall/responsiveLayout.d.ts +6 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/assets.d.ts +7 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/cards.d.ts +3 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/changes.d.ts +15 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/constants.d.ts +11 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/index.d.ts +3 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/modules.d.ts +8 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/overview.d.ts +5 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/packages.d.ts +19 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/row.d.ts +9 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/types.d.ts +44 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/utils.d.ts +2 -0
- package/dist/pages/Resources/BundleDiff/DiffServerAPIProvider/index.d.ts +3 -0
- package/dist/pages/Resources/BundleDiff/constants.d.ts +11 -0
- package/dist/pages/Resources/BundleDiff/index.d.ts +4 -0
- package/dist/pages/Resources/RuleIndex/constants.d.ts +3 -0
- package/dist/pages/Resources/RuleIndex/index.d.ts +3 -0
- package/dist/pages/TreeShaking/constants.d.ts +3 -0
- package/dist/pages/TreeShaking/editor.d.ts +11 -0
- package/dist/pages/TreeShaking/index.d.ts +8 -0
- package/dist/pages/TreeShaking/open-tag.d.ts +11 -0
- package/dist/pages/TreeShaking/range.d.ts +282 -0
- package/dist/pages/TreeShaking/space.d.ts +1 -0
- package/dist/pages/TreeShaking/table.d.ts +13 -0
- package/dist/pages/TreeShaking/types.d.ts +3 -0
- package/dist/pages/TreeShaking/utils.d.ts +7 -0
- package/dist/pages/WebpackLoaders/Analysis/constants.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Analysis/index.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Overall/constants.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Overall/index.d.ts +3 -0
- package/dist/pages/WebpackLoaders/constants.d.ts +2 -0
- package/dist/pages/WebpackPlugins/constants.d.ts +3 -0
- package/dist/pages/WebpackPlugins/index.d.ts +4 -0
- package/dist/pages/index.d.ts +10 -0
- package/dist/utils/data/base.d.ts +24 -0
- package/dist/utils/data/brief.d.ts +11 -0
- package/dist/utils/data/index.d.ts +5 -0
- package/dist/utils/data/local.d.ts +14 -0
- package/dist/utils/data/remote.d.ts +10 -0
- package/dist/utils/file.d.ts +47 -0
- package/dist/utils/hooks.d.ts +30 -0
- package/dist/utils/i18n/cn.d.ts +3 -0
- package/dist/utils/i18n/en.d.ts +40 -0
- package/dist/utils/i18n/index.d.ts +2 -0
- package/dist/utils/index.d.ts +15 -0
- package/dist/utils/loader.d.ts +7 -0
- package/dist/utils/locale.d.ts +4 -0
- package/dist/utils/manifest.d.ts +24 -0
- package/dist/utils/request.d.ts +29 -0
- package/dist/utils/routes.d.ts +3 -0
- package/dist/utils/size.d.ts +2 -0
- package/dist/utils/socket.d.ts +7 -0
- package/dist/utils/storage.d.ts +15 -0
- package/dist/utils/string.d.ts +2 -0
- package/dist/utils/time.d.ts +3 -0
- package/dist/utils/url.d.ts +7 -0
- package/dist/utils/worker/index.d.ts +4 -0
- package/dist/utils/worker/master.d.ts +8 -0
- package/dist/utils/worker/types.d.ts +9 -0
- package/dist/utils/worker/utils.d.ts +7 -0
- package/dist/utils/worker/worker.d.ts +13 -0
- package/package.json +4 -4
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NewTreeNodeType } from '../utils/hooks';
|
|
3
|
+
import './fileTreeCom.scss';
|
|
4
|
+
type FileTreeProps = {
|
|
5
|
+
treeData: NewTreeNodeType[];
|
|
6
|
+
needCode?: boolean;
|
|
7
|
+
needShowAllTree?: boolean;
|
|
8
|
+
needJumpto?: boolean;
|
|
9
|
+
defaultOpened?: boolean;
|
|
10
|
+
defaultOpenFather?: number;
|
|
11
|
+
cwd: string;
|
|
12
|
+
selectedChunk?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const FileTree: React.FC<FileTreeProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Client } from '@rsdoctor/types';
|
|
2
|
+
export declare const name = "Module Analyze";
|
|
3
|
+
export declare const route = Client.RsdoctorClientRoutes.ModuleAnalyze;
|
|
4
|
+
export declare enum DevtoolsRuleClientConstant {
|
|
5
|
+
UrlQueryForModuleAnalyze = "curModuleId"
|
|
6
|
+
}
|
|
7
|
+
export declare const clsNamePrefix = "module-analyze";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const ModuleFilesTree: React.FC<{
|
|
4
|
+
modules: SDK.ModuleData[];
|
|
5
|
+
dependencies: SDK.DependencyData[];
|
|
6
|
+
curModule: SDK.ModuleData;
|
|
7
|
+
cwd: string;
|
|
8
|
+
selectedChunk: string;
|
|
9
|
+
activeTabKey: string;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './index.scss';
|
|
4
|
+
export declare enum TabList {
|
|
5
|
+
Reasons = 0,
|
|
6
|
+
Dependencies = 1,
|
|
7
|
+
BailoutReason = 2
|
|
8
|
+
}
|
|
9
|
+
export declare const ModuleAnalyzeComponent: React.FC<{
|
|
10
|
+
modules: SDK.ModuleData[];
|
|
11
|
+
cwd: string;
|
|
12
|
+
moduleId: string | number;
|
|
13
|
+
show: boolean;
|
|
14
|
+
setShow: (arg: boolean) => void;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
|
+
export type NewTreeNodeType = {
|
|
3
|
+
__RESOURCEPATH__: string;
|
|
4
|
+
id: number;
|
|
5
|
+
key: string;
|
|
6
|
+
name: string;
|
|
7
|
+
level: number;
|
|
8
|
+
kind: number;
|
|
9
|
+
size?: string;
|
|
10
|
+
concatModules: number[] | undefined;
|
|
11
|
+
chunks?: string[];
|
|
12
|
+
getChildren?: () => NewTreeNodeType[];
|
|
13
|
+
dependencies?: number[];
|
|
14
|
+
fatherPath?: string;
|
|
15
|
+
children?: number[];
|
|
16
|
+
needExpand?: boolean | string;
|
|
17
|
+
};
|
|
18
|
+
export declare function useCreateFileTreeData(modules: SDK.ModuleData[], importedModules: SDK.ModuleData[], curModule: SDK.ModuleData): {
|
|
19
|
+
data: NewTreeNodeType[];
|
|
20
|
+
};
|
|
21
|
+
export declare function getContactMainModulePath(concatModules: number[], modules: SDK.ModuleData[]): string[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
|
+
export declare const getImporteds: (curModule: SDK.ModuleData, modules: SDK.ModuleData[]) => SDK.ModuleData[];
|
|
3
|
+
export declare const getModuleReasonsTree: (curModule: SDK.ModuleData, modules: SDK.ModuleData[], reasonsTree: string[], visited: Map<number, boolean>) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface Props {
|
|
4
|
+
project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
|
|
5
|
+
}
|
|
6
|
+
export declare const Page: React.FC<Omit<Props, "project"> & Partial<{
|
|
7
|
+
body?: any;
|
|
8
|
+
}>>;
|
|
9
|
+
export * from './constants';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SDK } from '@rsdoctor/types';
|
|
3
|
+
export declare const Assets: React.FC<{
|
|
4
|
+
outputFilename: string;
|
|
5
|
+
baseline: SDK.ServerAPI.ResponseTypes[SDK.ServerAPI.API.GetBundleDiffSummary];
|
|
6
|
+
current: SDK.ServerAPI.ResponseTypes[SDK.ServerAPI.API.GetBundleDiffSummary];
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ViewChangesContentProps {
|
|
3
|
+
file: string;
|
|
4
|
+
data: {
|
|
5
|
+
baseline?: string | void;
|
|
6
|
+
current: string | void;
|
|
7
|
+
baselineTitle?: string;
|
|
8
|
+
currentTitle?: string;
|
|
9
|
+
group: string;
|
|
10
|
+
}[];
|
|
11
|
+
}
|
|
12
|
+
export declare const ViewChanges: React.FC<ViewChangesContentProps & {
|
|
13
|
+
text?: string;
|
|
14
|
+
}>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BundleDiffComponentCardProps, BundleDiffTableModulesData } from './types';
|
|
3
|
+
import { UpdateType } from './constants';
|
|
4
|
+
export declare function getUpdateType(e: BundleDiffTableModulesData): UpdateType;
|
|
5
|
+
export declare const FileUpdateTypeTag: React.FC<{
|
|
6
|
+
type: UpdateType;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const Modules: React.FC<BundleDiffComponentCardProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SDK } from '@rsdoctor/types';
|
|
3
|
+
import { UpdateType } from './constants';
|
|
4
|
+
export declare const PackagesStatistic: React.FC<{
|
|
5
|
+
dataSource: ReturnType<typeof getPackagesTableDataSource>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const getPackagesTableDataSource: ({ baseline, current, }: {
|
|
8
|
+
baseline: SDK.PackageGraphData;
|
|
9
|
+
current: SDK.PackageGraphData;
|
|
10
|
+
}) => {
|
|
11
|
+
updateType: UpdateType;
|
|
12
|
+
name: string;
|
|
13
|
+
baseline?: SDK.PackageData[];
|
|
14
|
+
current?: SDK.PackageData[];
|
|
15
|
+
}[];
|
|
16
|
+
export declare const Packages: React.FC<{
|
|
17
|
+
baseline: SDK.PackageGraphData;
|
|
18
|
+
current: SDK.PackageGraphData;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColumnGroupType, ColumnType } from 'antd/es/table/interface';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BundleDiffComponentCardProps, BundleDiffTableAssetsData, BundleDiffTableModulesData } from './types';
|
|
4
|
+
export declare const ModuleHashPattern: RegExp;
|
|
5
|
+
export declare const getSizeColumnPropsForModuleRow: (key: "baseline" | "current", sizeKey: "parsedSize" | "sourceSize", sortByChanged?: boolean) => ColumnType<BundleDiffTableModulesData>;
|
|
6
|
+
export declare const getTargetColumnPropsForModuleRow: (key: "baseline" | "current", bModulesCount: number, cModulesCount: number) => ColumnGroupType<BundleDiffTableModulesData>;
|
|
7
|
+
export declare const ModuleRowForAsset: React.FC<{
|
|
8
|
+
data: BundleDiffTableAssetsData;
|
|
9
|
+
} & Pick<BundleDiffComponentCardProps, 'baseline' | 'current'>>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Client, Manifest, SDK } from '@rsdoctor/types';
|
|
2
|
+
import { UpdateType } from './constants';
|
|
3
|
+
import { InferServerAPIBody } from '../../../../components/Manifest/api';
|
|
4
|
+
export type BundleDiffServerAPIProviderComponentCommonProps<T extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends> = {
|
|
5
|
+
manifests?: Manifest.RsdoctorManifest[];
|
|
6
|
+
api: T;
|
|
7
|
+
children: (baseline: SDK.ServerAPI.InferResponseType<T>, current: SDK.ServerAPI.InferResponseType<T>) => JSX.Element;
|
|
8
|
+
} & InferServerAPIBody<T>;
|
|
9
|
+
export interface BundleDiffContainerProps {
|
|
10
|
+
manifests: Manifest.RsdoctorManifest[];
|
|
11
|
+
}
|
|
12
|
+
export interface BundleDiffComponentCommonProps {
|
|
13
|
+
baseline: Manifest.RsdoctorManifest;
|
|
14
|
+
current: Manifest.RsdoctorManifest;
|
|
15
|
+
onlyBaseline: boolean;
|
|
16
|
+
assetsDiffResult: Client.RsdoctorClientAssetsDiffResult;
|
|
17
|
+
}
|
|
18
|
+
export interface BundleDiffComponentCardProps {
|
|
19
|
+
baseline: SDK.ServerAPI.ResponseTypes[SDK.ServerAPI.API.GetBundleDiffSummary];
|
|
20
|
+
current: SDK.ServerAPI.ResponseTypes[SDK.ServerAPI.API.GetBundleDiffSummary];
|
|
21
|
+
onlyBaseline: boolean;
|
|
22
|
+
assetsDiffResult: Client.RsdoctorClientAssetsDiffResult;
|
|
23
|
+
}
|
|
24
|
+
export interface BundleDiffTableOverviewData {
|
|
25
|
+
total: Client.RsdoctorClientAssetsDiffItem;
|
|
26
|
+
initial?: Client.RsdoctorClientAssetsDiffItem;
|
|
27
|
+
}
|
|
28
|
+
export interface BundleDiffTableAssetsData {
|
|
29
|
+
alias: string;
|
|
30
|
+
baseline?: SDK.AssetData;
|
|
31
|
+
current?: SDK.AssetData;
|
|
32
|
+
}
|
|
33
|
+
export interface BundleDiffTableModulesData {
|
|
34
|
+
path: string;
|
|
35
|
+
baseline?: SDK.ModuleData;
|
|
36
|
+
current?: SDK.ModuleData;
|
|
37
|
+
__is_baseline__?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface BundleDiffTablePackagesData {
|
|
40
|
+
name: string;
|
|
41
|
+
updateType: UpdateType;
|
|
42
|
+
baseline?: SDK.PackageData[];
|
|
43
|
+
current?: SDK.PackageData[];
|
|
44
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
|
+
import { BundleDiffServerAPIProviderComponentCommonProps } from '../DiffContainer/types';
|
|
3
|
+
export declare const DiffServerAPIProvider: <T extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends>(props: BundleDiffServerAPIProviderComponentCommonProps<T>) => JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Client, Manifest } from '@rsdoctor/types';
|
|
3
|
+
export declare const name = "Bundle Diff";
|
|
4
|
+
export declare const route = Client.RsdoctorClientRoutes.BundleDiff;
|
|
5
|
+
export declare const BundleDiffContext: React.Context<{
|
|
6
|
+
manifests: Manifest.RsdoctorManifest[];
|
|
7
|
+
setManifests(_manifests: Manifest.RsdoctorManifest[]): void;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
setLoading(_loading: boolean): void;
|
|
10
|
+
withLoading(_func: (...args: unknown[]) => Promise<unknown> | unknown): Promise<void>;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
|
+
import { SetEditorStatus } from './types';
|
|
3
|
+
export interface CodeEditorProps {
|
|
4
|
+
module: SDK.ModuleInstance;
|
|
5
|
+
moduleGraph: SDK.ModuleGraphInstance;
|
|
6
|
+
ranges: SDK.SourceRange[];
|
|
7
|
+
setEditorData: SetEditorStatus;
|
|
8
|
+
source: SDK.ModuleSource;
|
|
9
|
+
toLine?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function CodeEditor(props: CodeEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
|
+
export declare enum AttributeKey {
|
|
3
|
+
Module = "data-module",
|
|
4
|
+
Range = "data-range"
|
|
5
|
+
}
|
|
6
|
+
export interface OpenTagData {
|
|
7
|
+
module: number;
|
|
8
|
+
range: SDK.SourceRange;
|
|
9
|
+
}
|
|
10
|
+
export declare function getOpenTagText(module: number, range: SDK.SourceRange, text: string): string;
|
|
11
|
+
export declare function parseOpenTag(dom: HTMLElement): OpenTagData | undefined;
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following is modified based on source found in
|
|
3
|
+
* https://github.com/microsoft/monaco-editor
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Copyright (c) 2016 - present Microsoft Corporation
|
|
7
|
+
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
8
|
+
*/
|
|
9
|
+
export declare class Range {
|
|
10
|
+
startLineNumber: number;
|
|
11
|
+
startColumn: number;
|
|
12
|
+
endLineNumber: number;
|
|
13
|
+
endColumn: number;
|
|
14
|
+
constructor(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number);
|
|
15
|
+
/**
|
|
16
|
+
* Test if this range is empty.
|
|
17
|
+
*/
|
|
18
|
+
isEmpty(): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Test if `range` is empty.
|
|
21
|
+
*/
|
|
22
|
+
static isEmpty(range: Range): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Test if position is in this range. If the position is at the edges, will return true.
|
|
25
|
+
*/
|
|
26
|
+
containsPosition(position: any): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Test if `position` is in `range`. If the position is at the edges, will return true.
|
|
29
|
+
*/
|
|
30
|
+
static containsPosition(range: Range, position: {
|
|
31
|
+
lineNumber: number;
|
|
32
|
+
column: number;
|
|
33
|
+
}): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Test if `position` is in `range`. If the position is at the edges, will return false.
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
static strictContainsPosition(range: Range, position: {
|
|
39
|
+
lineNumber: number;
|
|
40
|
+
column: number;
|
|
41
|
+
}): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Test if range is in this range. If the range is equal to this range, will return true.
|
|
44
|
+
*/
|
|
45
|
+
containsRange(range: Range): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Test if `otherRange` is in `range`. If the ranges are equal, will return true.
|
|
48
|
+
*/
|
|
49
|
+
static containsRange(range: Range, otherRange: {
|
|
50
|
+
startLineNumber: number;
|
|
51
|
+
endLineNumber: number;
|
|
52
|
+
startColumn: number;
|
|
53
|
+
endColumn: number;
|
|
54
|
+
}): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true.
|
|
57
|
+
*/
|
|
58
|
+
strictContainsRange(range: Range): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Test if `otherRange` is strictly in `range` (must start after, and end before). If the ranges are equal, will return false.
|
|
61
|
+
*/
|
|
62
|
+
static strictContainsRange(range: Range, otherRange: {
|
|
63
|
+
startLineNumber: number;
|
|
64
|
+
endLineNumber: number;
|
|
65
|
+
startColumn: number;
|
|
66
|
+
endColumn: number;
|
|
67
|
+
}): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* A reunion of the two ranges.
|
|
70
|
+
* The smallest position will be used as the start point, and the largest one as the end point.
|
|
71
|
+
*/
|
|
72
|
+
plusRange(range: Range): Range;
|
|
73
|
+
/**
|
|
74
|
+
* A reunion of the two ranges.
|
|
75
|
+
* The smallest position will be used as the start point, and the largest one as the end point.
|
|
76
|
+
*/
|
|
77
|
+
static plusRange(a: Range, b: Range): Range;
|
|
78
|
+
/**
|
|
79
|
+
* A intersection of the two ranges.
|
|
80
|
+
*/
|
|
81
|
+
intersectRanges(range: Range): Range | null;
|
|
82
|
+
/**
|
|
83
|
+
* A intersection of the two ranges.
|
|
84
|
+
*/
|
|
85
|
+
static intersectRanges(a: Range, b: Range): Range | null;
|
|
86
|
+
/**
|
|
87
|
+
* Test if this range equals other.
|
|
88
|
+
*/
|
|
89
|
+
equalsRange(other: Range): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Test if range `a` equals `b`.
|
|
92
|
+
*/
|
|
93
|
+
static equalsRange(a: Range, b: Range): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Return the end position (which will be after or equal to the start position)
|
|
96
|
+
*/
|
|
97
|
+
getEndPosition(): Position;
|
|
98
|
+
/**
|
|
99
|
+
* Return the end position (which will be after or equal to the start position)
|
|
100
|
+
*/
|
|
101
|
+
static getEndPosition(range: Range): Position;
|
|
102
|
+
/**
|
|
103
|
+
* Return the start position (which will be before or equal to the end position)
|
|
104
|
+
*/
|
|
105
|
+
getStartPosition(): Position;
|
|
106
|
+
/**
|
|
107
|
+
* Return the start position (which will be before or equal to the end position)
|
|
108
|
+
*/
|
|
109
|
+
static getStartPosition(range: Range): Position;
|
|
110
|
+
/**
|
|
111
|
+
* Transform to a user presentable string representation.
|
|
112
|
+
*/
|
|
113
|
+
toString(): string;
|
|
114
|
+
/**
|
|
115
|
+
* Create a new range using this range's start position, and using endLineNumber and endColumn as the end position.
|
|
116
|
+
*/
|
|
117
|
+
setEndPosition(endLineNumber: number, endColumn: number): Range;
|
|
118
|
+
/**
|
|
119
|
+
* Create a new range using this range's end position, and using startLineNumber and startColumn as the start position.
|
|
120
|
+
*/
|
|
121
|
+
setStartPosition(startLineNumber: number, startColumn: number): Range;
|
|
122
|
+
/**
|
|
123
|
+
* Create a new empty range using this range's start position.
|
|
124
|
+
*/
|
|
125
|
+
collapseToStart(): Range;
|
|
126
|
+
/**
|
|
127
|
+
* Create a new empty range using this range's start position.
|
|
128
|
+
*/
|
|
129
|
+
static collapseToStart(range: Range): Range;
|
|
130
|
+
/**
|
|
131
|
+
* Create a new empty range using this range's end position.
|
|
132
|
+
*/
|
|
133
|
+
collapseToEnd(): Range;
|
|
134
|
+
/**
|
|
135
|
+
* Create a new empty range using this range's end position.
|
|
136
|
+
*/
|
|
137
|
+
static collapseToEnd(range: Range): Range;
|
|
138
|
+
/**
|
|
139
|
+
* Moves the range by the given amount of lines.
|
|
140
|
+
*/
|
|
141
|
+
delta(lineCount: number): Range;
|
|
142
|
+
static fromPositions(start: {
|
|
143
|
+
lineNumber: number;
|
|
144
|
+
column: number;
|
|
145
|
+
}, end?: {
|
|
146
|
+
lineNumber: number;
|
|
147
|
+
column: number;
|
|
148
|
+
}): Range;
|
|
149
|
+
static lift(range: Range): Range | null;
|
|
150
|
+
/**
|
|
151
|
+
* Test if `obj` is an `IRange`.
|
|
152
|
+
*/
|
|
153
|
+
static isIRange(obj: Range): boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Test if the two ranges are touching in any way.
|
|
156
|
+
*/
|
|
157
|
+
static areIntersectingOrTouching(a: Range, b: Range): boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Test if the two ranges are intersecting. If the ranges are touching it returns true.
|
|
160
|
+
*/
|
|
161
|
+
static areIntersecting(a: Range, b: Range): boolean;
|
|
162
|
+
/**
|
|
163
|
+
* A function that compares ranges, useful for sorting ranges
|
|
164
|
+
* It will first compare ranges on the startPosition and then on the endPosition
|
|
165
|
+
*/
|
|
166
|
+
static compareRangesUsingStarts(a: Range, b: Range): number;
|
|
167
|
+
/**
|
|
168
|
+
* A function that compares ranges, useful for sorting ranges
|
|
169
|
+
* It will first compare ranges on the endPosition and then on the startPosition
|
|
170
|
+
*/
|
|
171
|
+
static compareRangesUsingEnds(a: {
|
|
172
|
+
endLineNumber: number;
|
|
173
|
+
endColumn: number;
|
|
174
|
+
startLineNumber: number;
|
|
175
|
+
startColumn: number;
|
|
176
|
+
}, b: {
|
|
177
|
+
endLineNumber: number;
|
|
178
|
+
endColumn: number;
|
|
179
|
+
startLineNumber: number;
|
|
180
|
+
startColumn: number;
|
|
181
|
+
}): number;
|
|
182
|
+
/**
|
|
183
|
+
* Test if the range spans multiple lines.
|
|
184
|
+
*/
|
|
185
|
+
static spansMultipleLines(range: Range): boolean;
|
|
186
|
+
toJSON(): this;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* A position in the editor.
|
|
190
|
+
*/
|
|
191
|
+
export declare class Position {
|
|
192
|
+
lineNumber: number;
|
|
193
|
+
column: number;
|
|
194
|
+
constructor(lineNumber: number, column: number);
|
|
195
|
+
/**
|
|
196
|
+
* Create a new position from this position.
|
|
197
|
+
*
|
|
198
|
+
* @param newLineNumber new line number
|
|
199
|
+
* @param newColumn new column
|
|
200
|
+
*/
|
|
201
|
+
with(newLineNumber?: number, newColumn?: number): Position;
|
|
202
|
+
/**
|
|
203
|
+
* Derive a new position from this position.
|
|
204
|
+
*
|
|
205
|
+
* @param deltaLineNumber line number delta
|
|
206
|
+
* @param deltaColumn column delta
|
|
207
|
+
*/
|
|
208
|
+
delta(deltaLineNumber?: number, deltaColumn?: number): Position;
|
|
209
|
+
/**
|
|
210
|
+
* Test if this position equals other position
|
|
211
|
+
*/
|
|
212
|
+
equals(other: any): boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Test if position `a` equals position `b`
|
|
215
|
+
*/
|
|
216
|
+
static equals(a: any, b: {
|
|
217
|
+
lineNumber: any;
|
|
218
|
+
column: any;
|
|
219
|
+
}): boolean;
|
|
220
|
+
/**
|
|
221
|
+
* Test if this position is before other position.
|
|
222
|
+
* If the two positions are equal, the result will be false.
|
|
223
|
+
*/
|
|
224
|
+
isBefore(other: any): boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Test if position `a` is before position `b`.
|
|
227
|
+
* If the two positions are equal, the result will be false.
|
|
228
|
+
*/
|
|
229
|
+
static isBefore(a: any, b: {
|
|
230
|
+
lineNumber: number;
|
|
231
|
+
column: number;
|
|
232
|
+
}): boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Test if this position is before other position.
|
|
235
|
+
* If the two positions are equal, the result will be true.
|
|
236
|
+
*/
|
|
237
|
+
isBeforeOrEqual(other: any): boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Test if position `a` is before position `b`.
|
|
240
|
+
* If the two positions are equal, the result will be true.
|
|
241
|
+
*/
|
|
242
|
+
static isBeforeOrEqual(a: any, b: {
|
|
243
|
+
lineNumber: number;
|
|
244
|
+
column: number;
|
|
245
|
+
}): boolean;
|
|
246
|
+
/**
|
|
247
|
+
* A function that compares positions, useful for sorting
|
|
248
|
+
*/
|
|
249
|
+
static compare(a: {
|
|
250
|
+
lineNumber: number;
|
|
251
|
+
column: number;
|
|
252
|
+
}, b: {
|
|
253
|
+
lineNumber: number;
|
|
254
|
+
column: number;
|
|
255
|
+
}): number;
|
|
256
|
+
/**
|
|
257
|
+
* Clone this position.
|
|
258
|
+
*/
|
|
259
|
+
clone(): Position;
|
|
260
|
+
/**
|
|
261
|
+
* Convert to a human-readable representation.
|
|
262
|
+
*/
|
|
263
|
+
toString(): string;
|
|
264
|
+
/**
|
|
265
|
+
* Create a `Position` from an `IPosition`.
|
|
266
|
+
*/
|
|
267
|
+
static lift(pos: {
|
|
268
|
+
lineNumber: any;
|
|
269
|
+
column: any;
|
|
270
|
+
}): Position;
|
|
271
|
+
/**
|
|
272
|
+
* Test if `obj` is an `IPosition`.
|
|
273
|
+
*/
|
|
274
|
+
static isIPosition(obj: {
|
|
275
|
+
lineNumber: any;
|
|
276
|
+
column: any;
|
|
277
|
+
}): boolean;
|
|
278
|
+
toJSON(): {
|
|
279
|
+
lineNumber: number;
|
|
280
|
+
column: number;
|
|
281
|
+
};
|
|
282
|
+
}
|