@alloy-js/core 0.20.0-dev.4 → 0.20.0-dev.7
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/src/binder.d.ts +74 -38
- package/dist/src/binder.d.ts.map +1 -1
- package/dist/src/binder.js +235 -173
- package/dist/src/binder.js.map +1 -0
- package/dist/src/code.js +2 -1
- package/dist/src/code.js.map +1 -0
- package/dist/src/components/AppendFile.js +2 -1
- package/dist/src/components/AppendFile.js.map +1 -0
- package/dist/src/components/Block.js +2 -1
- package/dist/src/components/Block.js.map +1 -0
- package/dist/src/components/CopyFile.js +2 -1
- package/dist/src/components/CopyFile.js.map +1 -0
- package/dist/src/components/Declaration.d.ts +2 -2
- package/dist/src/components/Declaration.d.ts.map +1 -1
- package/dist/src/components/Declaration.js +10 -3
- package/dist/src/components/Declaration.js.map +1 -0
- package/dist/src/components/For.js +2 -1
- package/dist/src/components/For.js.map +1 -0
- package/dist/src/components/Indent.js +2 -1
- package/dist/src/components/Indent.js.map +1 -0
- package/dist/src/components/List.js +2 -1
- package/dist/src/components/List.js.map +1 -0
- package/dist/src/components/MemberDeclaration.d.ts +2 -2
- package/dist/src/components/MemberDeclaration.d.ts.map +1 -1
- package/dist/src/components/MemberDeclaration.js +11 -6
- package/dist/src/components/MemberDeclaration.js.map +1 -0
- package/dist/src/components/MemberName.js +2 -1
- package/dist/src/components/MemberName.js.map +1 -0
- package/dist/src/components/MemberScope.d.ts +30 -13
- package/dist/src/components/MemberScope.d.ts.map +1 -1
- package/dist/src/components/MemberScope.js +39 -16
- package/dist/src/components/MemberScope.js.map +1 -0
- package/dist/src/components/Name.js +2 -1
- package/dist/src/components/Name.js.map +1 -0
- package/dist/src/components/Output.d.ts.map +1 -1
- package/dist/src/components/Output.js +4 -6
- package/dist/src/components/Output.js.map +1 -0
- package/dist/src/components/Prose.js +2 -1
- package/dist/src/components/Prose.js.map +1 -0
- package/dist/src/components/ReferenceOrContent.d.ts +1 -1
- package/dist/src/components/ReferenceOrContent.d.ts.map +1 -1
- package/dist/src/components/ReferenceOrContent.js +2 -1
- package/dist/src/components/ReferenceOrContent.js.map +1 -0
- package/dist/src/components/Scope.d.ts +5 -5
- package/dist/src/components/Scope.d.ts.map +1 -1
- package/dist/src/components/Scope.js +11 -6
- package/dist/src/components/Scope.js.map +1 -0
- package/dist/src/components/Show.js +2 -1
- package/dist/src/components/Show.js.map +1 -0
- package/dist/src/components/SourceDirectory.js +2 -1
- package/dist/src/components/SourceDirectory.js.map +1 -0
- package/dist/src/components/SourceFile.js +2 -1
- package/dist/src/components/SourceFile.js.map +1 -0
- package/dist/src/components/StatementList.js +2 -1
- package/dist/src/components/StatementList.js.map +1 -0
- package/dist/src/components/Switch.js +2 -1
- package/dist/src/components/Switch.js.map +1 -0
- package/dist/src/components/TemplateFile.js +2 -1
- package/dist/src/components/TemplateFile.js.map +1 -0
- package/dist/src/components/UpdateFile.js +2 -1
- package/dist/src/components/UpdateFile.js.map +1 -0
- package/dist/src/components/Wrap.js +2 -1
- package/dist/src/components/Wrap.js.map +1 -0
- package/dist/src/components/index.js +2 -1
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/components/stc/index.js +2 -1
- package/dist/src/components/stc/index.js.map +1 -0
- package/dist/src/components/stc/sti.js +2 -1
- package/dist/src/components/stc/sti.js.map +1 -0
- package/dist/src/context/assignment.js +2 -1
- package/dist/src/context/assignment.js.map +1 -0
- package/dist/src/context/binder.js +2 -1
- package/dist/src/context/binder.js.map +1 -0
- package/dist/src/context/declaration.js +2 -1
- package/dist/src/context/declaration.js.map +1 -0
- package/dist/src/context/index.js +2 -1
- package/dist/src/context/index.js.map +1 -0
- package/dist/src/context/member-declaration.js +2 -1
- package/dist/src/context/member-declaration.js.map +1 -0
- package/dist/src/context/member-scope.d.ts +7 -8
- package/dist/src/context/member-scope.d.ts.map +1 -1
- package/dist/src/context/member-scope.js +7 -6
- package/dist/src/context/member-scope.js.map +1 -0
- package/dist/src/context/name-policy.d.ts.map +1 -1
- package/dist/src/context/name-policy.js +5 -1
- package/dist/src/context/name-policy.js.map +1 -0
- package/dist/src/context/scope.d.ts +1 -0
- package/dist/src/context/scope.d.ts.map +1 -1
- package/dist/src/context/scope.js +9 -1
- package/dist/src/context/scope.js.map +1 -0
- package/dist/src/context/source-directory.js +2 -1
- package/dist/src/context/source-directory.js.map +1 -0
- package/dist/src/context/source-file.js +2 -1
- package/dist/src/context/source-file.js.map +1 -0
- package/dist/src/context.js +2 -1
- package/dist/src/context.js.map +1 -0
- package/dist/src/debug.js +2 -1
- package/dist/src/debug.js.map +1 -0
- package/dist/src/host/alloy-host.browser.js +2 -1
- package/dist/src/host/alloy-host.browser.js.map +1 -0
- package/dist/src/host/alloy-host.js +2 -1
- package/dist/src/host/alloy-host.js.map +1 -0
- package/dist/src/host/interface.js +2 -1
- package/dist/src/host/interface.js.map +1 -0
- package/dist/src/index.browser.js +2 -1
- package/dist/src/index.browser.js.map +1 -0
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -0
- package/dist/src/inspect.browser.d.ts +5 -0
- package/dist/src/inspect.browser.d.ts.map +1 -0
- package/dist/src/inspect.browser.js +6 -0
- package/dist/src/inspect.browser.js.map +1 -0
- package/dist/src/inspect.d.ts +2 -0
- package/dist/src/inspect.d.ts.map +1 -0
- package/dist/src/inspect.js +2 -0
- package/dist/src/inspect.js.map +1 -0
- package/dist/src/jsx-runtime.js +2 -1
- package/dist/src/jsx-runtime.js.map +1 -0
- package/dist/src/name-policy.d.ts +11 -0
- package/dist/src/name-policy.d.ts.map +1 -1
- package/dist/src/name-policy.js +5 -1
- package/dist/src/name-policy.js.map +1 -0
- package/dist/src/props-combinators.js +2 -1
- package/dist/src/props-combinators.js.map +1 -0
- package/dist/src/reactive-union-set.d.ts.map +1 -1
- package/dist/src/reactive-union-set.js +14 -9
- package/dist/src/reactive-union-set.js.map +1 -0
- package/dist/src/reactivity.js +2 -1
- package/dist/src/reactivity.js.map +1 -0
- package/dist/src/refkey.d.ts +39 -3
- package/dist/src/refkey.d.ts.map +1 -1
- package/dist/src/refkey.js +65 -10
- package/dist/src/refkey.js.map +1 -0
- package/dist/src/render.js +2 -1
- package/dist/src/render.js.map +1 -0
- package/dist/src/resource.js +2 -1
- package/dist/src/resource.js.map +1 -0
- package/dist/src/runtime/component.js +2 -1
- package/dist/src/runtime/component.js.map +1 -0
- package/dist/src/runtime/intrinsic.js +2 -1
- package/dist/src/runtime/intrinsic.js.map +1 -0
- package/dist/src/scheduler.js +2 -1
- package/dist/src/scheduler.js.map +1 -0
- package/dist/src/stc.js +2 -1
- package/dist/src/stc.js.map +1 -0
- package/dist/src/sti.js +2 -1
- package/dist/src/sti.js.map +1 -0
- package/dist/src/symbols/basic-scope.d.ts +14 -0
- package/dist/src/symbols/basic-scope.d.ts.map +1 -0
- package/dist/src/symbols/basic-scope.js +21 -0
- package/dist/src/symbols/basic-scope.js.map +1 -0
- package/dist/src/symbols/basic-symbol.d.ts +19 -0
- package/dist/src/symbols/basic-symbol.d.ts.map +1 -0
- package/dist/src/symbols/basic-symbol.js +29 -0
- package/dist/src/symbols/basic-symbol.js.map +1 -0
- package/dist/src/symbols/index.d.ts +3 -1
- package/dist/src/symbols/index.d.ts.map +1 -1
- package/dist/src/symbols/index.js +5 -2
- package/dist/src/symbols/index.js.map +1 -0
- package/dist/src/symbols/output-scope.d.ts +70 -41
- package/dist/src/symbols/output-scope.d.ts.map +1 -1
- package/dist/src/symbols/output-scope.js +100 -131
- package/dist/src/symbols/output-scope.js.map +1 -0
- package/dist/src/symbols/output-space.d.ts +25 -0
- package/dist/src/symbols/output-space.d.ts.map +1 -0
- package/dist/src/symbols/output-space.js +36 -0
- package/dist/src/symbols/output-space.js.map +1 -0
- package/dist/src/symbols/output-symbol.d.ts +213 -37
- package/dist/src/symbols/output-symbol.d.ts.map +1 -1
- package/dist/src/symbols/output-symbol.js +325 -204
- package/dist/src/symbols/output-symbol.js.map +1 -0
- package/dist/src/symbols/symbol-flow.d.ts +1 -1
- package/dist/src/symbols/symbol-flow.d.ts.map +1 -1
- package/dist/src/symbols/symbol-flow.js +24 -8
- package/dist/src/symbols/symbol-flow.js.map +1 -0
- package/dist/src/symbols/symbol-slot.d.ts +27 -9
- package/dist/src/symbols/symbol-slot.d.ts.map +1 -1
- package/dist/src/symbols/symbol-slot.js +22 -5
- package/dist/src/symbols/symbol-slot.js.map +1 -0
- package/dist/src/symbols/symbol-table.d.ts +19 -8
- package/dist/src/symbols/symbol-table.d.ts.map +1 -1
- package/dist/src/symbols/symbol-table.js +67 -17
- package/dist/src/symbols/symbol-table.js.map +1 -0
- package/dist/src/tap.js +2 -1
- package/dist/src/tap.js.map +1 -0
- package/dist/src/tracer.d.ts +15 -3
- package/dist/src/tracer.d.ts.map +1 -1
- package/dist/src/tracer.js +41 -64
- package/dist/src/tracer.js.map +1 -0
- package/dist/src/utils.js +2 -1
- package/dist/src/utils.js.map +1 -0
- package/dist/src/write-output.js +2 -1
- package/dist/src/write-output.js.map +1 -0
- package/dist/test/browser-build.test.js +2 -1
- package/dist/test/browser-build.test.js.map +1 -0
- package/dist/test/children.test.js +2 -1
- package/dist/test/children.test.js.map +1 -0
- package/dist/test/components/append-file.test.js +2 -1
- package/dist/test/components/append-file.test.js.map +1 -0
- package/dist/test/components/block.test.js +2 -1
- package/dist/test/components/block.test.js.map +1 -0
- package/dist/test/components/copy-file.test.js +2 -1
- package/dist/test/components/copy-file.test.js.map +1 -0
- package/dist/test/components/declaration.test.js +11 -15
- package/dist/test/components/declaration.test.js.map +1 -0
- package/dist/test/components/list.test.js +2 -1
- package/dist/test/components/list.test.js.map +1 -0
- package/dist/test/components/prose.test.js +2 -1
- package/dist/test/components/prose.test.js.map +1 -0
- package/dist/test/components/reference-or-content.test.js +4 -3
- package/dist/test/components/reference-or-content.test.js.map +1 -0
- package/dist/test/components/source-file.test.js +2 -1
- package/dist/test/components/source-file.test.js.map +1 -0
- package/dist/test/components/template-file.test.js +2 -1
- package/dist/test/components/template-file.test.js.map +1 -0
- package/dist/test/components/update-file.test.js +2 -1
- package/dist/test/components/update-file.test.js.map +1 -0
- package/dist/test/components/wrap.test.js +2 -1
- package/dist/test/components/wrap.test.js.map +1 -0
- package/dist/test/control-flow/for.test.js +2 -1
- package/dist/test/control-flow/for.test.js.map +1 -0
- package/dist/test/control-flow/match.test.js +2 -1
- package/dist/test/control-flow/match.test.js.map +1 -0
- package/dist/test/control-flow/show.test.js +2 -1
- package/dist/test/control-flow/show.test.js.map +1 -0
- package/dist/test/name-policy.test.js +2 -1
- package/dist/test/name-policy.test.js.map +1 -0
- package/dist/test/props-with-defaults.test.js +2 -1
- package/dist/test/props-with-defaults.test.js.map +1 -0
- package/dist/test/reactive-union-set.test.js +2 -1
- package/dist/test/reactive-union-set.test.js.map +1 -0
- package/dist/test/reactivity/circular-reactives.test.js +2 -1
- package/dist/test/reactivity/circular-reactives.test.js.map +1 -0
- package/dist/test/reactivity/cleanup.test.js +2 -1
- package/dist/test/reactivity/cleanup.test.js.map +1 -0
- package/dist/test/reactivity/memo.test.js +2 -1
- package/dist/test/reactivity/memo.test.js.map +1 -0
- package/dist/test/reactivity/ref-rendering.test.js +2 -1
- package/dist/test/reactivity/ref-rendering.test.js.map +1 -0
- package/dist/test/reactivity/test.test.js +2 -1
- package/dist/test/reactivity/test.test.js.map +1 -0
- package/dist/test/reactivity/untrack.test.js +2 -1
- package/dist/test/reactivity/untrack.test.js.map +1 -0
- package/dist/test/refkey.test.js +2 -1
- package/dist/test/refkey.test.js.map +1 -0
- package/dist/test/rendering/basic.test.js +2 -1
- package/dist/test/rendering/basic.test.js.map +1 -0
- package/dist/test/rendering/code.test.js +2 -1
- package/dist/test/rendering/code.test.js.map +1 -0
- package/dist/test/rendering/formatting.test.js +2 -1
- package/dist/test/rendering/formatting.test.js.map +1 -0
- package/dist/test/rendering/indent.test.js +2 -1
- package/dist/test/rendering/indent.test.js.map +1 -0
- package/dist/test/rendering/memoization.test.js +2 -1
- package/dist/test/rendering/memoization.test.js.map +1 -0
- package/dist/test/rendering/refkeys.test.js +2 -1
- package/dist/test/rendering/refkeys.test.js.map +1 -0
- package/dist/test/split-props.test.js +2 -1
- package/dist/test/split-props.test.js.map +1 -0
- package/dist/test/stc.test.js +2 -1
- package/dist/test/stc.test.js.map +1 -0
- package/dist/test/symbols/output-scope.test.js +34 -198
- package/dist/test/symbols/output-scope.test.js.map +1 -0
- package/dist/test/symbols/output-symbol.test.js +141 -386
- package/dist/test/symbols/output-symbol.test.js.map +1 -0
- package/dist/test/symbols/resolution.test.js +433 -115
- package/dist/test/symbols/resolution.test.js.map +1 -0
- package/dist/test/symbols/symbol-table.test.d.ts +2 -0
- package/dist/test/symbols/symbol-table.test.d.ts.map +1 -0
- package/dist/test/symbols/symbol-table.test.js +15 -0
- package/dist/test/symbols/symbol-table.test.js.map +1 -0
- package/dist/test/symbols/utils.d.ts +10 -24
- package/dist/test/symbols/utils.d.ts.map +1 -1
- package/dist/test/symbols/utils.js +25 -46
- package/dist/test/symbols/utils.js.map +1 -0
- package/dist/test/utils.test.js +2 -1
- package/dist/test/utils.test.js.map +1 -0
- package/dist/testing/extend-expect.js +2 -1
- package/dist/testing/extend-expect.js.map +1 -0
- package/dist/testing/extend-expect.test.js +2 -1
- package/dist/testing/extend-expect.test.js.map +1 -0
- package/dist/testing/index.js +2 -1
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/render.js +2 -1
- package/dist/testing/render.js.map +1 -0
- package/dist/testing/vitest.d.js +2 -1
- package/dist/testing/vitest.d.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -3
- package/src/binder.ts +368 -273
- package/src/components/Declaration.tsx +13 -3
- package/src/components/MemberDeclaration.tsx +15 -8
- package/src/components/MemberScope.tsx +61 -20
- package/src/components/Output.tsx +0 -4
- package/src/components/Scope.tsx +16 -9
- package/src/context/member-scope.ts +10 -10
- package/src/context/name-policy.ts +3 -0
- package/src/context/scope.ts +9 -0
- package/src/inspect.browser.ts +6 -0
- package/src/inspect.ts +1 -0
- package/src/name-policy.ts +14 -0
- package/src/reactive-union-set.ts +14 -8
- package/src/refkey.ts +106 -14
- package/src/symbols/basic-scope.ts +23 -0
- package/src/symbols/basic-symbol.ts +32 -0
- package/src/symbols/index.ts +3 -1
- package/src/symbols/output-scope.ts +131 -170
- package/src/symbols/output-space.ts +49 -0
- package/src/symbols/output-symbol.ts +434 -258
- package/src/symbols/symbol-flow.ts +38 -9
- package/src/symbols/symbol-slot.tsx +46 -8
- package/src/symbols/symbol-table.ts +95 -21
- package/src/tracer.ts +53 -83
- package/temp/api.json +7009 -4461
- package/test/components/declaration.test.tsx +6 -19
- package/test/components/reference-or-content.test.tsx +2 -2
- package/test/symbols/output-scope.test.ts +33 -125
- package/test/symbols/output-symbol.test.ts +128 -348
- package/test/symbols/resolution.test.ts +530 -117
- package/test/symbols/symbol-table.test.ts +15 -0
- package/test/symbols/utils.ts +38 -74
- package/tsdoc.json +4 -0
- package/dist/src/slot.d.ts +0 -15
- package/dist/src/slot.d.ts.map +0 -1
- package/dist/src/slot.js +0 -50
- package/dist/src/symbols/flags.d.ts +0 -70
- package/dist/src/symbols/flags.d.ts.map +0 -1
- package/dist/src/symbols/flags.js +0 -72
- package/dist/test/components/slot.test.d.ts +0 -2
- package/dist/test/components/slot.test.d.ts.map +0 -1
- package/dist/test/components/slot.test.js +0 -134
- package/src/slot.ts +0 -89
- package/src/symbols/flags.ts +0 -82
- package/test/components/slot.test.tsx +0 -174
package/dist/src/binder.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Ref } from "@vue/reactivity";
|
|
2
2
|
import { Refkey } from "./refkey.js";
|
|
3
|
-
import { OutputSymbolFlags } from "./symbols/flags.js";
|
|
4
3
|
import { OutputScope } from "./symbols/output-scope.js";
|
|
5
4
|
import { type OutputSymbol } from "./symbols/output-symbol.js";
|
|
6
5
|
export type Metadata = object;
|
|
@@ -25,28 +24,12 @@ export interface Binder {
|
|
|
25
24
|
* @see {@link resolve} a convenience function that uses the current scope and
|
|
26
25
|
* binder.
|
|
27
26
|
*/
|
|
28
|
-
resolveDeclarationByKey<TScope extends OutputScope = OutputScope, TSymbol extends OutputSymbol = OutputSymbol>(currentScope: TScope | undefined,
|
|
29
|
-
getSymbolForRefkey<TSymbol extends OutputSymbol>(refkey: Refkey): Ref<TSymbol | undefined>;
|
|
30
|
-
/**
|
|
31
|
-
* Find a symbol with a given name in the given scope. Returns a ref
|
|
32
|
-
* for the symbol, such that when the symbol is available, the ref value
|
|
33
|
-
* will update.
|
|
34
|
-
*/
|
|
35
|
-
findSymbolName<TScope extends OutputScope = OutputScope, TSymbol extends OutputSymbol = OutputSymbol>(currentScope: TScope | undefined, name: string): Ref<TSymbol | undefined>;
|
|
36
|
-
findScopeName<TScope extends OutputScope = OutputScope>(currentScope: TScope | undefined, name: string): Ref<TScope | undefined>;
|
|
37
|
-
/**
|
|
38
|
-
* Resolve a fully qualified name to a symbol. Access a nested scope by name
|
|
39
|
-
* with `::`, a nested static member with `.` and a nested instance member
|
|
40
|
-
* with `#`.
|
|
41
|
-
*
|
|
42
|
-
* Per-language packages may provide their own resolveFQN function that uses
|
|
43
|
-
* syntax more natural to that language.
|
|
44
|
-
*/
|
|
45
|
-
resolveFQN<TScope extends OutputScope = OutputScope, TSymbol extends OutputSymbol = OutputSymbol>(fqn: string): Ref<TSymbol | TScope | undefined>;
|
|
27
|
+
resolveDeclarationByKey<TScope extends OutputScope = OutputScope, TSymbol extends OutputSymbol = OutputSymbol>(currentScope: TScope | undefined, key: Refkey, options?: ResolveDeclarationByKeyOptions<TScope, TSymbol>): Ref<ResolutionResult<TScope, TSymbol> | undefined>;
|
|
46
28
|
/**
|
|
47
|
-
*
|
|
29
|
+
* Get a ref to the symbol associated with the given refkey. The value of the
|
|
30
|
+
* ref is undefined if the symbol has not been created yet.
|
|
48
31
|
*/
|
|
49
|
-
|
|
32
|
+
getSymbolForRefkey<TSymbol extends OutputSymbol>(refkey: Refkey): Ref<TSymbol | undefined>;
|
|
50
33
|
/**
|
|
51
34
|
* The name conflict resolver to use for this binder.
|
|
52
35
|
*/
|
|
@@ -75,7 +58,7 @@ export interface Binder {
|
|
|
75
58
|
* scope: global scope
|
|
76
59
|
* ├── scope: namespace scope 1
|
|
77
60
|
* │ └── symbol: foo
|
|
78
|
-
* │ └── static
|
|
61
|
+
* │ └── static members
|
|
79
62
|
* │ └── symbol: bar
|
|
80
63
|
* └── scope: namespace scope 2
|
|
81
64
|
* └── (resolve bar from here)
|
|
@@ -92,11 +75,19 @@ export interface Binder {
|
|
|
92
75
|
*/
|
|
93
76
|
export interface ResolutionResult<TScope extends OutputScope, TSymbol extends OutputSymbol> {
|
|
94
77
|
/**
|
|
95
|
-
* The symbol
|
|
78
|
+
* The resolved symbol. May be declared in a lexical scope or be a member symbol.
|
|
79
|
+
*/
|
|
80
|
+
symbol: TSymbol;
|
|
81
|
+
/**
|
|
82
|
+
* When the symbol is a member symbol, this is the symbol of the lexical
|
|
83
|
+
* declaration which contains this member symbol, either as one of its own
|
|
84
|
+
* member symbols, or as a member of one of its members.
|
|
85
|
+
*
|
|
86
|
+
* When the symbol is a non-member symbol, this is the same as `symbol`.
|
|
96
87
|
*/
|
|
97
|
-
|
|
88
|
+
lexicalDeclaration: TSymbol;
|
|
98
89
|
/**
|
|
99
|
-
* The scopes between the common scope and the reference
|
|
90
|
+
* The scopes between the common scope and the reference.
|
|
100
91
|
*/
|
|
101
92
|
pathUp: TScope[];
|
|
102
93
|
/**
|
|
@@ -104,18 +95,60 @@ export interface ResolutionResult<TScope extends OutputScope, TSymbol extends Ou
|
|
|
104
95
|
*/
|
|
105
96
|
pathDown: TScope[];
|
|
106
97
|
/**
|
|
107
|
-
* The
|
|
98
|
+
* The scopes from the root to scope of the lexical declaration.
|
|
99
|
+
*/
|
|
100
|
+
fullSymbolPath: TScope[];
|
|
101
|
+
/**
|
|
102
|
+
* The scopes from the root to the scope of the reference.
|
|
103
|
+
*/
|
|
104
|
+
fullReferencePath: TScope[];
|
|
105
|
+
/**
|
|
106
|
+
* The lexical scope which contains both the reference and the lexical
|
|
107
|
+
* declaration. Undefined when they do not share a common scope.
|
|
108
108
|
*/
|
|
109
109
|
commonScope: TScope | undefined;
|
|
110
110
|
/**
|
|
111
111
|
* When resolving a member symbol, this is the path of symbols that lead from
|
|
112
|
-
* the
|
|
112
|
+
* the lexical declaration to the member symbol.
|
|
113
113
|
*/
|
|
114
|
-
memberPath
|
|
114
|
+
memberPath: TSymbol[];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Describes a member in a member access chain, tracking both the symbol
|
|
118
|
+
* and whether this specific member was accessed via a memberRefkey.
|
|
119
|
+
*/
|
|
120
|
+
export interface MemberDescriptor {
|
|
121
|
+
symbol: OutputSymbol;
|
|
122
|
+
isMemberAccess: boolean;
|
|
115
123
|
}
|
|
116
124
|
export interface NameConflictResolver {
|
|
117
125
|
(name: string, symbols: OutputSymbol[]): void;
|
|
118
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* The context for a member resolution. This is used to properly resolve a
|
|
129
|
+
* member in the MemberResolver.
|
|
130
|
+
*/
|
|
131
|
+
export interface MemberResolutionContext<TScope extends OutputScope> {
|
|
132
|
+
/**
|
|
133
|
+
* The scopes that the member reference occurred in.
|
|
134
|
+
*/
|
|
135
|
+
referencePath: TScope[];
|
|
136
|
+
/**
|
|
137
|
+
* Whether we are using member access e.g. via `memberRefkey`.
|
|
138
|
+
* This is true when the member was resolved using a memberRefkey,
|
|
139
|
+
* which may carry additional metadata about the member access in the future.
|
|
140
|
+
*/
|
|
141
|
+
isMemberAccess: boolean;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
*
|
|
145
|
+
*/
|
|
146
|
+
export interface MemberResolver<TScope extends OutputScope, TSymbol extends OutputSymbol> {
|
|
147
|
+
(owner: TSymbol, member: TSymbol, context: MemberResolutionContext<TScope>): void;
|
|
148
|
+
}
|
|
149
|
+
export interface ResolveDeclarationByKeyOptions<TScope extends OutputScope, TSymbol extends OutputSymbol> {
|
|
150
|
+
memberResolver?: MemberResolver<TScope, TSymbol>;
|
|
151
|
+
}
|
|
119
152
|
export interface BinderOptions {
|
|
120
153
|
nameConflictResolver?: NameConflictResolver;
|
|
121
154
|
}
|
|
@@ -130,21 +163,24 @@ export declare function createOutputBinder(options?: BinderOptions): Binder;
|
|
|
130
163
|
* not found. The symbol you're looking for may not have been declared yet. When the symbol
|
|
131
164
|
* is declared, the ref will be updated with the resolution result.
|
|
132
165
|
*/
|
|
133
|
-
export declare function resolve<TScope extends OutputScope, TSymbol extends OutputSymbol>(refkey: Refkey): Ref<ResolutionResult<TScope, TSymbol>>;
|
|
166
|
+
export declare function resolve<TScope extends OutputScope, TSymbol extends OutputSymbol>(refkey: Refkey, options?: ResolveDeclarationByKeyOptions<TScope, TSymbol>): Ref<ResolutionResult<TScope, TSymbol>>;
|
|
167
|
+
/**
|
|
168
|
+
* Get a ref to the symbol for the given refkey using the current binder. The
|
|
169
|
+
* value of the ref will be undefined when no symbol with that refkey has been
|
|
170
|
+
* created.
|
|
171
|
+
*
|
|
172
|
+
* @remarks
|
|
173
|
+
*
|
|
174
|
+
* This API may return a ref for undefined, but that does not mean that the symbol is
|
|
175
|
+
* not found. The symbol you're looking for may not have been declared yet. When the symbol
|
|
176
|
+
* is declared, the ref will be updated with the symbol.
|
|
177
|
+
*/
|
|
178
|
+
export declare function symbolForRefkey(refkey: Refkey): Ref<OutputSymbol | undefined, OutputSymbol | undefined>;
|
|
134
179
|
declare const createSymbolsSymbol: unique symbol;
|
|
135
180
|
export declare function getSymbolCreator(creator: SymbolCreator): SymbolCreator[typeof createSymbolsSymbol];
|
|
136
181
|
export declare function getSymbolCreatorSymbol(): typeof createSymbolsSymbol;
|
|
137
182
|
export interface SymbolCreator {
|
|
138
183
|
[createSymbolsSymbol](binder: Binder): void;
|
|
139
184
|
}
|
|
140
|
-
/**
|
|
141
|
-
* Use symbol flags to determine the scope in which a symbol with those flags
|
|
142
|
-
* should be declared given the current context.
|
|
143
|
-
*
|
|
144
|
-
* @param flags - The symbol flags to use to determine the default scope.
|
|
145
|
-
* @returns an {@link OutputScope} that is the default scope for the given
|
|
146
|
-
* flags.
|
|
147
|
-
*/
|
|
148
|
-
export declare function useDefaultScope(flags?: OutputSymbolFlags): OutputScope | undefined;
|
|
149
185
|
export {};
|
|
150
186
|
//# sourceMappingURL=binder.d.ts.map
|
package/dist/src/binder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binder.d.ts","sourceRoot":"","sources":["../../src/binder.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"binder.d.ts","sourceRoot":"","sources":["../../src/binder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,GAAG,EAA0B,MAAM,iBAAiB,CAAC;AAKxE,OAAO,EAA0B,MAAM,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAO/D,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,MAAM;IACrB;;;;;;OAMG;IACH,uBAAuB,CACrB,MAAM,SAAS,WAAW,GAAG,WAAW,EACxC,OAAO,SAAS,YAAY,GAAG,YAAY,EAE3C,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,8BAA8B,CAAC,MAAM,EAAE,OAAO,CAAC,GACxD,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;IAEtD;;;OAGG;IACH,kBAAkB,CAAC,OAAO,SAAS,YAAY,EAC7C,MAAM,EAAE,MAAM,GACb,GAAG,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IAE5B;;OAEG;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