@nexiq/extension-sdk 1.0.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/extension-sdk/src/index.d.ts +94 -0
- package/dist/extension-sdk/src/index.js +2 -0
- package/dist/extension-sdk/src/tasks/componentTask.d.ts +2 -0
- package/dist/extension-sdk/src/tasks/componentTask.js +129 -0
- package/dist/extension-sdk/src/tasks/gitTask.d.ts +6 -0
- package/dist/extension-sdk/src/tasks/gitTask.js +69 -0
- package/dist/shared/src/component.d.ts +273 -0
- package/dist/shared/src/component.js +1 -0
- package/dist/shared/src/index.d.ts +126 -0
- package/dist/shared/src/index.js +3 -0
- package/dist/shared/src/types/backend.d.ts +109 -0
- package/dist/shared/src/types/backend.js +1 -0
- package/dist/shared/src/types/config.d.ts +42 -0
- package/dist/shared/src/types/config.js +1 -0
- package/dist/shared/src/types/git.d.ts +41 -0
- package/dist/shared/src/types/git.js +1 -0
- package/dist/shared/src/types/index.d.ts +80 -0
- package/dist/shared/src/types/index.js +5 -0
- package/dist/shared/src/types/object.d.ts +24 -0
- package/dist/shared/src/types/object.js +1 -0
- package/dist/shared/src/types/primitive.d.ts +175 -0
- package/dist/shared/src/types/primitive.js +1 -0
- package/dist/shared/src/utils.d.ts +5 -0
- package/dist/shared/src/utils.js +81 -0
- package/eslint.config.js +31 -0
- package/package.json +35 -0
- package/src/index.ts +112 -0
- package/src/tasks/componentTask.ts +166 -0
- package/src/tasks/gitTask.ts +83 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { ComponentFile, ComponentFileVar, PropData, EffectInfo, ComponentDBResolve } from "./component.js";
|
|
2
|
+
export type DataEdge = {
|
|
3
|
+
from: string;
|
|
4
|
+
to: string;
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
export interface EntityRow {
|
|
8
|
+
id: string;
|
|
9
|
+
scope_id: string;
|
|
10
|
+
kind: string;
|
|
11
|
+
name: string | null;
|
|
12
|
+
type: string | null;
|
|
13
|
+
line: number | null;
|
|
14
|
+
column: number | null;
|
|
15
|
+
end_line: number | null;
|
|
16
|
+
end_column: number | null;
|
|
17
|
+
declaration_kind: string | null;
|
|
18
|
+
data_json: string | null;
|
|
19
|
+
}
|
|
20
|
+
export interface ScopeRow {
|
|
21
|
+
id: string;
|
|
22
|
+
file_id: number;
|
|
23
|
+
parent_id: string | null;
|
|
24
|
+
kind: string;
|
|
25
|
+
entity_id: string | null;
|
|
26
|
+
data_json: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface SymbolRow {
|
|
29
|
+
id: string;
|
|
30
|
+
entity_id: string;
|
|
31
|
+
scope_id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
path: string | null;
|
|
34
|
+
is_alias: number;
|
|
35
|
+
has_default: number;
|
|
36
|
+
data_json: string | null;
|
|
37
|
+
}
|
|
38
|
+
export interface RenderRow {
|
|
39
|
+
id: string;
|
|
40
|
+
file_id: number;
|
|
41
|
+
parent_entity_id: string;
|
|
42
|
+
parent_render_id: string | null;
|
|
43
|
+
render_index: number;
|
|
44
|
+
tag: string;
|
|
45
|
+
symbol_id: string | null;
|
|
46
|
+
line: number | null;
|
|
47
|
+
column: number | null;
|
|
48
|
+
kind: string;
|
|
49
|
+
data_json: string | null;
|
|
50
|
+
}
|
|
51
|
+
export interface RelationRow {
|
|
52
|
+
from_id: string;
|
|
53
|
+
to_id: string;
|
|
54
|
+
kind: string;
|
|
55
|
+
line: number | null;
|
|
56
|
+
column: number | null;
|
|
57
|
+
data_json: string | null;
|
|
58
|
+
}
|
|
59
|
+
export interface FileRow {
|
|
60
|
+
id: number;
|
|
61
|
+
path: string;
|
|
62
|
+
hash: string;
|
|
63
|
+
fingerprint: string;
|
|
64
|
+
default_export: string | null;
|
|
65
|
+
star_exports_json: string | null;
|
|
66
|
+
}
|
|
67
|
+
export interface ExportRow {
|
|
68
|
+
id: string;
|
|
69
|
+
scope_id: string;
|
|
70
|
+
symbol_id: string | null;
|
|
71
|
+
entity_id: string | null;
|
|
72
|
+
name: string | null;
|
|
73
|
+
is_default: number;
|
|
74
|
+
}
|
|
75
|
+
export type DatabaseData = {
|
|
76
|
+
files: FileRow[];
|
|
77
|
+
entities: EntityRow[];
|
|
78
|
+
scopes: ScopeRow[];
|
|
79
|
+
symbols: SymbolRow[];
|
|
80
|
+
renders: RenderRow[];
|
|
81
|
+
exports: ExportRow[];
|
|
82
|
+
relations: RelationRow[];
|
|
83
|
+
diff?: AnalyzedDiff;
|
|
84
|
+
};
|
|
85
|
+
export type AnalyzedDiff = {
|
|
86
|
+
added: string[];
|
|
87
|
+
modified: string[];
|
|
88
|
+
deleted: string[];
|
|
89
|
+
deletedObjects?: Record<string, ComponentFileVar | PropData | EffectInfo>;
|
|
90
|
+
};
|
|
91
|
+
export type JsonData = {
|
|
92
|
+
src: string;
|
|
93
|
+
edges: DataEdge[];
|
|
94
|
+
files: Record<string, ComponentFile>;
|
|
95
|
+
labels?: Record<string, string[]>;
|
|
96
|
+
diff?: AnalyzedDiff;
|
|
97
|
+
resolve: ComponentDBResolve[];
|
|
98
|
+
};
|
|
99
|
+
export interface BenchmarkToolCall {
|
|
100
|
+
id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
arguments: Record<string, unknown>;
|
|
103
|
+
}
|
|
104
|
+
export interface BenchmarkStep {
|
|
105
|
+
role: "user" | "assistant" | "tool" | "system";
|
|
106
|
+
content?: string;
|
|
107
|
+
toolCalls?: BenchmarkToolCall[];
|
|
108
|
+
toolCallId?: string;
|
|
109
|
+
toolName?: string;
|
|
110
|
+
tokens: number;
|
|
111
|
+
}
|
|
112
|
+
export interface BenchmarkResult {
|
|
113
|
+
scenarioId: string;
|
|
114
|
+
projectName: string;
|
|
115
|
+
approach: "baseline" | "react-map-cold" | "react-map-warm";
|
|
116
|
+
testType: "single-prompt" | "planning";
|
|
117
|
+
model: string;
|
|
118
|
+
success: boolean;
|
|
119
|
+
totalTokens: number;
|
|
120
|
+
toolCallsCount: number;
|
|
121
|
+
latencyMs: number;
|
|
122
|
+
steps: BenchmarkStep[];
|
|
123
|
+
}
|
|
124
|
+
export * from "./types/index.js";
|
|
125
|
+
export * from "./component.js";
|
|
126
|
+
export * from "./utils.js";
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { DatabaseData } from "../index.js";
|
|
2
|
+
import type { ProjectStatus, GitStatus, GitCommit, GitFileDiff, ReactMapConfig, AppStateData, UIStateMap } from "./index.js";
|
|
3
|
+
export interface BackendRequestMap {
|
|
4
|
+
check_project_status: {
|
|
5
|
+
payload: {
|
|
6
|
+
projectPath: string;
|
|
7
|
+
};
|
|
8
|
+
response: ProjectStatus;
|
|
9
|
+
};
|
|
10
|
+
save_project_config: {
|
|
11
|
+
payload: {
|
|
12
|
+
projectPath: string;
|
|
13
|
+
config: ReactMapConfig;
|
|
14
|
+
};
|
|
15
|
+
response: {
|
|
16
|
+
success: boolean;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
get_project_icon: {
|
|
20
|
+
payload: {
|
|
21
|
+
projectPath: string;
|
|
22
|
+
};
|
|
23
|
+
response: string | null;
|
|
24
|
+
};
|
|
25
|
+
git_status: {
|
|
26
|
+
payload: {
|
|
27
|
+
projectPath: string;
|
|
28
|
+
};
|
|
29
|
+
response: GitStatus;
|
|
30
|
+
};
|
|
31
|
+
git_log: {
|
|
32
|
+
payload: {
|
|
33
|
+
projectPath: string;
|
|
34
|
+
options: number | {
|
|
35
|
+
limit?: number;
|
|
36
|
+
path?: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
response: GitCommit[];
|
|
40
|
+
};
|
|
41
|
+
git_diff: {
|
|
42
|
+
payload: {
|
|
43
|
+
projectPath: string;
|
|
44
|
+
options: {
|
|
45
|
+
file?: string;
|
|
46
|
+
commit?: string;
|
|
47
|
+
baseCommit?: string;
|
|
48
|
+
staged?: boolean;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
response: GitFileDiff[];
|
|
52
|
+
};
|
|
53
|
+
git_analyze_commit: {
|
|
54
|
+
payload: {
|
|
55
|
+
projectPath: string;
|
|
56
|
+
commitHash: string;
|
|
57
|
+
subPath?: string;
|
|
58
|
+
};
|
|
59
|
+
response: DatabaseData;
|
|
60
|
+
};
|
|
61
|
+
open_project: {
|
|
62
|
+
payload: {
|
|
63
|
+
projectPath: string;
|
|
64
|
+
subProject?: string;
|
|
65
|
+
};
|
|
66
|
+
response: {
|
|
67
|
+
sqlitePath: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
read_state: {
|
|
71
|
+
payload: {
|
|
72
|
+
projectPath: string;
|
|
73
|
+
};
|
|
74
|
+
response: unknown;
|
|
75
|
+
};
|
|
76
|
+
save_state: {
|
|
77
|
+
payload: {
|
|
78
|
+
projectPath: string;
|
|
79
|
+
state: AppStateData;
|
|
80
|
+
};
|
|
81
|
+
response: boolean;
|
|
82
|
+
};
|
|
83
|
+
update_graph_position: {
|
|
84
|
+
payload: {
|
|
85
|
+
projectPath: string;
|
|
86
|
+
subProject?: string;
|
|
87
|
+
positions: UIStateMap;
|
|
88
|
+
contextId?: string;
|
|
89
|
+
};
|
|
90
|
+
response: boolean;
|
|
91
|
+
};
|
|
92
|
+
call_tool: {
|
|
93
|
+
payload: {
|
|
94
|
+
name: string;
|
|
95
|
+
arguments: Record<string, unknown>;
|
|
96
|
+
};
|
|
97
|
+
response: unknown;
|
|
98
|
+
};
|
|
99
|
+
chunked_response: {
|
|
100
|
+
payload: {
|
|
101
|
+
chunk: string;
|
|
102
|
+
index: number;
|
|
103
|
+
total: number;
|
|
104
|
+
originalType: string;
|
|
105
|
+
};
|
|
106
|
+
response: void;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export type BackendMessageType = keyof BackendRequestMap;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type AppTheme = "dark" | "light";
|
|
2
|
+
export interface CustomColors {
|
|
3
|
+
nodeHighlight?: string;
|
|
4
|
+
comboHighlight?: string;
|
|
5
|
+
arrowColor?: string;
|
|
6
|
+
labelColor?: string;
|
|
7
|
+
gitAdded?: string;
|
|
8
|
+
gitModified?: string;
|
|
9
|
+
gitDeleted?: string;
|
|
10
|
+
stateNode?: string;
|
|
11
|
+
memoNode?: string;
|
|
12
|
+
callbackNode?: string;
|
|
13
|
+
refNode?: string;
|
|
14
|
+
effectNode?: string;
|
|
15
|
+
propNode?: string;
|
|
16
|
+
componentNode?: string;
|
|
17
|
+
hookNode?: string;
|
|
18
|
+
renderNode?: string;
|
|
19
|
+
typeKeyword?: string;
|
|
20
|
+
typeLiteral?: string;
|
|
21
|
+
typeString?: string;
|
|
22
|
+
typeNumber?: string;
|
|
23
|
+
typeBoolean?: string;
|
|
24
|
+
typePunctuation?: string;
|
|
25
|
+
typeReference?: string;
|
|
26
|
+
typeComponent?: string;
|
|
27
|
+
typeDefault?: string;
|
|
28
|
+
genericsColor?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface SubProject {
|
|
31
|
+
name: string;
|
|
32
|
+
path: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ReactMapConfig {
|
|
35
|
+
entry?: string;
|
|
36
|
+
aliases?: Record<string, string>;
|
|
37
|
+
extensions?: string[];
|
|
38
|
+
dependencyDepth?: number;
|
|
39
|
+
analysisPath?: string;
|
|
40
|
+
ignorePatterns?: string[];
|
|
41
|
+
ignoreSubProjects?: string[];
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface GitFileStatus {
|
|
2
|
+
path: string;
|
|
3
|
+
index: string;
|
|
4
|
+
working_dir: string;
|
|
5
|
+
}
|
|
6
|
+
export interface GitStatus {
|
|
7
|
+
current: string | null;
|
|
8
|
+
tracking: string | null;
|
|
9
|
+
detached: boolean;
|
|
10
|
+
files: GitFileStatus[];
|
|
11
|
+
staged: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface GitCommit {
|
|
14
|
+
hash: string;
|
|
15
|
+
date: string;
|
|
16
|
+
message: string;
|
|
17
|
+
author_name: string;
|
|
18
|
+
author_email: string;
|
|
19
|
+
}
|
|
20
|
+
export interface GitDiff {
|
|
21
|
+
file: string;
|
|
22
|
+
diff: string;
|
|
23
|
+
}
|
|
24
|
+
export interface GitDiffLine {
|
|
25
|
+
type: 'added' | 'deleted' | 'normal';
|
|
26
|
+
content: string;
|
|
27
|
+
newLineNumber?: number;
|
|
28
|
+
oldLineNumber?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface GitFileDiff {
|
|
31
|
+
path: string;
|
|
32
|
+
hunks: GitDiffHunk[];
|
|
33
|
+
}
|
|
34
|
+
export interface GitDiffHunk {
|
|
35
|
+
content: string;
|
|
36
|
+
lines: GitDiffLine[];
|
|
37
|
+
oldStart: number;
|
|
38
|
+
oldLines: number;
|
|
39
|
+
newStart: number;
|
|
40
|
+
newLines: number;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { ComponentLoc, VariableName } from "../component.js";
|
|
2
|
+
import type { TypeData, TypeDataLiteralBody } from "./primitive.js";
|
|
3
|
+
import type { ReactMapConfig, SubProject } from "./config.js";
|
|
4
|
+
export * from "./primitive.js";
|
|
5
|
+
export * from "./object.js";
|
|
6
|
+
export * from "./git.js";
|
|
7
|
+
export * from "./config.js";
|
|
8
|
+
export interface ProjectStatus {
|
|
9
|
+
hasConfig: boolean;
|
|
10
|
+
isMonorepo: boolean;
|
|
11
|
+
projectType: "vite" | "next" | "unknown";
|
|
12
|
+
config: ReactMapConfig | null;
|
|
13
|
+
subProjects: SubProject[];
|
|
14
|
+
}
|
|
15
|
+
export type GraphViewType = "component" | "file" | "router";
|
|
16
|
+
export interface AppStateData {
|
|
17
|
+
selectedSubProject: string | null;
|
|
18
|
+
centeredItemId: string | null;
|
|
19
|
+
selectedId: string | null;
|
|
20
|
+
isSidebarOpen: boolean;
|
|
21
|
+
activeTab: "projects" | "git";
|
|
22
|
+
selectedCommit: string | null;
|
|
23
|
+
viewport?: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
zoom: number;
|
|
27
|
+
} | null;
|
|
28
|
+
view?: GraphViewType;
|
|
29
|
+
sidebar: {
|
|
30
|
+
right: {
|
|
31
|
+
width?: number;
|
|
32
|
+
height?: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export interface TypeDataParam {
|
|
37
|
+
name: string;
|
|
38
|
+
default?: TypeData;
|
|
39
|
+
constraint?: TypeData;
|
|
40
|
+
}
|
|
41
|
+
export interface TypeDataParamFunction extends TypeDataParam {
|
|
42
|
+
const?: boolean;
|
|
43
|
+
in?: boolean;
|
|
44
|
+
out?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface TypeDataDeclareBase {
|
|
47
|
+
id: string;
|
|
48
|
+
type: "interface" | "type";
|
|
49
|
+
name: VariableName;
|
|
50
|
+
}
|
|
51
|
+
export interface TypeDataDeclareInterface extends TypeDataDeclareBase, ComponentLoc {
|
|
52
|
+
type: "interface";
|
|
53
|
+
extends?: string[];
|
|
54
|
+
body: TypeDataLiteralBody[];
|
|
55
|
+
params?: Record<string, TypeDataParam>;
|
|
56
|
+
}
|
|
57
|
+
export interface TypeDataDeclareType extends TypeDataDeclareBase, ComponentLoc {
|
|
58
|
+
type: "type";
|
|
59
|
+
body: TypeData;
|
|
60
|
+
params?: TypeDataParam[];
|
|
61
|
+
}
|
|
62
|
+
export type TypeDataDeclare = TypeDataDeclareInterface | TypeDataDeclareType;
|
|
63
|
+
export type ComponentTypeData = {
|
|
64
|
+
type: "name";
|
|
65
|
+
name: string;
|
|
66
|
+
} | {
|
|
67
|
+
type: "inline";
|
|
68
|
+
body: TypeData;
|
|
69
|
+
};
|
|
70
|
+
export interface UIItemState {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
radius?: number;
|
|
74
|
+
collapsedRadius?: number;
|
|
75
|
+
expandedRadius?: number;
|
|
76
|
+
isLayoutCalculated?: boolean;
|
|
77
|
+
collapsed?: boolean;
|
|
78
|
+
}
|
|
79
|
+
export type UIStateMap = Record<string, UIItemState>;
|
|
80
|
+
export * from "./backend.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface FuncParamName {
|
|
2
|
+
type: "named";
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export interface FuncParamObjectProperty {
|
|
6
|
+
type: "object-property";
|
|
7
|
+
shorthand: boolean;
|
|
8
|
+
key: string;
|
|
9
|
+
value: FuncParam;
|
|
10
|
+
}
|
|
11
|
+
export type FuncParamObjectPatternProperty = FuncParamObjectProperty | FuncParamRestElement;
|
|
12
|
+
export interface FuncParamObjectPattern {
|
|
13
|
+
type: "object-pattern";
|
|
14
|
+
property: FuncParamObjectPatternProperty[];
|
|
15
|
+
}
|
|
16
|
+
export interface FuncParamArrayPattern {
|
|
17
|
+
type: "array-pattern";
|
|
18
|
+
elements: FuncParam[];
|
|
19
|
+
}
|
|
20
|
+
export interface FuncParamRestElement {
|
|
21
|
+
type: "rest-element";
|
|
22
|
+
name: string;
|
|
23
|
+
}
|
|
24
|
+
export type FuncParam = FuncParamName | FuncParamObjectPattern | FuncParamArrayPattern | FuncParamRestElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import type { FuncParam, TypeDataParamFunction } from "./index.js";
|
|
2
|
+
export interface TypeDataString {
|
|
3
|
+
type: "string";
|
|
4
|
+
}
|
|
5
|
+
export interface TypeDataNumber {
|
|
6
|
+
type: "number";
|
|
7
|
+
}
|
|
8
|
+
export interface TypeDataBigInt {
|
|
9
|
+
type: "bigint";
|
|
10
|
+
}
|
|
11
|
+
export interface TypeDataBoolean {
|
|
12
|
+
type: "boolean";
|
|
13
|
+
}
|
|
14
|
+
export interface TypeDataNull {
|
|
15
|
+
type: "null";
|
|
16
|
+
}
|
|
17
|
+
export interface TypeDataUndefined {
|
|
18
|
+
type: "undefined";
|
|
19
|
+
}
|
|
20
|
+
export interface TypeDataAny {
|
|
21
|
+
type: "any";
|
|
22
|
+
}
|
|
23
|
+
export interface TypeDataVoid {
|
|
24
|
+
type: "void";
|
|
25
|
+
}
|
|
26
|
+
export interface TypeDataUnknown {
|
|
27
|
+
type: "unknown";
|
|
28
|
+
}
|
|
29
|
+
export interface TypeDataNever {
|
|
30
|
+
type: "never";
|
|
31
|
+
}
|
|
32
|
+
export interface TypeDataLiteralTypeBigInt {
|
|
33
|
+
type: "bigint";
|
|
34
|
+
value: string;
|
|
35
|
+
}
|
|
36
|
+
export interface TypeDataLiteralTypeString {
|
|
37
|
+
type: "string";
|
|
38
|
+
value: string;
|
|
39
|
+
}
|
|
40
|
+
export interface TypeDataLiteralTypeNumber {
|
|
41
|
+
type: "number";
|
|
42
|
+
value: number;
|
|
43
|
+
}
|
|
44
|
+
export interface TypeDataLiteralTypeBoolean {
|
|
45
|
+
type: "boolean";
|
|
46
|
+
value: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface TypeDataLiteralTypeTemplate {
|
|
49
|
+
type: "template";
|
|
50
|
+
expression: TypeData[];
|
|
51
|
+
quasis: string[];
|
|
52
|
+
}
|
|
53
|
+
export interface TypeDataLiteralTypeUnary {
|
|
54
|
+
type: "unary";
|
|
55
|
+
operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof";
|
|
56
|
+
prefix: boolean;
|
|
57
|
+
argument: TypeDataLiteralTypeLiteral;
|
|
58
|
+
}
|
|
59
|
+
export type TypeDataLiteralTypeLiteral = TypeDataLiteralTypeBoolean | TypeDataLiteralTypeNumber | TypeDataLiteralTypeString | TypeDataLiteralTypeUnary | TypeDataLiteralTypeBigInt | TypeDataLiteralTypeTemplate;
|
|
60
|
+
export interface TypeDataLiteralType {
|
|
61
|
+
type: "literal-type";
|
|
62
|
+
literal: TypeDataLiteralTypeLiteral;
|
|
63
|
+
}
|
|
64
|
+
export type TypeDataRef = {
|
|
65
|
+
type: "ref";
|
|
66
|
+
params?: TypeData[];
|
|
67
|
+
} & ({
|
|
68
|
+
refType: "named";
|
|
69
|
+
name: string;
|
|
70
|
+
} | {
|
|
71
|
+
refType: "qualified";
|
|
72
|
+
names: string[];
|
|
73
|
+
});
|
|
74
|
+
export interface TypeDataLiteralArray {
|
|
75
|
+
type: "literal-array";
|
|
76
|
+
elements: PropDataType[];
|
|
77
|
+
}
|
|
78
|
+
export interface TypeDataLiteralObject {
|
|
79
|
+
type: "literal-object";
|
|
80
|
+
properties: Record<string, PropDataType>;
|
|
81
|
+
}
|
|
82
|
+
export type PropDataType = TypeDataLiteralType | TypeDataRef | TypeDataNull | TypeDataUndefined | TypeDataLiteralArray | TypeDataLiteralObject;
|
|
83
|
+
export type TypeDataFunctionParameter = {
|
|
84
|
+
param: FuncParam;
|
|
85
|
+
typeData?: TypeData;
|
|
86
|
+
optional?: boolean;
|
|
87
|
+
};
|
|
88
|
+
export type TypeDataFunction = {
|
|
89
|
+
type: "function";
|
|
90
|
+
params: TypeDataParamFunction[];
|
|
91
|
+
parameters: TypeDataFunctionParameter[];
|
|
92
|
+
return: TypeData;
|
|
93
|
+
};
|
|
94
|
+
export type TypeDataPrimitive = TypeDataString | TypeDataNumber | TypeDataBigInt | TypeDataBoolean | TypeDataNull | TypeDataUndefined | TypeDataAny | TypeDataVoid | TypeDataUnknown | TypeDataNever | TypeDataRef | TypeDataLiteralType | TypeDataFunction;
|
|
95
|
+
export interface TypeDataArray {
|
|
96
|
+
type: "array";
|
|
97
|
+
element: TypeData;
|
|
98
|
+
}
|
|
99
|
+
export interface TypeDataTupleElementBase {
|
|
100
|
+
type: "named" | "unnamed";
|
|
101
|
+
typeData: TypeData;
|
|
102
|
+
}
|
|
103
|
+
export interface TypeDataTupleElementNamed extends TypeDataTupleElementBase {
|
|
104
|
+
type: "named";
|
|
105
|
+
name: string;
|
|
106
|
+
optional: boolean;
|
|
107
|
+
}
|
|
108
|
+
export interface TypeDataTupleElementUnNamed extends TypeDataTupleElementBase {
|
|
109
|
+
type: "unnamed";
|
|
110
|
+
}
|
|
111
|
+
export type TypeDataTupleElement = TypeDataTupleElementNamed | TypeDataTupleElementUnNamed;
|
|
112
|
+
export interface TypeDataTuple {
|
|
113
|
+
type: "tuple";
|
|
114
|
+
elements: TypeDataTupleElement[];
|
|
115
|
+
}
|
|
116
|
+
export interface TypeDataIndexAccess {
|
|
117
|
+
type: "index-access";
|
|
118
|
+
indexType: TypeData;
|
|
119
|
+
objectType: TypeData;
|
|
120
|
+
}
|
|
121
|
+
export interface TypeDataQuery {
|
|
122
|
+
type: "query";
|
|
123
|
+
expr: TypeData;
|
|
124
|
+
}
|
|
125
|
+
export interface TypeDataImport {
|
|
126
|
+
type: "import";
|
|
127
|
+
name: string;
|
|
128
|
+
qualifier?: string;
|
|
129
|
+
}
|
|
130
|
+
export interface TypeDataLiteralBodyBase {
|
|
131
|
+
signatureType: "property" | "index" | "method";
|
|
132
|
+
}
|
|
133
|
+
export interface TypeDataLiteralBodyIndexPrarameter {
|
|
134
|
+
name: string;
|
|
135
|
+
type: TypeData;
|
|
136
|
+
}
|
|
137
|
+
export interface TypeDataLiteralBodyIndex extends TypeDataLiteralBodyBase {
|
|
138
|
+
signatureType: "index";
|
|
139
|
+
type: TypeData;
|
|
140
|
+
parameter: TypeDataLiteralBodyIndexPrarameter;
|
|
141
|
+
}
|
|
142
|
+
export interface TypeDataLiteralBodyProperty extends TypeDataLiteralBodyBase {
|
|
143
|
+
signatureType: "property";
|
|
144
|
+
type: TypeData;
|
|
145
|
+
optional?: boolean;
|
|
146
|
+
computed?: boolean;
|
|
147
|
+
name: string;
|
|
148
|
+
}
|
|
149
|
+
export interface TypeDataLiteralBodyMethod extends TypeDataLiteralBodyBase {
|
|
150
|
+
signatureType: "method";
|
|
151
|
+
name: string;
|
|
152
|
+
optional?: boolean;
|
|
153
|
+
computed?: boolean;
|
|
154
|
+
params: TypeDataParamFunction[];
|
|
155
|
+
parameters: TypeDataFunctionParameter[];
|
|
156
|
+
return: TypeData;
|
|
157
|
+
}
|
|
158
|
+
export type TypeDataLiteralBody = TypeDataLiteralBodyProperty | TypeDataLiteralBodyIndex | TypeDataLiteralBodyMethod;
|
|
159
|
+
export interface TypeDataTypeBodyLiteral {
|
|
160
|
+
type: "type-literal";
|
|
161
|
+
members: TypeDataLiteralBody[];
|
|
162
|
+
}
|
|
163
|
+
export interface TypeDataTypeBodyParathesis {
|
|
164
|
+
type: "parenthesis";
|
|
165
|
+
members: TypeData;
|
|
166
|
+
}
|
|
167
|
+
export interface TypeDataTypeBodyUnion {
|
|
168
|
+
type: "union";
|
|
169
|
+
members: TypeData[];
|
|
170
|
+
}
|
|
171
|
+
export interface TypeDataTypeBodyIntersection {
|
|
172
|
+
type: "intersection";
|
|
173
|
+
members: TypeData[];
|
|
174
|
+
}
|
|
175
|
+
export type TypeData = TypeDataPrimitive | TypeDataArray | TypeDataTuple | TypeDataIndexAccess | TypeDataQuery | TypeDataImport | TypeDataTypeBodyLiteral | TypeDataTypeBodyUnion | TypeDataTypeBodyIntersection | TypeDataTypeBodyParathesis | TypeDataLiteralArray | TypeDataLiteralObject;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VariableName } from "./component.js";
|
|
2
|
+
import type { GitFileDiff } from "./types/git.js";
|
|
3
|
+
export type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
4
|
+
export declare const getDisplayName: (name: VariableName | string | undefined) => string;
|
|
5
|
+
export declare function parseRawDiff(rawDiff: string, filterFile?: string): GitFileDiff[];
|