@wcstack/state 2.5.0 → 2.6.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/README.ja.md +60 -1
- package/README.md +60 -1
- package/dist/auto.min.js +1 -1
- package/dist/auto.min.js.map +1 -1
- package/dist/index.d.ts +21 -4
- package/dist/index.esm.js +5725 -5083
- package/dist/index.esm.js.map +1 -1
- package/dist/manifest.esm.js +25 -2
- package/dist/parser.d.ts +21 -1
- package/dist/parser.esm.js +119 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -492,15 +492,13 @@ interface IStateAddress {
|
|
|
492
492
|
readonly listIndex: IListIndex | null;
|
|
493
493
|
readonly parentAddress: IStateAddress | null;
|
|
494
494
|
}
|
|
495
|
-
interface
|
|
495
|
+
interface ITreePath {
|
|
496
496
|
readonly stateElement: IStateElement;
|
|
497
497
|
readonly pathInfo: IPathInfo;
|
|
498
|
-
readonly parentAbsolutePathInfo: IAbsolutePathInfo | null;
|
|
499
498
|
}
|
|
500
499
|
interface IAbsoluteStateAddress {
|
|
501
|
-
readonly absolutePathInfo:
|
|
500
|
+
readonly absolutePathInfo: ITreePath;
|
|
502
501
|
readonly listIndex: IListIndex | null;
|
|
503
|
-
readonly parentAbsoluteAddress: IAbsoluteStateAddress | null;
|
|
504
502
|
}
|
|
505
503
|
|
|
506
504
|
/**
|
|
@@ -899,6 +897,25 @@ interface WcsStateApi {
|
|
|
899
897
|
* 再評価させたくない場合に使う(該当行へ直接書き込む設計と組で用いる)。
|
|
900
898
|
*/
|
|
901
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;
|
|
902
919
|
/** `<wcs-state>` 要素への参照 */
|
|
903
920
|
readonly $stateElement: HTMLElement;
|
|
904
921
|
/**
|