triggerix-editor-preset-war3 0.0.4 → 0.0.5

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.cts CHANGED
@@ -159,8 +159,8 @@ declare function getSlotToolDescriptors(registry: War3Registry, slotDef: SlotDef
159
159
  declare function resolveSlotDisplayText(entry: SlotValueEntry | null | undefined, registry: War3Registry, fallbackLabel: string): string;
160
160
 
161
161
  /**
162
- * 类型安全地定义 LeafTool
163
- * 用户通过回调参数注解来指定输入类型,TS 自动推导输出类型
162
+ * Type-safe LeafTool definition.
163
+ * Input type comes from the resolve callback annotation; output is inferred.
164
164
  */
165
165
  declare function defineLeafTool<TInput, TOutput>(def: {
166
166
  type?: string;
@@ -175,8 +175,8 @@ declare function defineLeafTool<TInput, TOutput>(def: {
175
175
  resolve: (input: TInput) => TOutput;
176
176
  };
177
177
  /**
178
- * 类型安全地定义 CompositeTool
179
- * 用户注解 resolve 回调参数来指定 slot 值类型,TS 验证 slots keys 一致性
178
+ * Type-safe CompositeTool definition.
179
+ * Slot value types come from the resolve callback; slot keys are validated against it.
180
180
  */
181
181
  declare function defineCompositeTool<TSlotValues extends Record<string, unknown>, TOutput>(def: {
182
182
  type?: string;
@@ -186,7 +186,7 @@ declare function defineCompositeTool<TSlotValues extends Record<string, unknown>
186
186
  resolve: (slotValues: TSlotValues) => TOutput;
187
187
  }): CompositeToolDef<TSlotValues, TOutput>;
188
188
  /**
189
- * 类型安全地定义 Condition
189
+ * Type-safe Condition definition.
190
190
  */
191
191
  declare function defineCondition<TSlotValues extends Record<string, unknown> = Record<string, unknown>>(def: Omit<War3ConditionDef<TSlotValues>, 'resolve'> & {
192
192
  resolve?: (slotValues: TSlotValues) => unknown;
@@ -201,13 +201,13 @@ declare function parseTemplate(template: string, slots?: Record<string, SlotDef>
201
201
  declare function defineWar3Preset(options: War3PresetOptions): Preset<War3Editor>;
202
202
 
203
203
  /**
204
- * 递归解析单个 slot
204
+ * Recursively resolve a single slot value.
205
205
  */
206
206
  declare function resolveSlotValue(entry: SlotValueEntry, registry: War3Registry): Value | undefined;
207
207
  /**
208
- * 将编辑器状态序列化为标准 Rule JSON
208
+ * Serialize editor state into a standard Rule JSON.
209
209
  *
210
- * 输出结构(与 @triggerix/core 兼容):
210
+ * Output shape (compatible with @triggerix/core):
211
211
  * {
212
212
  * id, event: { type, payload? }, conditions?: { type:'and', conditions:[...] },
213
213
  * actions: [{ type, params? }]
package/dist/index.d.mts CHANGED
@@ -159,8 +159,8 @@ declare function getSlotToolDescriptors(registry: War3Registry, slotDef: SlotDef
159
159
  declare function resolveSlotDisplayText(entry: SlotValueEntry | null | undefined, registry: War3Registry, fallbackLabel: string): string;
160
160
 
161
161
  /**
162
- * 类型安全地定义 LeafTool
163
- * 用户通过回调参数注解来指定输入类型,TS 自动推导输出类型
162
+ * Type-safe LeafTool definition.
163
+ * Input type comes from the resolve callback annotation; output is inferred.
164
164
  */
165
165
  declare function defineLeafTool<TInput, TOutput>(def: {
166
166
  type?: string;
@@ -175,8 +175,8 @@ declare function defineLeafTool<TInput, TOutput>(def: {
175
175
  resolve: (input: TInput) => TOutput;
176
176
  };
177
177
  /**
178
- * 类型安全地定义 CompositeTool
179
- * 用户注解 resolve 回调参数来指定 slot 值类型,TS 验证 slots keys 一致性
178
+ * Type-safe CompositeTool definition.
179
+ * Slot value types come from the resolve callback; slot keys are validated against it.
180
180
  */
181
181
  declare function defineCompositeTool<TSlotValues extends Record<string, unknown>, TOutput>(def: {
182
182
  type?: string;
@@ -186,7 +186,7 @@ declare function defineCompositeTool<TSlotValues extends Record<string, unknown>
186
186
  resolve: (slotValues: TSlotValues) => TOutput;
187
187
  }): CompositeToolDef<TSlotValues, TOutput>;
188
188
  /**
189
- * 类型安全地定义 Condition
189
+ * Type-safe Condition definition.
190
190
  */
191
191
  declare function defineCondition<TSlotValues extends Record<string, unknown> = Record<string, unknown>>(def: Omit<War3ConditionDef<TSlotValues>, 'resolve'> & {
192
192
  resolve?: (slotValues: TSlotValues) => unknown;
@@ -201,13 +201,13 @@ declare function parseTemplate(template: string, slots?: Record<string, SlotDef>
201
201
  declare function defineWar3Preset(options: War3PresetOptions): Preset<War3Editor>;
202
202
 
203
203
  /**
204
- * 递归解析单个 slot
204
+ * Recursively resolve a single slot value.
205
205
  */
206
206
  declare function resolveSlotValue(entry: SlotValueEntry, registry: War3Registry): Value | undefined;
207
207
  /**
208
- * 将编辑器状态序列化为标准 Rule JSON
208
+ * Serialize editor state into a standard Rule JSON.
209
209
  *
210
- * 输出结构(与 @triggerix/core 兼容):
210
+ * Output shape (compatible with @triggerix/core):
211
211
  * {
212
212
  * id, event: { type, payload? }, conditions?: { type:'and', conditions:[...] },
213
213
  * actions: [{ type, params? }]
package/dist/index.d.ts CHANGED
@@ -159,8 +159,8 @@ declare function getSlotToolDescriptors(registry: War3Registry, slotDef: SlotDef
159
159
  declare function resolveSlotDisplayText(entry: SlotValueEntry | null | undefined, registry: War3Registry, fallbackLabel: string): string;
160
160
 
161
161
  /**
162
- * 类型安全地定义 LeafTool
163
- * 用户通过回调参数注解来指定输入类型,TS 自动推导输出类型
162
+ * Type-safe LeafTool definition.
163
+ * Input type comes from the resolve callback annotation; output is inferred.
164
164
  */
165
165
  declare function defineLeafTool<TInput, TOutput>(def: {
166
166
  type?: string;
@@ -175,8 +175,8 @@ declare function defineLeafTool<TInput, TOutput>(def: {
175
175
  resolve: (input: TInput) => TOutput;
176
176
  };
177
177
  /**
178
- * 类型安全地定义 CompositeTool
179
- * 用户注解 resolve 回调参数来指定 slot 值类型,TS 验证 slots keys 一致性
178
+ * Type-safe CompositeTool definition.
179
+ * Slot value types come from the resolve callback; slot keys are validated against it.
180
180
  */
181
181
  declare function defineCompositeTool<TSlotValues extends Record<string, unknown>, TOutput>(def: {
182
182
  type?: string;
@@ -186,7 +186,7 @@ declare function defineCompositeTool<TSlotValues extends Record<string, unknown>
186
186
  resolve: (slotValues: TSlotValues) => TOutput;
187
187
  }): CompositeToolDef<TSlotValues, TOutput>;
188
188
  /**
189
- * 类型安全地定义 Condition
189
+ * Type-safe Condition definition.
190
190
  */
191
191
  declare function defineCondition<TSlotValues extends Record<string, unknown> = Record<string, unknown>>(def: Omit<War3ConditionDef<TSlotValues>, 'resolve'> & {
192
192
  resolve?: (slotValues: TSlotValues) => unknown;
@@ -201,13 +201,13 @@ declare function parseTemplate(template: string, slots?: Record<string, SlotDef>
201
201
  declare function defineWar3Preset(options: War3PresetOptions): Preset<War3Editor>;
202
202
 
203
203
  /**
204
- * 递归解析单个 slot
204
+ * Recursively resolve a single slot value.
205
205
  */
206
206
  declare function resolveSlotValue(entry: SlotValueEntry, registry: War3Registry): Value | undefined;
207
207
  /**
208
- * 将编辑器状态序列化为标准 Rule JSON
208
+ * Serialize editor state into a standard Rule JSON.
209
209
  *
210
- * 输出结构(与 @triggerix/core 兼容):
210
+ * Output shape (compatible with @triggerix/core):
211
211
  * {
212
212
  * id, event: { type, payload? }, conditions?: { type:'and', conditions:[...] },
213
213
  * actions: [{ type, params? }]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "triggerix-editor-preset-war3",
3
3
  "type": "module",
4
- "version": "0.0.4",
4
+ "version": "0.0.5",
5
5
  "description": "War3-style template editor preset for Triggerix",
6
6
  "homepage": "https://github.com/triggerix-lang/triggerix-editor-preset-war3#readme",
7
7
  "repository": {