@djvlc/contracts-types 1.8.1 → 1.8.2
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/index.d.mts +30 -77
- package/dist/index.d.ts +30 -77
- package/dist/index.js +1 -9
- package/dist/index.mjs +2 -6
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -641,7 +641,7 @@ interface PageConfig {
|
|
|
641
641
|
* 页面级状态定义
|
|
642
642
|
*
|
|
643
643
|
* @description
|
|
644
|
-
*
|
|
644
|
+
* 状态管理采用扁平化设计,所有状态集中在页面级。
|
|
645
645
|
* 组件通过表达式引用状态:{ type: "state", value: "userInfo.name" }
|
|
646
646
|
*/
|
|
647
647
|
interface PageState {
|
|
@@ -775,9 +775,6 @@ interface ExpressionValidationConfig {
|
|
|
775
775
|
}
|
|
776
776
|
/**
|
|
777
777
|
* 默认校验配置
|
|
778
|
-
*
|
|
779
|
-
* @description
|
|
780
|
-
* V2.1 变更:context → local
|
|
781
778
|
*/
|
|
782
779
|
declare const DEFAULT_EXPRESSION_VALIDATION_CONFIG: ExpressionValidationConfig;
|
|
783
780
|
/**
|
|
@@ -1242,7 +1239,7 @@ interface DataBindingErrorConfig {
|
|
|
1242
1239
|
* 数据绑定配置
|
|
1243
1240
|
*
|
|
1244
1241
|
* @description
|
|
1245
|
-
*
|
|
1242
|
+
* 数据绑定集中在页面级管理。
|
|
1246
1243
|
* targetState 为必填字段,绑定结果会写入对应的状态字段。
|
|
1247
1244
|
*/
|
|
1248
1245
|
interface DataBinding {
|
|
@@ -1283,8 +1280,8 @@ interface DataBinding {
|
|
|
1283
1280
|
* 内置动作类型
|
|
1284
1281
|
*
|
|
1285
1282
|
* @description
|
|
1286
|
-
*
|
|
1287
|
-
* copyToClipboard、scrollTo
|
|
1283
|
+
* 预置的简单动作类型,不需要通过 ActionDefinition 定义。
|
|
1284
|
+
* copyToClipboard、scrollTo 等复杂操作通过自定义 Action 实现。
|
|
1288
1285
|
*/
|
|
1289
1286
|
type BuiltinActionType = 'setState' | 'navigate' | 'openDialog' | 'closeDialog' | 'showToast' | 'showLoading' | 'hideLoading' | 'refreshData' | 'track';
|
|
1290
1287
|
/**
|
|
@@ -1307,16 +1304,12 @@ interface ActionPolicy {
|
|
|
1307
1304
|
* 动作引用
|
|
1308
1305
|
*
|
|
1309
1306
|
* @description
|
|
1310
|
-
*
|
|
1311
|
-
*
|
|
1312
|
-
* - 新增 id 用于追踪
|
|
1313
|
-
* - 新增 policy 用于超时、重试、幂等控制
|
|
1314
|
-
* - 新增 condition 用于条件执行
|
|
1315
|
-
* - 新增 async 用于并行/串行控制
|
|
1307
|
+
* 定义一个动作的执行配置,必须指定 actionDefinitionVersionId 或 builtinAction 之一。
|
|
1308
|
+
* 支持超时、重试、幂等控制、条件执行、并行/串行控制等能力。
|
|
1316
1309
|
*/
|
|
1317
1310
|
interface ActionRef {
|
|
1318
|
-
/** 动作唯一 ID
|
|
1319
|
-
id
|
|
1311
|
+
/** 动作唯一 ID(用于全链路追踪,必填) */
|
|
1312
|
+
id: string;
|
|
1320
1313
|
/** 动作别名(用于调试) */
|
|
1321
1314
|
alias?: string;
|
|
1322
1315
|
/** 动作定义版本 ID(引用 ActionDefinition) */
|
|
@@ -1384,7 +1377,7 @@ interface EventHandler {
|
|
|
1384
1377
|
* 页面生命周期钩子
|
|
1385
1378
|
*
|
|
1386
1379
|
* @description
|
|
1387
|
-
*
|
|
1380
|
+
* 定义页面级生命周期事件。
|
|
1388
1381
|
* onScroll、onResize 通过组件内部或扩展实现。
|
|
1389
1382
|
*/
|
|
1390
1383
|
interface PageLifecycle {
|
|
@@ -1435,8 +1428,7 @@ interface LayoutConfig extends LayoutValues {
|
|
|
1435
1428
|
* 节点样式配置
|
|
1436
1429
|
*
|
|
1437
1430
|
* @description
|
|
1438
|
-
*
|
|
1439
|
-
* V2 版本移除了 responsive,响应式通过 condition 或 CSS 层面处理。
|
|
1431
|
+
* 组件节点的样式配置,响应式通过 condition 或 CSS 层面处理。
|
|
1440
1432
|
*/
|
|
1441
1433
|
interface NodeStyleConfig {
|
|
1442
1434
|
/** 内联样式(支持表达式) */
|
|
@@ -1461,14 +1453,12 @@ interface LoopConfig {
|
|
|
1461
1453
|
* 组件节点(组件树的基本单元)
|
|
1462
1454
|
*
|
|
1463
1455
|
* @description
|
|
1464
|
-
*
|
|
1465
|
-
* -
|
|
1466
|
-
* -
|
|
1467
|
-
* -
|
|
1468
|
-
* -
|
|
1469
|
-
* -
|
|
1470
|
-
* - 新增 slotName(声明当前节点所属插槽)
|
|
1471
|
-
* - props 支持表达式类型
|
|
1456
|
+
* 定义组件树中的基本渲染单元:
|
|
1457
|
+
* - 状态管理在页面级统一管理
|
|
1458
|
+
* - 数据绑定集中在 pageSchema.dataBindings
|
|
1459
|
+
* - 支持 layout(画布式自由定位)
|
|
1460
|
+
* - 支持 slots(具名插槽)
|
|
1461
|
+
* - props 支持静态值或表达式
|
|
1472
1462
|
*/
|
|
1473
1463
|
interface ComponentNode {
|
|
1474
1464
|
/** 节点唯一 ID(页面内唯一) */
|
|
@@ -2556,9 +2546,8 @@ interface PageResolveWithSnapshotResponse extends PageResolveResponse {
|
|
|
2556
2546
|
* 属性 Schema(JSON Schema 子集 + 编辑器扩展)
|
|
2557
2547
|
*
|
|
2558
2548
|
* @description
|
|
2559
|
-
*
|
|
2560
|
-
*
|
|
2561
|
-
* - 如需允许额外属性,需显式设置 additionalProperties: true
|
|
2549
|
+
* additionalProperties 默认为 false(严格模式)。
|
|
2550
|
+
* 如需允许额外属性,需显式设置 additionalProperties: true。
|
|
2562
2551
|
*/
|
|
2563
2552
|
interface PropsSchema {
|
|
2564
2553
|
/** Schema 类型(固定为 object) */
|
|
@@ -2574,7 +2563,6 @@ interface PropsSchema {
|
|
|
2574
2563
|
/**
|
|
2575
2564
|
* 是否允许未知属性
|
|
2576
2565
|
* @default false
|
|
2577
|
-
* @description V2 版本默认 false(严格模式)
|
|
2578
2566
|
*/
|
|
2579
2567
|
additionalProperties?: boolean;
|
|
2580
2568
|
}
|
|
@@ -2599,8 +2587,7 @@ interface PropGroup {
|
|
|
2599
2587
|
* 属性定义(扩展 JSON Schema)
|
|
2600
2588
|
*
|
|
2601
2589
|
* @description
|
|
2602
|
-
*
|
|
2603
|
-
* - object 类型的 additionalProperties 默认为 false
|
|
2590
|
+
* object 类型的 additionalProperties 默认为 false。
|
|
2604
2591
|
*/
|
|
2605
2592
|
interface PropDefinition {
|
|
2606
2593
|
/** 属性类型 */
|
|
@@ -2648,7 +2635,6 @@ interface PropDefinition {
|
|
|
2648
2635
|
/**
|
|
2649
2636
|
* 额外属性定义
|
|
2650
2637
|
* @default false
|
|
2651
|
-
* @description V2 版本默认 false(严格模式)
|
|
2652
2638
|
*/
|
|
2653
2639
|
additionalProperties?: boolean | PropDefinition;
|
|
2654
2640
|
/** 编辑器组件类型 */
|
|
@@ -3080,16 +3066,11 @@ type MethodCategory = 'lifecycle' | 'data' | 'display' | 'scroll' | 'custom';
|
|
|
3080
3066
|
*/
|
|
3081
3067
|
declare const CURRENT_COMPONENT_META_VERSION: SemVer;
|
|
3082
3068
|
/**
|
|
3083
|
-
* 组件元数据
|
|
3069
|
+
* 组件元数据
|
|
3084
3070
|
*
|
|
3085
3071
|
* @description
|
|
3086
|
-
*
|
|
3087
|
-
*
|
|
3088
|
-
* - 新增 style 样式配置(包含隔离策略)
|
|
3089
|
-
* - 新增 slots 插槽声明(组件嵌套能力)
|
|
3090
|
-
* - 新增 methods 方法声明(命令式 API)
|
|
3091
|
-
* - PropsSchema.additionalProperties 默认 false
|
|
3092
|
-
* - PropDefinition.additionalProperties(object 类型)默认 false
|
|
3072
|
+
* 定义组件的完整元数据,包括属性 Schema、事件声明、能力声明、兼容性信息等。
|
|
3073
|
+
* PropsSchema 和 PropDefinition 的 additionalProperties 默认为 false(严格模式)。
|
|
3093
3074
|
*/
|
|
3094
3075
|
interface ComponentMeta {
|
|
3095
3076
|
/** 规格版本号 */
|
|
@@ -3702,19 +3683,11 @@ interface RetryPolicy {
|
|
|
3702
3683
|
*/
|
|
3703
3684
|
declare const CURRENT_ACTION_SPEC_VERSION: SemVer;
|
|
3704
3685
|
/**
|
|
3705
|
-
* 动作规格(ActionSpec)
|
|
3686
|
+
* 动作规格(ActionSpec)
|
|
3706
3687
|
*
|
|
3707
3688
|
* @description
|
|
3708
|
-
*
|
|
3709
|
-
*
|
|
3710
|
-
* V2 版本变化:
|
|
3711
|
-
* - 新增 specVersion 字段
|
|
3712
|
-
* - timeout → timeoutMs(单位明确化)
|
|
3713
|
-
* - keyTtl → keyTtlSeconds(单位明确化)
|
|
3714
|
-
* - window → windowSeconds(单位明确化)
|
|
3715
|
-
* - initialDelay → initialDelayMs(单位明确化)
|
|
3716
|
-
* - maxDelay → maxDelayMs(单位明确化)
|
|
3717
|
-
* - errorMapping key 必须符合 ^[A-Z][A-Z0-9_]{2,63}$ 格式
|
|
3689
|
+
* 定义动作的完整行为规范,包括参数校验、幂等规则、频控、风控等。
|
|
3690
|
+
* 时间相关字段均使用明确单位后缀(Ms/Seconds)。
|
|
3718
3691
|
*/
|
|
3719
3692
|
interface ActionSpec {
|
|
3720
3693
|
/** 规格版本号 */
|
|
@@ -4235,15 +4208,11 @@ interface FallbackCondition {
|
|
|
4235
4208
|
*/
|
|
4236
4209
|
declare const CURRENT_DATA_QUERY_SPEC_VERSION: SemVer;
|
|
4237
4210
|
/**
|
|
4238
|
-
* 数据查询规格
|
|
4211
|
+
* 数据查询规格
|
|
4239
4212
|
*
|
|
4240
4213
|
* @description
|
|
4241
|
-
*
|
|
4242
|
-
*
|
|
4243
|
-
* - 移除顶层 sourceType(通过 sourceConfig.type 区分)
|
|
4244
|
-
* - timeout → timeoutMs(单位明确化)
|
|
4245
|
-
* - cache.ttl → cache.ttlSeconds(单位明确化)
|
|
4246
|
-
* - cache.staleMaxAge → cache.staleMaxAgeSeconds(单位明确化)
|
|
4214
|
+
* 定义数据查询的完整行为规范,包括数据源、字段裁剪、脱敏、缓存等。
|
|
4215
|
+
* 时间相关字段均使用明确单位后缀(Ms/Seconds)。
|
|
4247
4216
|
*/
|
|
4248
4217
|
interface DataQuerySpec {
|
|
4249
4218
|
/** 规格版本号 */
|
|
@@ -5037,26 +5006,10 @@ interface VersionDiff {
|
|
|
5037
5006
|
/**
|
|
5038
5007
|
* 包版本号
|
|
5039
5008
|
*/
|
|
5040
|
-
declare const VERSION = "2.
|
|
5009
|
+
declare const VERSION = "2.0.0";
|
|
5041
5010
|
/**
|
|
5042
5011
|
* 协议版本号
|
|
5043
5012
|
*/
|
|
5044
5013
|
declare const PROTOCOL_VERSION = "2.0.0";
|
|
5045
|
-
/**
|
|
5046
|
-
* PageSchema 当前版本
|
|
5047
|
-
*/
|
|
5048
|
-
declare const PAGE_SCHEMA_VERSION = "2.0.0";
|
|
5049
|
-
/**
|
|
5050
|
-
* ComponentMeta 当前版本
|
|
5051
|
-
*/
|
|
5052
|
-
declare const COMPONENT_META_SCHEMA_VERSION = "2.0.0";
|
|
5053
|
-
/**
|
|
5054
|
-
* ActionSpec 当前版本
|
|
5055
|
-
*/
|
|
5056
|
-
declare const ACTION_SPEC_VERSION = "2.0.0";
|
|
5057
|
-
/**
|
|
5058
|
-
* DataQuerySpec 当前版本
|
|
5059
|
-
*/
|
|
5060
|
-
declare const DATA_QUERY_SPEC_VERSION = "2.0.0";
|
|
5061
5014
|
|
|
5062
|
-
export { type ABTestRolloutConfig,
|
|
5015
|
+
export { type ABTestRolloutConfig, ALLOWED_FUNCTION_NAMES, ALL_BUILTIN_FUNCTIONS, ARRAY_FUNCTIONS, type ActionClientContext, type ActionDefinition, type ActionDefinitionVersion, type ActionExecuteRequest, type ActionExecuteResponse, type ActionExecutor, type ActionPolicy, type ActionRef, type ActionResult, type ActionSheetItem, type ActionSheetOptions, type ActionSheetResult, type ActionSpec, ActionType, type Activity, type ActivityPrecondition, type ActivityRule, type ActivityStatus, type ActivityType, type AggregationDataSourceConfig, type AggregationQueryItem, type AnyValueOrExpression, type ApiErrorDetail, type ApiErrorResponse, type ApiResponse, type ApiSuccessResponse, type AppContext, AuditAction, type AuditConfig, type AuditLogEntry, type BackgroundConfig, type BaseActivityRule, type BlacklistRolloutConfig, type BlockedComponentInfo, type BlockedComponentItem, type BootstrapConfig, type BrowserCompat, type BuiltinActionType, CURRENT_ACTION_SPEC_VERSION, CURRENT_COMPONENT_META_VERSION, CURRENT_DATA_QUERY_SPEC_VERSION, CURRENT_SCHEMA_VERSION, type CacheConfig, type CacheLevel, type CanaryHealthCheck, type CanaryRolloutConfig, type CanaryStage, type CanvasType, type CapabilityDeclaration, type CapabilityName, type ChangeLog, type ChangeLogItem, type ClaimActivityRule, type ClaimPrize, type ClaimRecord, type ClaimState, type ClipboardApi, type CompatInfo, type Component, type ComponentCategory, type ComponentContext, type ComponentDependency, type ComponentIntegrity, type ComponentMeta, type ComponentNode, type ComponentQueryParams, type ComponentRegisterRequest, type ComponentStatus, type ComponentStatusChangeRequest, type ComponentVersion, type ConfirmOptions, type ConsecutiveReward, type CreateManifestRequest, type CreatePreviewTokenRequest, type CumulativeReward, DATE_FUNCTIONS, DEFAULT_EXPRESSION_VALIDATION_CONFIG, DEPENDENCY_PREFIX, type DataBinding, type DataBindingErrorConfig, type DataLoadStrategy, type DataQueryDefinition, type DataQueryDefinitionVersion, type DataQueryRequest, type DataQueryResponse, type DataQuerySpec, type DataSourceConfig, type DataSourceType, type DatabaseDataSourceConfig, type DeepReadonly, type DefinitionVersionDigest, type DefinitionsDigest, type DependencyPrefix, type DialogOptions, type DialogResult, type DjvlcError, type EditorComponent, type Environment, ErrorCategory, ErrorCode, ErrorCodeToHttpStatus, type ErrorMapping, ErrorMessages, type EventDeclaration, type EventHandler, type ExecutorContext, type ExecutorResult, type Expression, type ExpressionContext, type ExpressionContextTyped, type ExpressionDependency, type ExpressionEventContext, type ExpressionFunctionCategory, type ExpressionFunctionDefinition, type ExpressionLocal, type ExpressionMeta, type ExpressionType, type ExpressionValidationConfig, type ExpressionValidationError, type ExpressionValidationResult, type ExpressionValidationWarning, FORMAT_FUNCTIONS, type FallbackCondition, type FallbackConfig, type FeatureCondition, type FeatureRolloutConfig, type FieldPermission, type FieldPolicy, type FieldTransform, type FileIntegrity, type FunctionParamDefinition, type GraphQLDataSourceConfig, type HostApi, type HttpDataSourceConfig, type HttpRetryConfig, type I18nDetectionStrategy, type ISODateTime, type IdempotencyKeyStrategy, type IdempotencyRule, type IntegrityHash, type InternalDataSourceConfig, type InventoryConfig, type JsonObject, type JsonValue, type KillSwitchItem, LOGIC_FUNCTIONS, type LayoutConfig, type LayoutValues, type LoopConfig, type LotteryActivityRule, type LotteryCost, type LotteryPrize, type LotteryState, type Manifest, type ManifestEntry, type ManifestItem, type ManifestValidationError, type ManifestValidationResult, type ManifestValidationWarning, type MaskingConfig, type MaskingRule, type MaskingType, type MethodCategory, type MethodDeclaration, type MethodParam, NUMBER_FUNCTIONS, type NavigateOptions, type NodeStyleConfig, type OperatorInfo, type OpsConfig, type OrderByItem, PROTOCOL_VERSION, type PageAssetsJson, type PageBehaviorConfig, type PageConfig, type PageDraft, type PageI18nConfig, type PageIntegrityJson, type PageLayoutConfig, type PageLifecycle, type PageManifest, type PageMeta, type PageResolveRequest, type PageResolveResponse, type PageResolveWithSnapshotResponse, type PageSEO, type PageSchema, type PageSnapshotJson, type PageSnapshotManifest, type PageSnapshotMeta, type PageSnapshotPage, type PageState, PageStatus, type PageStatusType, type PageStylesConfig, type PageVersion, type PaginatedResponse, type PaginationMeta, type PaginationParams, type ParamPermission, type ParticipationLimit, type PercentageRolloutConfig, type PityConfig, type Precondition, type PreconditionType, type PreviewImageOptions, type PreviewToken, type PreviewTokenValidationResult, type ProbabilityConfig, type PropDefinition, type PropFormat, type PropGroup, type PropType, type PropsSchema, type PublishCdnConfig, PublishChannel, type PublishConfig, type PublishEnvironment, type PublishNotificationConfig, type PublishRecord, type PublishRolloutConfig, PublishStatus, type QueryPermissions, type RateLimitDimension, type RateLimitItem, type RateLimitRule, type RequestContext, type ResolvedManifest, type ResponsiveBreakpoints, type RetryPolicy, type RiskControlConfig, type RolloutConfig, type RolloutMatchRequest, type RolloutMatchResult, type RolloutStrategy, type RolloutStrategyConfig, type RolloutStrategyType, type RuntimeContext, type RuntimeSpec, type SHAIntegrity, STRING_FUNCTIONS, type ScanCodeResult, type SchemaVersion, type SemVer, type ShareOptions, type ShareResult, type SigninActivityRule, type SigninRecord, type SigninRewardRecord, type SigninState, type SlotCategory, type SlotDeclaration, type SnapshotComponentEntry, type StateFieldDefinition, type StorageApi, type StorageOptions, type StyleConfig, type StyleIsolation, TemplateParseError, type TemplateParseMode, type ThemeConfig, type TimeWindowRolloutConfig, type ToastOptions, type TrackEvent, type URLString, UTILITY_FUNCTIONS, type UniqueId, type UpsertRolloutRequest, type UserActivityState, type UserContext, VERSION, type ValidationRule, type VersionDiff, type VersionInfo, VersionStatus, type VersionStatusType, type ViewportConfig, type WhitelistRolloutConfig, bindingRef, createDjvlcError, createExpressionContext, createLoopLocal, dep, isDjvlcError, localRef, stateRef, template };
|
package/dist/index.d.ts
CHANGED
|
@@ -641,7 +641,7 @@ interface PageConfig {
|
|
|
641
641
|
* 页面级状态定义
|
|
642
642
|
*
|
|
643
643
|
* @description
|
|
644
|
-
*
|
|
644
|
+
* 状态管理采用扁平化设计,所有状态集中在页面级。
|
|
645
645
|
* 组件通过表达式引用状态:{ type: "state", value: "userInfo.name" }
|
|
646
646
|
*/
|
|
647
647
|
interface PageState {
|
|
@@ -775,9 +775,6 @@ interface ExpressionValidationConfig {
|
|
|
775
775
|
}
|
|
776
776
|
/**
|
|
777
777
|
* 默认校验配置
|
|
778
|
-
*
|
|
779
|
-
* @description
|
|
780
|
-
* V2.1 变更:context → local
|
|
781
778
|
*/
|
|
782
779
|
declare const DEFAULT_EXPRESSION_VALIDATION_CONFIG: ExpressionValidationConfig;
|
|
783
780
|
/**
|
|
@@ -1242,7 +1239,7 @@ interface DataBindingErrorConfig {
|
|
|
1242
1239
|
* 数据绑定配置
|
|
1243
1240
|
*
|
|
1244
1241
|
* @description
|
|
1245
|
-
*
|
|
1242
|
+
* 数据绑定集中在页面级管理。
|
|
1246
1243
|
* targetState 为必填字段,绑定结果会写入对应的状态字段。
|
|
1247
1244
|
*/
|
|
1248
1245
|
interface DataBinding {
|
|
@@ -1283,8 +1280,8 @@ interface DataBinding {
|
|
|
1283
1280
|
* 内置动作类型
|
|
1284
1281
|
*
|
|
1285
1282
|
* @description
|
|
1286
|
-
*
|
|
1287
|
-
* copyToClipboard、scrollTo
|
|
1283
|
+
* 预置的简单动作类型,不需要通过 ActionDefinition 定义。
|
|
1284
|
+
* copyToClipboard、scrollTo 等复杂操作通过自定义 Action 实现。
|
|
1288
1285
|
*/
|
|
1289
1286
|
type BuiltinActionType = 'setState' | 'navigate' | 'openDialog' | 'closeDialog' | 'showToast' | 'showLoading' | 'hideLoading' | 'refreshData' | 'track';
|
|
1290
1287
|
/**
|
|
@@ -1307,16 +1304,12 @@ interface ActionPolicy {
|
|
|
1307
1304
|
* 动作引用
|
|
1308
1305
|
*
|
|
1309
1306
|
* @description
|
|
1310
|
-
*
|
|
1311
|
-
*
|
|
1312
|
-
* - 新增 id 用于追踪
|
|
1313
|
-
* - 新增 policy 用于超时、重试、幂等控制
|
|
1314
|
-
* - 新增 condition 用于条件执行
|
|
1315
|
-
* - 新增 async 用于并行/串行控制
|
|
1307
|
+
* 定义一个动作的执行配置,必须指定 actionDefinitionVersionId 或 builtinAction 之一。
|
|
1308
|
+
* 支持超时、重试、幂等控制、条件执行、并行/串行控制等能力。
|
|
1316
1309
|
*/
|
|
1317
1310
|
interface ActionRef {
|
|
1318
|
-
/** 动作唯一 ID
|
|
1319
|
-
id
|
|
1311
|
+
/** 动作唯一 ID(用于全链路追踪,必填) */
|
|
1312
|
+
id: string;
|
|
1320
1313
|
/** 动作别名(用于调试) */
|
|
1321
1314
|
alias?: string;
|
|
1322
1315
|
/** 动作定义版本 ID(引用 ActionDefinition) */
|
|
@@ -1384,7 +1377,7 @@ interface EventHandler {
|
|
|
1384
1377
|
* 页面生命周期钩子
|
|
1385
1378
|
*
|
|
1386
1379
|
* @description
|
|
1387
|
-
*
|
|
1380
|
+
* 定义页面级生命周期事件。
|
|
1388
1381
|
* onScroll、onResize 通过组件内部或扩展实现。
|
|
1389
1382
|
*/
|
|
1390
1383
|
interface PageLifecycle {
|
|
@@ -1435,8 +1428,7 @@ interface LayoutConfig extends LayoutValues {
|
|
|
1435
1428
|
* 节点样式配置
|
|
1436
1429
|
*
|
|
1437
1430
|
* @description
|
|
1438
|
-
*
|
|
1439
|
-
* V2 版本移除了 responsive,响应式通过 condition 或 CSS 层面处理。
|
|
1431
|
+
* 组件节点的样式配置,响应式通过 condition 或 CSS 层面处理。
|
|
1440
1432
|
*/
|
|
1441
1433
|
interface NodeStyleConfig {
|
|
1442
1434
|
/** 内联样式(支持表达式) */
|
|
@@ -1461,14 +1453,12 @@ interface LoopConfig {
|
|
|
1461
1453
|
* 组件节点(组件树的基本单元)
|
|
1462
1454
|
*
|
|
1463
1455
|
* @description
|
|
1464
|
-
*
|
|
1465
|
-
* -
|
|
1466
|
-
* -
|
|
1467
|
-
* -
|
|
1468
|
-
* -
|
|
1469
|
-
* -
|
|
1470
|
-
* - 新增 slotName(声明当前节点所属插槽)
|
|
1471
|
-
* - props 支持表达式类型
|
|
1456
|
+
* 定义组件树中的基本渲染单元:
|
|
1457
|
+
* - 状态管理在页面级统一管理
|
|
1458
|
+
* - 数据绑定集中在 pageSchema.dataBindings
|
|
1459
|
+
* - 支持 layout(画布式自由定位)
|
|
1460
|
+
* - 支持 slots(具名插槽)
|
|
1461
|
+
* - props 支持静态值或表达式
|
|
1472
1462
|
*/
|
|
1473
1463
|
interface ComponentNode {
|
|
1474
1464
|
/** 节点唯一 ID(页面内唯一) */
|
|
@@ -2556,9 +2546,8 @@ interface PageResolveWithSnapshotResponse extends PageResolveResponse {
|
|
|
2556
2546
|
* 属性 Schema(JSON Schema 子集 + 编辑器扩展)
|
|
2557
2547
|
*
|
|
2558
2548
|
* @description
|
|
2559
|
-
*
|
|
2560
|
-
*
|
|
2561
|
-
* - 如需允许额外属性,需显式设置 additionalProperties: true
|
|
2549
|
+
* additionalProperties 默认为 false(严格模式)。
|
|
2550
|
+
* 如需允许额外属性,需显式设置 additionalProperties: true。
|
|
2562
2551
|
*/
|
|
2563
2552
|
interface PropsSchema {
|
|
2564
2553
|
/** Schema 类型(固定为 object) */
|
|
@@ -2574,7 +2563,6 @@ interface PropsSchema {
|
|
|
2574
2563
|
/**
|
|
2575
2564
|
* 是否允许未知属性
|
|
2576
2565
|
* @default false
|
|
2577
|
-
* @description V2 版本默认 false(严格模式)
|
|
2578
2566
|
*/
|
|
2579
2567
|
additionalProperties?: boolean;
|
|
2580
2568
|
}
|
|
@@ -2599,8 +2587,7 @@ interface PropGroup {
|
|
|
2599
2587
|
* 属性定义(扩展 JSON Schema)
|
|
2600
2588
|
*
|
|
2601
2589
|
* @description
|
|
2602
|
-
*
|
|
2603
|
-
* - object 类型的 additionalProperties 默认为 false
|
|
2590
|
+
* object 类型的 additionalProperties 默认为 false。
|
|
2604
2591
|
*/
|
|
2605
2592
|
interface PropDefinition {
|
|
2606
2593
|
/** 属性类型 */
|
|
@@ -2648,7 +2635,6 @@ interface PropDefinition {
|
|
|
2648
2635
|
/**
|
|
2649
2636
|
* 额外属性定义
|
|
2650
2637
|
* @default false
|
|
2651
|
-
* @description V2 版本默认 false(严格模式)
|
|
2652
2638
|
*/
|
|
2653
2639
|
additionalProperties?: boolean | PropDefinition;
|
|
2654
2640
|
/** 编辑器组件类型 */
|
|
@@ -3080,16 +3066,11 @@ type MethodCategory = 'lifecycle' | 'data' | 'display' | 'scroll' | 'custom';
|
|
|
3080
3066
|
*/
|
|
3081
3067
|
declare const CURRENT_COMPONENT_META_VERSION: SemVer;
|
|
3082
3068
|
/**
|
|
3083
|
-
* 组件元数据
|
|
3069
|
+
* 组件元数据
|
|
3084
3070
|
*
|
|
3085
3071
|
* @description
|
|
3086
|
-
*
|
|
3087
|
-
*
|
|
3088
|
-
* - 新增 style 样式配置(包含隔离策略)
|
|
3089
|
-
* - 新增 slots 插槽声明(组件嵌套能力)
|
|
3090
|
-
* - 新增 methods 方法声明(命令式 API)
|
|
3091
|
-
* - PropsSchema.additionalProperties 默认 false
|
|
3092
|
-
* - PropDefinition.additionalProperties(object 类型)默认 false
|
|
3072
|
+
* 定义组件的完整元数据,包括属性 Schema、事件声明、能力声明、兼容性信息等。
|
|
3073
|
+
* PropsSchema 和 PropDefinition 的 additionalProperties 默认为 false(严格模式)。
|
|
3093
3074
|
*/
|
|
3094
3075
|
interface ComponentMeta {
|
|
3095
3076
|
/** 规格版本号 */
|
|
@@ -3702,19 +3683,11 @@ interface RetryPolicy {
|
|
|
3702
3683
|
*/
|
|
3703
3684
|
declare const CURRENT_ACTION_SPEC_VERSION: SemVer;
|
|
3704
3685
|
/**
|
|
3705
|
-
* 动作规格(ActionSpec)
|
|
3686
|
+
* 动作规格(ActionSpec)
|
|
3706
3687
|
*
|
|
3707
3688
|
* @description
|
|
3708
|
-
*
|
|
3709
|
-
*
|
|
3710
|
-
* V2 版本变化:
|
|
3711
|
-
* - 新增 specVersion 字段
|
|
3712
|
-
* - timeout → timeoutMs(单位明确化)
|
|
3713
|
-
* - keyTtl → keyTtlSeconds(单位明确化)
|
|
3714
|
-
* - window → windowSeconds(单位明确化)
|
|
3715
|
-
* - initialDelay → initialDelayMs(单位明确化)
|
|
3716
|
-
* - maxDelay → maxDelayMs(单位明确化)
|
|
3717
|
-
* - errorMapping key 必须符合 ^[A-Z][A-Z0-9_]{2,63}$ 格式
|
|
3689
|
+
* 定义动作的完整行为规范,包括参数校验、幂等规则、频控、风控等。
|
|
3690
|
+
* 时间相关字段均使用明确单位后缀(Ms/Seconds)。
|
|
3718
3691
|
*/
|
|
3719
3692
|
interface ActionSpec {
|
|
3720
3693
|
/** 规格版本号 */
|
|
@@ -4235,15 +4208,11 @@ interface FallbackCondition {
|
|
|
4235
4208
|
*/
|
|
4236
4209
|
declare const CURRENT_DATA_QUERY_SPEC_VERSION: SemVer;
|
|
4237
4210
|
/**
|
|
4238
|
-
* 数据查询规格
|
|
4211
|
+
* 数据查询规格
|
|
4239
4212
|
*
|
|
4240
4213
|
* @description
|
|
4241
|
-
*
|
|
4242
|
-
*
|
|
4243
|
-
* - 移除顶层 sourceType(通过 sourceConfig.type 区分)
|
|
4244
|
-
* - timeout → timeoutMs(单位明确化)
|
|
4245
|
-
* - cache.ttl → cache.ttlSeconds(单位明确化)
|
|
4246
|
-
* - cache.staleMaxAge → cache.staleMaxAgeSeconds(单位明确化)
|
|
4214
|
+
* 定义数据查询的完整行为规范,包括数据源、字段裁剪、脱敏、缓存等。
|
|
4215
|
+
* 时间相关字段均使用明确单位后缀(Ms/Seconds)。
|
|
4247
4216
|
*/
|
|
4248
4217
|
interface DataQuerySpec {
|
|
4249
4218
|
/** 规格版本号 */
|
|
@@ -5037,26 +5006,10 @@ interface VersionDiff {
|
|
|
5037
5006
|
/**
|
|
5038
5007
|
* 包版本号
|
|
5039
5008
|
*/
|
|
5040
|
-
declare const VERSION = "2.
|
|
5009
|
+
declare const VERSION = "2.0.0";
|
|
5041
5010
|
/**
|
|
5042
5011
|
* 协议版本号
|
|
5043
5012
|
*/
|
|
5044
5013
|
declare const PROTOCOL_VERSION = "2.0.0";
|
|
5045
|
-
/**
|
|
5046
|
-
* PageSchema 当前版本
|
|
5047
|
-
*/
|
|
5048
|
-
declare const PAGE_SCHEMA_VERSION = "2.0.0";
|
|
5049
|
-
/**
|
|
5050
|
-
* ComponentMeta 当前版本
|
|
5051
|
-
*/
|
|
5052
|
-
declare const COMPONENT_META_SCHEMA_VERSION = "2.0.0";
|
|
5053
|
-
/**
|
|
5054
|
-
* ActionSpec 当前版本
|
|
5055
|
-
*/
|
|
5056
|
-
declare const ACTION_SPEC_VERSION = "2.0.0";
|
|
5057
|
-
/**
|
|
5058
|
-
* DataQuerySpec 当前版本
|
|
5059
|
-
*/
|
|
5060
|
-
declare const DATA_QUERY_SPEC_VERSION = "2.0.0";
|
|
5061
5014
|
|
|
5062
|
-
export { type ABTestRolloutConfig,
|
|
5015
|
+
export { type ABTestRolloutConfig, ALLOWED_FUNCTION_NAMES, ALL_BUILTIN_FUNCTIONS, ARRAY_FUNCTIONS, type ActionClientContext, type ActionDefinition, type ActionDefinitionVersion, type ActionExecuteRequest, type ActionExecuteResponse, type ActionExecutor, type ActionPolicy, type ActionRef, type ActionResult, type ActionSheetItem, type ActionSheetOptions, type ActionSheetResult, type ActionSpec, ActionType, type Activity, type ActivityPrecondition, type ActivityRule, type ActivityStatus, type ActivityType, type AggregationDataSourceConfig, type AggregationQueryItem, type AnyValueOrExpression, type ApiErrorDetail, type ApiErrorResponse, type ApiResponse, type ApiSuccessResponse, type AppContext, AuditAction, type AuditConfig, type AuditLogEntry, type BackgroundConfig, type BaseActivityRule, type BlacklistRolloutConfig, type BlockedComponentInfo, type BlockedComponentItem, type BootstrapConfig, type BrowserCompat, type BuiltinActionType, CURRENT_ACTION_SPEC_VERSION, CURRENT_COMPONENT_META_VERSION, CURRENT_DATA_QUERY_SPEC_VERSION, CURRENT_SCHEMA_VERSION, type CacheConfig, type CacheLevel, type CanaryHealthCheck, type CanaryRolloutConfig, type CanaryStage, type CanvasType, type CapabilityDeclaration, type CapabilityName, type ChangeLog, type ChangeLogItem, type ClaimActivityRule, type ClaimPrize, type ClaimRecord, type ClaimState, type ClipboardApi, type CompatInfo, type Component, type ComponentCategory, type ComponentContext, type ComponentDependency, type ComponentIntegrity, type ComponentMeta, type ComponentNode, type ComponentQueryParams, type ComponentRegisterRequest, type ComponentStatus, type ComponentStatusChangeRequest, type ComponentVersion, type ConfirmOptions, type ConsecutiveReward, type CreateManifestRequest, type CreatePreviewTokenRequest, type CumulativeReward, DATE_FUNCTIONS, DEFAULT_EXPRESSION_VALIDATION_CONFIG, DEPENDENCY_PREFIX, type DataBinding, type DataBindingErrorConfig, type DataLoadStrategy, type DataQueryDefinition, type DataQueryDefinitionVersion, type DataQueryRequest, type DataQueryResponse, type DataQuerySpec, type DataSourceConfig, type DataSourceType, type DatabaseDataSourceConfig, type DeepReadonly, type DefinitionVersionDigest, type DefinitionsDigest, type DependencyPrefix, type DialogOptions, type DialogResult, type DjvlcError, type EditorComponent, type Environment, ErrorCategory, ErrorCode, ErrorCodeToHttpStatus, type ErrorMapping, ErrorMessages, type EventDeclaration, type EventHandler, type ExecutorContext, type ExecutorResult, type Expression, type ExpressionContext, type ExpressionContextTyped, type ExpressionDependency, type ExpressionEventContext, type ExpressionFunctionCategory, type ExpressionFunctionDefinition, type ExpressionLocal, type ExpressionMeta, type ExpressionType, type ExpressionValidationConfig, type ExpressionValidationError, type ExpressionValidationResult, type ExpressionValidationWarning, FORMAT_FUNCTIONS, type FallbackCondition, type FallbackConfig, type FeatureCondition, type FeatureRolloutConfig, type FieldPermission, type FieldPolicy, type FieldTransform, type FileIntegrity, type FunctionParamDefinition, type GraphQLDataSourceConfig, type HostApi, type HttpDataSourceConfig, type HttpRetryConfig, type I18nDetectionStrategy, type ISODateTime, type IdempotencyKeyStrategy, type IdempotencyRule, type IntegrityHash, type InternalDataSourceConfig, type InventoryConfig, type JsonObject, type JsonValue, type KillSwitchItem, LOGIC_FUNCTIONS, type LayoutConfig, type LayoutValues, type LoopConfig, type LotteryActivityRule, type LotteryCost, type LotteryPrize, type LotteryState, type Manifest, type ManifestEntry, type ManifestItem, type ManifestValidationError, type ManifestValidationResult, type ManifestValidationWarning, type MaskingConfig, type MaskingRule, type MaskingType, type MethodCategory, type MethodDeclaration, type MethodParam, NUMBER_FUNCTIONS, type NavigateOptions, type NodeStyleConfig, type OperatorInfo, type OpsConfig, type OrderByItem, PROTOCOL_VERSION, type PageAssetsJson, type PageBehaviorConfig, type PageConfig, type PageDraft, type PageI18nConfig, type PageIntegrityJson, type PageLayoutConfig, type PageLifecycle, type PageManifest, type PageMeta, type PageResolveRequest, type PageResolveResponse, type PageResolveWithSnapshotResponse, type PageSEO, type PageSchema, type PageSnapshotJson, type PageSnapshotManifest, type PageSnapshotMeta, type PageSnapshotPage, type PageState, PageStatus, type PageStatusType, type PageStylesConfig, type PageVersion, type PaginatedResponse, type PaginationMeta, type PaginationParams, type ParamPermission, type ParticipationLimit, type PercentageRolloutConfig, type PityConfig, type Precondition, type PreconditionType, type PreviewImageOptions, type PreviewToken, type PreviewTokenValidationResult, type ProbabilityConfig, type PropDefinition, type PropFormat, type PropGroup, type PropType, type PropsSchema, type PublishCdnConfig, PublishChannel, type PublishConfig, type PublishEnvironment, type PublishNotificationConfig, type PublishRecord, type PublishRolloutConfig, PublishStatus, type QueryPermissions, type RateLimitDimension, type RateLimitItem, type RateLimitRule, type RequestContext, type ResolvedManifest, type ResponsiveBreakpoints, type RetryPolicy, type RiskControlConfig, type RolloutConfig, type RolloutMatchRequest, type RolloutMatchResult, type RolloutStrategy, type RolloutStrategyConfig, type RolloutStrategyType, type RuntimeContext, type RuntimeSpec, type SHAIntegrity, STRING_FUNCTIONS, type ScanCodeResult, type SchemaVersion, type SemVer, type ShareOptions, type ShareResult, type SigninActivityRule, type SigninRecord, type SigninRewardRecord, type SigninState, type SlotCategory, type SlotDeclaration, type SnapshotComponentEntry, type StateFieldDefinition, type StorageApi, type StorageOptions, type StyleConfig, type StyleIsolation, TemplateParseError, type TemplateParseMode, type ThemeConfig, type TimeWindowRolloutConfig, type ToastOptions, type TrackEvent, type URLString, UTILITY_FUNCTIONS, type UniqueId, type UpsertRolloutRequest, type UserActivityState, type UserContext, VERSION, type ValidationRule, type VersionDiff, type VersionInfo, VersionStatus, type VersionStatusType, type ViewportConfig, type WhitelistRolloutConfig, bindingRef, createDjvlcError, createExpressionContext, createLoopLocal, dep, isDjvlcError, localRef, stateRef, template };
|
package/dist/index.js
CHANGED
|
@@ -1176,25 +1176,18 @@ var CURRENT_ACTION_SPEC_VERSION = "2.0.0";
|
|
|
1176
1176
|
var CURRENT_DATA_QUERY_SPEC_VERSION = "2.0.0";
|
|
1177
1177
|
|
|
1178
1178
|
// src/index.ts
|
|
1179
|
-
var VERSION = "2.
|
|
1179
|
+
var VERSION = "2.0.0";
|
|
1180
1180
|
var PROTOCOL_VERSION = "2.0.0";
|
|
1181
|
-
var PAGE_SCHEMA_VERSION = "2.0.0";
|
|
1182
|
-
var COMPONENT_META_SCHEMA_VERSION = "2.0.0";
|
|
1183
|
-
var ACTION_SPEC_VERSION = "2.0.0";
|
|
1184
|
-
var DATA_QUERY_SPEC_VERSION = "2.0.0";
|
|
1185
1181
|
|
|
1186
|
-
exports.ACTION_SPEC_VERSION = ACTION_SPEC_VERSION;
|
|
1187
1182
|
exports.ALLOWED_FUNCTION_NAMES = ALLOWED_FUNCTION_NAMES;
|
|
1188
1183
|
exports.ALL_BUILTIN_FUNCTIONS = ALL_BUILTIN_FUNCTIONS;
|
|
1189
1184
|
exports.ARRAY_FUNCTIONS = ARRAY_FUNCTIONS;
|
|
1190
1185
|
exports.ActionType = ActionType;
|
|
1191
1186
|
exports.AuditAction = AuditAction;
|
|
1192
|
-
exports.COMPONENT_META_SCHEMA_VERSION = COMPONENT_META_SCHEMA_VERSION;
|
|
1193
1187
|
exports.CURRENT_ACTION_SPEC_VERSION = CURRENT_ACTION_SPEC_VERSION;
|
|
1194
1188
|
exports.CURRENT_COMPONENT_META_VERSION = CURRENT_COMPONENT_META_VERSION;
|
|
1195
1189
|
exports.CURRENT_DATA_QUERY_SPEC_VERSION = CURRENT_DATA_QUERY_SPEC_VERSION;
|
|
1196
1190
|
exports.CURRENT_SCHEMA_VERSION = CURRENT_SCHEMA_VERSION;
|
|
1197
|
-
exports.DATA_QUERY_SPEC_VERSION = DATA_QUERY_SPEC_VERSION;
|
|
1198
1191
|
exports.DATE_FUNCTIONS = DATE_FUNCTIONS;
|
|
1199
1192
|
exports.DEFAULT_EXPRESSION_VALIDATION_CONFIG = DEFAULT_EXPRESSION_VALIDATION_CONFIG;
|
|
1200
1193
|
exports.DEPENDENCY_PREFIX = DEPENDENCY_PREFIX;
|
|
@@ -1205,7 +1198,6 @@ exports.ErrorMessages = ErrorMessages;
|
|
|
1205
1198
|
exports.FORMAT_FUNCTIONS = FORMAT_FUNCTIONS;
|
|
1206
1199
|
exports.LOGIC_FUNCTIONS = LOGIC_FUNCTIONS;
|
|
1207
1200
|
exports.NUMBER_FUNCTIONS = NUMBER_FUNCTIONS;
|
|
1208
|
-
exports.PAGE_SCHEMA_VERSION = PAGE_SCHEMA_VERSION;
|
|
1209
1201
|
exports.PROTOCOL_VERSION = PROTOCOL_VERSION;
|
|
1210
1202
|
exports.PageStatus = PageStatus;
|
|
1211
1203
|
exports.PublishChannel = PublishChannel;
|
package/dist/index.mjs
CHANGED
|
@@ -1174,11 +1174,7 @@ var CURRENT_ACTION_SPEC_VERSION = "2.0.0";
|
|
|
1174
1174
|
var CURRENT_DATA_QUERY_SPEC_VERSION = "2.0.0";
|
|
1175
1175
|
|
|
1176
1176
|
// src/index.ts
|
|
1177
|
-
var VERSION = "2.
|
|
1177
|
+
var VERSION = "2.0.0";
|
|
1178
1178
|
var PROTOCOL_VERSION = "2.0.0";
|
|
1179
|
-
var PAGE_SCHEMA_VERSION = "2.0.0";
|
|
1180
|
-
var COMPONENT_META_SCHEMA_VERSION = "2.0.0";
|
|
1181
|
-
var ACTION_SPEC_VERSION = "2.0.0";
|
|
1182
|
-
var DATA_QUERY_SPEC_VERSION = "2.0.0";
|
|
1183
1179
|
|
|
1184
|
-
export {
|
|
1180
|
+
export { ALLOWED_FUNCTION_NAMES, ALL_BUILTIN_FUNCTIONS, ARRAY_FUNCTIONS, ActionType, AuditAction, CURRENT_ACTION_SPEC_VERSION, CURRENT_COMPONENT_META_VERSION, CURRENT_DATA_QUERY_SPEC_VERSION, CURRENT_SCHEMA_VERSION, DATE_FUNCTIONS, DEFAULT_EXPRESSION_VALIDATION_CONFIG, DEPENDENCY_PREFIX, ErrorCategory, ErrorCode, ErrorCodeToHttpStatus, ErrorMessages, FORMAT_FUNCTIONS, LOGIC_FUNCTIONS, NUMBER_FUNCTIONS, PROTOCOL_VERSION, PageStatus, PublishChannel, PublishStatus, STRING_FUNCTIONS, TemplateParseError, UTILITY_FUNCTIONS, VERSION, VersionStatus, bindingRef, createDjvlcError, createExpressionContext, createLoopLocal, dep, isDjvlcError, localRef, stateRef, template };
|