• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2* Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
3* Licensed under the Apache License, Version 2.0 (the "License");
4* you may not use this file except in compliance with the License.
5* You may obtain a copy of the License at
6*
7* http://www.apache.org/licenses/LICENSE-2.0
8*
9* Unless required by applicable law or agreed to in writing, software
10* distributed under the License is distributed on an "AS IS" BASIS,
11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12* See the License for the specific language governing permissions and
13* limitations under the License.
14*/
15
16import internal = require("stream");
17
18export interface FileTemp {
19  name: string;
20  content: string;
21}
22
23export interface DirTemp {
24  name: string;
25  files: FileTemp[];
26  dirs: DirTemp[];
27}
28
29export interface ParamObj {
30  type: string;
31  name: string;
32  arraySize: number;
33  arraySizeList: number[];
34}
35
36export interface EnumObj {
37  name: string;
38  alias: string;
39  members: string[];
40  values?: string[];
41}
42
43export interface UnionObj {
44  name: string;
45  alias: string;
46  members: ParamObj[];
47}
48
49export interface StructObj {
50  name: string;
51  alias: string;
52  members: ParamObj[];
53  functions: FuncObj[];
54}
55
56export interface ClassObj {
57  name: string;
58  alias: string;
59  variableList: ParamObj[];
60  functionList: FuncObj[];
61}
62
63export interface FuncObj {
64  type: string;
65  name: string;
66  returns: string;
67  parameters: ParamObj[];
68}
69
70export interface TypeObj {
71  name: string,
72  alias: string,
73  members: ParamObj[],
74  functions: FuncObj[],
75  types: string[]
76}
77
78export interface ParseObj {
79  enums: EnumObj[];
80  unions: UnionObj[];
81  structs: StructObj[];
82  classes: ClassObj[];
83  funcs: FuncObj[];
84  types?: TypeObj[];
85}
86
87export interface ServiceRootInfo {
88  serviceName: string,
89  funcs: FuncObj[],
90  serviceId: string,
91  versionTag: string,
92}
93
94export interface HdfRootInfo {
95  // driverName即为文件名字
96  driverName: string;
97  funcs: FuncObj[];
98  // 默认4.1
99  versionTag: string;
100}
101
102export interface FuncTransferMap {
103  fromType: string;
104  tranferContent: string[];
105}
106
107// h2dts
108export interface GenInfo {
109  parseObj: ParseObj;
110  rawFilePath: string;
111  fileName: string;
112}
113
114// h2dtscpp
115export interface DtscppRootInfo {
116  funcs: FuncObj[];
117  rawFilePath: string;
118  fileName: string;
119}
120
121export interface FuncInfo {
122  name: string,
123  params: ParamObj[],
124  retType: string,
125}
126
127// 保存 typedefine int cJSON_bool
128export interface TypeList {
129  // cJSON_bool
130  typeName: string;
131  // int
132  typeBody: string;
133}
134
135export interface InterfaceBody {
136  params: ParamObj[];
137  funcs: FuncObj[];
138}
139// 保存 typedefine struct cJSON { int a; double b; string c;}
140export interface InterfaceList {
141  interfaceName: string;
142  interfaceBody: InterfaceBody;
143}
144
145