@alloy-js/core 0.23.0-dev.12 → 0.23.0-dev.15
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/api-extractor.json +1 -8
- package/api-extractor.testing.json +19 -0
- package/dist/dev/src/binder.js +108 -1
- package/dist/dev/src/binder.js.map +1 -1
- package/dist/dev/src/components/Block.js +17 -5
- package/dist/dev/src/components/Block.js.map +1 -1
- package/dist/dev/src/components/List.js +1 -1
- package/dist/dev/src/components/List.js.map +1 -1
- package/dist/dev/src/components/MemberDeclaration.js +6 -6
- package/dist/dev/src/components/MemberName.js +7 -0
- package/dist/dev/src/components/MemberName.js.map +1 -1
- package/dist/dev/src/components/MemberScope.js +7 -2
- package/dist/dev/src/components/MemberScope.js.map +1 -1
- package/dist/dev/src/components/Output.js +4 -4
- package/dist/dev/src/components/Output.js.map +1 -1
- package/dist/dev/src/components/Scope.js +7 -1
- package/dist/dev/src/components/Scope.js.map +1 -1
- package/dist/dev/src/components/SourceFile.js +3 -3
- package/dist/dev/src/components/SourceFile.js.map +1 -1
- package/dist/dev/src/context/binder.js +5 -0
- package/dist/dev/src/context/binder.js.map +1 -1
- package/dist/dev/src/context/format-options.js +14 -1
- package/dist/dev/src/context/format-options.js.map +1 -1
- package/dist/dev/src/context/scope.js +5 -0
- package/dist/dev/src/context/scope.js.map +1 -1
- package/dist/dev/src/context/source-directory.js +9 -0
- package/dist/dev/src/context/source-directory.js.map +1 -1
- package/dist/dev/src/debug/cli.js +3 -2
- package/dist/dev/src/debug/cli.js.map +1 -1
- package/dist/dev/src/debug/source-map.browser.js +24 -0
- package/dist/dev/src/debug/source-map.browser.js.map +1 -0
- package/dist/dev/src/debug/trace.js +7 -6
- package/dist/dev/src/debug/trace.js.map +1 -1
- package/dist/dev/src/host/node-host.browser.js +21 -0
- package/dist/dev/src/host/node-host.browser.js.map +1 -0
- package/dist/dev/src/host/node-host.js +20 -0
- package/dist/dev/src/host/node-host.js.map +1 -0
- package/dist/dev/src/library-symbol-reference.js +54 -0
- package/dist/dev/src/library-symbol-reference.js.map +1 -1
- package/dist/dev/src/name-policy.js +27 -0
- package/dist/dev/src/name-policy.js.map +1 -1
- package/dist/dev/src/reactivity.js +16 -0
- package/dist/dev/src/reactivity.js.map +1 -1
- package/dist/dev/src/render-stack.js +4 -3
- package/dist/dev/src/render-stack.js.map +1 -1
- package/dist/dev/src/render.js.map +1 -1
- package/dist/dev/src/symbols/output-scope.js +34 -1
- package/dist/dev/src/symbols/output-scope.js.map +1 -1
- package/dist/dev/src/symbols/output-space.js +15 -0
- package/dist/dev/src/symbols/output-space.js.map +1 -1
- package/dist/dev/src/symbols/output-symbol.js +81 -11
- package/dist/dev/src/symbols/output-symbol.js.map +1 -1
- package/dist/dev/src/symbols/symbol-slot.js +7 -0
- package/dist/dev/src/symbols/symbol-slot.js.map +1 -1
- package/dist/dev/src/symbols/symbol-slot.test.js +27 -2
- package/dist/dev/src/symbols/symbol-slot.test.js.map +1 -1
- package/dist/dev/src/write-output.js +6 -5
- package/dist/dev/src/write-output.js.map +1 -1
- package/dist/dev/test/browser-build.test.js +67 -68
- package/dist/dev/test/browser-build.test.js.map +1 -1
- package/dist/dev/testing/create-test-wrapper.js +59 -5
- package/dist/dev/testing/create-test-wrapper.js.map +1 -1
- package/dist/dev/testing/extend-expect.js +20 -0
- package/dist/dev/testing/extend-expect.js.map +1 -1
- package/dist/dev/testing/index.js +1 -1
- package/dist/dev/testing/index.js.map +1 -1
- package/dist/dev/testing/render.js +11 -0
- package/dist/dev/testing/render.js.map +1 -1
- package/dist/src/binder.d.ts +107 -3
- package/dist/src/binder.d.ts.map +1 -1
- package/dist/src/binder.js +108 -1
- package/dist/src/binder.js.map +1 -1
- package/dist/src/components/Block.d.ts +12 -0
- package/dist/src/components/Block.d.ts.map +1 -1
- package/dist/src/components/Block.js +12 -0
- package/dist/src/components/Block.js.map +1 -1
- package/dist/src/components/List.d.ts +11 -1
- package/dist/src/components/List.d.ts.map +1 -1
- package/dist/src/components/List.js.map +1 -1
- package/dist/src/components/MemberDeclaration.d.ts +6 -6
- package/dist/src/components/MemberDeclaration.js +6 -6
- package/dist/src/components/MemberName.d.ts +6 -0
- package/dist/src/components/MemberName.d.ts.map +1 -1
- package/dist/src/components/MemberName.js +7 -0
- package/dist/src/components/MemberName.js.map +1 -1
- package/dist/src/components/MemberScope.d.ts +5 -0
- package/dist/src/components/MemberScope.d.ts.map +1 -1
- package/dist/src/components/MemberScope.js +5 -0
- package/dist/src/components/MemberScope.js.map +1 -1
- package/dist/src/components/Output.d.ts +4 -2
- package/dist/src/components/Output.d.ts.map +1 -1
- package/dist/src/components/Output.js.map +1 -1
- package/dist/src/components/Scope.d.ts +6 -0
- package/dist/src/components/Scope.d.ts.map +1 -1
- package/dist/src/components/Scope.js +6 -0
- package/dist/src/components/Scope.js.map +1 -1
- package/dist/src/components/SourceFile.d.ts +22 -2
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js.map +1 -1
- package/dist/src/context/binder.d.ts +4 -0
- package/dist/src/context/binder.d.ts.map +1 -1
- package/dist/src/context/binder.js +5 -0
- package/dist/src/context/binder.js.map +1 -1
- package/dist/src/context/format-options.d.ts +14 -1
- package/dist/src/context/format-options.d.ts.map +1 -1
- package/dist/src/context/format-options.js +14 -1
- package/dist/src/context/format-options.js.map +1 -1
- package/dist/src/context/scope.d.ts +4 -0
- package/dist/src/context/scope.d.ts.map +1 -1
- package/dist/src/context/scope.js +5 -0
- package/dist/src/context/scope.js.map +1 -1
- package/dist/src/context/source-directory.d.ts +9 -0
- package/dist/src/context/source-directory.d.ts.map +1 -1
- package/dist/src/context/source-directory.js +9 -0
- package/dist/src/context/source-directory.js.map +1 -1
- package/dist/src/debug/cli.d.ts.map +1 -1
- package/dist/src/debug/cli.js +3 -2
- package/dist/src/debug/cli.js.map +1 -1
- package/dist/src/debug/source-map.browser.d.ts +16 -0
- package/dist/src/debug/source-map.browser.d.ts.map +1 -0
- package/dist/src/debug/source-map.browser.js +24 -0
- package/dist/src/debug/source-map.browser.js.map +1 -0
- package/dist/src/debug/trace.d.ts.map +1 -1
- package/dist/src/debug/trace.js +7 -6
- package/dist/src/debug/trace.js.map +1 -1
- package/dist/src/host/node-host.browser.d.ts +11 -0
- package/dist/src/host/node-host.browser.d.ts.map +1 -0
- package/dist/src/host/node-host.browser.js +21 -0
- package/dist/src/host/node-host.browser.js.map +1 -0
- package/dist/src/host/node-host.d.ts +11 -0
- package/dist/src/host/node-host.d.ts.map +1 -0
- package/dist/src/host/node-host.js +20 -0
- package/dist/src/host/node-host.js.map +1 -0
- package/dist/src/library-symbol-reference.d.ts +52 -0
- package/dist/src/library-symbol-reference.d.ts.map +1 -1
- package/dist/src/library-symbol-reference.js +54 -0
- package/dist/src/library-symbol-reference.js.map +1 -1
- package/dist/src/name-policy.d.ts +30 -3
- package/dist/src/name-policy.d.ts.map +1 -1
- package/dist/src/name-policy.js +27 -0
- package/dist/src/name-policy.js.map +1 -1
- package/dist/src/reactivity.d.ts +15 -0
- package/dist/src/reactivity.d.ts.map +1 -1
- package/dist/src/reactivity.js +16 -0
- package/dist/src/reactivity.js.map +1 -1
- package/dist/src/render-stack.d.ts.map +1 -1
- package/dist/src/render-stack.js +4 -3
- package/dist/src/render-stack.js.map +1 -1
- package/dist/src/render.d.ts +2 -0
- package/dist/src/render.d.ts.map +1 -1
- package/dist/src/render.js.map +1 -1
- package/dist/src/symbols/output-scope.d.ts +33 -1
- package/dist/src/symbols/output-scope.d.ts.map +1 -1
- package/dist/src/symbols/output-scope.js +34 -1
- package/dist/src/symbols/output-scope.js.map +1 -1
- package/dist/src/symbols/output-space.d.ts +12 -0
- package/dist/src/symbols/output-space.d.ts.map +1 -1
- package/dist/src/symbols/output-space.js +15 -0
- package/dist/src/symbols/output-space.js.map +1 -1
- package/dist/src/symbols/output-symbol.d.ts +93 -12
- package/dist/src/symbols/output-symbol.d.ts.map +1 -1
- package/dist/src/symbols/output-symbol.js +81 -11
- package/dist/src/symbols/output-symbol.js.map +1 -1
- package/dist/src/symbols/symbol-slot.d.ts.map +1 -1
- package/dist/src/symbols/symbol-slot.js +7 -0
- package/dist/src/symbols/symbol-slot.js.map +1 -1
- package/dist/src/symbols/symbol-slot.test.js +18 -1
- package/dist/src/symbols/symbol-slot.test.js.map +1 -1
- package/dist/src/write-output.d.ts.map +1 -1
- package/dist/src/write-output.js +6 -5
- package/dist/src/write-output.js.map +1 -1
- package/dist/test/browser-build.test.js +67 -68
- package/dist/test/browser-build.test.js.map +1 -1
- package/dist/testing/create-test-wrapper.d.ts +75 -2
- package/dist/testing/create-test-wrapper.d.ts.map +1 -1
- package/dist/testing/create-test-wrapper.js +55 -1
- package/dist/testing/create-test-wrapper.js.map +1 -1
- package/dist/testing/extend-expect.d.ts +26 -0
- package/dist/testing/extend-expect.d.ts.map +1 -1
- package/dist/testing/extend-expect.js +20 -0
- package/dist/testing/extend-expect.js.map +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/render.d.ts +9 -0
- package/dist/testing/render.d.ts.map +1 -1
- package/dist/testing/render.js +11 -0
- package/dist/testing/render.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/api/components/AppendRegion.md +83 -0
- package/docs/api/components/Block.md +49 -0
- package/docs/api/components/CopyFile.md +26 -0
- package/docs/api/components/Declaration.md +85 -0
- package/docs/api/components/For.md +91 -0
- package/docs/api/components/Indent.md +40 -0
- package/docs/api/components/List.md +68 -0
- package/docs/api/components/MemberDeclaration.md +89 -0
- package/docs/api/components/MemberName.md +21 -0
- package/docs/api/components/MemberScope.md +81 -0
- package/docs/api/components/Name.md +19 -0
- package/docs/api/components/Output.md +62 -0
- package/docs/api/components/Prose.md +29 -0
- package/docs/api/components/ReferenceOrContent.md +28 -0
- package/docs/api/components/Scope.md +83 -0
- package/docs/api/components/Show.md +32 -0
- package/docs/api/components/SourceDirectory.md +28 -0
- package/docs/api/components/SourceFile.md +60 -0
- package/docs/api/components/StatementList.md +29 -0
- package/docs/api/components/Switch.md +42 -0
- package/docs/api/components/TemplateFile.md +71 -0
- package/docs/api/components/TemplateVariable.md +57 -0
- package/docs/api/components/UpdateFile.md +56 -0
- package/docs/api/components/Wrap.md +40 -0
- package/docs/api/components/createAccessExpression.md +55 -0
- package/docs/api/components/index.md +27 -0
- package/docs/api/contexts/Assignment-context.md +43 -0
- package/docs/api/contexts/Binder-context.md +22 -0
- package/docs/api/contexts/Declaration-context.md +15 -0
- package/docs/api/contexts/Member-context.md +17 -0
- package/docs/api/contexts/MemberDeclaration-context.md +24 -0
- package/docs/api/contexts/NamePolicy-context.md +18 -0
- package/docs/api/contexts/Scope-context.md +20 -0
- package/docs/api/contexts/SourceDirectory-context.md +26 -0
- package/docs/api/contexts/SourceFile-context.md +19 -0
- package/docs/api/contexts/index.md +11 -0
- package/docs/api/functions/attachDiagnosticsCollector.md +18 -0
- package/docs/api/functions/baseListPropsToMapJoinArgs.md +20 -0
- package/docs/api/functions/children.md +27 -0
- package/docs/api/functions/childrenArray.md +25 -0
- package/docs/api/functions/code.md +25 -0
- package/docs/api/functions/computed.md +18 -0
- package/docs/api/functions/createComponent.md +20 -0
- package/docs/api/functions/createContentSlot.md +33 -0
- package/docs/api/functions/createContext.md +19 -0
- package/docs/api/functions/createCustomContext.md +18 -0
- package/docs/api/functions/createDeclarationTap.md +20 -0
- package/docs/api/functions/createFileResource.md +35 -0
- package/docs/api/functions/createFormatOptionsContextFor.md +28 -0
- package/docs/api/functions/createIntrinsic.md +19 -0
- package/docs/api/functions/createMemberTap.md +20 -0
- package/docs/api/functions/createNamePolicy.md +37 -0
- package/docs/api/functions/createNamedContext.md +19 -0
- package/docs/api/functions/createOutputBinder.md +24 -0
- package/docs/api/functions/createRenderTreeHook.md +19 -0
- package/docs/api/functions/createResource.md +77 -0
- package/docs/api/functions/createScope.md +35 -0
- package/docs/api/functions/createScopeTap.md +20 -0
- package/docs/api/functions/createSourceFileTap.md +20 -0
- package/docs/api/functions/createSymbol.md +25 -0
- package/docs/api/functions/createSymbolSlot.md +19 -0
- package/docs/api/functions/createTap.md +55 -0
- package/docs/api/functions/decl.md +20 -0
- package/docs/api/functions/defaultProps.md +21 -0
- package/docs/api/functions/effect.md +26 -0
- package/docs/api/functions/emitDiagnostic.md +18 -0
- package/docs/api/functions/emitSymbol.md +18 -0
- package/docs/api/functions/ensureIsEmpty.md +20 -0
- package/docs/api/functions/findCurrentEffectId.md +19 -0
- package/docs/api/functions/findKeyedChild.md +19 -0
- package/docs/api/functions/findKeyedChildren.md +19 -0
- package/docs/api/functions/findUnkeyedChildren.md +18 -0
- package/docs/api/functions/formatReactivePropertyLabel.md +21 -0
- package/docs/api/functions/getAssignmentSymbol.md +19 -0
- package/docs/api/functions/getContext.md +17 -0
- package/docs/api/functions/getContextForRenderNode.md +18 -0
- package/docs/api/functions/getDiagnosticsForTree.md +18 -0
- package/docs/api/functions/getEffectDebugId.md +18 -0
- package/docs/api/functions/getElementCache.md +17 -0
- package/docs/api/functions/getReactiveCreationLocation.md +18 -0
- package/docs/api/functions/getSymbolCreator.md +18 -0
- package/docs/api/functions/getSymbolCreatorSymbol.md +17 -0
- package/docs/api/functions/index.md +105 -0
- package/docs/api/functions/inspectRefkey.md +18 -0
- package/docs/api/functions/instantiateTakenMembersTo.md +20 -0
- package/docs/api/functions/isComponentCreator.md +19 -0
- package/docs/api/functions/isCustomContext.md +18 -0
- package/docs/api/functions/isIntrinsicElement.md +18 -0
- package/docs/api/functions/isKeyedChild.md +18 -0
- package/docs/api/functions/isLibrarySymbolReference.md +18 -0
- package/docs/api/functions/isMemberRefkey.md +18 -0
- package/docs/api/functions/isNamekey.md +18 -0
- package/docs/api/functions/isPrintHook.md +18 -0
- package/docs/api/functions/isRefkey.md +18 -0
- package/docs/api/functions/isRefkeyable.md +18 -0
- package/docs/api/functions/isRenderableObject.md +20 -0
- package/docs/api/functions/isSymbolRefkey.md +18 -0
- package/docs/api/functions/join.md +33 -0
- package/docs/api/functions/mapJoin.md +106 -0
- package/docs/api/functions/memberRefkey.md +27 -0
- package/docs/api/functions/memo.md +29 -0
- package/docs/api/functions/mergeProps.md +64 -0
- package/docs/api/functions/moveTakenMembersTo.md +18 -0
- package/docs/api/functions/namekey.md +41 -0
- package/docs/api/functions/nextReactiveId.md +19 -0
- package/docs/api/functions/notifyContentState.md +17 -0
- package/docs/api/functions/onCleanup.md +26 -0
- package/docs/api/functions/printTree.md +31 -0
- package/docs/api/functions/reactivePropertyRefId.md +21 -0
- package/docs/api/functions/ref.md +21 -0
- package/docs/api/functions/refId.md +18 -0
- package/docs/api/functions/refkey.md +24 -0
- package/docs/api/functions/render.md +31 -0
- package/docs/api/functions/renderAsync.md +31 -0
- package/docs/api/functions/renderTree.md +18 -0
- package/docs/api/functions/reportDiagnostics.md +18 -0
- package/docs/api/functions/resetRefIdCounter.md +17 -0
- package/docs/api/functions/resolve.md +31 -0
- package/docs/api/functions/root.md +25 -0
- package/docs/api/functions/shallowReactive.md +18 -0
- package/docs/api/functions/shallowRef.md +21 -0
- package/docs/api/functions/sourceFilesForTree.md +31 -0
- package/docs/api/functions/splitProps.md +19 -0
- package/docs/api/functions/stc.md +18 -0
- package/docs/api/functions/sti.md +18 -0
- package/docs/api/functions/symbolForRefkey.md +24 -0
- package/docs/api/functions/taggedComponent.md +19 -0
- package/docs/api/functions/takeSymbols.md +18 -0
- package/docs/api/functions/text.md +19 -0
- package/docs/api/functions/toRef.md +20 -0
- package/docs/api/functions/toRefkey.md +18 -0
- package/docs/api/functions/toRefs.md +20 -0
- package/docs/api/functions/traverseOutput.md +21 -0
- package/docs/api/functions/unresolvedRefkey.md +18 -0
- package/docs/api/functions/untrack.md +18 -0
- package/docs/api/functions/useContext.md +18 -0
- package/docs/api/functions/useFormatOptions.md +18 -0
- package/docs/api/functions/useMemberContext.md +17 -0
- package/docs/api/functions/useMemberScope.md +17 -0
- package/docs/api/functions/writeOutput.md +21 -0
- package/docs/api/index.md +9 -0
- package/docs/api/testing/functions/createTestWrapper.md +70 -0
- package/docs/api/testing/functions/d.md +21 -0
- package/docs/api/testing/functions/dedent.md +18 -0
- package/docs/api/testing/functions/index.md +6 -0
- package/docs/api/testing/functions/renderToString.md +20 -0
- package/docs/api/testing/index.md +4 -0
- package/docs/api/testing/types/TestWrapper.md +10 -0
- package/docs/api/testing/types/ToRenderToOptions.md +24 -0
- package/docs/api/testing/types/index.md +4 -0
- package/docs/api/types/AlignIntrinsicElement.md +5 -0
- package/docs/api/types/AppendRegionProps.md +5 -0
- package/docs/api/types/BaseListProps.md +21 -0
- package/docs/api/types/BasePartProps.md +10 -0
- package/docs/api/types/BasicScope.md +15 -0
- package/docs/api/types/BasicSymbol.md +18 -0
- package/docs/api/types/Binder.md +18 -0
- package/docs/api/types/BinderOptions.md +7 -0
- package/docs/api/types/BrIntrinsicElement.md +5 -0
- package/docs/api/types/BreakParentIntrinsicElement.md +5 -0
- package/docs/api/types/Child.md +5 -0
- package/docs/api/types/Children.md +5 -0
- package/docs/api/types/ChildrenOptions.md +7 -0
- package/docs/api/types/CommonFormatOptions.md +8 -0
- package/docs/api/types/Component.md +8 -0
- package/docs/api/types/ComponentContext.md +11 -0
- package/docs/api/types/ComponentCreator.md +11 -0
- package/docs/api/types/ComponentDefinition.md +7 -0
- package/docs/api/types/ContentOutputFile.md +10 -0
- package/docs/api/types/ContentSlot.md +12 -0
- package/docs/api/types/Context.md +19 -0
- package/docs/api/types/ContextProviderProps.md +8 -0
- package/docs/api/types/CopyFileContext.md +8 -0
- package/docs/api/types/CopyOutputFile.md +9 -0
- package/docs/api/types/CustomContext.md +10 -0
- package/docs/api/types/CustomContextChildrenCallback.md +5 -0
- package/docs/api/types/DeclarationProps.md +5 -0
- package/docs/api/types/DedentIntrinsicElement.md +5 -0
- package/docs/api/types/DedentToRootIntrinsicElement.md +5 -0
- package/docs/api/types/Diagnostic.md +11 -0
- package/docs/api/types/DiagnosticHandle.md +7 -0
- package/docs/api/types/DiagnosticInput.md +10 -0
- package/docs/api/types/DiagnosticSeverity.md +5 -0
- package/docs/api/types/DiagnosticStackEntry.md +9 -0
- package/docs/api/types/DiagnosticsCollector.md +8 -0
- package/docs/api/types/Disposable_2.md +7 -0
- package/docs/api/types/EffectDebugOptions.md +8 -0
- package/docs/api/types/EffectOptions.md +7 -0
- package/docs/api/types/ElementCache.md +5 -0
- package/docs/api/types/ElementCacheKey.md +5 -0
- package/docs/api/types/FillIntrinsicElement.md +5 -0
- package/docs/api/types/ForCallbackArgs.md +5 -0
- package/docs/api/types/ForSupportedCollections.md +5 -0
- package/docs/api/types/GroupIntrinsicElement.md +5 -0
- package/docs/api/types/HardlineIntrinsicElement.md +5 -0
- package/docs/api/types/HbrIntrinsicElement.md +5 -0
- package/docs/api/types/IfBreakIntrinsicElement.md +5 -0
- package/docs/api/types/IndentIfBreakIntrinsicElement.md +5 -0
- package/docs/api/types/IndentIntrinsicElement.md +5 -0
- package/docs/api/types/IntrinsicElement.md +5 -0
- package/docs/api/types/IntrinsicElementBase.md +9 -0
- package/docs/api/types/IntrinsicElements.md +26 -0
- package/docs/api/types/JoinOptions.md +9 -0
- package/docs/api/types/LbrIntrinsicElement.md +5 -0
- package/docs/api/types/LibrarySymbolReference.md +13 -0
- package/docs/api/types/LineIntrinsicElement.md +5 -0
- package/docs/api/types/LineSuffixBoundaryIntrinsicElement.md +5 -0
- package/docs/api/types/LineSuffixIntrinsicElement.md +5 -0
- package/docs/api/types/LiterallineIntrinsicElement.md +5 -0
- package/docs/api/types/MakeChildrenOptional.md +7 -0
- package/docs/api/types/MarkAsRootIntrinsicElement.md +5 -0
- package/docs/api/types/MatchProps.md +9 -0
- package/docs/api/types/MemberDeclarationProps.md +5 -0
- package/docs/api/types/MemberDescriptor.md +10 -0
- package/docs/api/types/MemberRefkey.md +10 -0
- package/docs/api/types/MemberResolutionContext.md +10 -0
- package/docs/api/types/MemberResolver.md +32 -0
- package/docs/api/types/MemberScopeProps.md +5 -0
- package/docs/api/types/Metadata.md +5 -0
- package/docs/api/types/NameConflictResolver.md +27 -0
- package/docs/api/types/NamePolicy.md +8 -0
- package/docs/api/types/NamePolicyGetter.md +9 -0
- package/docs/api/types/Namekey.md +10 -0
- package/docs/api/types/NamekeyOptions.md +8 -0
- package/docs/api/types/OnReactiveSetAddCallback.md +5 -0
- package/docs/api/types/OnReactiveSetDeleteCallback.md +5 -0
- package/docs/api/types/OutputDeclarationSpace.md +13 -0
- package/docs/api/types/OutputDirectory.md +59 -0
- package/docs/api/types/OutputFile.md +5 -0
- package/docs/api/types/OutputFileBase.md +8 -0
- package/docs/api/types/OutputMemberSpace.md +13 -0
- package/docs/api/types/OutputScope.md +33 -0
- package/docs/api/types/OutputScopeOptions.md +9 -0
- package/docs/api/types/OutputSpace.md +7 -0
- package/docs/api/types/OutputSymbol.md +76 -0
- package/docs/api/types/OutputSymbolOptions.md +16 -0
- package/docs/api/types/OutputVisitor.md +10 -0
- package/docs/api/types/PrintHook.md +10 -0
- package/docs/api/types/PrintTreeOptions.md +11 -0
- package/docs/api/types/Props.md +5 -0
- package/docs/api/types/ReactiveUnionSet.md +20 -0
- package/docs/api/types/ReactiveUnionSetOptions.md +8 -0
- package/docs/api/types/Refkey.md +5 -0
- package/docs/api/types/Refkeyable.md +5 -0
- package/docs/api/types/RefkeyableObject.md +7 -0
- package/docs/api/types/RenderableObject.md +9 -0
- package/docs/api/types/RenderedTextTree.md +5 -0
- package/docs/api/types/ResolutionResult.md +39 -0
- package/docs/api/types/ResolveDeclarationByKeyOptions.md +7 -0
- package/docs/api/types/Resource.md +11 -0
- package/docs/api/types/RootOptions.md +7 -0
- package/docs/api/types/SbrIntrinsicElement.md +5 -0
- package/docs/api/types/ScopeProps.md +5 -0
- package/docs/api/types/SoftlineIntrinsicElement.md +5 -0
- package/docs/api/types/SourceLocation.md +9 -0
- package/docs/api/types/SplitProps.md +12 -0
- package/docs/api/types/StcComponentCreator.md +9 -0
- package/docs/api/types/StcSignature.md +5 -0
- package/docs/api/types/StiComponentCreator.md +9 -0
- package/docs/api/types/StiSignature.md +7 -0
- package/docs/api/types/SymbolCreator.md +15 -0
- package/docs/api/types/SymbolRefkey.md +9 -0
- package/docs/api/types/SymbolSlot.md +12 -0
- package/docs/api/types/SymbolTable.md +15 -0
- package/docs/api/types/TakeSymbolCallback.md +7 -0
- package/docs/api/types/TakeSymbolsCallback.md +7 -0
- package/docs/api/types/Tap.md +11 -0
- package/docs/api/types/TapHandler.md +9 -0
- package/docs/api/types/Tapper.md +9 -0
- package/docs/api/types/TemplateVariableProps.md +5 -0
- package/docs/api/types/index.md +122 -0
- package/docs/api/variables/FormatOptions.md +5 -0
- package/docs/api/variables/Match.md +7 -0
- package/docs/api/variables/REFKEYABLE.md +5 -0
- package/docs/api/variables/RENDERABLE.md +5 -0
- package/docs/api/variables/TO_SYMBOL.md +39 -0
- package/docs/api/variables/contextsByKey.md +5 -0
- package/docs/api/variables/index.md +11 -0
- package/docs/api/variables/intrinsicElementKey.md +5 -0
- package/docs/api/variables/matchTag.md +5 -0
- package/docs/api/variables/printHookTag.md +7 -0
- package/docs/components.md +97 -0
- package/docs/context.md +67 -0
- package/docs/control-flow.md +5 -0
- package/docs/debugging.md +105 -0
- package/docs/formatting.md +99 -0
- package/docs/guides/language-package-guide.md +593 -0
- package/docs/guides/references-and-refkeys.md +210 -0
- package/docs/guides/style-guide.md +244 -0
- package/docs/index.md +22 -0
- package/docs/reactivity.md +68 -0
- package/docs/rendering.md +41 -0
- package/docs/symbols-and-scopes.md +180 -0
- package/package.json +8 -4
- package/src/binder.ts +107 -3
- package/src/components/Block.tsx +12 -0
- package/src/components/List.tsx +11 -1
- package/src/components/MemberDeclaration.tsx +6 -6
- package/src/components/MemberName.tsx +6 -0
- package/src/components/MemberScope.tsx +5 -0
- package/src/components/Output.tsx +4 -1
- package/src/components/Scope.tsx +6 -0
- package/src/components/SourceFile.tsx +22 -2
- package/src/context/binder.ts +4 -0
- package/src/context/format-options.ts +14 -1
- package/src/context/scope.ts +4 -0
- package/src/context/source-directory.ts +9 -0
- package/src/debug/cli.ts +3 -2
- package/src/debug/source-map.browser.ts +30 -0
- package/src/debug/trace.ts +7 -6
- package/src/host/node-host.browser.ts +23 -0
- package/src/host/node-host.ts +22 -0
- package/src/library-symbol-reference.ts +52 -0
- package/src/name-policy.ts +30 -3
- package/src/reactivity.ts +15 -0
- package/src/render-stack.ts +4 -3
- package/src/render.ts +2 -0
- package/src/symbols/output-scope.ts +33 -1
- package/src/symbols/output-space.ts +13 -0
- package/src/symbols/output-symbol.ts +93 -12
- package/src/symbols/symbol-slot.test.tsx +28 -1
- package/src/symbols/symbol-slot.tsx +8 -0
- package/src/write-output.ts +6 -5
- package/temp/api-testing.json +673 -0
- package/temp/api.json +48 -47
- package/test/browser-build.test.ts +71 -78
- package/testing/create-test-wrapper.tsx +81 -2
- package/testing/extend-expect.ts +22 -1
- package/testing/index.ts +1 -1
- package/testing/render.ts +9 -0
- package/testing/vitest.d.ts +3 -8
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# createAccessExpression
|
|
2
|
+
|
|
3
|
+
Create a language-specific access/member expression component pair.
|
|
4
|
+
|
|
5
|
+
Returns `{ Expression, Part }` where:
|
|
6
|
+
|
|
7
|
+
* `Expression` is the main component that collects Part children and renders the chain
|
|
8
|
+
* `Part` is a no-op component whose props are consumed by Expression
|
|
9
|
+
|
|
10
|
+
The factory handles:
|
|
11
|
+
|
|
12
|
+
* Children collection and Part filtering
|
|
13
|
+
* Symbol resolution (refkey → symbol via binder, single computed per part)
|
|
14
|
+
* Reactive optimization (getter delegation over single computed per part)
|
|
15
|
+
* Flattening nested Expression instances
|
|
16
|
+
* `takeSymbols()` to prevent symbol leakage
|
|
17
|
+
* Call chain detection and chunked formatting algorithm
|
|
18
|
+
|
|
19
|
+
Configuration for creating a language-specific access expression component.
|
|
20
|
+
|
|
21
|
+
* jsx
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { createAccessExpression } from "@alloy-js/core";
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
<createAccessExpression />
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
* stc
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { createAccessExpression } from "@alloy-js/core/stc";
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
createAccessExpression({
|
|
37
|
+
canUseCallChains: undefined,
|
|
38
|
+
createDescriptor: undefined,
|
|
39
|
+
formatPart: undefined,
|
|
40
|
+
getBase: undefined,
|
|
41
|
+
isCallPart: undefined,
|
|
42
|
+
wrapPartResult: undefined,
|
|
43
|
+
}).children(children)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Props
|
|
47
|
+
|
|
48
|
+
| | | |
|
|
49
|
+
| ---------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
50
|
+
| canUseCallChains | (parts: TPart\[]) => boolean | Additional check for whether call chain formatting should be used. Called only when `isCallPart` is provided and more than one call is detected. Return false to force linear formatting (e.g., TypeScript disables call chains when any part has `await`). Defaults to `() => true`. |
|
|
51
|
+
| createDescriptor | (props: TPartProps, symbol: OutputSymbol \| undefined, first: boolean) => TPart | Convert Part props + resolved symbol into a plain descriptor object. Called once per Part during children processing. The returned descriptor is wrapped in a computed + getter delegation for reactive optimization. |
|
|
52
|
+
| formatPart | (part: TPart, prevPart: TPart, inCallChain: boolean) => Children | Format a non-first part given its descriptor and the previous part. Returns JSX children for that segment (e.g., `.foo`, `?.bar`, `[idx]`, `(args)`). `inCallChain` is true when rendering inside a chunked call chain. |
|
|
53
|
+
| getBase | (part: TPart) => Children | Extract the base content from the first part (the leftmost identifier). |
|
|
54
|
+
| isCallPart | (part: TPart) => boolean | Identify which parts are function calls, for call chain detection. When provided, the factory uses the chunked call chain algorithm (line breaks after each call group) when more than one call is detected. When omitted, the expression is always formatted linearly. |
|
|
55
|
+
| wrapPartResult | (expression: Children, part: TPart, index: number, isLast: boolean) => Children | Post-process the accumulated expression after each part in linear (non-call-chain) mode. Use this for language-specific wrapping like TypeScript’s `await` which wraps the entire expression so far. Defaults to identity (returns expression unchanged). |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# core — components
|
|
2
|
+
|
|
3
|
+
- [AppendRegion](AppendRegion.md) — import { AppendRegion } from "@alloy-js/core";
|
|
4
|
+
- [Block](Block.md) — Create an indented block of source text.
|
|
5
|
+
- [CopyFile](CopyFile.md) — import { CopyFile } from "@alloy-js/core";
|
|
6
|
+
- [createAccessExpression](createAccessExpression.md) — Create a language-specific access/member expression component pair.
|
|
7
|
+
- [Declaration](Declaration.md) — Declares a symbol in the current scope for this component’s children.
|
|
8
|
+
- [For](For.md) — The For component iterates over the provided array and invokes the child callback for each item.
|
|
9
|
+
- [Indent](Indent.md) — Create an indented block of source text.
|
|
10
|
+
- [List](List.md) — Create a list of children with text between each child.
|
|
11
|
+
- [MemberDeclaration](MemberDeclaration.md) — Declares a symbol in the current member scope for this component’s children.
|
|
12
|
+
- [MemberName](MemberName.md) — Renders the name of the current member declaration from [MemberDeclaration context](../../contexts/memberdeclaration-context/).
|
|
13
|
+
- [MemberScope](MemberScope.md) — Declare a member scope, which is a lexical scope whose symbols are provided by the owner symbol.
|
|
14
|
+
- [Name](Name.md) — import { Name } from "@alloy-js/core";
|
|
15
|
+
- [Output](Output.md) — This component is the root component for all your emitted output.
|
|
16
|
+
- [Prose](Prose.md) — Create a block of text which will break once a word exceeds the configured line width.
|
|
17
|
+
- [ReferenceOrContent](ReferenceOrContent.md) — import { ReferenceOrContent } from "@alloy-js/core";
|
|
18
|
+
- [Scope](Scope.md) — Declare a scope for this component’s children.
|
|
19
|
+
- [Show](Show.md) — import { Show } from "@alloy-js/core";
|
|
20
|
+
- [SourceDirectory](SourceDirectory.md) — import { SourceDirectory } from "@alloy-js/core";
|
|
21
|
+
- [SourceFile](SourceFile.md) — import { SourceFile } from "@alloy-js/core";
|
|
22
|
+
- [StatementList](StatementList.md) — Join child elements with semicolons and hardlines.
|
|
23
|
+
- [Switch](Switch.md) — Conditionally render blocks of content based on the `when` prop of nested [Match](../../variables/match/) components.
|
|
24
|
+
- [TemplateFile](TemplateFile.md) — A component that reads a template file and replaces variable placeholders with actual values.
|
|
25
|
+
- [TemplateVariable](TemplateVariable.md) — import { TemplateVariable } from "@alloy-js/core";
|
|
26
|
+
- [UpdateFile](UpdateFile.md) — A component for updating existing files or initializing new files.
|
|
27
|
+
- [Wrap](Wrap.md) — Conditionally wrap the children of this component with the component given to `with` and passing `props` to it.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Assignment context
|
|
2
|
+
|
|
3
|
+
AssignmentContext provides the symbol that is the target of the current assignment.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const AssignmentContext: ComponentContext<AssignmentContext>
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Accessor
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
const myContext = useContext(AssignmentContext);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Context interface
|
|
16
|
+
|
|
17
|
+
| | | |
|
|
18
|
+
| ---------- | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
+
| isAssigned | boolean | Whether the symbol has had a value assigned to it. Once the symbol has been assigned, subsequent assignments will have no effect. |
|
|
20
|
+
| target | [OutputSymbol](../../types/outputsymbol/) | The symbol that is the target of the current assignment. |
|
|
21
|
+
|
|
22
|
+
## Factory
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { createAssignmentContext } from "@alloy-js/core";
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
function createAssignmentContext(target: OutputSymbol): AssignmentContext;
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Creates a new [Assignment context interface](../assignment-context/).
|
|
32
|
+
|
|
33
|
+
### Parameters
|
|
34
|
+
|
|
35
|
+
| | | |
|
|
36
|
+
| ------ | ------------ | - |
|
|
37
|
+
| target | OutputSymbol | |
|
|
38
|
+
|
|
39
|
+
## Remarks
|
|
40
|
+
|
|
41
|
+
When a variable is declared, the symbol for the variable doesn’t yet know what value it will hold, because that depends on the assignment to the variable in the variable declaration’s initializer. This context provides the symbol that is the target of the current assignment, so that children of an assignment or initializer can provide additional symbol information.
|
|
42
|
+
|
|
43
|
+
For example, when assigning an object value expression to a variable, the object value expression should use assignment context to provide the member symbols for the object value’s properties.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Binder context
|
|
2
|
+
|
|
3
|
+
The binder context provides the binder instance to all components. This context is provided by the [output component](../../components/output/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const BinderContext: ComponentContext<Binder>
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Accessor
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { useBinder } from "@alloy-js/core";
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const myContext = useBinder();
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Returns the current [Binder](../../types/binder/) from context, or `undefined` if no binder is available. The binder is provided by the [Output](../../components/output/) component.
|
|
19
|
+
|
|
20
|
+
## Context interface
|
|
21
|
+
|
|
22
|
+
[Binder](../../types/binder/)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Declaration context
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
const DeclarationContext: ComponentContext<OutputSymbol>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Accessor
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
const myContext = useContext(DeclarationContext);
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Context interface
|
|
14
|
+
|
|
15
|
+
[OutputSymbol](../../types/outputsymbol/)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Member context
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
const MemberContext: ComponentContext<MemberContext>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Accessor
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
const myContext = useContext(MemberContext);
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Context interface
|
|
14
|
+
|
|
15
|
+
| | | |
|
|
16
|
+
| ----------- | ----------------------------------------- | - |
|
|
17
|
+
| ownerSymbol | [OutputSymbol](../../types/outputsymbol/) | |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# MemberDeclaration context
|
|
2
|
+
|
|
3
|
+
Provides the symbol for the member currently being declared.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const MemberDeclarationContext: ComponentContext<OutputSymbol>
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Accessor
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { useMemberDeclaration } from "@alloy-js/core";
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const myContext = useMemberDeclaration();
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Context interface
|
|
19
|
+
|
|
20
|
+
[OutputSymbol](../../types/outputsymbol/)
|
|
21
|
+
|
|
22
|
+
## See also
|
|
23
|
+
|
|
24
|
+
* [Declaration context](../declaration-context/) for getting the symbol for the current non-member declaration.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# NamePolicy context
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
const NamePolicyContext: ComponentContext<NamePolicy<string>>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Accessor
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { useNamePolicy } from "@alloy-js/core";
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const myContext = useNamePolicy();
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Context interface
|
|
17
|
+
|
|
18
|
+
[NamePolicy](../../types/namepolicy/)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Scope context
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
const ScopeContext: ComponentContext<OutputScope>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Accessor
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { useScope } from "@alloy-js/core";
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const myContext = useScope();
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Returns the current [OutputScope](../../types/outputscope/) from context. Must be called inside a component that is a descendant of a `<Scope>` provider.
|
|
17
|
+
|
|
18
|
+
## Context interface
|
|
19
|
+
|
|
20
|
+
[OutputScope](../../types/outputscope/)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# SourceDirectory context
|
|
2
|
+
|
|
3
|
+
Always provided by `<Output>` — `useContext(SourceDirectoryContext)` is never `undefined` inside an `<Output>` tree. At the root of the tree, `path` equals the `basePath` prop on `<Output>` (default `"./"`); nested `<SourceDirectory>` components update `path` relative to their parent.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const SourceDirectoryContext: ComponentContext<SourceDirectoryContext>
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Accessor
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
const myContext = useContext(SourceDirectoryContext);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Context interface
|
|
16
|
+
|
|
17
|
+
| | | |
|
|
18
|
+
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
|
|
19
|
+
| addContent | (content: SourceDirectoryContext \| SourceFileContext \| CopyFileContext) => void | |
|
|
20
|
+
| contents | ([SourceDirectory context interface](../sourcedirectory-context/) \| [SourceFile context interface](../sourcefile-context/) \| [CopyFileContext](../../types/copyfilecontext/))\[] | |
|
|
21
|
+
| path | string | |
|
|
22
|
+
|
|
23
|
+
## See also
|
|
24
|
+
|
|
25
|
+
* [Output](../../components/output/)
|
|
26
|
+
* [SourceDirectory](../../components/sourcedirectory/)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# SourceFile context
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
const SourceFileContext: ComponentContext<SourceFileContext>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Accessor
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
const myContext = useContext(SourceFileContext);
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Context interface
|
|
14
|
+
|
|
15
|
+
| | | |
|
|
16
|
+
| --------- | ------------------------------------------------------------------------------------------------------------ | - |
|
|
17
|
+
| filetype | string | |
|
|
18
|
+
| path | string | |
|
|
19
|
+
| reference | optional [ComponentDefinition](../../types/componentdefinition/)<{ refkey: [Refkey](../../types/refkey/); }> | |
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# core — contexts
|
|
2
|
+
|
|
3
|
+
- [Assignment context](Assignment-context.md) — AssignmentContext provides the symbol that is the target of the current assignment.
|
|
4
|
+
- [Binder context](Binder-context.md) — The binder context provides the binder instance to all components.
|
|
5
|
+
- [Declaration context](Declaration-context.md) — const DeclarationContext: ComponentContext<OutputSymbol>
|
|
6
|
+
- [Member context](Member-context.md) — const MemberContext: ComponentContext<MemberContext>
|
|
7
|
+
- [MemberDeclaration context](MemberDeclaration-context.md) — Provides the symbol for the member currently being declared.
|
|
8
|
+
- [NamePolicy context](NamePolicy-context.md) — const NamePolicyContext: ComponentContext<NamePolicy<string>>
|
|
9
|
+
- [Scope context](Scope-context.md) — const ScopeContext: ComponentContext<OutputScope>
|
|
10
|
+
- [SourceDirectory context](SourceDirectory-context.md) — Always provided by `<Output>` — `useContext(SourceDirectoryContext)` is never `undefined` inside an `<Output>` tree.
|
|
11
|
+
- [SourceFile context](SourceFile-context.md) — const SourceFileContext: ComponentContext<SourceFileContext>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# attachDiagnosticsCollector
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { attachDiagnosticsCollector } from "@alloy-js/core";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function attachDiagnosticsCollector(collector: DiagnosticsCollector): void;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| --------- | -------------------- | - |
|
|
14
|
+
| collector | DiagnosticsCollector | |
|
|
15
|
+
|
|
16
|
+
## Returns
|
|
17
|
+
|
|
18
|
+
void
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# baseListPropsToMapJoinArgs
|
|
2
|
+
|
|
3
|
+
Convert a list of props to a joiner and ender for use in [mapJoin](../mapjoin/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { baseListPropsToMapJoinArgs } from "@alloy-js/core";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function baseListPropsToMapJoinArgs(props: BaseListProps): JoinOptions;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Parameters
|
|
13
|
+
|
|
14
|
+
| | | |
|
|
15
|
+
| ----- | ------------- | - |
|
|
16
|
+
| props | BaseListProps | |
|
|
17
|
+
|
|
18
|
+
## Returns
|
|
19
|
+
|
|
20
|
+
[JoinOptions](../../types/joinoptions/)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# children
|
|
2
|
+
|
|
3
|
+
Returns a memo which is a list of all the provided children. If you want this as an array, see [childrenArray](../childrenarray/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { children } from "@alloy-js/core";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function children(fn: () => Children, options?: ChildrenOptions): () => Children;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Parameters
|
|
13
|
+
|
|
14
|
+
| | | |
|
|
15
|
+
| ------- | ------------------------ | - |
|
|
16
|
+
| fn | () => Children | |
|
|
17
|
+
| options | optional ChildrenOptions | |
|
|
18
|
+
|
|
19
|
+
## Options
|
|
20
|
+
|
|
21
|
+
| | | |
|
|
22
|
+
| ----------------- | ---------------- | -------------------------------------------------- |
|
|
23
|
+
| preserveFragments | optional boolean | When true, fragments and arrays are not flattened. |
|
|
24
|
+
|
|
25
|
+
## Returns
|
|
26
|
+
|
|
27
|
+
() => [Children](../../types/children/)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# childrenArray
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { childrenArray } from "@alloy-js/core";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function childrenArray(fn: () => Children, options?: ChildrenOptions): Children[];
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ------- | ------------------------ | - |
|
|
14
|
+
| fn | () => Children | |
|
|
15
|
+
| options | optional ChildrenOptions | |
|
|
16
|
+
|
|
17
|
+
## Options
|
|
18
|
+
|
|
19
|
+
| | | |
|
|
20
|
+
| ----------------- | ---------------- | -------------------------------------------------- |
|
|
21
|
+
| preserveFragments | optional boolean | When true, fragments and arrays are not flattened. |
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
[Children](../../types/children/)\[]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# code
|
|
2
|
+
|
|
3
|
+
Turn the provided string template into Children by replacing literal line breaks with hardlines and automatically indenting indented content. Similar in spirit to the `<code>` element in HTML.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { code } from "@alloy-js/core";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function code(template: TemplateStringsArray, ...substitutions: Children[]): Children;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Parameters
|
|
13
|
+
|
|
14
|
+
| | | |
|
|
15
|
+
| ------------- | -------------------- | - |
|
|
16
|
+
| template | TemplateStringsArray | |
|
|
17
|
+
| substitutions | Children\[] | |
|
|
18
|
+
|
|
19
|
+
## Returns
|
|
20
|
+
|
|
21
|
+
[Children](../../types/children/)
|
|
22
|
+
|
|
23
|
+
## See also
|
|
24
|
+
|
|
25
|
+
* [text](../text/) for a similar function which treats whitespace similar to JSX template bodies.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# createComponent
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createComponent } from "@alloy-js/core";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createComponent<TProps extends Props = Props>(C: Component<TProps>, props: TProps, source?: SourceLocation): ComponentCreator<TProps>;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ------ | ----------------------- | - |
|
|
14
|
+
| C | Component\<TProps> | |
|
|
15
|
+
| props | TProps | |
|
|
16
|
+
| source | optional SourceLocation | |
|
|
17
|
+
|
|
18
|
+
## Returns
|
|
19
|
+
|
|
20
|
+
[ComponentCreator](../../types/componentcreator/)\<TProps>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# createContentSlot
|
|
2
|
+
|
|
3
|
+
Create a component which tracks whether any content is placed inside of it. The component exposes a ref `isEmpty` which indicates whether the slot is empty, as well as convenience accessors `isEmpty` and `hasContent`. Additionally, it provides two sub-components, `WhenEmpty` and `WhenHasContent`, which render their contents conditionally based on whether the slot is empty.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { createContentSlot } from "@alloy-js/core";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function createContentSlot(): ContentSlot;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Parameters
|
|
13
|
+
|
|
14
|
+
| |
|
|
15
|
+
| - |
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
[ContentSlot](../../types/contentslot/)
|
|
20
|
+
|
|
21
|
+
## Example
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
const ContentSlot = createContentSlot();
|
|
25
|
+
|
|
26
|
+
<>
|
|
27
|
+
<ContentSlot.WhenEmpty>The slot is empty!</ContentSlot.WhenEmpty>
|
|
28
|
+
<ContentSlot.WhenHasContent>The slot has content!</ContentSlot.WhenHasContent>
|
|
29
|
+
<ContentSlot>
|
|
30
|
+
{someCondition && "Here is some content!"}
|
|
31
|
+
</ContentSlot>
|
|
32
|
+
</>
|
|
33
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# createContext
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createContext } from "@alloy-js/core";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createContext<T = unknown>(defaultValue?: T, name?: string): ComponentContext<T>;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ------------ | --------------- | - |
|
|
14
|
+
| defaultValue | optional T | |
|
|
15
|
+
| name | optional string | |
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
[ComponentContext](../../types/componentcontext/)\<T>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# createCustomContext
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createCustomContext } from "@alloy-js/core";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createCustomContext(useCallback: (useChildren: CustomContextChildrenCallback) => void): CustomContext;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ----------- | ---------------------------------------------------- | - |
|
|
14
|
+
| useCallback | (useChildren: CustomContextChildrenCallback) => void | |
|
|
15
|
+
|
|
16
|
+
## Returns
|
|
17
|
+
|
|
18
|
+
[CustomContext](../../types/customcontext/)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# createDeclarationTap
|
|
2
|
+
|
|
3
|
+
Create a tap for [Declaration context](../../contexts/declaration-context/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { createDeclarationTap } from "@alloy-js/core";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function createDeclarationTap<TSymbol extends OutputSymbol = OutputSymbol>(handler?: TapHandler<TSymbol>): Tap<TSymbol>;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Parameters
|
|
13
|
+
|
|
14
|
+
| | | |
|
|
15
|
+
| ------- | ----------------------------- | - |
|
|
16
|
+
| handler | optional TapHandler\<TSymbol> | |
|
|
17
|
+
|
|
18
|
+
## Returns
|
|
19
|
+
|
|
20
|
+
[Tap](../../types/tap/)\<TSymbol>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# createFileResource
|
|
2
|
+
|
|
3
|
+
Create a resource that reads a file from the file system.
|
|
4
|
+
|
|
5
|
+
This is a convenience function that creates a resource for reading file content using the AlloyHost file system API. The file is read as text when the resource is created.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createFileResource } from "@alloy-js/core";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
function createFileResource(path: string): Resource<string>;
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Parameters
|
|
15
|
+
|
|
16
|
+
| | | |
|
|
17
|
+
| ---- | ------ | - |
|
|
18
|
+
| path | string | |
|
|
19
|
+
|
|
20
|
+
## Returns
|
|
21
|
+
|
|
22
|
+
[Resource](../../types/resource/)\<string>
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
// Read a configuration file
|
|
28
|
+
const configResource = createFileResource('./config.json');
|
|
29
|
+
|
|
30
|
+
// Access the file content
|
|
31
|
+
if (!configResource.loading && !configResource.error) {
|
|
32
|
+
const configText = configResource.data; // string content of the file
|
|
33
|
+
const config = JSON.parse(configText);
|
|
34
|
+
}
|
|
35
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# createFormatOptionsContextFor
|
|
2
|
+
|
|
3
|
+
Create a format options context for a specific file type. Returns a `Provider` component and a `useFormatOptions` hook.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { createFormatOptionsContextFor } from "@alloy-js/core";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function createFormatOptionsContextFor<T>(filetype: string, defaults?: T): {
|
|
10
|
+
Provider: import("../index.js").ComponentDefinition<import("../context.js").ContextProviderProps<T>>;
|
|
11
|
+
useFormatOptions: (overrides?: Partial<T>) => T;
|
|
12
|
+
};
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| | | |
|
|
18
|
+
| -------- | ---------- | - |
|
|
19
|
+
| filetype | string | |
|
|
20
|
+
| defaults | optional T | |
|
|
21
|
+
|
|
22
|
+
## Returns
|
|
23
|
+
|
|
24
|
+
{ Provider: import(”../index.js”).[ComponentDefinition](../../types/componentdefinition/)\<import(”../context.js”).[ContextProviderProps](../../types/contextproviderprops/)\<T>>; useFormatOptions: (overrides?: Partial\<T>) => T; }
|
|
25
|
+
|
|
26
|
+
## Remarks
|
|
27
|
+
|
|
28
|
+
Merge precedence: `defaults` (lowest) → Provider `value` → `overrides` argument to `useFormatOptions()` (highest). Undefined override values are ignored.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# createIntrinsic
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createIntrinsic } from "@alloy-js/core";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createIntrinsic<TKey extends keyof IntrinsicElements>(name: TKey, props: IntrinsicElements[TKey]): IntrinsicElementBase<TKey>;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ----- | ------------------------ | - |
|
|
14
|
+
| name | TKey | |
|
|
15
|
+
| props | IntrinsicElements\[TKey] | |
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
[IntrinsicElementBase](../../types/intrinsicelementbase/)\<TKey>
|