Skip to content

Commit 4f0281f

Browse files
committed
feat: 实现新版属性服务注册功能
1 parent 928344e commit 4f0281f

File tree

9 files changed

+55
-2
lines changed

9 files changed

+55
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "next-flow-interface",
3-
"version": "0.23.5",
3+
"version": "0.23.6",
44
"description": "Interface package for NEXT FlOW. You can use this package to build your own plugin that can control anything.",
55
"type": "module",
66
"module": "dist/index.js",

src/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { IAttribute } from '@/service/sync/attribute/dto/instance/attribute.interface'
2+
import IBaseAttribute from '@/service/sync/attribute/dto/instance/base-attribute.interface'
3+
import INodeAttribute from '@/service/sync/attribute/dto/instance/node-attribute.interface'
14
import RvNodeServiceApi from '@/service/sync/step/node/rv-node-service-api'
25

36
import { AntCheckboxProps } from './components/ant/ant-checkbox-props'
@@ -212,6 +215,8 @@ import ThemeServiceApi from './service/main/theme/theme-service-api'
212215
import UserAuth from './service/main/user/dto/user-auth.interface'
213216
import UserInfo from './service/main/user/dto/user-info.interface'
214217
import UserServiceApi from './service/main/user/user-service-api'
218+
import AttributeServiceApi from './service/sync/attribute/attribute-service-api'
219+
import { AttributeType } from './service/sync/attribute/dto/attribute-type.enum'
215220
import AwarenessServiceApi, {
216221
AwarenessChanges,
217222
AwarenessChangeSubscriber,
@@ -325,6 +330,10 @@ import UrlUtils from './utils/url-utils'
325330
import VectorUtils from './utils/vector-utils'
326331

327332
export type {
333+
AttributeServiceApi,
334+
IBaseAttribute,
335+
INodeAttribute,
336+
IAttribute,
328337
Intl,
329338
MeetingState,
330339
PluginState,
@@ -558,8 +567,9 @@ export type {
558567
}
559568

560569
export {
561-
AcceptMime,
570+
AttributeType,
562571
Locale,
572+
AcceptMime,
563573
MeetingStatus,
564574
ShareMode,
565575
PageMode,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { IAttribute } from '@/service/sync/attribute/dto/instance/attribute.interface'
2+
3+
export default interface AttributeServiceApi {
4+
register(definition: IAttribute): void
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export enum AttributeType {
2+
Global = 'GLOBAL',
3+
Step = 'STEP',
4+
Node = 'NODE',
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import IGlobalAttribute from '@/service/sync/attribute/dto/instance/global-attribute.interface'
2+
import INodeAttribute from '@/service/sync/attribute/dto/instance/node-attribute.interface'
3+
import IStepAttribute from '@/service/sync/attribute/dto/instance/step-attribute.interface'
4+
5+
export type IAttribute = INodeAttribute | IStepAttribute | IGlobalAttribute
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { RvPath } from 'rhine-var'
2+
3+
import { AttributeType } from '@/service/sync/attribute/dto/attribute-type.enum'
4+
5+
export default interface IBaseAttribute<T = unknown> {
6+
type: AttributeType
7+
8+
path: RvPath
9+
10+
defaultValue?: T
11+
12+
getPathString(): string
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import IBaseAttribute from '@/service/sync/attribute/dto/instance/base-attribute.interface'
2+
3+
export default interface IGlobalAttribute<T = unknown> extends IBaseAttribute<T> {
4+
generate(): T
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import IBaseAttribute from '@/service/sync/attribute/dto/instance/base-attribute.interface'
2+
3+
export default interface INodeAttribute<T = unknown> extends IBaseAttribute<T> {
4+
generate(sid: string, nid: string): T
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import IBaseAttribute from '@/service/sync/attribute/dto/instance/base-attribute.interface'
2+
3+
export default interface IStepAttribute<T = unknown> extends IBaseAttribute<T> {
4+
generate(sid: string): T
5+
}

0 commit comments

Comments
 (0)