@wcstack/state 1.27.0 → 1.29.0

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.ts CHANGED
@@ -226,7 +226,12 @@ interface IFilterInfo {
226
226
  readonly args: string[];
227
227
  readonly filterFn: FilterFn;
228
228
  }
229
- interface IBindingInfo {
229
+ /**
230
+ * バインディング式のパース結果(DOM 非依存の部分)。`@wcstack/state/parser` の
231
+ * ParseBindTextResult がこれをそのまま公開するため、Node 等の DOM lib 型を
232
+ * ここに足してはならない(足すなら IBindingInfo 側へ)。
233
+ */
234
+ interface IParsedBinding {
230
235
  readonly propName: string;
231
236
  readonly propSegments: string[];
232
237
  readonly propModifiers: string[];
@@ -235,11 +240,13 @@ interface IBindingInfo {
235
240
  readonly stateName: string;
236
241
  readonly inFilters: IFilterInfo[];
237
242
  readonly outFilters: IFilterInfo[];
238
- readonly node: Node;
239
- readonly replaceNode: Node;
240
243
  readonly bindingType: BindingType;
241
244
  readonly uuid?: string | null;
242
245
  }
246
+ interface IBindingInfo extends IParsedBinding {
247
+ readonly node: Node;
248
+ readonly replaceNode: Node;
249
+ }
243
250
 
244
251
  interface IState {
245
252
  [key: string]: any;
@@ -691,6 +698,41 @@ interface IWcsManifest {
691
698
  };
692
699
  /** 構造ディレクティブ(`<template data-wcs="for: ...">` 等) */
693
700
  structuralDirectives: readonly string[];
701
+ /**
702
+ * 修飾子(`#` 後)の語彙。flags は値を取らない形(`#prevent`)、keyValue は
703
+ * `=` で値を取る形(`#init=element`)、eventNamePrefix は `on` + イベント名の形
704
+ * (`#onchange` — two-way / radio / checkbox のイベント名上書き。README「Modifiers」)。
705
+ * define.ts の定数が単一正本で、ランタイムの消費箇所も同じ定数に分岐する。
706
+ */
707
+ modifiers: {
708
+ flags: readonly string[];
709
+ keyValue: readonly string[];
710
+ eventNamePrefix: string;
711
+ };
712
+ /** リストインデックス参照名(`$1`..`$N`)。prefix + 1 始まり連番、maxDepth まで。 */
713
+ indexParam: {
714
+ prefix: string;
715
+ maxDepth: number;
716
+ };
717
+ /**
718
+ * bindingType 判別の語彙(parseBindTextsForElement の分岐と同一の定数から導出)。
719
+ * 判別順: else → spread → 構造ディレクティブ/radio/checkbox → eventToken・`on*`
720
+ * (event)→ prop。propNamespaces は左辺先頭セグメントの特殊 namespace で、
721
+ * apply 層のディスパッチキー集合との一致はテストが強制する。
722
+ * 既知の未収載: `radio` / `checkbox`(BindingType union のみが正本)。
723
+ */
724
+ bindingTypes: {
725
+ elseKeyword: string;
726
+ spread: string;
727
+ eventPropertyPrefix: string;
728
+ propNamespaces: {
729
+ eventToken: string;
730
+ command: string;
731
+ class: string;
732
+ attr: string;
733
+ style: string;
734
+ };
735
+ };
694
736
  };
695
737
  /** 組み込みフィルタ名(builtinFilters から自動導出=実装が正本) */
696
738
  filters: string[];
@@ -765,6 +807,11 @@ type DevtoolsEvent = {
765
807
  readonly maxDepth: number;
766
808
  /** 打ち切ったバッチに載っていたアドレスのパス(報告用) */
767
809
  readonly paths: readonly string[];
810
+ } | {
811
+ readonly type: "state:watch-fired";
812
+ readonly stateName: string;
813
+ /** `$watch` の宣言キー(ワイルドカードを含む生のパス) */
814
+ readonly path: string;
768
815
  } | {
769
816
  readonly type: "propagation:suppressed";
770
817
  readonly reason: "confirmation" | "visited-edge";