tadcode-wpsjs 1.1.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.
@@ -0,0 +1,53 @@
1
+ declare module 'tadcode-wpsjs:typetools' {
2
+ /**根据给的对象,添加execution方法 */
3
+ type WithExecution<T> = T extends (...args: infer A) => infer R
4
+ ? ((...args: A) => WithExecution<R>) & { execution: () => Promise<R> }
5
+ : T extends object
6
+ ? { [K in keyof T]: WithExecution<T[K]> } & { execution: () => Promise<T> }
7
+ : T & { execution: () => Promise<T> }
8
+
9
+ /**部分可选 */
10
+ type MakePropertyOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>
11
+
12
+ /**选取修改类型 */
13
+ type PickModify<T, K extends keyof T, M> = {
14
+ [P in K]: M
15
+ }
16
+
17
+ /**
18
+ * 深度可选工具类型
19
+ */
20
+ type DeepPartial<T> = T extends object
21
+ ? { [K in keyof T]?: DeepPartial<T[K]> }
22
+ : T
23
+
24
+ /**去掉联合类型对象中的id */
25
+ type DistributiveOmit<T, K extends PropertyKey> =
26
+ T extends any ? Omit<T, K> : never
27
+
28
+ /**根据给的对象,添加promise方法 */
29
+ type WithPromise<T> =
30
+ T extends (...args: infer A) => infer R ?
31
+ ((...args: A) => WithPromise<R>) & Promise<T> & { [K in keyof T]: WithPromise<T[K]> } :
32
+ T extends Array<infer U> ?
33
+ Array<WithPromise<U>> & Promise<T> :
34
+ T extends object ?
35
+ { [K in keyof T]: WithPromise<T[K]> } & Promise<T> :
36
+ T extends boolean ?
37
+ Promise<boolean> :
38
+ T extends number ?
39
+ Promise<number> :
40
+ T extends string ?
41
+ Promise<string> :
42
+ Promise<T>
43
+
44
+ // 搞定!🎉
45
+ export type {
46
+ WithExecution,
47
+ MakePropertyOptional,
48
+ PickModify,
49
+ DeepPartial,
50
+ DistributiveOmit,
51
+ WithPromise,
52
+ }
53
+ }
@@ -0,0 +1,31 @@
1
+ declare module 'application:datatable' {
2
+ // 基础类型定义
3
+ type CriteriaOp =
4
+ | 'Equals' | 'NotEqu' | 'Greater' | 'GreaterEqu' | 'Less' | 'LessEqu'
5
+ | 'GreaterEquAndLessEqu' | 'LessOrGreater' | 'BeginWith' | 'EndWith'
6
+ | 'Contains' | 'NotContains' | 'Intersected' | 'Empty' | 'NotEmpty';
7
+
8
+ type DynamicType =
9
+ | 'today' | 'yesterday' | 'tomorrow' | 'last7Days' | 'last30Days'
10
+ | 'thisWeek' | 'lastWeek' | 'nextWeek' | 'thisMonth' | 'lastMonth' | 'nextMonth';
11
+
12
+ // Criteria Value 类型
13
+ interface CriteriaValue {
14
+ type?: string;
15
+ value?: any;
16
+ dynamicType?: DynamicType;
17
+ }
18
+
19
+ // Criteria 接口
20
+ interface Criteria {
21
+ // 属性
22
+ Field: number | string;
23
+ Op: CriteriaOp;
24
+ Values: CriteriaValue[];
25
+
26
+ // 注意:文档中显示有 Criteria 构造函数/工厂方法,但这里是接口定义
27
+ }
28
+
29
+ // 导出 Criteria 类型
30
+ export type { Criteria };
31
+ }
@@ -0,0 +1,25 @@
1
+ declare module 'application:datatable' {
2
+ // FieldDescriptor 接口(根据文档引用)
3
+ interface FieldDescriptor {
4
+ Name: string;
5
+ // 其他FieldDescriptor属性
6
+ }
7
+
8
+ // Field 接口
9
+ interface Field {
10
+ // 属性
11
+ readonly FieldDescriptor: FieldDescriptor;
12
+ readonly Id: string;
13
+ readonly Name: string;
14
+ readonly Type: string;
15
+ Visible: boolean;
16
+ readonly Width: string;
17
+
18
+ // 方法
19
+ Copy(Before?: string | number, After?: string | number): Field;
20
+ Move(Before?: string | number, After?: string | number): any; // ApiResult
21
+ }
22
+
23
+ // 导出 Field 类型
24
+ export type { Field };
25
+ }
@@ -0,0 +1,212 @@
1
+ declare module 'application:datatable' {
2
+ import type { DistributiveOmit, DeepPartial } from 'tadcode-wpsjs:typetools'
3
+
4
+ interface FieldBase {
5
+ id: string
6
+ name: string
7
+ }
8
+
9
+ type DatePart =
10
+ | 'MM/dd'
11
+ | 'yyyy/MM/dd'
12
+ | 'yyyy-MM-dd'
13
+ | 'yyyy\"年\"M\"月\"d\"日\"'
14
+ | 'yyyy\"年\"m\"月\"'
15
+
16
+ type DateFormat =
17
+ | `${DatePart};@`
18
+ | `${DatePart} aaaa;@`
19
+ | `${DatePart} aaaa hh:mm;@`
20
+
21
+ type TimePart =
22
+ | 'h:mm'
23
+ | 'h:mm:ss'
24
+
25
+ type TimeFormat =
26
+ | `[$-409]${TimePart};@`
27
+ | `[$-409]${TimePart} AM/PM;@`
28
+
29
+ type ZeroFormat =
30
+ | `${number}_ `
31
+ | `#,##${number}_ `
32
+
33
+ type CurrencyFormat =
34
+ | `¥#,##0;¥-#,##0`
35
+ | `¥#,##0.0;¥-#,##0.0`
36
+ | `¥#,##0.00;¥-#,##0.00`
37
+ | `$#,##0;$-#,##0`
38
+ | `$#,##0.0;$-#,##0.0`
39
+ | `$#,##0.00;$-#,##0.00`
40
+ | `\"€\"#,##0;\"€\"-#,##0`
41
+ | `\"€\"#,##0.0;\"€\"-#,##0.0`
42
+ | `\"€\"#,##0.00;\"€\"-#,##0.00`
43
+
44
+ type RatingRange = 0 | 1 | 2 | 3 | 4 | 5
45
+
46
+ type CompleteRange = `0.${number}`
47
+
48
+ type SelectItem = { id: string, value: string }
49
+
50
+ type OmitFieldSelectId<T> = T extends { type: 'SingleSelect' | 'MultipleSelect', items: [SelectItem, ...SelectItem[]] } ? Omit<T, 'items'> & { items: [Omit<SelectItem, 'id'>, ...Omit<SelectItem, 'id'>[]] } : T
51
+
52
+ interface FieldTypeFormat {
53
+ MultiLineText: {
54
+ uniqueValue?: boolean
55
+ defaultValue?: string
56
+ }
57
+ Date: {
58
+ uniqueValue?: boolean
59
+ defaultValue?: string
60
+ numberFormat?: DateFormat
61
+ defaultValueType?: 'Normal' | 'RecordCreateTime'
62
+ }
63
+ Time: {
64
+ uniqueValue?: boolean
65
+ defaultValue?: string
66
+ numberFormat?: TimeFormat
67
+ }
68
+ Number: {
69
+ uniqueValue?: boolean
70
+ defaultValue?: string
71
+ numberFormat?: ZeroFormat
72
+ }
73
+ Currency: {
74
+ uniqueValue?: boolean
75
+ defaultValue?: string
76
+ numberFormat?: CurrencyFormat
77
+ }
78
+ Percentage: {
79
+ uniqueValue?: boolean
80
+ defaultValue?: string
81
+ numberFormat?: `${number}%`
82
+ }
83
+ ID: {
84
+ uniqueValue?: boolean
85
+ defaultValue?: string
86
+ numberFormat?: string
87
+ }
88
+ Phone: {
89
+ uniqueValue?: boolean
90
+ defaultValue?: string
91
+ numberFormat?: string
92
+ }
93
+ Email: {
94
+ uniqueValue?: boolean
95
+ defaultValue?: string
96
+ numberFormat?: string
97
+ }
98
+ Url: {
99
+ uniqueValue?: boolean
100
+ defaultValue?: string
101
+ numberFormat?: string
102
+ displayText?: string
103
+ }
104
+ Checkbox: {
105
+ uniqueValue?: boolean
106
+ defaultValue?: '1'
107
+ numberFormat?: string
108
+ }
109
+ SingleSelect: {
110
+ uniqueValue?: boolean
111
+ defaultValue?: string
112
+ numberFormat?: string
113
+ autoAddItem?: boolean
114
+ items: [SelectItem, ...SelectItem[]]
115
+ }
116
+ MultipleSelect: {
117
+ uniqueValue?: boolean
118
+ defaultValue?: string
119
+ numberFormat?: string
120
+ autoAddItem?: boolean
121
+ items: [SelectItem, ...SelectItem[]]
122
+ }
123
+ Rating: {
124
+ uniqueValue?: boolean
125
+ defaultValue?: string
126
+ numberFormat?: string
127
+ max: RatingRange
128
+ }
129
+ Complete: {
130
+ uniqueValue?: boolean
131
+ defaultValue?: `0.${number}`
132
+ numberFormat?: `${number}%`
133
+ }
134
+ Contact: {
135
+ uniqueValue?: boolean
136
+ defaultValue?: {
137
+ avatar: string
138
+ companyId: string
139
+ nickName: string
140
+ }[]
141
+ defaultValueType?: 'Normal' | 'RecordCreator'
142
+ numberFormat?: string
143
+ multipleContacts: boolean
144
+ noticeNewContact: boolean
145
+ }
146
+ Attachment: {
147
+ uniqueValue?: boolean
148
+ onlyUploadByCamera?: boolean
149
+ displayStyle?: 'Pic' | 'List'
150
+ }
151
+ /* 可关联的记录范围不支持设置 */
152
+ Link: {
153
+ uniqueValue?: boolean
154
+ linkSheet: number
155
+ multipleLinks: boolean
156
+ }
157
+ Note: {}
158
+ AutoNumber: {
159
+ uniqueValue?: boolean
160
+ numberFormat?: '000000' | '00000000',
161
+ }
162
+ CreatedBy: {
163
+ uniqueValue?: boolean
164
+ }
165
+ CreatedTime: {
166
+ uniqueValue?: boolean
167
+ }
168
+ Formula: {}
169
+ Lookup: {
170
+ lookupSheetId?: 5,
171
+ lookupField?: string,
172
+ lookupFunction?: 'Origin',
173
+ filter?: {
174
+ groups: [
175
+ {
176
+ conds: {
177
+ linkSheetFieldId: string
178
+ /**注意字段类型,文本 数字 日期 所用操作符会不一样 */
179
+ condOpType: Operator
180
+ curSheetCondType: 'Field' | 'Literal'
181
+ curSheetCondContents: string[]
182
+ }[]
183
+ }
184
+ ]
185
+ }
186
+ }
187
+ }
188
+
189
+ type FieldTypeKeys = keyof FieldTypeFormat
190
+
191
+ type ResultField<T> = { type: T } & FieldTypeFormat[T] & FieldBase
192
+
193
+ // 使用映射类型生成联合类型
194
+ type Field = {
195
+ [K in FieldTypeKeys]: ResultField<K>
196
+ }[FieldTypeKeys]
197
+
198
+ interface FieldFuncOptions {
199
+ SheetId: number
200
+ Fields: Field[]
201
+ FieldIds: string[]
202
+ }
203
+
204
+ interface FieldApi {
205
+ CreateFields(options: Pick<FieldFuncOptions, 'SheetId'> & { Fields: DistributiveOmit<OmitFieldSelectId<Field>, 'id'>[] }): Field[]
206
+ GetFields(options: Pick<FieldFuncOptions, 'SheetId'>): Field[]
207
+ UpdateFields(options: Pick<FieldFuncOptions, 'SheetId'> & { Fields: (DeepPartial<Field> & { id: string })[] }): Field[]
208
+ DeleteFields(options: Pick<FieldFuncOptions, 'SheetId' | 'FieldIds'>): (Pick<FieldBase, 'id'> & { deleted: boolean })[]
209
+ }
210
+
211
+ export type { FieldApi }
212
+ }
@@ -0,0 +1,20 @@
1
+ declare module 'application:datatable' {
2
+ // Field 接口(根据文档引用)
3
+ interface Field {
4
+ readonly Id: string;
5
+ Name: string;
6
+ // 其他Field属性
7
+ }
8
+
9
+ // Fields 接口
10
+ interface Fields {
11
+ // 属性
12
+ readonly Count: number;
13
+
14
+ // 方法
15
+ Item(Index: string | number): Field;
16
+ }
17
+
18
+ // 导出 Fields 类型
19
+ export type { Fields };
20
+ }
@@ -0,0 +1,22 @@
1
+ declare module 'application:datatable' {
2
+ // 基础类型定义
3
+ interface Attachment {
4
+ // Attachment类型
5
+ }
6
+
7
+ // Record 接口
8
+ interface Record {
9
+ // 属性
10
+ readonly Id: string;
11
+ readonly Text: string;
12
+ Value: any; // 可读写的值,根据字段类型不同返回不同类型
13
+
14
+ // 方法
15
+ Item(Index: number | string): Record;
16
+ Delete(): boolean;
17
+ Select(): boolean;
18
+ }
19
+
20
+ // 导出 Record 类型
21
+ export type { Record };
22
+ }
@@ -0,0 +1,178 @@
1
+ declare module 'application:datatable' {
2
+ import type { DistributiveOmit, DeepPartial } from 'tadcode-wpsjs:typetools'
3
+
4
+ /* 复杂字段 超链接 联系人 附件 关联 */
5
+ interface RecordValueFormat {
6
+ MultiLineText: string
7
+ Date: `${number}/${number}` | `${number}/${number}/${number}`
8
+ Time: `${number}:${number}` | `${number}:${number}:${number}`
9
+ Number: number
10
+ Currency: number
11
+ Percentage: number
12
+ ID: string
13
+ Phone: string
14
+ Email: string
15
+ Url: string | { address: string, displayText: string }
16
+ Checkbox: boolean
17
+ SingleSelect: string
18
+ MultipleSelect: string[]
19
+ Rating: RatingRange
20
+ Complete: number
21
+ Contact: {
22
+ id: string,
23
+ nickName?: string,
24
+ avatar?: string
25
+ }[]
26
+ Attachment: {
27
+ uploadId: string,
28
+ fileName: string,
29
+ source: 'upload_ks3' | 'cloud',
30
+ type: string,
31
+ linkUrl?: string
32
+ size: number,
33
+ imgSize: string,
34
+ }[]
35
+ Link: string[] | { recordIds: string[] }
36
+ Note: never
37
+ AutoNumber: never
38
+ CreatedBy: never
39
+ CreatedTime: never
40
+ Formula: never
41
+ Lookup: never
42
+ SingleSelect: never
43
+ MultipleSelect: never
44
+ }
45
+
46
+ interface RecordItem {
47
+ id: string,
48
+ fields: Record<string, RecordValueFormat[keyof RecordValueFormat]> & Partial<RecordValueFormat>
49
+ }
50
+
51
+ type Operator = 'Equals' | 'NotEqu' | 'Greater' | 'GreaterEqu' | 'Less' | 'LessEqu' | 'GreaterEquAndLessEqu' | 'LessOrGreater' | 'BeginWith' | 'EndWith' | 'Contains' | 'NotContains' | 'Intersected' | 'Empty' | 'NotEmpty'
52
+
53
+ type DynamicDateRange = 'today' | 'yesterday' | 'tomorrow' | 'last7Days' | 'last30Days' | 'thisWeek' | 'lastWeek' | 'nextWeek' | 'thisMonth' | 'lastMonth' | 'nextMonth'
54
+
55
+ interface RecordsFuncOptionsFilter {
56
+ /**选填。表示各筛选条件之间的逻辑关系。只能是'AND'或'OR'。缺省值为'AND' */
57
+ mode?: 'AND' | 'OR',
58
+ /**filter结构体内必填。包含筛选条件的数组。每个字段上只能有一个筛选条件 */
59
+ criteria: {
60
+ /**必填。根据 preferId 与否,需要填入字段名或字段id */
61
+ field: string
62
+ /**"Equals": 等于
63
+
64
+ "NotEqu": 不等于
65
+
66
+ "Greater": 大于
67
+
68
+ "GreaterEqu": 大等于
69
+
70
+ "Less": 小于
71
+
72
+ "LessEqu": 小等于
73
+
74
+ "GreaterEquAndLessEqu": 介于(取等)
75
+
76
+ "LessOrGreater": 介于(不取等)
77
+
78
+ "BeginWith": 开头是
79
+
80
+ "EndWith": 结尾是
81
+
82
+ "Contains": 包含
83
+
84
+ "NotContains": 不包含
85
+
86
+ "Intersected": 指定值
87
+
88
+ "Empty": 为空
89
+
90
+ "NotEmpty": 不为空
91
+ */
92
+ op: Operator
93
+ /**
94
+ * 必填。表示筛选规则中的值。数组形式。值为字符串时表示文本匹配。
95
+ * 这里的 values,必须是一个数组,传 ["多维表"],相当于传 [{ type: 'Text', value: '多维表' }],即不传默认帮你补充 Text 类型。
96
+ * 复选框的值,values: ['0'] 代表否,value: ['1'] 代表是。
97
+ *
98
+ * values[]数组内的元素为字符串时,表示文本匹配。各筛选规则独立地限制了values数组内最多允许填写的元素数,当values内元素数超过阈值时,该筛选规则将失效。
99
+ *
100
+ * a. “为空、不为空”不允许填写元素;
101
+ *
102
+ * b. “介于”允许最多填写2个元素;
103
+ *
104
+ * c. “指定值”允许填写65535个元素;
105
+ *
106
+ * d. 其他规则允许最多填写1个元素
107
+ */
108
+ values: string[] | {
109
+ type: 'Text'
110
+ value: string
111
+ }[] |
112
+ {
113
+ type: 'DynamicSimple'
114
+ /**
115
+ * 当"op"为"greater"或"less"时,"dynamicType"只能是昨天、今天或明天。
116
+ *
117
+ * "today": 今天
118
+ *
119
+ * "yesterday": 昨天
120
+ *
121
+ * "tomorrow": 明天
122
+ *
123
+ * "last7Days": 最近7天
124
+ *
125
+ * "last30Days": 最近30天
126
+ *
127
+ * "thisWeek": 本周
128
+ *
129
+ * "lastWeek": 上周
130
+ *
131
+ * "nextWeek":下周
132
+ *
133
+ * "thisMonth": 本月
134
+ *
135
+ * "lastMonth": 上月
136
+ *
137
+ * "nextMonth": 次月
138
+ */
139
+ dynamicType: DynamicDateRange
140
+ }[]
141
+ }[]
142
+ }
143
+
144
+ interface RecordFuncOptions {
145
+ SheetId: number
146
+ RecordId: string
147
+ RecordIds: string[]
148
+ Records: RecordItem[]
149
+ /**
150
+ * 填写后将从被指定的视图获取该用户所见到的记录;若不填写,则从工作表获取记录
151
+ */
152
+ ViewId: string
153
+ /**
154
+ * 存在分页时,指定本次查询的起始记录(含)。若不填写或填写为空字符串,则从第一条记录开始获取
155
+ *
156
+ * 当前最大值:1000
157
+ */
158
+ PageSize: number
159
+ /**分页查询时,将返回一个offset值,指向下一页的第一条记录,供后续查询。查询到最后一页或第maxRecords条记录时,返回数据将不再包含offset值 */
160
+ Offset: number
161
+ /**指定要获取的“前maxRecords条记录”,若不填写,则默认返回全部记录 */
162
+ MaxRecords: number
163
+ /**具体字段类型说明详见 [附件2](https://kdocs.cn/l/ctzsgDlAGF0l?linkname=QSt7dOHYA0) */
164
+ Fields: string[]
165
+ /**详细说明见 [附件4](https://www.kdocs.cn/l/ctzsgDlAGF0l?linkname=wsTfzS9o34) */
166
+ Filter: RecordsFuncOptionsFilter
167
+ }
168
+ /* 行记录 */
169
+ interface RecordApi {
170
+ CreateRecords(options: Pick<RecordFuncOptions, 'SheetId'> & { Records: { fields: Record<string, any> }[] }): RecordItem[]
171
+ GetRecord(options: Pick<RecordFuncOptions, 'SheetId' | 'RecordId'>): RecordItem
172
+ GetRecords(options: Pick<RecordFuncOptions, 'SheetId'> & Partial<Pick<RecordFuncOptions, 'ViewId' | 'PageSize' | 'Offset' | 'MaxRecords' | 'Fields' | 'Filter'>>): { records: RecordItem[] }
173
+ UpdateRecords(options: Pick<RecordFuncOptions, 'SheetId' | 'Records'>): RecordItem[]
174
+ DeleteRecords(options: Pick<RecordFuncOptions, 'SheetId' | 'RecordIds'>): (Pick<RecordItem, 'id'> & { deleted: boolean })[]
175
+ }
176
+
177
+ export type { RecordApi }
178
+ }
@@ -0,0 +1,77 @@
1
+ declare module 'application:datatable' {
2
+ import type { Criteria } from 'application:datatable'
3
+ // 基础类型定义
4
+ type FilterOp = 'And' | 'Or'
5
+
6
+ type CriteriaOperator =
7
+ | 'Equals' | 'NotEqu' | 'Greater' | 'GreaterEqu' | 'Less' | 'LessEqu'
8
+ | 'GreaterEquAndLessEqu' | 'LessOrGreater' | 'BeginWith' | 'EndWith'
9
+ | 'Contains' | 'NotContains' | 'Intersected' | 'Empty' | 'NotEmpty'
10
+
11
+ type DynamicType =
12
+ | 'today' | 'yesterday' | 'tomorrow' | 'last7Days' | 'last30Days'
13
+ | 'thisWeek' | 'lastWeek' | 'nextWeek' | 'thisMonth' | 'lastMonth' | 'nextMonth'
14
+
15
+ interface EventContext {
16
+ Destroy(): void
17
+ }
18
+
19
+ interface ApiResult {
20
+ code: number
21
+ Message?: string
22
+ }
23
+
24
+ interface Font {
25
+ Color: string
26
+ }
27
+
28
+ interface Interior {
29
+ Color: string
30
+ }
31
+
32
+ interface DBCellValue {
33
+ // DBCellValue类型
34
+ }
35
+
36
+ interface Filter {
37
+ Criterias: Criteria[]
38
+ Op?: FilterOp
39
+ }
40
+
41
+ interface OnDeleteRecordEventData {
42
+ sheetId: number
43
+ recordIds: string[]
44
+ }
45
+
46
+ // RecordRange 接口
47
+ interface RecordRange {
48
+ // 属性
49
+ readonly Count: number
50
+ FieldId: any[] // 返回Array
51
+ readonly Font: Font
52
+ Id: any[] // 返回Array
53
+ Index: any[] // 返回Array
54
+ readonly Interior: Interior
55
+ readonly Text: string | any[][]
56
+ Value: any
57
+
58
+ // 方法
59
+ Item(Index?: number | string | any[], Field?: number | string | any[]): RecordRange
60
+ Add(Before?: number | string, After?: number | string, Count?: number): RecordRange
61
+ Condition(Filters: Filter[], FilterOp?: FilterOp): RecordRange
62
+ Delete(): ApiResult
63
+ Select(): boolean
64
+ SetValues(Values: any[], ignoreErr?: boolean): ApiResult
65
+
66
+ // 事件
67
+ OnDeleteRecord(callback: (data: OnDeleteRecordEventData) => void): EventContext
68
+ OnUpdate(callback: (data: RecordRange) => void): EventContext
69
+ }
70
+
71
+ interface RecordRange {
72
+ (Index?: number | string | any[], Field?: number | string | any[]): RecordRange
73
+ }
74
+
75
+ // 导出 RecordRange 类型
76
+ export type { RecordRange }
77
+ }
@@ -0,0 +1,28 @@
1
+ declare module 'application:datatable' {
2
+ import type { Record } from 'application:datatable'
3
+ // 基础类型定义
4
+ type ViewType = 'Grid' | 'Kanban' | 'Gallery' | 'Form' | 'Query' | 'Gantt'
5
+
6
+ interface EventContext {
7
+ Destroy(): void
8
+ }
9
+
10
+ // Records 接口
11
+ interface Records {
12
+ // 属性
13
+ readonly Count: number
14
+
15
+ // 方法
16
+ Item(Index: number | string): Record
17
+ Add(Before?: number | string, After?: number | string, Count?: number): Records
18
+ Delete(Index: number | string): any // ApiResult
19
+ FindNext(What: string): Record | null
20
+ FindPrevious(What: string): Record | null
21
+ }
22
+
23
+ interface Records {
24
+ (Index: number | string): Record
25
+ }
26
+ // 导出 Records 类型
27
+ export type { Records }
28
+ }
@@ -0,0 +1,29 @@
1
+ declare module 'application:datatable' {
2
+ interface ActiveViewInfo {
3
+ "sheetId": number
4
+ "viewId": string
5
+ "name": string
6
+ "type": string
7
+ }
8
+
9
+ interface ActiveSheetInfo {
10
+ "sheetId": number
11
+ "name": string
12
+ "description": string
13
+ }
14
+
15
+ interface Field {
16
+ "type": FieldTypeKeys
17
+ "name": string
18
+ "id": string
19
+ "value": any
20
+ }
21
+
22
+ interface SelectionApi {
23
+ GetActiveView(): ActiveViewInfo
24
+ GetSelectionRecords(): { id: string, fields: Field[] }[][]
25
+ GetActiveSheet(): ActiveSheetInfo
26
+ }
27
+
28
+ export type { SelectionApi }
29
+ }