@nudojs/core 1.0.0 → 2.0.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/{chunk-RZOQL6PT.js → chunk-VVSVQKWF.js} +3595 -413
- package/dist/exec.d.ts +1 -1
- package/dist/exec.js +55 -1
- package/dist/{index-OfNo5qlN.d.ts → index-DxjxtxOJ.d.ts} +112 -18
- package/dist/index.d.ts +416 -238
- package/dist/index.js +943 -1357
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,195 +1,44 @@
|
|
|
1
|
+
import { A as Abs, P as Phi, a as AstEnv, C as Confidence, b as Pred, S as Shape, T as Term, c as AbsModuleExports, d as PrimName, R as RelSource, H as HofSite } from './index-DxjxtxOJ.js';
|
|
2
|
+
export { $ as $add, e as $arr, f as $arrMutContainer, g as $arrRest, h as $async, i as $asyncReturn, j as $await, k as $call, l as $callNamed, m as $catchVal, n as $class, o as $concat, p as $div, q as $elems, r as $eq, s as $eqLoose, t as $fnVal, u as $for, v as $forIter, w as $forOf, x as $fork, y as $ge, z as $gen, B as $get, D as $gt, E as $idx, F as $idxSet, G as $invoke, I as $invokeSuper, J as $isForkExit, K as $join, L as $le, M as $len, N as $lit, O as $loopReturn, Q as $lt, U as $mod, V as $mul, W as $ne, X as $neLoose, Y as $neg, Z as $new, _ as $not, a0 as $nullishTest, a1 as $obj, a2 as $objRest, a3 as $optionalGet, a4 as $optionalInvoke, a5 as $orDefault, a6 as $pushLoopExit, a7 as $regex, a8 as $rethrowIfNudoReturn, a9 as $set, aa as $setKey, ab as $spread, ac as $staticInvoke, ad as $sub, ae as $super, af as $switch, ag as $thisGet, ah as $thisSet, ai as $throw, aj as $tryCurrentMark, ak as $tryMark, al as $tryPopMark, am as $tryTakeSince, an as $typeof, ao as $while, ap as $whileSeq, aq as $yield, ar as BCallRecord, as as BClassSpec, at as BMemberDiag, au as DEFAULT_MAX_LOOP_ITERS, av as HofCollectCtx, aw as LiteralValue, ax as NudoReturn, ay as NudoThrow, az as RunTranspiledOptions, aA as TranspileOptions, aB as TranspiledCallResult, aC as abs, aD as absToString, aE as alphaOf, aF as and, aG as anyVar, aH as app, aI as applyCallbackAbs, aJ as asAbs, aK as asAbsVal, aL as betaOf, aM as bindImports, aN as bool, aO as boolLit, aP as callAtFunctionBoundary, aQ as callTranspiledExport, aR as callTranspiledExportFull, aS as clearBClasses, aT as collectAbsExports, aU as confJoin, aV as createHofCollectCtx, aW as currentExecPhi, aX as emptyPhi, aY as eq, aZ as ge, a_ as geNum, a$ as getAbsOrigin, b0 as getBCallCollector, b1 as getBClass, b2 as gt, b3 as gtNum, b4 as implies, b5 as instantiateReturn, b6 as isArrMutator, b7 as isDefinitelyFalse, b8 as isDefinitelyTrue, b9 as isEvalMissingSlotEnabled, ba as isExactLit, bb as isNudoReturn, bc as isNudoThrow, bd as isNumPrim, be as isRelFn, bf as isStrPrim, bg as le, bh as leNum, bi as lit, bj as litTruth, bk as litValue, bl as lt, bm as ltNum, bn as mapElementFallback, bo as namespaceNameOf, bp as ne, bq as never, br as not, bs as noteMemberDispatchMiss, bt as noteObjSlotMissing, bu as notePrimMemberMissing, bv as noteUnknownMemberMissing, bw as num, bx as numLit, by as numVar, bz as obj, bA as or, bB as pFalse, bC as pTrue, bD as phiAnd, bE as predEquals, bF as predToString, bG as predVars, bH as projectFlatMapResult, bI as promoteParamShape, bJ as ptypeof, bK as pushLoopExit, bL as pushThrowExit, bM as recordMemberDiag, bN as registerBClass, bO as runTranspiled, bP as runWithEvalMissingSlot, bQ as runWithLoopExits, bR as setApplyCallbackHost, bS as setBCallCollector, bT as setEvalMissingSlotEnabled, bU as setMemberDiagCollector, bV as shapeOfTerm, bW as shapeToString, bX as simplifyTerm, bY as snapshotAbs, bZ as str, b_ as strLit, b$ as substAbs, c0 as substPred, c1 as substPredAbs, c2 as tagAbsOrigin, c3 as takeLoopExits, c4 as takeThrowExits, c5 as termEquals, c6 as termToString, c7 as transpile, c8 as transpileExpression, c9 as transpileFile, ca as transpileSource, cb as tryPromoteDirectCall, cc as tryPromoteForOfIteratee, cd as tryPromoteHofCallback, ce as tryPromoteReceiverAsArr, cf as undefAbs, cg as unknown, ch as v, ci as withExecPhi } from './index-DxjxtxOJ.js';
|
|
1
3
|
import { Node, File } from '@babel/types';
|
|
2
|
-
import { P as Phi, A as AstEnv, a as Abs, C as Confidence, b as Pred, S as Shape, T as Term, c as AbsModuleExports, d as PrimName, R as RelSource, H as HofSite } from './index-OfNo5qlN.js';
|
|
3
|
-
export { $ as $add, e as $arr, f as $async, g as $asyncReturn, h as $await, i as $call, j as $callNamed, k as $catchVal, l as $class, m as $concat, n as $div, o as $elems, p as $eq, q as $fnVal, r as $for, s as $forIter, t as $forOf, u as $fork, v as $ge, w as $gen, x as $get, y as $gt, z as $idx, B as $idxSet, D as $invoke, E as $invokeSuper, F as $join, G as $le, I as $len, J as $lit, K as $lt, L as $mod, M as $mul, N as $ne, O as $neg, Q as $new, U as $not, V as $obj, W as $optionalGet, X as $optionalInvoke, Y as $orDefault, Z as $regex, _ as $set, a0 as $setKey, a1 as $spread, a2 as $staticInvoke, a3 as $sub, a4 as $super, a5 as $switch, a6 as $thisGet, a7 as $thisSet, a8 as $throw, a9 as $typeof, aa as $while, ab as $whileSeq, ac as $yield, ad as BCallRecord, ae as BClassSpec, af as BMemberDiag, ag as DEFAULT_MAX_LOOP_ITERS, ah as HofCollectCtx, ai as NudoThrow, aj as RunTranspiledOptions, ak as TranspileOptions, al as TranspiledCallResult, am as abs, an as absToString, ao as alphaOf, ap as and, aq as anyVar, ar as app, as as applyCallbackAbs, at as asAbs, au as asAbsVal, av as betaOf, aw as bindImports, ax as bool, ay as boolLit, az as callTranspiledExport, aA as callTranspiledExportFull, aB as clearBClasses, aC as collectAbsExports, aD as confJoin, aE as createHofCollectCtx, aF as currentExecPhi, aG as emptyPhi, aH as eq, aI as ge, aJ as geNum, aK as getAbsOrigin, aL as getBCallCollector, aM as getBClass, aN as gt, aO as gtNum, aP as implies, aQ as instantiateReturn, aR as isDefinitelyFalse, aS as isDefinitelyTrue, aT as isExactLit, aU as isNudoThrow, aV as isNumPrim, aW as isRelFn, aX as isStrPrim, aY as le, aZ as leNum, a_ as lit, a$ as litTruth, b0 as litValue, b1 as lt, b2 as ltNum, b3 as mapElementFallback, b4 as namespaceNameOf, b5 as ne, b6 as never, b7 as not, b8 as noteMemberDispatchMiss, b9 as notePrimMemberMissing, ba as noteUnknownMemberMissing, bb as num, bc as numLit, bd as numVar, be as obj, bf as or, bg as pFalse, bh as pTrue, bi as phiAnd, bj as predEquals, bk as predToString, bl as predVars, bm as projectFlatMapResult, bn as promoteParamShape, bo as ptypeof, bp as recordMemberDiag, bq as registerBClass, br as runTranspiled, bs as setApplyCallbackHost, bt as setBCallCollector, bu as setMemberDiagCollector, bv as shapeOfTerm, bw as shapeToString, bx as simplifyTerm, by as snapshotAbs, bz as str, bA as strLit, bB as substAbs, bC as substPred, bD as substPredAbs, bE as tagAbsOrigin, bF as termEquals, bG as termToString, bH as transpile, bI as transpileExpression, bJ as transpileFile, bK as transpileSource, bL as tryPromoteDirectCall, bM as tryPromoteForOfIteratee, bN as tryPromoteHofCallback, bO as tryPromoteReceiverAsArr, bP as undefAbs, bQ as unknown, bR as v, bS as withExecPhi } from './index-OfNo5qlN.js';
|
|
4
4
|
|
|
5
5
|
type Environment = {
|
|
6
|
-
lookup(name: string):
|
|
7
|
-
bind(name: string, value:
|
|
8
|
-
update(name: string, value:
|
|
9
|
-
extend(bindings: Record<string,
|
|
6
|
+
lookup(name: string): Abs;
|
|
7
|
+
bind(name: string, value: Abs): Environment;
|
|
8
|
+
update(name: string, value: Abs): boolean;
|
|
9
|
+
extend(bindings: Record<string, Abs>): Environment;
|
|
10
10
|
fork(): Environment;
|
|
11
11
|
has(name: string): boolean;
|
|
12
12
|
snapshot(): Environment;
|
|
13
|
-
getOwnBindings(): Record<string,
|
|
13
|
+
getOwnBindings(): Record<string, Abs>;
|
|
14
14
|
};
|
|
15
|
-
declare function createEnvironment(parent?: Environment, bindings?: Map<string,
|
|
16
|
-
|
|
17
|
-
type LiteralValue = string | number | boolean | bigint | null | undefined;
|
|
18
|
-
type SigImpl = (args: TypeValue[], thisVal?: TypeValue) => TypeValue | undefined;
|
|
19
|
-
type FunctionSignature = {
|
|
20
|
-
paramTypes: TypeValue[];
|
|
21
|
-
returnType: TypeValue;
|
|
22
|
-
throwsType: TypeValue;
|
|
23
|
-
impl?: SigImpl;
|
|
24
|
-
};
|
|
25
|
-
type Refinement = {
|
|
26
|
-
name: string;
|
|
27
|
-
meta: Record<string, unknown>;
|
|
28
|
-
check?: (value: unknown) => boolean;
|
|
29
|
-
ops?: Record<string, (self: TypeValue, other: TypeValue) => TypeValue | undefined>;
|
|
30
|
-
methods?: Record<string, (self: TypeValue, args: TypeValue[]) => TypeValue | undefined>;
|
|
31
|
-
properties?: Record<string, (self: TypeValue) => TypeValue | undefined>;
|
|
32
|
-
};
|
|
33
|
-
type TypeValue = {
|
|
34
|
-
kind: "literal";
|
|
35
|
-
value: LiteralValue;
|
|
36
|
-
} | {
|
|
37
|
-
kind: "primitive";
|
|
38
|
-
type: "number" | "string" | "boolean" | "bigint" | "symbol";
|
|
39
|
-
} | {
|
|
40
|
-
kind: "refined";
|
|
41
|
-
base: TypeValue;
|
|
42
|
-
refinement: Refinement;
|
|
43
|
-
} | {
|
|
44
|
-
kind: "object";
|
|
45
|
-
properties: Record<string, TypeValue>;
|
|
46
|
-
id: symbol;
|
|
47
|
-
} | {
|
|
48
|
-
kind: "array";
|
|
49
|
-
element: TypeValue;
|
|
50
|
-
} | {
|
|
51
|
-
kind: "tuple";
|
|
52
|
-
elements: TypeValue[];
|
|
53
|
-
} | {
|
|
54
|
-
kind: "function";
|
|
55
|
-
params: string[];
|
|
56
|
-
body: Node;
|
|
57
|
-
closure: Environment;
|
|
58
|
-
} | {
|
|
59
|
-
kind: "promise";
|
|
60
|
-
value: TypeValue;
|
|
61
|
-
} | {
|
|
62
|
-
kind: "instance";
|
|
63
|
-
className: string;
|
|
64
|
-
properties: Record<string, TypeValue>;
|
|
65
|
-
} | {
|
|
66
|
-
kind: "union";
|
|
67
|
-
members: TypeValue[];
|
|
68
|
-
} | {
|
|
69
|
-
kind: "never";
|
|
70
|
-
} | {
|
|
71
|
-
kind: "unknown";
|
|
72
|
-
};
|
|
73
|
-
declare function createUnion(...members: TypeValue[]): TypeValue;
|
|
74
|
-
declare const T: {
|
|
75
|
-
readonly literal: (value: LiteralValue) => TypeValue;
|
|
76
|
-
readonly number: TypeValue;
|
|
77
|
-
readonly string: TypeValue;
|
|
78
|
-
readonly boolean: TypeValue;
|
|
79
|
-
readonly bigint: TypeValue;
|
|
80
|
-
readonly symbol: TypeValue;
|
|
81
|
-
readonly null: TypeValue;
|
|
82
|
-
readonly undefined: TypeValue;
|
|
83
|
-
readonly unknown: TypeValue;
|
|
84
|
-
readonly never: TypeValue;
|
|
85
|
-
readonly object: (properties: Record<string, TypeValue>) => TypeValue;
|
|
86
|
-
readonly array: (element: TypeValue) => TypeValue;
|
|
87
|
-
readonly tuple: (elements: TypeValue[]) => TypeValue;
|
|
88
|
-
readonly promise: (value: TypeValue) => TypeValue;
|
|
89
|
-
readonly instanceOf: (className: string, properties?: Record<string, TypeValue>) => TypeValue;
|
|
90
|
-
readonly union: typeof createUnion;
|
|
91
|
-
readonly fn: (params: string[], body: Node, closure: Environment) => TypeValue;
|
|
92
|
-
readonly refine: (base: TypeValue, refinement: Refinement) => TypeValue;
|
|
93
|
-
readonly fnSig: (paramTypes: TypeValue[], returnType: TypeValue, throwsType?: TypeValue, impl?: SigImpl) => TypeValue;
|
|
94
|
-
};
|
|
95
|
-
declare function typeValueEquals(a: TypeValue, b: TypeValue): boolean;
|
|
96
|
-
declare function simplifyUnion(members: TypeValue[]): TypeValue;
|
|
97
|
-
declare function widenLiteral(tv: TypeValue): TypeValue;
|
|
98
|
-
/**
|
|
99
|
-
* union 成员全部为同原语基底的字面量且数量 > maxLiterals 时塌缩为该基类型;
|
|
100
|
-
* 非 union、混合类型、或数量不超限的原样返回。
|
|
101
|
-
*
|
|
102
|
-
* 复用 simplifyUnion(内含吸收律与去重):先让「基类型已在场」的字面量被吸收
|
|
103
|
-
* (3 | number → number),再对剩余的纯字面量联合做阈值坍缩(1|2|…|20 → number)。
|
|
104
|
-
* 两步不冲突也不重复:吸收只删基类型已在场的字面量,阈值坍缩只处理无基类型
|
|
105
|
-
* 在场的纯字面量联合。
|
|
106
|
-
*/
|
|
107
|
-
declare function collapseLiteralUnion(tv: TypeValue, maxLiterals: number): TypeValue;
|
|
108
|
-
declare function isSubtypeOf(a: TypeValue, b: TypeValue): boolean;
|
|
109
|
-
declare function deepCloneTypeValue(tv: TypeValue, idMap?: Map<symbol, symbol>): TypeValue;
|
|
110
|
-
declare function mergeObjectProperties(a: TypeValue & {
|
|
111
|
-
kind: "object";
|
|
112
|
-
}, b: TypeValue & {
|
|
113
|
-
kind: "object";
|
|
114
|
-
}): TypeValue;
|
|
115
|
-
declare function typeValueToString(tv: TypeValue): string;
|
|
116
|
-
declare function narrowType(tv: TypeValue, predicate: (member: TypeValue) => boolean): TypeValue;
|
|
117
|
-
declare function subtractType(tv: TypeValue, predicate: (member: TypeValue) => boolean): TypeValue;
|
|
118
|
-
declare function getPrimitiveTypeOf(tv: TypeValue): string | undefined;
|
|
119
|
-
declare function getRefinedBase(tv: TypeValue): TypeValue;
|
|
120
|
-
declare function isFnSig(tv: TypeValue): boolean;
|
|
121
|
-
declare function getFnSig(tv: TypeValue): FunctionSignature | undefined;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* 残差 IR 兜底(不是类型运算真理源)。
|
|
125
|
-
*
|
|
126
|
-
* 真理在 algebra:算术/比较/相等/typeof/!/−/字符串词法序/nullish 均走 Abs。
|
|
127
|
-
* 这里只保留:
|
|
128
|
-
* - add:代数拒绝时的混合 `+`
|
|
129
|
-
* - 比较/相等:代数无法判定时的保守 boolean / 字面量折叠
|
|
130
|
-
* - dispatchMethod/Property:宿主 refined 扩展(startsWith、length…)
|
|
131
|
-
*/
|
|
132
|
-
|
|
133
|
-
declare const Ops: {
|
|
134
|
-
readonly add: (left: TypeValue, right: TypeValue) => TypeValue;
|
|
135
|
-
readonly strictEq: (left: TypeValue, right: TypeValue) => TypeValue;
|
|
136
|
-
readonly strictNeq: (left: TypeValue, right: TypeValue) => TypeValue;
|
|
137
|
-
readonly gt: (left: TypeValue, right: TypeValue) => TypeValue;
|
|
138
|
-
readonly lt: (left: TypeValue, right: TypeValue) => TypeValue;
|
|
139
|
-
readonly gte: (left: TypeValue, right: TypeValue) => TypeValue;
|
|
140
|
-
readonly lte: (left: TypeValue, right: TypeValue) => TypeValue;
|
|
141
|
-
readonly not: (operand: TypeValue) => TypeValue;
|
|
142
|
-
};
|
|
143
|
-
declare function applyBinaryOp(op: string, left: TypeValue, right: TypeValue): TypeValue;
|
|
144
|
-
declare function dispatchBinaryOp(op: string, left: TypeValue, right: TypeValue): TypeValue;
|
|
145
|
-
declare function dispatchMethod(receiver: TypeValue, name: string, args: TypeValue[]): TypeValue | undefined;
|
|
146
|
-
declare function dispatchProperty(receiver: TypeValue, name: string): TypeValue | undefined;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* 模板字面量谓词,独立于 template.ts 以断开运行时循环引用:
|
|
150
|
-
* type-value.ts(联合吸收律)与 template.ts 都依赖本模块,而本模块对
|
|
151
|
-
* type-value.ts 只有 `import type` 边(编译后消失),运行时依赖保持单向
|
|
152
|
-
* type-value.ts / template.ts -> template-predicates.ts。
|
|
153
|
-
*/
|
|
154
|
-
declare function isTemplate(tv: TypeValue): boolean;
|
|
155
|
-
|
|
156
|
-
declare function createTemplate(parts: TypeValue[]): TypeValue;
|
|
157
|
-
|
|
158
|
-
declare function getTemplateParts(tv: TypeValue): TypeValue[] | undefined;
|
|
159
|
-
declare function concatTemplates(left: TypeValue, right: TypeValue): TypeValue;
|
|
160
|
-
|
|
161
|
-
type RangeMeta = {
|
|
162
|
-
min?: number;
|
|
163
|
-
max?: number;
|
|
164
|
-
/** 下界开区间:value > min(JS 实数,不能写成 >= min+1) */
|
|
165
|
-
minExclusive?: boolean;
|
|
166
|
-
/** 上界开区间:value < max */
|
|
167
|
-
maxExclusive?: boolean;
|
|
168
|
-
integer?: boolean;
|
|
169
|
-
};
|
|
170
|
-
declare function createRange(meta: RangeMeta): TypeValue;
|
|
171
|
-
declare function isRange(tv: TypeValue): boolean;
|
|
172
|
-
declare function getRangeMeta(tv: TypeValue): RangeMeta | undefined;
|
|
15
|
+
declare function createEnvironment(parent?: Environment, bindings?: Map<string, Abs>): Environment;
|
|
173
16
|
|
|
174
17
|
/**
|
|
175
18
|
* Nudo Mock 帮助函数
|
|
176
19
|
*
|
|
177
|
-
* 提供类型安全的 mock 创建,替代 sinon
|
|
20
|
+
* 提供类型安全的 mock 创建,替代 sinon 表达式。
|
|
21
|
+
* 值字段为 Abs(类型系统真理源)。
|
|
22
|
+
* Abs 路径经 mock-abs.ts / mockDirectivesToAbsSeeds 消费。
|
|
178
23
|
*/
|
|
179
24
|
|
|
180
25
|
type MockHelper = {
|
|
181
26
|
kind: "mock-helper";
|
|
182
|
-
returnValue?:
|
|
183
|
-
resolvedValue?:
|
|
184
|
-
rejectedValue?:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
onSecondCallValue?: TypeValue;
|
|
27
|
+
returnValue?: Abs;
|
|
28
|
+
resolvedValue?: Abs;
|
|
29
|
+
rejectedValue?: Abs;
|
|
30
|
+
onFirstCallValue?: Abs;
|
|
31
|
+
onSecondCallValue?: Abs;
|
|
188
32
|
withArgsCases?: {
|
|
189
|
-
args:
|
|
190
|
-
returnValue:
|
|
33
|
+
args: Abs[];
|
|
34
|
+
returnValue: Abs;
|
|
191
35
|
}[];
|
|
192
|
-
|
|
36
|
+
/** callsFake 的函数体(AST);params 同步存下供 Abs absFunction */
|
|
37
|
+
callsFakeImpl?: {
|
|
38
|
+
params: string[];
|
|
39
|
+
body: Node;
|
|
40
|
+
async?: boolean;
|
|
41
|
+
};
|
|
193
42
|
};
|
|
194
43
|
/**
|
|
195
44
|
* 创建一个 stub mock
|
|
@@ -197,13 +46,17 @@ type MockHelper = {
|
|
|
197
46
|
*/
|
|
198
47
|
declare function stub(): MockHelper;
|
|
199
48
|
declare namespace stub {
|
|
200
|
-
var returns: (value:
|
|
201
|
-
var resolves: (value:
|
|
202
|
-
var rejects: (value:
|
|
203
|
-
var onFirstCall: (value:
|
|
204
|
-
var onSecondCall: (value:
|
|
205
|
-
var withArgs: (...args:
|
|
206
|
-
var callsFake: (fn:
|
|
49
|
+
var returns: (value: Abs) => MockHelper;
|
|
50
|
+
var resolves: (value: Abs) => MockHelper;
|
|
51
|
+
var rejects: (value: Abs) => MockHelper;
|
|
52
|
+
var onFirstCall: (value: Abs) => MockHelper;
|
|
53
|
+
var onSecondCall: (value: Abs) => MockHelper;
|
|
54
|
+
var withArgs: (...args: Abs[]) => MockHelper;
|
|
55
|
+
var callsFake: (fn: {
|
|
56
|
+
params: string[];
|
|
57
|
+
body: Node;
|
|
58
|
+
async?: boolean;
|
|
59
|
+
}) => MockHelper;
|
|
207
60
|
}
|
|
208
61
|
/**
|
|
209
62
|
* 创建一个 spy mock
|
|
@@ -211,17 +64,13 @@ declare namespace stub {
|
|
|
211
64
|
*/
|
|
212
65
|
declare function spy(): MockHelper;
|
|
213
66
|
declare namespace spy {
|
|
214
|
-
var returns: (value:
|
|
67
|
+
var returns: (value: Abs) => MockHelper;
|
|
215
68
|
}
|
|
216
69
|
/**
|
|
217
70
|
* 创建一个 mock
|
|
218
71
|
* 用法: @nudo:mock service = mock()
|
|
219
72
|
*/
|
|
220
73
|
declare function mock(): MockHelper;
|
|
221
|
-
/**
|
|
222
|
-
* 将 MockHelper 转换为 TypeValue
|
|
223
|
-
*/
|
|
224
|
-
declare function mockHelperToTypeValue(helper: MockHelper, env: Environment): TypeValue;
|
|
225
74
|
|
|
226
75
|
/**
|
|
227
76
|
* 原地剥除 AST 中的 TS-only 语法节点/字段,返回同一棵 AST(便于链式使用)。
|
|
@@ -256,6 +105,8 @@ declare function describePhi(): string;
|
|
|
256
105
|
* 与 term-registry 同一纪律:不给共享单例挂 impl。
|
|
257
106
|
*/
|
|
258
107
|
|
|
108
|
+
/** Abs 原生 env/builtin 实现(B-path 优先) */
|
|
109
|
+
type AbsSigImpl = (args: Abs[], thisVal?: Abs) => Abs | undefined;
|
|
259
110
|
type AbsFnImpl = {
|
|
260
111
|
params: string[];
|
|
261
112
|
/** 可选:无 body 时走 relation(纯关系 fn) */
|
|
@@ -266,6 +117,12 @@ type AbsFnImpl = {
|
|
|
266
117
|
kind?: string;
|
|
267
118
|
/** 调用时直接派发(mock withArgs 等),优先于 body */
|
|
268
119
|
apply?: (args: Abs[]) => Abs;
|
|
120
|
+
/**
|
|
121
|
+
* 对象方法(ObjectMethod / 方法型 FunctionExpression):$invoke 时把
|
|
122
|
+
* receiver 作为 apply 的**首参**注入。shape.params 仍是用户可见形参
|
|
123
|
+
* (不含 receiver),自由调用不注入 → this 为 unbound(JS 语义)。
|
|
124
|
+
*/
|
|
125
|
+
bindThis?: boolean;
|
|
269
126
|
/**
|
|
270
127
|
* Optional content key for cache fingerprints. formatAbs cannot see
|
|
271
128
|
* WeakMap-side mock semantics (returns/withArgs/callsFake), so hosts that
|
|
@@ -372,12 +229,18 @@ declare function negAbs(a: Abs, _phi?: Phi): Abs;
|
|
|
372
229
|
declare function notAbs(a: Abs): Abs;
|
|
373
230
|
/** 该 shape 在 JS 上一定不是 null/undefined */
|
|
374
231
|
declare function definitelyNotNullishShape(s: Shape): boolean;
|
|
232
|
+
/** 仅当 term 确为 lit null/undefined 时为 true;非 lit 的 litValue===undefined 不得当 nullish */
|
|
375
233
|
declare function isNullishLitAbs(a: Abs): boolean;
|
|
376
234
|
/**
|
|
377
235
|
* 严格相等(Abs):双字面量折叠;nullish 与 definitely-not-nullish → false。
|
|
378
236
|
* 返回 undefined = 无法判定(交给 boolean + 调用方)。
|
|
379
237
|
*/
|
|
380
238
|
declare function strictEqAbs(a: Abs, b: Abs): boolean | undefined;
|
|
239
|
+
/**
|
|
240
|
+
* 宽松相等 `==`(C2.3):双 lit 走 Abstract Equality;否则回落严格相等判定。
|
|
241
|
+
* 返回 undefined = 无法判定。
|
|
242
|
+
*/
|
|
243
|
+
declare function looseEqAbs(a: Abs, b: Abs): boolean | undefined;
|
|
381
244
|
|
|
382
245
|
/**
|
|
383
246
|
* Abs 侧常用 builtin:shape 级运算,不依赖 TypeValue host 库。
|
|
@@ -408,6 +271,12 @@ declare function evalPromiseCtor(_args: Abs[]): Abs;
|
|
|
408
271
|
declare function evalPromiseStatic(name: string, args: Abs[]): Abs | undefined;
|
|
409
272
|
/** 命名空间分派入口 */
|
|
410
273
|
declare function evalNamespaceCall(ns: string, method: string, args: Abs[]): Abs | undefined;
|
|
274
|
+
declare function isErrorCtorName(name: string | undefined): boolean;
|
|
275
|
+
/**
|
|
276
|
+
* Error brand:shape 带 name/message(字面量 message 保精确)。
|
|
277
|
+
* $new 与 ast-eval 的 new Error 共用——catch 形参成员访问可解。
|
|
278
|
+
*/
|
|
279
|
+
declare function errorBrandAbs(name: string, messageArg?: Abs): Abs;
|
|
411
280
|
/** new X(...) */
|
|
412
281
|
declare function evalBuiltinNew(className: string, args: Abs[]): Abs | undefined;
|
|
413
282
|
/** brand 实例方法(Date/RegExp/Map/Set) */
|
|
@@ -498,9 +367,10 @@ declare function spread(base: Abs, over: Abs): Abs;
|
|
|
498
367
|
* 同 key 集:槽位级 join(字面量并);异 key 集:保持 sum。
|
|
499
368
|
*/
|
|
500
369
|
declare function joinObjects(a: Abs, b: Abs): Abs;
|
|
501
|
-
/** 值级 join
|
|
370
|
+
/** 值级 join:同型双字面量保留为枚举 sum;其余 prim 同型收成 path */
|
|
502
371
|
declare function joinValues(a: Abs, b: Abs): Abs;
|
|
503
372
|
declare function makeSum(a: Abs, b: Abs): Abs;
|
|
373
|
+
declare function absShapeKey(a: Abs, seen?: Set<object>): string;
|
|
504
374
|
type FnAbs = Abs & {
|
|
505
375
|
shape: {
|
|
506
376
|
k: "fn";
|
|
@@ -520,6 +390,86 @@ declare function joinFunctions(a: Abs, b: Abs): Abs;
|
|
|
520
390
|
/** 通用 join:分派到对象/函数/值 */
|
|
521
391
|
declare function joinAbs(a: Abs, b: Abs): Abs;
|
|
522
392
|
|
|
393
|
+
/**
|
|
394
|
+
* Map / Set 字面量条目追踪(C1.1 / C1.2)。
|
|
395
|
+
* 按 Abs 对象身份挂 side table:`m.set("k", v)` 后同 identity 的 `m.get("k")`
|
|
396
|
+
* 可回查。非字面量 key 不入表;get/has 对未知 key 保守回落。
|
|
397
|
+
*/
|
|
398
|
+
|
|
399
|
+
type LitKey = string | number | boolean | null | undefined;
|
|
400
|
+
type MapTable = {
|
|
401
|
+
byLit: Map<LitKey, Abs>;
|
|
402
|
+
/** 非字面量 key 写入的值(get 未知 key 时 join 用) */
|
|
403
|
+
shadowValues: Abs[];
|
|
404
|
+
/** 抽象分支并入后「可能不存在」的字面量键(get/has 需保守) */
|
|
405
|
+
maybeAbsent?: Set<LitKey>;
|
|
406
|
+
};
|
|
407
|
+
type SetTable = {
|
|
408
|
+
elements: Abs[];
|
|
409
|
+
/**
|
|
410
|
+
* fork 后 membership 不确定。
|
|
411
|
+
* - `true`:整表不确定(未知 delete / 非字面量元素混杂)
|
|
412
|
+
* - `Set<LitKey>`:这些字面 key 可能在部分臂缺失(跨臂 delete 不同元素时,长度启发式不够)
|
|
413
|
+
*/
|
|
414
|
+
maybeAbsent?: true | Set<LitKey>;
|
|
415
|
+
};
|
|
416
|
+
/** $fork 抽象分支:每侧独立 overlay,避免身份表被另一侧 set 污染 */
|
|
417
|
+
type ArmOverlay = WeakMap<object, {
|
|
418
|
+
map?: MapTable;
|
|
419
|
+
set?: SetTable;
|
|
420
|
+
}>;
|
|
421
|
+
declare function pushCollectionArm(): void;
|
|
422
|
+
declare function popCollectionArm(): ArmOverlay | undefined;
|
|
423
|
+
/**
|
|
424
|
+
* 合并 fork 各臂 overlay → 全局表(由 endCollectionFork 实现)。
|
|
425
|
+
* 保留导出名以免外部测试/调用点漂移。
|
|
426
|
+
*/
|
|
427
|
+
declare function mergeCollectionArms(arms: Array<ArmOverlay | undefined>): void;
|
|
428
|
+
declare function beginCollectionFork(): void;
|
|
429
|
+
declare function noteCollectionWrite(id: object): void;
|
|
430
|
+
declare function endCollectionFork(arms: Array<ArmOverlay | undefined>): void;
|
|
431
|
+
declare function isMapAbs(a: Abs | undefined): boolean;
|
|
432
|
+
declare function isSetAbs(a: Abs | undefined): boolean;
|
|
433
|
+
declare function makeMapAbs(iterable?: Abs): Abs;
|
|
434
|
+
declare function makeSetAbs(iterable?: Abs): Abs;
|
|
435
|
+
/** Map#set:fork 内写 overlay;否则原地。返回同一 Abs(JS 可变语义) */
|
|
436
|
+
declare function mapSetEntry(mapAbs: Abs, key: Abs | undefined, value: Abs): Abs;
|
|
437
|
+
/** Map#delete:fork overlay 内移除字面量键;未知 key 仅标 shadow 不确定 */
|
|
438
|
+
declare function mapDeleteEntry(mapAbs: Abs, key: Abs | undefined): Abs;
|
|
439
|
+
/** Map#clear:清空条目;fork 下仍走 overlay */
|
|
440
|
+
declare function mapClearEntries(mapAbs: Abs): Abs;
|
|
441
|
+
/** Map#get:命中字面量 key → 精确;miss / 未知 key / maybeAbsent / shadow 并 undefined */
|
|
442
|
+
declare function mapGetEntry(mapAbs: Abs, key: Abs | undefined): Abs;
|
|
443
|
+
/** Map#has:字面量 miss 折 exact false 时,get 必须是 undefined(不可再并 value) */
|
|
444
|
+
declare function mapHasEntry(mapAbs: Abs, key: Abs | undefined): Abs;
|
|
445
|
+
declare function mapSizeAbs(mapAbs: Abs): Abs;
|
|
446
|
+
declare function mapValuesAbs(mapAbs: Abs): Abs[];
|
|
447
|
+
/**
|
|
448
|
+
* Map 迭代条目:JS `for (const [k,v] of map)` / `Array.from(map)` 产出
|
|
449
|
+
* `[key, value]` 元组 Abs。字面量 key 精确;shadow 写入 key 为 unknown。
|
|
450
|
+
*/
|
|
451
|
+
declare function mapEntriesAbs(mapAbs: Abs): Abs[];
|
|
452
|
+
/** Set#add:fork 内写 overlay;返回同一 Abs */
|
|
453
|
+
declare function setAddEntry(setAbs: Abs, value: Abs): Abs;
|
|
454
|
+
/** Set#delete:按字面量元素移除;fork overlay 内生效。
|
|
455
|
+
* 字面量删除且无残留非字面量元素 → 该臂可精确 miss;
|
|
456
|
+
* 臂间分歧由 endCollectionFork 按元素数差标 maybeAbsent。 */
|
|
457
|
+
declare function setDeleteEntry(setAbs: Abs, value: Abs): Abs;
|
|
458
|
+
/** Set#clear */
|
|
459
|
+
declare function setClearEntries(setAbs: Abs): Abs;
|
|
460
|
+
declare function setHasEntry(setAbs: Abs, value: Abs): Abs;
|
|
461
|
+
declare function setSizeAbs(setAbs: Abs): Abs;
|
|
462
|
+
declare function setElementsAbs(setAbs: Abs): Abs[];
|
|
463
|
+
/**
|
|
464
|
+
* 确切条目数:Set 无 maybeAbsent / Map 无 shadow+maybeAbsent 时返回长度;
|
|
465
|
+
* 否则 undefined(for-of 不得假装有界)。
|
|
466
|
+
*/
|
|
467
|
+
declare function collectionExactLen(c: Abs): number | undefined;
|
|
468
|
+
/** 元素联合(for-of / Array.from);无表 → unknown。
|
|
469
|
+
* Map 语义是 entry `[k,v]` 元组联合,不是裸 value。 */
|
|
470
|
+
declare function collectionElementJoin(c: Abs): Abs;
|
|
471
|
+
declare function clearCollectionTables(): void;
|
|
472
|
+
|
|
523
473
|
/**
|
|
524
474
|
* 结构可赋值:src ≤ tgt(Abs 上的 leq)。
|
|
525
475
|
*
|
|
@@ -559,6 +509,13 @@ type EvalOptions = {
|
|
|
559
509
|
file?: File;
|
|
560
510
|
/** host 已求值的相对依赖导出表 */
|
|
561
511
|
modules?: Record<string, AbsModuleExports>;
|
|
512
|
+
/** host 注入(@nudo:mock 等)在求值前绑定(evalSource 也认) */
|
|
513
|
+
seedVars?: Record<string, Abs>;
|
|
514
|
+
seedFns?: Record<string, {
|
|
515
|
+
params: string[];
|
|
516
|
+
body: Node;
|
|
517
|
+
async?: boolean;
|
|
518
|
+
}>;
|
|
562
519
|
};
|
|
563
520
|
declare const MAX_CALL_DEPTH = 64;
|
|
564
521
|
declare const MAX_TOTAL_CALLS = 200000;
|
|
@@ -577,7 +534,8 @@ type AbsCallRecord = {
|
|
|
577
534
|
};
|
|
578
535
|
threw?: boolean;
|
|
579
536
|
};
|
|
580
|
-
|
|
537
|
+
/** 设置收集器并返回先前值(嵌套/并发宿主须 restore,勿直接置 null) */
|
|
538
|
+
declare function setAbsCallCollector(collector: ((r: AbsCallRecord) => void) | null): ((r: AbsCallRecord) => void) | null;
|
|
581
539
|
declare function setAbsNodeCollector(collector: ((node: Node, value: Abs) => void) | null): void;
|
|
582
540
|
/** 赋值记录:结构可赋值检查用 */
|
|
583
541
|
type AbsAssignRecord = {
|
|
@@ -602,11 +560,19 @@ type EvalResult = {
|
|
|
602
560
|
cont?: boolean;
|
|
603
561
|
/** throw 了 value(未捕获时向上传播) */
|
|
604
562
|
threw?: boolean;
|
|
563
|
+
/** throw 语句源位置(1-based line,0-based column;Babel loc 口径) */
|
|
564
|
+
throwLoc?: {
|
|
565
|
+
line: number;
|
|
566
|
+
column: number;
|
|
567
|
+
};
|
|
605
568
|
/**
|
|
606
569
|
* if 无 else 且 consequent 已 return/throw:真分支已产出 value,
|
|
607
570
|
* 假分支 fall-through 仍可能走后续语句。evalBlock 需与后续结果 join。
|
|
608
571
|
*/
|
|
609
572
|
partialReturn?: boolean;
|
|
573
|
+
/** 抽象分支可能 throw(另一侧继续)— try 需并 catch 路径 */
|
|
574
|
+
partialThrow?: boolean;
|
|
575
|
+
throwValue?: Abs;
|
|
610
576
|
};
|
|
611
577
|
/**
|
|
612
578
|
* 分析一段 JS 源码。
|
|
@@ -617,6 +583,18 @@ declare function evalSource(source: string, entry: {
|
|
|
617
583
|
fn: string;
|
|
618
584
|
args: Abs[];
|
|
619
585
|
}, opts?: EvalOptions): EvalResult;
|
|
586
|
+
/**
|
|
587
|
+
* 调用具名函数并返回 throws/loc(T20)。
|
|
588
|
+
* threw 时 result=never、throws=抛出值、throwLoc=throw 语句位置。
|
|
589
|
+
*/
|
|
590
|
+
declare function callFunctionFull(env: AstEnv, name: string, args: Abs[], phi?: Phi, budget?: LeakBudget): {
|
|
591
|
+
result: Abs;
|
|
592
|
+
throws: Abs;
|
|
593
|
+
throwLoc?: {
|
|
594
|
+
line: number;
|
|
595
|
+
column: number;
|
|
596
|
+
};
|
|
597
|
+
};
|
|
620
598
|
declare function callFunction(env: AstEnv, name: string, args: Abs[], phi?: Phi, budget?: LeakBudget): Abs;
|
|
621
599
|
/**
|
|
622
600
|
* 在 this=receiver 下求值方法体。
|
|
@@ -647,6 +625,18 @@ declare function applyAbsFn(fnVal: Abs, args: Abs[], env: AstEnv, phi: Phi, budg
|
|
|
647
625
|
* `, "scale", [numVar("x", gtNum(v("x"), 0))], gtNum(v("x"), 0))
|
|
648
626
|
*/
|
|
649
627
|
declare function analyzeFn(source: string, fnName: string, args: Abs[], phi?: Phi, budget?: LeakBudget, file?: File, modules?: Record<string, AbsModuleExports>): Abs;
|
|
628
|
+
/**
|
|
629
|
+
* analyzeFn 的 throws/loc 感知版(T19/T20):threw 时 result=never、throws=抛出值。
|
|
630
|
+
* 供 case 兜底在 B-path 失败时仍可无损拿 throws+loc,不经 TypeValue evaluateFunctionFull。
|
|
631
|
+
*/
|
|
632
|
+
declare function analyzeFnFull(source: string, fnName: string, args: Abs[], opts?: EvalOptions): {
|
|
633
|
+
result: Abs;
|
|
634
|
+
throws: Abs;
|
|
635
|
+
throwLoc?: {
|
|
636
|
+
line: number;
|
|
637
|
+
column: number;
|
|
638
|
+
};
|
|
639
|
+
};
|
|
650
640
|
/**
|
|
651
641
|
* 程序级 Abs 求值:注册全部顶层函数/class,再顺序执行语句。
|
|
652
642
|
* 返回最终 env(vars 含导出绑定)。TypeValue 仅在调用方 bridge 时出现。
|
|
@@ -805,6 +795,8 @@ declare function isIntFlag(c: NudoConstraint): boolean;
|
|
|
805
795
|
declare function number(): ConstraintBuilder;
|
|
806
796
|
declare function string(): ConstraintBuilder;
|
|
807
797
|
declare function boolean(): ConstraintBuilder;
|
|
798
|
+
/** any() —— 无约束;formatConstraint / draft import 与显示同源 */
|
|
799
|
+
declare function any(): ConstraintBuilder;
|
|
808
800
|
/** array(item) —— 数组,元素满足 item */
|
|
809
801
|
declare function array(item: NudoConstraint | ConstraintBuilder): ConstraintBuilder;
|
|
810
802
|
/**
|
|
@@ -976,18 +968,22 @@ declare function takeInterfaceDiagsSince(since: number): InterfaceDiag[];
|
|
|
976
968
|
/** 有效契约来源:手写(源码 refine ∪ 侧车手写绑定)> 生成段 > 隐式 */
|
|
977
969
|
type InterfaceSource = "handwritten" | "generated" | "implicit";
|
|
978
970
|
/**
|
|
979
|
-
*
|
|
980
|
-
*
|
|
981
|
-
*
|
|
982
|
-
*
|
|
983
|
-
*
|
|
971
|
+
* 源文件本地导出名表(侧车自动绑定边界):
|
|
972
|
+
* - ESM:`export function/const/let/var/class` 与本地 `export { x }` /
|
|
973
|
+
* `export { local as exported }`(按**导出名**绑定);
|
|
974
|
+
* - `export default function add` / `const add = …; export default add`:
|
|
975
|
+
* 按**本地名** `add` 绑定(侧车可 `export const add = fn(…)`);
|
|
976
|
+
* 同时登记 `"default"`,供侧车 `export default fn(…)` 对齐;
|
|
977
|
+
* - CJS(C4.3):`module.exports = { a, b }`、`module.exports.a = …`、
|
|
978
|
+
* `exports.a = …`、`module.exports = localFn`(登记 localFn 名)。
|
|
979
|
+
* 排除 re-export(`export {x} from` / `export *`)。
|
|
984
980
|
*/
|
|
985
981
|
declare function localNamedExports(source: string): Set<string>;
|
|
986
982
|
/**
|
|
987
|
-
*
|
|
988
|
-
*
|
|
989
|
-
*
|
|
990
|
-
*
|
|
983
|
+
* 侧车源码的生成段导出名:export 之前(跳过紧邻的 import/const 链)的注释
|
|
984
|
+
* 行含 `@generated` → 该名为 generated。组合式下行段(§5.3)形态为
|
|
985
|
+
* `import` + `@generated 头` + prelude + export;callsite 段则是头紧贴
|
|
986
|
+
* export。隔了其他代码行 / 无标记 / re-export 列表均不算。
|
|
991
987
|
*/
|
|
992
988
|
declare function generatedExportNames(sidecarSrc: string): Set<string>;
|
|
993
989
|
type EffectiveInterfaceOpts = RefineResolveOpts & {
|
|
@@ -1028,10 +1024,109 @@ declare function effectiveInterface(source: string, fnName: string, opts?: Effec
|
|
|
1028
1024
|
declare function sidecarClosureFingerprint(fromFile: string, opts: EffectiveInterfaceOpts): string | undefined;
|
|
1029
1025
|
/** 组合式显示:重建构建器调用形态(number().gt(0) / union(…) / fn(…)) */
|
|
1030
1026
|
declare function formatConstraint(c: NudoConstraint): string;
|
|
1027
|
+
/** EffectiveInterface → 契约展示串(与 CLI interface 打印同口径,不含函数名) */
|
|
1028
|
+
declare function formatEffectiveInterfaceDisplay(eff: EffectiveInterface): string;
|
|
1029
|
+
/** CodeLens / hover 首行标题(design-refine-derivation §8):`● interface / <source>` */
|
|
1030
|
+
declare function formatInterfaceTierLine(source: InterfaceSource): string;
|
|
1031
|
+
type InterfaceTierInfo = {
|
|
1032
|
+
source: InterfaceSource;
|
|
1033
|
+
/** handwritten/generated 时的契约展示;implicit 为 undefined */
|
|
1034
|
+
display?: string;
|
|
1035
|
+
};
|
|
1036
|
+
type InterfaceTierOpts = EffectiveInterfaceOpts;
|
|
1037
|
+
/**
|
|
1038
|
+
* interface 档单一读取口(A7):CodeLens `● interface`、hover、inlay、
|
|
1039
|
+
* semantic tokens 共用本函数,保证「同源」。
|
|
1040
|
+
*
|
|
1041
|
+
* 与 computeInterfaceLenses 同口径:仅源文件 **本地 named export** 进档;
|
|
1042
|
+
* 私有名 / 非导出 → undefined(不进 interface 档,不假装 implicit 契约)。
|
|
1043
|
+
*/
|
|
1044
|
+
declare function interfaceTierOf(source: string, fnName: string, fromFile: string, opts?: InterfaceTierOpts): InterfaceTierInfo | undefined;
|
|
1045
|
+
/** interfaceTierOf 的来源投影;非导出 → undefined */
|
|
1046
|
+
declare function interfaceSourceOf(source: string, fnName: string, fromFile: string, opts?: InterfaceTierOpts): InterfaceSource | undefined;
|
|
1047
|
+
|
|
1048
|
+
/**
|
|
1049
|
+
* C4.1:函数形参表面(contract surface)——
|
|
1050
|
+
* 侧车 `fn({…})` / `@nudo:refine` 参数名与求值形参的对齐基线。
|
|
1051
|
+
*
|
|
1052
|
+
* - Identifier / 默认参(AssignmentPattern left)→ 绑定名
|
|
1053
|
+
* - RestElement → 契约名用裸名(`args`),展示名 `...args`
|
|
1054
|
+
* - ObjectPattern / ArrayPattern → 求值占位 `_p{i}`;契约面 = 顶层绑定名
|
|
1055
|
+
* (对象属性 / 数组元素 Identifier)。嵌套 pattern 的绑定名标 `nested`,
|
|
1056
|
+
* 消费方可显式降级(C4.5 param-mismatch / 不执法)。
|
|
1057
|
+
*/
|
|
1058
|
+
type FormalParam = {
|
|
1059
|
+
kind: "id";
|
|
1060
|
+
name: string;
|
|
1061
|
+
index: number;
|
|
1062
|
+
} | {
|
|
1063
|
+
kind: "default";
|
|
1064
|
+
name: string;
|
|
1065
|
+
index: number;
|
|
1066
|
+
} | {
|
|
1067
|
+
kind: "rest";
|
|
1068
|
+
name: string;
|
|
1069
|
+
display: string;
|
|
1070
|
+
index: number;
|
|
1071
|
+
} | {
|
|
1072
|
+
kind: "pattern";
|
|
1073
|
+
/** 求值/签名占位名(generalize 与 dts 用) */
|
|
1074
|
+
placeholder: string;
|
|
1075
|
+
/** 顶层可表达绑定名(侧车契约面) */
|
|
1076
|
+
bound: string[];
|
|
1077
|
+
/**
|
|
1078
|
+
* 契约名 → 对象属性键。rename `{a: b}` 时契约可写 a 或 b,
|
|
1079
|
+
* 投影必须用属性键 a(Abs 对象只有 slot a)。
|
|
1080
|
+
*/
|
|
1081
|
+
propKey: Record<string, string>;
|
|
1082
|
+
/** 仅嵌套内出现、顶层不可单独表达的名(降级用) */
|
|
1083
|
+
nested: string[];
|
|
1084
|
+
index: number;
|
|
1085
|
+
};
|
|
1086
|
+
type AstParam = {
|
|
1087
|
+
type: string;
|
|
1088
|
+
name?: string;
|
|
1089
|
+
left?: AstParam;
|
|
1090
|
+
right?: unknown;
|
|
1091
|
+
argument?: AstParam;
|
|
1092
|
+
properties?: Array<{
|
|
1093
|
+
key?: AstParam;
|
|
1094
|
+
value?: AstParam;
|
|
1095
|
+
type?: string;
|
|
1096
|
+
argument?: AstParam;
|
|
1097
|
+
}>;
|
|
1098
|
+
elements?: Array<AstParam | null | undefined>;
|
|
1099
|
+
};
|
|
1100
|
+
declare function formalParamsFromNodes(params: AstParam[] | undefined | null): FormalParam[];
|
|
1101
|
+
/** 求值/签名用形参名(与 analyzer extractParamNames / dts 对齐) */
|
|
1102
|
+
declare function formalParamDisplayNames(formals: FormalParam[]): string[];
|
|
1103
|
+
/** 侧车契约可绑定的参数名全集 */
|
|
1104
|
+
declare function contractParamNameSet(formals: FormalParam[]): Set<string>;
|
|
1105
|
+
/**
|
|
1106
|
+
* 契约参数名 → 形参定位。
|
|
1107
|
+
* - 命中 id/default/rest → 该 index(执法按整参)
|
|
1108
|
+
* - 命中 pattern 顶层 bound 名 → 该 pattern index + field
|
|
1109
|
+
* - 命中 placeholder / `_` → pattern index(整对象)
|
|
1110
|
+
* - 未命中 → undefined(C4.5 param-mismatch)
|
|
1111
|
+
*/
|
|
1112
|
+
declare function locateContractParam(formals: FormalParam[], contractName: string): {
|
|
1113
|
+
index: number;
|
|
1114
|
+
field?: string;
|
|
1115
|
+
rest?: boolean;
|
|
1116
|
+
} | undefined;
|
|
1031
1117
|
|
|
1032
1118
|
type LoadDepsFingerprint = {
|
|
1033
1119
|
fp: string;
|
|
1034
1120
|
paths: string[];
|
|
1121
|
+
/**
|
|
1122
|
+
* path + loadModule-resolved content(miss → null)。调用方(磁盘缓存键)
|
|
1123
|
+
* 必须优先用这里的 content,不得回读磁盘——否则 buffer-aware loadModule
|
|
1124
|
+
* 与磁盘不一致时键会分叉。
|
|
1125
|
+
*/
|
|
1126
|
+
contents: Array<{
|
|
1127
|
+
path: string;
|
|
1128
|
+
content: string | null;
|
|
1129
|
+
}>;
|
|
1035
1130
|
/** BFS 撞到节点上限:剩余 dep 未进指纹,键不可信 */
|
|
1036
1131
|
truncated: boolean;
|
|
1037
1132
|
};
|
|
@@ -1069,6 +1164,8 @@ declare function getGeneralizeMemoSize(): number;
|
|
|
1069
1164
|
* 返回删除的条目数。路径需与 generalize 时 resolveDepPath 形态一致(建议先 norm)。
|
|
1070
1165
|
*/
|
|
1071
1166
|
declare function evictGeneralizeMemoForPaths(paths: string[]): number;
|
|
1167
|
+
/** 公开:收集 Abs 自由 term 变元(dts 泛型投影 / α 作用域判定复用 L2 基建)。 */
|
|
1168
|
+
declare function collectAbsFreeVars(a: Abs): Set<string>;
|
|
1072
1169
|
type TypeParam = {
|
|
1073
1170
|
id: string;
|
|
1074
1171
|
value: Abs;
|
|
@@ -1085,6 +1182,11 @@ type PolyFn = {
|
|
|
1085
1182
|
param: string;
|
|
1086
1183
|
pred: Pred;
|
|
1087
1184
|
}>;
|
|
1185
|
+
/**
|
|
1186
|
+
* 形参表面(C4.1):默认/rest/解构的契约可绑定名。
|
|
1187
|
+
* 与 params(求值展示名)并列;检查/侧车匹配走 formals。
|
|
1188
|
+
*/
|
|
1189
|
+
formals?: FormalParam[];
|
|
1088
1190
|
/**
|
|
1089
1191
|
* 函数形参的符号外延(与 typeParams 同 α 空间)。
|
|
1090
1192
|
* symbolic 一次跑正常结束时从 env 快照拷出;instantiate 重跑不写。
|
|
@@ -1107,6 +1209,7 @@ declare function extractFn(source: string, fnName: string, fileAst?: ReturnType<
|
|
|
1107
1209
|
params: string[];
|
|
1108
1210
|
body: Node;
|
|
1109
1211
|
env: AstEnv;
|
|
1212
|
+
formals: FormalParam[];
|
|
1110
1213
|
} | undefined;
|
|
1111
1214
|
declare function generalizeFromAst(fnName: string, source: string, opts?: {
|
|
1112
1215
|
budget?: LeakBudget;
|
|
@@ -1162,7 +1265,7 @@ declare function formatDiagnostics(diags: Diagnostic[]): string;
|
|
|
1162
1265
|
*
|
|
1163
1266
|
* 本模块是模板语义的唯一真理源:前缀/后缀/固定文本/长度/匹配/名称渲染/
|
|
1164
1267
|
* 相邻合并/谓词判定等纯计算以「中性 part 视图」(TemplatePartView)暴露;
|
|
1165
|
-
*
|
|
1268
|
+
* Abs 方法表(methods.ts)只做薄适配。
|
|
1166
1269
|
*/
|
|
1167
1270
|
|
|
1168
1271
|
type TemplateMeta = {
|
|
@@ -1197,7 +1300,7 @@ declare function formatTemplateNameViews(views: TemplatePartView[]): string;
|
|
|
1197
1300
|
declare function mergeAdjacentFixedViews<P>(views: TemplatePartView<P>[], rebuildFixed: (text: string) => TemplatePartView<P>): TemplatePartView<P>[];
|
|
1198
1301
|
/** 具体字符串是否匹配模板(Refinement.check 的判定语义) */
|
|
1199
1302
|
declare function templateMatchesValue(value: string, views: TemplatePartView[]): boolean;
|
|
1200
|
-
/**
|
|
1303
|
+
/** 三值判定;Abs 方法表把 "unknown" 适配为 boolPrim */
|
|
1201
1304
|
type TemplatePredicateDecision = boolean | "unknown";
|
|
1202
1305
|
declare function decideStartsWith(prefix: string, search: string): TemplatePredicateDecision;
|
|
1203
1306
|
declare function decideEndsWith(suffix: string, search: string): TemplatePredicateDecision;
|
|
@@ -1467,7 +1570,12 @@ declare function literalMeetsConstraint(lv: number | string | boolean | null, c:
|
|
|
1467
1570
|
*
|
|
1468
1571
|
* 参数侧只展示显式 `@nudo:refine` 契约(entryReqs)——
|
|
1469
1572
|
* 不从函数体 `if` 反推前置条件(那是控制流,不是对外契约)。
|
|
1573
|
+
*
|
|
1574
|
+
* A7(design-refine-derivation §8):default 走 symbolic + entryReqs;
|
|
1575
|
+
* 与 CodeLens `● interface` 同源——interfaceTierOf 标注来源;
|
|
1576
|
+
* implicit 导出的返回 inlay 标明 `derived`(展示档,非义务契约)。
|
|
1470
1577
|
*/
|
|
1578
|
+
|
|
1471
1579
|
type AbsInlay = {
|
|
1472
1580
|
/** 1-based 行号 */
|
|
1473
1581
|
line: number;
|
|
@@ -1475,16 +1583,22 @@ type AbsInlay = {
|
|
|
1475
1583
|
character: number;
|
|
1476
1584
|
label: string;
|
|
1477
1585
|
kind: "type" | "parameter";
|
|
1586
|
+
/** interface 档来源(与 CodeLens `● interface` 同源);非导出缺省 */
|
|
1587
|
+
interfaceSource?: InterfaceSource;
|
|
1588
|
+
/** true = 隐式推导展示(非义务契约),label 已带 `· derived` */
|
|
1589
|
+
derived?: boolean;
|
|
1590
|
+
};
|
|
1591
|
+
type CollectAbsInlaysOpts = InterfaceTierOpts & {
|
|
1592
|
+
loadModule?: (spec: string, fromFile: string) => string | undefined;
|
|
1593
|
+
fromFile?: string;
|
|
1478
1594
|
};
|
|
1479
1595
|
/**
|
|
1480
1596
|
* 收集源码中函数签名的 Abs inlay:
|
|
1481
|
-
* - 参数后:仅 `@nudo:refine`
|
|
1597
|
+
* - 参数后:仅 `@nudo:refine` / 侧车显式契约(entryReqs)
|
|
1482
1598
|
* - `{` 前:返回计算形(`x | x * 2`),无 term 时退回 shape
|
|
1599
|
+
* - interface 档:导出函数带 `interfaceSource`;implicit 返回标 `derived`
|
|
1483
1600
|
*/
|
|
1484
|
-
declare function collectAbsInlays(source: string,
|
|
1485
|
-
loadModule?: (spec: string, fromFile: string) => string | undefined;
|
|
1486
|
-
fromFile?: string;
|
|
1487
|
-
}): AbsInlay[];
|
|
1601
|
+
declare function collectAbsInlays(source: string, opts?: CollectAbsInlaysOpts): AbsInlay[];
|
|
1488
1602
|
|
|
1489
1603
|
/**
|
|
1490
1604
|
* 指称:Abs → 运行时谓词(设计 §2.7)。
|
|
@@ -1496,28 +1610,6 @@ declare function collectAbsInlays(source: string, refineOpts?: {
|
|
|
1496
1610
|
/** Abs 上的运行时守卫表达式(JS boolean 布尔串) */
|
|
1497
1611
|
declare function denoteGuard(a: Abs, v: string): string;
|
|
1498
1612
|
|
|
1499
|
-
/**
|
|
1500
|
-
* Abs ⇄ TypeValue 桥。
|
|
1501
|
-
*
|
|
1502
|
-
* 纪律:
|
|
1503
|
-
* - absToTypeValue 有损:丢 term/pred 时 conf 降为 widened,禁止假装 exact
|
|
1504
|
-
* - typeValueToAbs 尽量恢复 term=lit
|
|
1505
|
-
* - 下游(dts/lsp/service)吃 TypeValue;代数运算吃 Abs
|
|
1506
|
-
*/
|
|
1507
|
-
|
|
1508
|
-
declare function setTvConfidence(tv: TypeValue, conf: Confidence): void;
|
|
1509
|
-
declare function getTvConfidence(tv: TypeValue): Confidence | undefined;
|
|
1510
|
-
/**
|
|
1511
|
-
* Abs → TypeValue(给下游)。
|
|
1512
|
-
* 有损:非 lit term 丢弃;pred 尽量 encode 成 refined,否则丢。
|
|
1513
|
-
*/
|
|
1514
|
-
declare function absToTypeValue(a: Abs): TypeValue;
|
|
1515
|
-
/**
|
|
1516
|
-
* TypeValue → Abs(给代数运算)。
|
|
1517
|
-
* 置信度:优先读 abs→tv 时挂上的 conf 旁路,避免 #widened 回升 #exact。
|
|
1518
|
-
*/
|
|
1519
|
-
declare function typeValueToAbs(tv: TypeValue): Abs;
|
|
1520
|
-
|
|
1521
1613
|
/**
|
|
1522
1614
|
* Abs → NudoConstraint 投影(Phase 1,interface 分层推导的生成侧半边)。
|
|
1523
1615
|
*
|
|
@@ -1556,6 +1648,93 @@ declare function absToConstraint(a: Abs): NudoConstraint | undefined;
|
|
|
1556
1648
|
*/
|
|
1557
1649
|
declare function joinThenProject(absList: Abs[]): NudoConstraint | undefined;
|
|
1558
1650
|
|
|
1651
|
+
/**
|
|
1652
|
+
* 推导图(derivation trace)side-channel(design-refine-derivation §14.3#6 / §11 Phase 2)。
|
|
1653
|
+
*
|
|
1654
|
+
* 不叫 provenance:`setProvenanceTracking` 已被 evaluator 的 TypeValue origin map
|
|
1655
|
+
* 占用。机制对齐 `setCallCollector` / `setAbsTruncationCollector` 先例——
|
|
1656
|
+
* **不进 Abs payload**;ast-eval 与 B-path 共用 core ops(`add` / `joinAbs`),
|
|
1657
|
+
* 两条路径天然都覆盖。
|
|
1658
|
+
*
|
|
1659
|
+
* 设计原则:emit 打印的是推导图的投影,**禁止**事后从最终 Abs 反编译 shift 链。
|
|
1660
|
+
* 本模块在 ops 层打点:数值常量加法 → shift 边;joinAbs → join 边。
|
|
1661
|
+
* 根约束(手写契约参数)由宿主在入口 Abs 上打 root 标签。
|
|
1662
|
+
*/
|
|
1663
|
+
|
|
1664
|
+
/** 推导节点:边带调用位点 / +k / join;root 携带可打印的约束源表达式 */
|
|
1665
|
+
type DerivationNode = {
|
|
1666
|
+
id: number;
|
|
1667
|
+
kind: "root" | "shift" | "join" | "opaque";
|
|
1668
|
+
/** root:宿主给的可读约束表达式(`positive` / `number().gt(0)`) */
|
|
1669
|
+
expr?: string;
|
|
1670
|
+
/** root:跨文件 import 源(相对 specifier,相对 root 侧车目录) */
|
|
1671
|
+
importFrom?: string;
|
|
1672
|
+
/** root:import 绑定名(与 expr 一致时省略) */
|
|
1673
|
+
importName?: string;
|
|
1674
|
+
/** shift:数值偏移 */
|
|
1675
|
+
offset?: number;
|
|
1676
|
+
/** 父节点 id(root 无父) */
|
|
1677
|
+
parents: number[];
|
|
1678
|
+
};
|
|
1679
|
+
/** 调用位点上的实参推导(供 emit 投影组合式) */
|
|
1680
|
+
type ArgDerivation = {
|
|
1681
|
+
node: DerivationNode;
|
|
1682
|
+
/** 从该节点回溯到 root 的路径(含自身,root 在末尾) */
|
|
1683
|
+
chain: DerivationNode[];
|
|
1684
|
+
};
|
|
1685
|
+
type Collector = (node: DerivationNode) => void;
|
|
1686
|
+
/** 设置观察者(null 清除);缓冲照常累积 */
|
|
1687
|
+
declare function setDerivationCollector(fn: Collector | null): void;
|
|
1688
|
+
declare function hasDerivationSession(): boolean;
|
|
1689
|
+
/** 开始一次推导会话(root 驱动下行求值前调用);与 end/abort 成对 */
|
|
1690
|
+
declare function beginDerivationSession(): void;
|
|
1691
|
+
/** 结束会话并取走全部节点(顺序 = 创建序) */
|
|
1692
|
+
declare function endDerivationSession(): DerivationNode[];
|
|
1693
|
+
/** 丢弃当前会话(求值失败时) */
|
|
1694
|
+
declare function abortDerivationSession(): void;
|
|
1695
|
+
/**
|
|
1696
|
+
* 在入口 Abs 上打 root 标签:该值来自手写契约参数约束。
|
|
1697
|
+
* expr 是可打印源(`positive`);importFrom 指向共享模板侧车。
|
|
1698
|
+
*/
|
|
1699
|
+
declare function tagDerivationRoot(abs: Abs, meta: {
|
|
1700
|
+
expr: string;
|
|
1701
|
+
importFrom?: string;
|
|
1702
|
+
importName?: string;
|
|
1703
|
+
}): DerivationNode;
|
|
1704
|
+
/** 读取 Abs 上的推导节点(无标签 → undefined) */
|
|
1705
|
+
declare function getDerivation(abs: Abs): DerivationNode | undefined;
|
|
1706
|
+
/** 手动把推导挂到结果 Abs(宿主在 analyzeFn 返回值上补标签时用) */
|
|
1707
|
+
declare function setDerivation(abs: Abs, node: DerivationNode): void;
|
|
1708
|
+
/** 从节点回溯 root 路径(含自身;环/缺失截断) */
|
|
1709
|
+
declare function derivationChain(node: DerivationNode): DerivationNode[];
|
|
1710
|
+
/**
|
|
1711
|
+
* ops 层打点:`a + k`(k 为有限数值字面量)且 a 带推导 → 结果挂 shift 节点。
|
|
1712
|
+
* 由 arithmetic.add 在返回前调用;无会话/无父标签时 no-op。
|
|
1713
|
+
*/
|
|
1714
|
+
declare function noteDerivationAdd(a: Abs, b: Abs, result: Abs): void;
|
|
1715
|
+
/**
|
|
1716
|
+
* ops 层打点:join 结果挂 join 节点(任一侧有推导即可)。
|
|
1717
|
+
* 工件聚合路径会经 join;check 分轨不依赖 join 节点。
|
|
1718
|
+
*/
|
|
1719
|
+
declare function noteDerivationJoin(inputs: Abs[], result: Abs): void;
|
|
1720
|
+
/**
|
|
1721
|
+
* 把推导链投影为组合式(§2.4:写组合式,不展开)。
|
|
1722
|
+
*
|
|
1723
|
+
* 返回 prelude(`const x = positive.shift(1);`)+ expr(`x` / `x.shift(2)`)
|
|
1724
|
+
* + 需要的 import。无 root 锚或链上出现 join/opaque → undefined(调用方
|
|
1725
|
+
* 退回展开式投影或 not-projectable)。
|
|
1726
|
+
*/
|
|
1727
|
+
declare function projectDerivationDsl(node: DerivationNode, localName: string): {
|
|
1728
|
+
prelude: string[];
|
|
1729
|
+
expr: string;
|
|
1730
|
+
imports: Array<{
|
|
1731
|
+
name: string;
|
|
1732
|
+
from: string;
|
|
1733
|
+
}>;
|
|
1734
|
+
} | undefined;
|
|
1735
|
+
/** 项结构调试用(测试断言) */
|
|
1736
|
+
declare function termKey(t: Term | undefined): string;
|
|
1737
|
+
|
|
1559
1738
|
/**
|
|
1560
1739
|
* 源码级调用图侦察:从 check 门禁拆出的 AST 扫描层。
|
|
1561
1740
|
*
|
|
@@ -1567,13 +1746,13 @@ declare function joinThenProject(absList: Abs[]): NudoConstraint | undefined;
|
|
|
1567
1746
|
*/
|
|
1568
1747
|
|
|
1569
1748
|
/**
|
|
1570
|
-
*
|
|
1571
|
-
* service 的 CallRecord 声明,按结构兼容接收)。
|
|
1749
|
+
* 注入记录的最小结构面。Abs 为唯一真理源。
|
|
1572
1750
|
*/
|
|
1573
1751
|
type InjectedDomainRecord = {
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1752
|
+
/** 无损参数 Abs(必填;domain 证据唯一来源) */
|
|
1753
|
+
argAbs?: Abs[];
|
|
1754
|
+
resultAbs?: Abs;
|
|
1755
|
+
throwsAbs?: Abs;
|
|
1577
1756
|
};
|
|
1578
1757
|
type InjectedDomainEvidenceOpts = {
|
|
1579
1758
|
/** 被调函数形参名(位置序);契约按参数名对齐证据位 */
|
|
@@ -1598,15 +1777,14 @@ type InjectedDomainEvidenceOpts = {
|
|
|
1598
1777
|
*
|
|
1599
1778
|
* 证据门槛(§6):
|
|
1600
1779
|
* - 只有 plain literal 实参构成证据:union/unknown/primitive/refined 形态
|
|
1601
|
-
*
|
|
1602
|
-
*
|
|
1780
|
+
* 无法归因到确定值,不参与。Abs 路径直接读 `litValue` + conf
|
|
1781
|
+
* ∈ {exact, path}。
|
|
1603
1782
|
* - null 证据预过滤(T4 caveat:lit(null) 编码 prim undefined + eq(self,
|
|
1604
1783
|
* null),对任何约束恒不满足,不过滤必 FP);undefined/bigint/symbol
|
|
1605
1784
|
* 不在字面量证据域内,一并跳过;
|
|
1606
1785
|
* - resultType=never ∧ throws=never 是求值中断泄漏(analyzer 注入消费区
|
|
1607
|
-
*
|
|
1608
|
-
*
|
|
1609
|
-
* targetExport/targetAliases/fnModule 十项,无截断标记)——递归截断走
|
|
1786
|
+
* 同款过滤;有 resultAbs/throwsAbs 时同口径)。CallRecord 上没有截断字段
|
|
1787
|
+
* (查证于 evaluator.ts CallRecord 声明)——递归截断走
|
|
1610
1788
|
* nudo:recursion-truncated 诊断通道且只 widen 结果,不产生新字面量证据;
|
|
1611
1789
|
* - fn/shape/array 参数位 Phase 1 不执法(§3.3 HOF 豁免:
|
|
1612
1790
|
* literalMeetsConstraint 对这些形态恒 false,直接查必 FP)。
|
|
@@ -1615,4 +1793,4 @@ type InjectedDomainEvidenceOpts = {
|
|
|
1615
1793
|
*/
|
|
1616
1794
|
declare function checkInjectedDomainEvidence(fnName: string, source: string, records: InjectedDomainRecord[], opts: InjectedDomainEvidenceOpts): CheckIssue[];
|
|
1617
1795
|
|
|
1618
|
-
export { Abs, type AbsAssignRecord, type AbsCallRecord, type AbsFnImpl, type AbsInlay, AbsModuleExports, AstEnv, type CheckIssue, type CheckJson, type CheckOptions, type CheckReport, type ClassDef, Confidence, type ConstraintBuilder, type Diagnostic, type EffectiveInterface, type EffectiveInterfaceOpts, type Environment, type EvalOptions, type EvalResult, type FnAbs, type FnFp, type
|
|
1796
|
+
export { Abs, type AbsAssignRecord, type AbsCallRecord, type AbsFnImpl, type AbsInlay, AbsModuleExports, type AbsSigImpl, type ArgDerivation, AstEnv, type CheckIssue, type CheckJson, type CheckOptions, type CheckReport, type ClassDef, type CollectAbsInlaysOpts, Confidence, type ConstraintBuilder, type DerivationNode, type Diagnostic, type EffectiveInterface, type EffectiveInterfaceOpts, type Environment, type EvalOptions, type EvalResult, type FnAbs, type FnFp, type FormalParam, type FormatOptions, HofSite, type InjectedDomainRecord, type InterfaceDiag, type InterfaceSource, type InterfaceTierInfo, type InterfaceTierOpts, type LeakBudget, type LeqResult, type LoadDepsFingerprint, MAX_CALL_DEPTH, MAX_TOTAL_CALLS, type MethodDef, type MockHelper, type NamedImport, type NudoConstraint, type NudoField, type NudoFnConstraint, NudoSidecarError, type NudoSig, type ObjShape, Phi, type PolyFn, Pred, PrimName, type RefineDiag, type RefineEntry, type RefineResolveOpts, RelSource, SELF, Shape, type Slot, type TemplateMeta, type TemplatePartDesc, type TemplatePartView, type TemplatePredicateDecision, Term, type TypeParam, abortDerivationSession, absFunction, absShapeKey, absTemplateViews, absToConstraint, add, allFixedTextOfViews, analyzeFn, analyzeFnFull, any, applyAbsFn, array, attachFnImpl, awaitAbs, beginCollectionFork, beginDerivationSession, boolean, buildArgsFromAssume, callAbsMethod, callFunction, callFunctionFull, canSkipLiteralCallScan, checkArg, checkCall, checkInjectedDomainEvidence, checkSource, classFromMethods, clearCollectionTables, cmp, coerceAsyncReturn, collectAbsFreeVars, collectAbsInlays, collectAbsNodeTypes, collectionElementJoin, collectionExactLen, concatString, constraintToEntryAbs, contractParamNameSet, createEnvironment, createTemplateAbs, currentPhi, decideEndsWith, decideIncludes, decideStartsWith, defaultLeakBudget, defineClass, definitelyNotNullishShape, denoteGuard, derivationChain, describePhi, div, effectiveInterface, emptyEnv, endCollectionFork, endDerivationSession, errorBrandAbs, evalArrayStatic, evalBuiltinInstanceMethod, evalBuiltinNew, evalDateCtor, evalDateMethod, evalDateStatic, evalGlobalFn, evalJsonMethod, evalMathMethod, evalMethodBody, evalNamespaceCall, evalNode, evalNumberStatic, evalObjectMethod, evalProgramAbs, evalPromiseCtor, evalPromiseStatic, evalRegExpCtor, evalRegExpMethod, evalSource, evictCheckSourceMemoForPaths, evictGeneralizeMemoForPaths, exceedsBudget, execNudoModule, extractAllLoadSpecs, extractFn, extractNudoImports, extractRefineReturnFromSource, extractRefinesFromSource, falseConstraint, findAbsAtPosition, fixedLengthOfViews, fn, fnConstraintToEntryReqs, fnFingerprints, fnOf, formalParamDisplayNames, formalParamsFromNodes, formatAbs, formatAbsMultiline, formatCheckReport, formatConstraint, formatDiagnostics, formatEffectiveInterfaceDisplay, formatInterfaceTierLine, formatShape, formatShapeSlot, formatTemplateNameViews, generalizeAll, generalizeFromAst, generalizeSourceKeyPart, generatedExportNames, getAbsProperty, getClass, getClassChain, getDerivation, getFnImpl, getFnNameAndBodies, getGeneralizeMemoSize, getParseSourceCacheSize, getSlot, getTerm, hasDerivationSession, hashSource, instanceOf, instantiateClass, instantiateConstraint, interfaceDiagCount, interfaceSourceOf, interfaceTierOf, isErrorCtorName, isIntFlag, isMapAbs, isNodeModulesPath, isNudoConstraint, isNullishLitAbs, isObj, isSetAbs, isTemplateLike, joinAbs, joinFunctions, joinObjects, joinThenProject, joinValues, knownPrefixOfViews, knownSuffixOfViews, leakIfNeeded, lenTerm, leqAbs, listFunctionNames, literalMeetsConstraint, loadModuleDepsFingerprint, localNamedExports, locateContractParam, lookupMethod, lookupMethodWithOwner, lookupSuperMethod, looseEqAbs, makeMapAbs, makeSetAbs, makeSum, mapClearEntries, mapDeleteEntry, mapEntriesAbs, mapGetEntry, mapHasEntry, mapSetEntry, mapSizeAbs, mapValuesAbs, matchRelIdentLit, maybeLeak, mergeAdjacentFixedViews, mergeCollectionArms, mock, mod, mul, negAbs, normPath, notAbs, noteCollectionWrite, noteDerivationAdd, noteDerivationJoin, number, objOf, omit, parseSource, partial, pick, popCollectionArm, popPhi, projectBrand, projectDerivationDsl, pushCollectionArm, pushPhi, refineAbsForRelTrue, refineDiagCount, refineToIndexedFull, relationFingerprint, relationFn, resetAbsCallBudget, resetCheckSourceMemo, resetFnFpCache, resetGeneralizeMemo, resetHashSourceCache, resetLeakCounter, resetNudoModuleExecCache, resetParseSourceCache, resetPhi, resolveDepPath, serializeCheckJson, setAbsAssignCollector, setAbsCallCollector, setAbsNodeCollector, setAbsTruncationCollector, setAddEntry, setClearEntries, setDeleteEntry, setDerivation, setDerivationCollector, setElementsAbs, setHasEntry, setInterfaceDiagCollector, setRefineDiagCollector, setSizeAbs, shape, shapeOnlyFn, sidecarClosureFingerprint, sidecarPathOf, sidecarSpecsOf, spread, spy, stableAnalyzeKeySource, strictEqAbs, string, stripTypes, stub, sub, superNameOf, tagDerivationRoot, takeInterfaceDiags, takeInterfaceDiagsSince, takeRefineDiags, takeRefineDiagsSince, templateMatchesValue, templatePartsOf, termDepth, termKey, termNodes, trueConstraint, typeofAbs, union, viewTemplateParts, withPhiConstraint, withVar, wrapPromise };
|