@anov/cic-standard-sdk 0.0.4 → 0.0.6
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/cic-sdk.cjs.js +1 -1
- package/dist/cic-sdk.es.js +1 -1
- package/dist/cic-sdk.umd.js +1 -1
- package/dist/sdk/CICSDK.d.ts +14 -14
- package/dist/types/cic.d.ts +18 -0
- package/dist/types/index.d.ts +11 -23
- package/dist/types/variables.d.ts +3 -3
- package/package.json +3 -2
package/dist/sdk/CICSDK.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CICConfig, ComponentInstance,
|
|
1
|
+
import type { CICConfig, ComponentInstance, CICPage } from '../types';
|
|
2
2
|
import type { ICICSDK } from './ICICSDK';
|
|
3
|
-
export
|
|
3
|
+
export * from '../types';
|
|
4
4
|
/**
|
|
5
5
|
* CIC SDK 类
|
|
6
6
|
* 提供对 CIC 配置的封装访问与操作
|
|
@@ -37,9 +37,9 @@ export declare class CICSDK implements ICICSDK {
|
|
|
37
37
|
*/
|
|
38
38
|
static traverseTree(root: ComponentInstance | ComponentInstance[], callback: (component: ComponentInstance, parent?: ComponentInstance) => void | boolean, parent?: ComponentInstance): void;
|
|
39
39
|
/** 创建 DataSource */
|
|
40
|
-
static createDataSource: (input: unknown, options?: import("./generators/common").CreateOptions) => import("./generators/common").Result<DataSourceItem>;
|
|
40
|
+
static createDataSource: (input: unknown, options?: import("./generators/common").CreateOptions) => import("./generators/common").Result<import("../types").DataSourceItem>;
|
|
41
41
|
static validateDataSource: (input: unknown) => import("./generators/common").Result<null>;
|
|
42
|
-
static normalizeDataSource: (input: unknown, options?: import("./generators/common").CreateOptions) => DataSourceItem;
|
|
42
|
+
static normalizeDataSource: (input: unknown, options?: import("./generators/common").CreateOptions) => import("../types").DataSourceItem;
|
|
43
43
|
/** 创建 Component */
|
|
44
44
|
static createComponent: (input: unknown, options?: import("./generators/common").CreateOptions) => import("./generators/common").Result<ComponentInstance>;
|
|
45
45
|
static validateComponent: (input: unknown) => import("./generators/common").Result<null>;
|
|
@@ -49,22 +49,22 @@ export declare class CICSDK implements ICICSDK {
|
|
|
49
49
|
static validatePage: (input: unknown) => import("./generators/common").Result<null>;
|
|
50
50
|
static normalizePage: (input: unknown, options?: import("./generators/common").CreateOptions) => CICPage;
|
|
51
51
|
/** 创建 Meta/Layout */
|
|
52
|
-
static createMeta: (input: unknown) => import("./generators/common").Result<Meta>;
|
|
53
|
-
static createLayout: (input: unknown) => import("./generators/common").Result<Layout>;
|
|
52
|
+
static createMeta: (input: unknown) => import("./generators/common").Result<import("../types").Meta>;
|
|
53
|
+
static createLayout: (input: unknown) => import("./generators/common").Result<import("../types").Layout>;
|
|
54
54
|
static validateMeta: (input: unknown) => import("./generators/common").Result<null>;
|
|
55
55
|
static validateLayout: (input: unknown) => import("./generators/common").Result<null>;
|
|
56
|
-
static normalizeMeta: (input: unknown) => Meta;
|
|
57
|
-
static normalizeLayout: (input: unknown) => Layout;
|
|
56
|
+
static normalizeMeta: (input: unknown) => import("../types").Meta;
|
|
57
|
+
static normalizeLayout: (input: unknown) => import("../types").Layout;
|
|
58
58
|
/** 创建 Variables */
|
|
59
|
-
static createVariables: (input: unknown) => import("./generators/common").Result<Variables>;
|
|
59
|
+
static createVariables: (input: unknown) => import("./generators/common").Result<import("../types").Variables>;
|
|
60
60
|
static validateVariables: (input: unknown) => import("./generators/common").Result<null>;
|
|
61
|
-
static normalizeVariables: (input: unknown) => Variables;
|
|
61
|
+
static normalizeVariables: (input: unknown) => import("../types").Variables;
|
|
62
62
|
/** 创建 Dependency */
|
|
63
|
-
static createDependency: (input: unknown) => import("./generators/common").Result<Dependency>;
|
|
63
|
+
static createDependency: (input: unknown) => import("./generators/common").Result<import("../types").Dependency>;
|
|
64
64
|
static validateDependency: (input: unknown) => import("./generators/common").Result<null>;
|
|
65
|
-
static normalizeDependency: (input: unknown) => Dependency;
|
|
65
|
+
static normalizeDependency: (input: unknown) => import("../types").Dependency;
|
|
66
66
|
/** 创建 Registry 组件项 */
|
|
67
|
-
static createRegistryComponent: (input: unknown) => import("./generators/common").Result<import("../types
|
|
67
|
+
static createRegistryComponent: (input: unknown) => import("./generators/common").Result<import("../types").RegistryComponents>;
|
|
68
68
|
static validateRegistryComponent: (input: unknown) => import("./generators/common").Result<null>;
|
|
69
|
-
static normalizeRegistryComponent: (input: unknown) => import("../types
|
|
69
|
+
static normalizeRegistryComponent: (input: unknown) => import("../types").RegistryComponents;
|
|
70
70
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Meta } from './meta';
|
|
2
|
+
import { Registry } from './registry';
|
|
3
|
+
import { Variables } from './variables';
|
|
4
|
+
import { CICPage } from './page';
|
|
5
|
+
import { Dependency } from './deps';
|
|
6
|
+
/**
|
|
7
|
+
* CIC 配置定义
|
|
8
|
+
* 说明:定义了 CIC 项目的全局配置,包含版本、元数据、页面、组件、变量、依赖等。
|
|
9
|
+
*/
|
|
10
|
+
export interface CICConfig {
|
|
11
|
+
version: string;
|
|
12
|
+
meta: Meta;
|
|
13
|
+
pages: CICPage[];
|
|
14
|
+
registry?: Registry;
|
|
15
|
+
variables?: Variables;
|
|
16
|
+
deps?: Dependency[];
|
|
17
|
+
extensions?: Record<string, any>;
|
|
18
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
meta: Meta;
|
|
13
|
-
pages: CICPage[];
|
|
14
|
-
registry?: Registry;
|
|
15
|
-
variables?: Variables;
|
|
16
|
-
deps?: Dependency[];
|
|
17
|
-
extensions?: Record<string, any>;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* CIC 类型定义
|
|
21
|
-
* 说明:定义了 CIC 项目中使用的各种类型,包括元数据、布局、页面、组件、变量、依赖项等。
|
|
22
|
-
*/
|
|
23
|
-
export type { Meta, Layout, CICPage, Registry, Variables, Dependency, ComponentInstance, DataSourceItem };
|
|
1
|
+
/** AUTO-GENERATED BY generate-types.ts — DO NOT EDIT MANUALLY */
|
|
2
|
+
export * from './cic';
|
|
3
|
+
export * from './componets';
|
|
4
|
+
export * from './data';
|
|
5
|
+
export * from './dataSources';
|
|
6
|
+
export * from './deps';
|
|
7
|
+
export * from './events';
|
|
8
|
+
export * from './meta';
|
|
9
|
+
export * from './page';
|
|
10
|
+
export * from './registry';
|
|
11
|
+
export * from './variables';
|
|
@@ -50,9 +50,9 @@ export type VariablesMap = Record<string, Variable>;
|
|
|
50
50
|
/** 变量集合,按作用域组织:global/page/component。 */
|
|
51
51
|
export interface Variables {
|
|
52
52
|
/** 全局变量,对所有页面和组件均生效。 */
|
|
53
|
-
global
|
|
53
|
+
global?: VariablesMap;
|
|
54
54
|
/** 页面级变量,键为页面 ID,值为该页面的变量映射。 */
|
|
55
|
-
page
|
|
55
|
+
page?: Record<string, VariablesMap>;
|
|
56
56
|
/** 组件级变量,键为组件 ID,值为该组件的变量映射。 */
|
|
57
|
-
component
|
|
57
|
+
component?: Record<string, VariablesMap>;
|
|
58
58
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anov/cic-standard-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "CIC Standard SDK with TypeScript support",
|
|
5
5
|
"main": "dist/cic-sdk.cjs.js",
|
|
6
6
|
"module": "dist/cic-sdk.es.js",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"test": "vitest",
|
|
26
26
|
"test:coverage": "vitest run --coverage",
|
|
27
27
|
"gen:schema": "tsx scripts/generate-schema.ts",
|
|
28
|
-
"gen:mock": "tsx scripts/generate-mock.ts"
|
|
28
|
+
"gen:mock": "tsx scripts/generate-mock.ts",
|
|
29
|
+
"gen:types": "tsx scripts/generate-types.ts"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@types/node": "^24.10.2",
|