@wcstack/state 2.5.1 → 2.6.1

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
@@ -897,6 +897,25 @@ interface WcsStateApi {
897
897
  * 再評価させたくない場合に使う(該当行へ直接書き込む設計と組で用いる)。
898
898
  */
899
899
  $untrackDependency<T>(fn: () => T): T;
900
+ /**
901
+ * 鍵付き購読: `path` の現在値が `key` に等しいかを返し、評価中のリスト行 getter を
902
+ * その鍵で購読する。`path` への書き込みは旧値・新値の鍵の行だけを再評価する
903
+ * (パターン依存なら全行)。`path` 自体は依存として追跡しない。
904
+ * 例: `get "items.*.selected"() { return this.$eq("selectedId", this.$untrackDependency(() => this["items.*.id"])); }`
905
+ */
906
+ $eq(path: string, key: unknown): boolean;
907
+ /**
908
+ * `$eq` の鍵を `keyPath`(ワイルドカードは評価中の行で解決)から依存を張らずに読む形。
909
+ * 例: `get "items.*.selected"() { return this.$eqPath("selectedId", "items.*.id"); }`
910
+ */
911
+ $eqPath(path: string, keyPath: string): boolean;
912
+ /**
913
+ * `$eq` の鍵を評価中の行の index(`$1` 相当。`level` でワイルドカード段を選ぶ)にする形。
914
+ * getter を index 依存には記録せず、行の移動時はリスト差分が鍵を付け替えるので、
915
+ * 1 行削除で再評価されるのは高々 2 行。
916
+ * 例: `get "items.*.selected"() { return this.$eqIndex("selectedIndex"); }`
917
+ */
918
+ $eqIndex(path: string, level?: number): boolean;
900
919
  /** `<wcs-state>` 要素への参照 */
901
920
  readonly $stateElement: HTMLElement;
902
921
  /**