@wcstack/state 1.15.0 → 1.16.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 +79 -2
- package/dist/index.esm.js +165 -13
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/manifest.d.ts +74 -0
- package/dist/manifest.esm.js +925 -0
- package/dist/wcs-manifest.json +533 -0
- package/package.json +8 -3
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* filterMeta.ts — 組み込みフィルタの構造化メタデータ(単一正本・route-a A2-1)。
|
|
3
|
+
*
|
|
4
|
+
* これまで vscode-wcs(completionData.ts BUILTIN_FILTERS)が手で持っていたフィルタの
|
|
5
|
+
* 引数仕様・型・説明を、実装側(@wcstack/state)に**正本として移設**したもの。
|
|
6
|
+
* manifest.ts がこれを公開し、vscode-wcs はそれを消費して手リストを撤去できる。
|
|
7
|
+
*
|
|
8
|
+
* 完全性は __tests__/manifest.test.ts のドリフト検出が保証する
|
|
9
|
+
* (filterMeta のキー集合 == builtinFilters のキー集合)。フィルタを追加して meta を
|
|
10
|
+
* 書き忘れると CI が落ちる。
|
|
11
|
+
*/
|
|
12
|
+
type FilterResultType = "boolean" | "number" | "string" | "passthrough";
|
|
13
|
+
type FilterArgType = "number" | "string" | "any";
|
|
14
|
+
interface IFilterMeta {
|
|
15
|
+
/** 説明(補完・ホバー用) */
|
|
16
|
+
description: string;
|
|
17
|
+
/** 引数を取るか */
|
|
18
|
+
hasArgs: boolean;
|
|
19
|
+
/** 適用後の結果型(passthrough は入力型をそのまま返す) */
|
|
20
|
+
resultType: FilterResultType;
|
|
21
|
+
/** 受け入れ可能な入力型('any' は任意) */
|
|
22
|
+
acceptTypes: "any" | readonly string[];
|
|
23
|
+
/** 引数の最小数 */
|
|
24
|
+
minArgs: number;
|
|
25
|
+
/** 引数の最大数 */
|
|
26
|
+
maxArgs: number;
|
|
27
|
+
/** 各引数の期待型(省略時はチェックしない) */
|
|
28
|
+
argTypes?: readonly FilterArgType[];
|
|
29
|
+
}
|
|
30
|
+
/** 組み込みフィルタ名 → 構造化メタデータ。キー集合は builtinFilters と一致しなければならない。 */
|
|
31
|
+
declare const builtinFilterMeta: Record<string, IFilterMeta>;
|
|
32
|
+
|
|
33
|
+
type BindingType = 'text' | 'prop' | 'event' | 'for' | 'if' | 'elseif' | 'else' | 'radio' | 'checkbox' | 'spread';
|
|
34
|
+
|
|
35
|
+
declare const STRUCTURAL_BINDING_TYPE_SET: Set<BindingType>;
|
|
36
|
+
|
|
37
|
+
/** マニフェストのバージョン(構造を変えたら上げる)。 */
|
|
38
|
+
declare const WCS_MANIFEST_VERSION = 1;
|
|
39
|
+
interface IWcsManifest {
|
|
40
|
+
version: number;
|
|
41
|
+
syntax: {
|
|
42
|
+
/** バインド属性名(既定 data-wcs) */
|
|
43
|
+
bindAttribute: string;
|
|
44
|
+
/** タグ名(既定 wcs-state) */
|
|
45
|
+
tagName: string;
|
|
46
|
+
/** パス区切り(`.`) */
|
|
47
|
+
pathDelimiter: string;
|
|
48
|
+
/** ワイルドカード(`*`) */
|
|
49
|
+
wildcard: string;
|
|
50
|
+
/** バインディング構文 `[prop][#mod]: [path][@state][|filter...]` の区切り文字 */
|
|
51
|
+
delimiters: {
|
|
52
|
+
binding: string;
|
|
53
|
+
propValue: string;
|
|
54
|
+
modifier: string;
|
|
55
|
+
stateName: string;
|
|
56
|
+
filter: string;
|
|
57
|
+
};
|
|
58
|
+
/** 構造ディレクティブ(`<template data-wcs="for: ...">` 等) */
|
|
59
|
+
structuralDirectives: readonly string[];
|
|
60
|
+
};
|
|
61
|
+
/** 組み込みフィルタ名(builtinFilters から自動導出=実装が正本) */
|
|
62
|
+
filters: string[];
|
|
63
|
+
/** 組み込みフィルタの構造化メタデータ(説明・引数仕様・型)。vscode-wcs の手リスト撤去用。 */
|
|
64
|
+
filterMeta: Record<string, IFilterMeta>;
|
|
65
|
+
/** 予約ライフサイクルフック名 */
|
|
66
|
+
reservedLifecycle: readonly string[];
|
|
67
|
+
/** 予約 state API(プロトコル系の `$` 名前空間) */
|
|
68
|
+
reservedStateApi: readonly string[];
|
|
69
|
+
}
|
|
70
|
+
/** 機械可読な単一正本を返す。vscode-wcs はこれを消費する想定。 */
|
|
71
|
+
declare function getWcsManifest(): IWcsManifest;
|
|
72
|
+
|
|
73
|
+
export { STRUCTURAL_BINDING_TYPE_SET, WCS_MANIFEST_VERSION, builtinFilterMeta, getWcsManifest };
|
|
74
|
+
export type { FilterArgType, FilterResultType, IFilterMeta, IWcsManifest };
|