@powerlines/plugin-alloy 0.25.22 → 0.25.23
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/core/components/index.d.cts +5 -0
- package/dist/core/components/index.d.mts +5 -0
- package/dist/core/components/output.d.cts +25 -0
- package/dist/core/components/output.d.cts.map +1 -0
- package/dist/core/components/output.d.mts +25 -0
- package/dist/core/components/output.d.mts.map +1 -0
- package/dist/core/components/output.mjs +2 -1
- package/dist/core/components/output.mjs.map +1 -0
- package/dist/core/components/single-line-comment.d.cts +23 -0
- package/dist/core/components/single-line-comment.d.cts.map +1 -0
- package/dist/core/components/single-line-comment.d.mts +23 -0
- package/dist/core/components/single-line-comment.d.mts.map +1 -0
- package/dist/core/components/single-line-comment.mjs +2 -1
- package/dist/core/components/single-line-comment.mjs.map +1 -0
- package/dist/core/components/source-file.d.cts +33 -0
- package/dist/core/components/source-file.d.cts.map +1 -0
- package/dist/core/components/source-file.d.mts +33 -0
- package/dist/core/components/source-file.d.mts.map +1 -0
- package/dist/core/components/source-file.mjs +2 -1
- package/dist/core/components/source-file.mjs.map +1 -0
- package/dist/core/components/spacing.d.cts +24 -0
- package/dist/core/components/spacing.d.cts.map +1 -0
- package/dist/core/components/spacing.d.mts +24 -0
- package/dist/core/components/spacing.d.mts.map +1 -0
- package/dist/core/components/spacing.mjs +2 -1
- package/dist/core/components/spacing.mjs.map +1 -0
- package/dist/core/contexts/context.d.cts +30 -0
- package/dist/core/contexts/context.d.cts.map +1 -0
- package/dist/core/contexts/context.d.mts +30 -0
- package/dist/core/contexts/context.d.mts.map +1 -0
- package/dist/core/contexts/context.mjs +2 -1
- package/dist/core/contexts/context.mjs.map +1 -0
- package/dist/core/contexts/index.d.cts +4 -0
- package/dist/core/contexts/index.d.mts +4 -0
- package/dist/core/contexts/meta.d.cts +48 -0
- package/dist/core/contexts/meta.d.cts.map +1 -0
- package/dist/core/contexts/meta.d.mts +48 -0
- package/dist/core/contexts/meta.d.mts.map +1 -0
- package/dist/core/contexts/meta.mjs +2 -1
- package/dist/core/contexts/meta.mjs.map +1 -0
- package/dist/core/contexts/reflection.d.cts +53 -0
- package/dist/core/contexts/reflection.d.cts.map +1 -0
- package/dist/core/contexts/reflection.d.mts +53 -0
- package/dist/core/contexts/reflection.d.mts.map +1 -0
- package/dist/core/contexts/reflection.mjs +2 -1
- package/dist/core/contexts/reflection.mjs.map +1 -0
- package/dist/core/helpers/code.d.cts +30 -0
- package/dist/core/helpers/code.d.cts.map +1 -0
- package/dist/core/helpers/code.d.mts +30 -0
- package/dist/core/helpers/code.d.mts.map +1 -0
- package/dist/core/helpers/code.mjs +2 -1
- package/dist/core/helpers/code.mjs.map +1 -0
- package/dist/core/helpers/index.d.cts +2 -0
- package/dist/core/helpers/index.d.mts +2 -0
- package/dist/core/index.d.cts +12 -0
- package/dist/core/index.d.mts +12 -0
- package/dist/helpers/capnp.d.cts +88 -0
- package/dist/helpers/capnp.d.cts.map +1 -0
- package/dist/helpers/capnp.d.mts +88 -0
- package/dist/helpers/capnp.d.mts.map +1 -0
- package/dist/helpers/capnp.mjs +2 -1
- package/dist/helpers/capnp.mjs.map +1 -0
- package/dist/helpers/create-builtin.d.cts +16 -0
- package/dist/helpers/create-builtin.d.cts.map +1 -0
- package/dist/helpers/create-builtin.d.mts +16 -0
- package/dist/helpers/create-builtin.d.mts.map +1 -0
- package/dist/helpers/create-builtin.mjs +2 -1
- package/dist/helpers/create-builtin.mjs.map +1 -0
- package/dist/helpers/index.d.cts +5 -0
- package/dist/helpers/index.d.mts +5 -0
- package/dist/helpers/refkey.d.cts +14 -0
- package/dist/helpers/refkey.d.cts.map +1 -0
- package/dist/helpers/refkey.d.mts +14 -0
- package/dist/helpers/refkey.d.mts.map +1 -0
- package/dist/helpers/refkey.mjs +2 -1
- package/dist/helpers/refkey.mjs.map +1 -0
- package/dist/helpers/typescript.d.cts +26 -0
- package/dist/helpers/typescript.d.cts.map +1 -0
- package/dist/helpers/typescript.d.mts +26 -0
- package/dist/helpers/typescript.d.mts.map +1 -0
- package/dist/helpers/typescript.mjs +2 -1
- package/dist/helpers/typescript.mjs.map +1 -0
- package/dist/index.d.cts +19 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +19 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -0
- package/dist/markdown/components/front-matter.d.cts +16 -0
- package/dist/markdown/components/front-matter.d.cts.map +1 -0
- package/dist/markdown/components/front-matter.d.mts +16 -0
- package/dist/markdown/components/front-matter.d.mts.map +1 -0
- package/dist/markdown/components/front-matter.mjs +2 -1
- package/dist/markdown/components/front-matter.mjs.map +1 -0
- package/dist/markdown/components/index.d.cts +4 -0
- package/dist/markdown/components/index.d.mts +4 -0
- package/dist/markdown/components/markdown-file.d.cts +29 -0
- package/dist/markdown/components/markdown-file.d.cts.map +1 -0
- package/dist/markdown/components/markdown-file.d.mts +29 -0
- package/dist/markdown/components/markdown-file.d.mts.map +1 -0
- package/dist/markdown/components/markdown-file.mjs +2 -1
- package/dist/markdown/components/markdown-file.mjs.map +1 -0
- package/dist/markdown/components/markdown-table.d.cts +28 -0
- package/dist/markdown/components/markdown-table.d.cts.map +1 -0
- package/dist/markdown/components/markdown-table.d.mts +28 -0
- package/dist/markdown/components/markdown-table.d.mts.map +1 -0
- package/dist/markdown/components/markdown-table.mjs +2 -1
- package/dist/markdown/components/markdown-table.mjs.map +1 -0
- package/dist/markdown/contexts/index.d.cts +2 -0
- package/dist/markdown/contexts/index.d.mts +2 -0
- package/dist/markdown/contexts/markdown-table.d.cts +38 -0
- package/dist/markdown/contexts/markdown-table.d.cts.map +1 -0
- package/dist/markdown/contexts/markdown-table.d.mts +38 -0
- package/dist/markdown/contexts/markdown-table.d.mts.map +1 -0
- package/dist/markdown/contexts/markdown-table.mjs +2 -1
- package/dist/markdown/contexts/markdown-table.mjs.map +1 -0
- package/dist/markdown/index.d.cts +7 -0
- package/dist/markdown/index.d.mts +7 -0
- package/dist/render.d.cts +39 -0
- package/dist/render.d.cts.map +1 -0
- package/dist/render.d.mts +39 -0
- package/dist/render.d.mts.map +1 -0
- package/dist/render.mjs +2 -1
- package/dist/render.mjs.map +1 -0
- package/dist/types/components.d.cts +142 -0
- package/dist/types/components.d.cts.map +1 -0
- package/dist/types/components.d.mts +142 -0
- package/dist/types/components.d.mts.map +1 -0
- package/dist/types/index.d.cts +3 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/plugin.d.cts +39 -0
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +39 -0
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/typescript/components/builtin-file.d.cts +35 -0
- package/dist/typescript/components/builtin-file.d.cts.map +1 -0
- package/dist/typescript/components/builtin-file.d.mts +35 -0
- package/dist/typescript/components/builtin-file.d.mts.map +1 -0
- package/dist/typescript/components/builtin-file.mjs +2 -1
- package/dist/typescript/components/builtin-file.mjs.map +1 -0
- package/dist/typescript/components/class-declaration.d.cts +145 -0
- package/dist/typescript/components/class-declaration.d.cts.map +1 -0
- package/dist/typescript/components/class-declaration.d.mts +145 -0
- package/dist/typescript/components/class-declaration.d.mts.map +1 -0
- package/dist/typescript/components/class-declaration.mjs +2 -1
- package/dist/typescript/components/class-declaration.mjs.map +1 -0
- package/dist/typescript/components/dynamic-import-statement.d.cts +33 -0
- package/dist/typescript/components/dynamic-import-statement.d.cts.map +1 -0
- package/dist/typescript/components/dynamic-import-statement.d.mts +33 -0
- package/dist/typescript/components/dynamic-import-statement.d.mts.map +1 -0
- package/dist/typescript/components/dynamic-import-statement.mjs +2 -1
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -0
- package/dist/typescript/components/entry-file.d.cts +28 -0
- package/dist/typescript/components/entry-file.d.cts.map +1 -0
- package/dist/typescript/components/entry-file.d.mts +28 -0
- package/dist/typescript/components/entry-file.d.mts.map +1 -0
- package/dist/typescript/components/entry-file.mjs +2 -1
- package/dist/typescript/components/entry-file.mjs.map +1 -0
- package/dist/typescript/components/index.d.cts +15 -0
- package/dist/typescript/components/index.d.mts +15 -0
- package/dist/typescript/components/infrastructure-file.d.cts +21 -0
- package/dist/typescript/components/infrastructure-file.d.cts.map +1 -0
- package/dist/typescript/components/infrastructure-file.d.mts +21 -0
- package/dist/typescript/components/infrastructure-file.d.mts.map +1 -0
- package/dist/typescript/components/infrastructure-file.mjs +2 -1
- package/dist/typescript/components/infrastructure-file.mjs.map +1 -0
- package/dist/typescript/components/interface-declaration.d.cts +86 -0
- package/dist/typescript/components/interface-declaration.d.cts.map +1 -0
- package/dist/typescript/components/interface-declaration.d.mts +86 -0
- package/dist/typescript/components/interface-declaration.d.mts.map +1 -0
- package/dist/typescript/components/interface-declaration.mjs +2 -1
- package/dist/typescript/components/interface-declaration.mjs.map +1 -0
- package/dist/typescript/components/object-declaration.d.cts +30 -0
- package/dist/typescript/components/object-declaration.d.cts.map +1 -0
- package/dist/typescript/components/object-declaration.d.mts +30 -0
- package/dist/typescript/components/object-declaration.d.mts.map +1 -0
- package/dist/typescript/components/object-declaration.mjs +2 -1
- package/dist/typescript/components/object-declaration.mjs.map +1 -0
- package/dist/typescript/components/property-name.d.cts +24 -0
- package/dist/typescript/components/property-name.d.cts.map +1 -0
- package/dist/typescript/components/property-name.d.mts +24 -0
- package/dist/typescript/components/property-name.d.mts.map +1 -0
- package/dist/typescript/components/property-name.mjs +2 -1
- package/dist/typescript/components/property-name.mjs.map +1 -0
- package/dist/typescript/components/record-expression.d.cts +13 -0
- package/dist/typescript/components/record-expression.d.cts.map +1 -0
- package/dist/typescript/components/record-expression.d.mts +13 -0
- package/dist/typescript/components/record-expression.d.mts.map +1 -0
- package/dist/typescript/components/record-expression.mjs +2 -1
- package/dist/typescript/components/record-expression.mjs.map +1 -0
- package/dist/typescript/components/tsdoc-reflection.d.cts +44 -0
- package/dist/typescript/components/tsdoc-reflection.d.cts.map +1 -0
- package/dist/typescript/components/tsdoc-reflection.d.mts +44 -0
- package/dist/typescript/components/tsdoc-reflection.d.mts.map +1 -0
- package/dist/typescript/components/tsdoc-reflection.mjs +2 -1
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -0
- package/dist/typescript/components/tsdoc.d.cts +164 -0
- package/dist/typescript/components/tsdoc.d.cts.map +1 -0
- package/dist/typescript/components/tsdoc.d.mts +164 -0
- package/dist/typescript/components/tsdoc.d.mts.map +1 -0
- package/dist/typescript/components/tsdoc.mjs +2 -1
- package/dist/typescript/components/tsdoc.mjs.map +1 -0
- package/dist/typescript/components/type-declaration.d.cts +18 -0
- package/dist/typescript/components/type-declaration.d.cts.map +1 -0
- package/dist/typescript/components/type-declaration.d.mts +18 -0
- package/dist/typescript/components/type-declaration.d.mts.map +1 -0
- package/dist/typescript/components/type-declaration.mjs +2 -1
- package/dist/typescript/components/type-declaration.mjs.map +1 -0
- package/dist/typescript/components/type-parameters.d.cts +24 -0
- package/dist/typescript/components/type-parameters.d.cts.map +1 -0
- package/dist/typescript/components/type-parameters.d.mts +24 -0
- package/dist/typescript/components/type-parameters.d.mts.map +1 -0
- package/dist/typescript/components/type-parameters.mjs +2 -1
- package/dist/typescript/components/type-parameters.mjs.map +1 -0
- package/dist/typescript/components/typescript-file.d.cts +50 -0
- package/dist/typescript/components/typescript-file.d.cts.map +1 -0
- package/dist/typescript/components/typescript-file.d.mts +50 -0
- package/dist/typescript/components/typescript-file.d.mts.map +1 -0
- package/dist/typescript/components/typescript-file.mjs +2 -1
- package/dist/typescript/components/typescript-file.mjs.map +1 -0
- package/dist/typescript/contexts/index.d.cts +2 -0
- package/dist/typescript/contexts/index.d.mts +2 -0
- package/dist/typescript/contexts/lexical-scope.d.cts +17 -0
- package/dist/typescript/contexts/lexical-scope.d.cts.map +1 -0
- package/dist/typescript/contexts/lexical-scope.d.mts +17 -0
- package/dist/typescript/contexts/lexical-scope.d.mts.map +1 -0
- package/dist/typescript/contexts/lexical-scope.mjs +2 -1
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -0
- package/dist/typescript/contexts/member-scope.d.cts +20 -0
- package/dist/typescript/contexts/member-scope.d.cts.map +1 -0
- package/dist/typescript/contexts/member-scope.d.mts +20 -0
- package/dist/typescript/contexts/member-scope.d.mts.map +1 -0
- package/dist/typescript/contexts/member-scope.mjs +2 -1
- package/dist/typescript/contexts/member-scope.mjs.map +1 -0
- package/dist/typescript/helpers/get-call-signature-props.d.cts +15 -0
- package/dist/typescript/helpers/get-call-signature-props.d.cts.map +1 -0
- package/dist/typescript/helpers/get-call-signature-props.d.mts +15 -0
- package/dist/typescript/helpers/get-call-signature-props.d.mts.map +1 -0
- package/dist/typescript/helpers/get-call-signature-props.mjs +2 -1
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -0
- package/dist/typescript/helpers/index.d.cts +3 -0
- package/dist/typescript/helpers/index.d.mts +3 -0
- package/dist/typescript/helpers/utilities.d.cts +11 -0
- package/dist/typescript/helpers/utilities.d.cts.map +1 -0
- package/dist/typescript/helpers/utilities.d.mts +11 -0
- package/dist/typescript/helpers/utilities.d.mts.map +1 -0
- package/dist/typescript/helpers/utilities.mjs +2 -1
- package/dist/typescript/helpers/utilities.mjs.map +1 -0
- package/dist/typescript/index.d.cts +21 -0
- package/dist/typescript/index.d.mts +21 -0
- package/dist/yaml/components/index.d.cts +2 -0
- package/dist/yaml/components/index.d.mts +2 -0
- package/dist/yaml/components/yaml-file.d.cts +34 -0
- package/dist/yaml/components/yaml-file.d.cts.map +1 -0
- package/dist/yaml/components/yaml-file.d.mts +34 -0
- package/dist/yaml/components/yaml-file.d.mts.map +1 -0
- package/dist/yaml/components/yaml-file.mjs +2 -1
- package/dist/yaml/components/yaml-file.mjs.map +1 -0
- package/dist/yaml/index.d.cts +3 -0
- package/dist/yaml/index.d.mts +3 -0
- package/package.json +5 -5
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
+
import { Children } from "@alloy-js/core";
|
|
3
|
+
import { ReflectionKind, ReflectionParameter, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
|
+
import { JSDocExampleProps, ParameterDescriptor } from "@alloy-js/typescript";
|
|
5
|
+
|
|
6
|
+
//#region src/typescript/components/tsdoc.d.ts
|
|
7
|
+
interface TSDocProps extends ComponentProps {
|
|
8
|
+
heading?: Children;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Generates a TypeScript interface for the given reflection class.
|
|
12
|
+
*/
|
|
13
|
+
declare function TSDoc(props: TSDocProps): Children;
|
|
14
|
+
interface TSDocTagProps extends ComponentProps {
|
|
15
|
+
tag: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create a TSDoc `@<props.tag>` tag.
|
|
19
|
+
*/
|
|
20
|
+
declare function TSDocTag(props: TSDocTagProps): Children;
|
|
21
|
+
interface TSDocParamsProps {
|
|
22
|
+
parameters: ParameterDescriptor[] | string[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A component that creates a TSDoc block with `@param` tags for each parameter.
|
|
26
|
+
*/
|
|
27
|
+
declare function TSDocParams(props: TSDocParamsProps): Children;
|
|
28
|
+
/**
|
|
29
|
+
* Create a TSDoc `@title` tag.
|
|
30
|
+
*/
|
|
31
|
+
declare function TSDocTitle(props: ComponentProps): Children;
|
|
32
|
+
/**
|
|
33
|
+
* Create a TSDoc `@domain` tag.
|
|
34
|
+
*/
|
|
35
|
+
declare function TSDocDomain(props: ComponentProps): Children;
|
|
36
|
+
/**
|
|
37
|
+
* Create a TSDoc `@alias` tag.
|
|
38
|
+
*/
|
|
39
|
+
declare function TSDocAlias(props: ComponentProps): Children;
|
|
40
|
+
/**
|
|
41
|
+
* Create a TSDoc `@permission` tag.
|
|
42
|
+
*/
|
|
43
|
+
declare function TSDocPermission(props: ComponentProps): Children;
|
|
44
|
+
interface TSDocDefaultValueProps extends ComponentProps {
|
|
45
|
+
type: ReflectionKind | ReflectionProperty | ReflectionParameter;
|
|
46
|
+
defaultValue: any;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Create a TSDoc `@defaultValue` tag.
|
|
50
|
+
*/
|
|
51
|
+
declare function TSDocDefaultValue(props: TSDocDefaultValueProps): Children;
|
|
52
|
+
/**
|
|
53
|
+
* Create a TSDoc `@remarks` tag.
|
|
54
|
+
*/
|
|
55
|
+
declare function TSDocRemarks(props: ComponentProps): Children;
|
|
56
|
+
/**
|
|
57
|
+
* Create a TSDoc `@see` tag.
|
|
58
|
+
*/
|
|
59
|
+
declare function TSDocLink(props: ComponentProps): Children;
|
|
60
|
+
interface TSDocExampleProps extends JSDocExampleProps {
|
|
61
|
+
/**
|
|
62
|
+
* Whether the file is a TSX file.
|
|
63
|
+
*
|
|
64
|
+
* @defaultValue false
|
|
65
|
+
*/
|
|
66
|
+
tsx?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create a TSDoc `@example` tag.
|
|
70
|
+
*/
|
|
71
|
+
declare function TSDocExample(props: TSDocExampleProps): Children;
|
|
72
|
+
/**
|
|
73
|
+
* Create a TSDoc `@readonly` tag.
|
|
74
|
+
*/
|
|
75
|
+
declare function TSDocReadonly(): Children;
|
|
76
|
+
/**
|
|
77
|
+
* Create a TSDoc `@internal` tag.
|
|
78
|
+
*/
|
|
79
|
+
declare function TSDocInternal(): Children;
|
|
80
|
+
/**
|
|
81
|
+
* Create a TSDoc `@ignore` tag.
|
|
82
|
+
*/
|
|
83
|
+
declare function TSDocIgnore(): Children;
|
|
84
|
+
/**
|
|
85
|
+
* Create a TSDoc `@hidden` tag.
|
|
86
|
+
*/
|
|
87
|
+
declare function TSDocHidden(): Children;
|
|
88
|
+
interface TSDocAttributesTagsProps {
|
|
89
|
+
type?: ReflectionKind | ReflectionProperty | ReflectionParameter;
|
|
90
|
+
title?: string;
|
|
91
|
+
alias?: string[];
|
|
92
|
+
permission?: string[];
|
|
93
|
+
domain?: string;
|
|
94
|
+
readonly?: boolean;
|
|
95
|
+
internal?: boolean;
|
|
96
|
+
ignore?: boolean;
|
|
97
|
+
hidden?: boolean;
|
|
98
|
+
defaultValue?: any;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
102
|
+
*/
|
|
103
|
+
declare function TSDocAttributesTags(props: TSDocAttributesTagsProps): Children;
|
|
104
|
+
interface TSDocParamProps {
|
|
105
|
+
name: Children;
|
|
106
|
+
children?: Children;
|
|
107
|
+
optional?: boolean;
|
|
108
|
+
defaultValue?: Children;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Create a TSDoc parameter set off with `@param`.
|
|
112
|
+
*/
|
|
113
|
+
declare function TSDocParam(props: TSDocParamProps): Children;
|
|
114
|
+
/**
|
|
115
|
+
* Create a TSDoc `@returns` tag.
|
|
116
|
+
*/
|
|
117
|
+
declare function TSDocReturns(props: ComponentProps): Children;
|
|
118
|
+
/**
|
|
119
|
+
* Create a TSDoc `@throws` tag.
|
|
120
|
+
*/
|
|
121
|
+
declare function TSDocThrows(props: ComponentProps): Children;
|
|
122
|
+
interface TSDocModuleProps extends ComponentProps {
|
|
123
|
+
/**
|
|
124
|
+
* The prefix for the builtin module name
|
|
125
|
+
*
|
|
126
|
+
* @remarks
|
|
127
|
+
* This value is populated from the Powerlines configuration output builtin prefix by default.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* /**
|
|
132
|
+
* @module powerlines:my-module
|
|
133
|
+
* \/
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
prefix?: string;
|
|
137
|
+
/**
|
|
138
|
+
* The name of the module
|
|
139
|
+
*
|
|
140
|
+
* @remarks
|
|
141
|
+
* This will be used in the `@module` tag as well as the import path for the module, e.g. `storm:<name>`.
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```ts
|
|
145
|
+
* import { MyModule } from "powerlines:my-module";
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
name: Children;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Generates a TSDoc `@module` tag for the given module name.
|
|
152
|
+
*/
|
|
153
|
+
declare function TSDocModule(props: TSDocModuleProps): Children;
|
|
154
|
+
declare type __ΩTSDocProps = any[];
|
|
155
|
+
declare type __ΩTSDocTagProps = any[];
|
|
156
|
+
declare type __ΩTSDocParamsProps = any[];
|
|
157
|
+
declare type __ΩTSDocDefaultValueProps = any[];
|
|
158
|
+
declare type __ΩTSDocExampleProps = any[];
|
|
159
|
+
declare type __ΩTSDocAttributesTagsProps = any[];
|
|
160
|
+
declare type __ΩTSDocParamProps = any[];
|
|
161
|
+
declare type __ΩTSDocModuleProps = any[];
|
|
162
|
+
//#endregion
|
|
163
|
+
export { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle, __ΩTSDocAttributesTagsProps, __ΩTSDocDefaultValueProps, __ΩTSDocExampleProps, __ΩTSDocModuleProps, __ΩTSDocParamProps, __ΩTSDocParamsProps, __ΩTSDocProps, __ΩTSDocTagProps };
|
|
164
|
+
//# sourceMappingURL=tsdoc.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsdoc.d.cts","names":[],"sources":["../../../src/typescript/components/tsdoc.tsx"],"sourcesContent":[],"mappings":";;;;;;UAyCiB,UAAA,SAAmB;YACxB;AADZ;AAOA;AA2BA;AAOA;AAgBiB,iBAlDD,KAAA,CAkDiB,KAAA,EAlDJ,UAmDf,CAAA,EAnDyB,QAmDN;AAMjB,UA9BC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AkB,kBAAe;;;;iBAiDjC,YAAA,QAAoB,iBAAc;;;;iBAOlC,WAAA,QAAmB,iBAAc;UAIhC,gBAAA,SAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;QA2BlC;;;;;iBAMQ,WAAA,QAAmB,mBAAgB"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
+
import { Children } from "@alloy-js/core";
|
|
3
|
+
import { ReflectionKind, ReflectionParameter, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
|
+
import { JSDocExampleProps, ParameterDescriptor } from "@alloy-js/typescript";
|
|
5
|
+
|
|
6
|
+
//#region src/typescript/components/tsdoc.d.ts
|
|
7
|
+
interface TSDocProps extends ComponentProps {
|
|
8
|
+
heading?: Children;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Generates a TypeScript interface for the given reflection class.
|
|
12
|
+
*/
|
|
13
|
+
declare function TSDoc(props: TSDocProps): Children;
|
|
14
|
+
interface TSDocTagProps extends ComponentProps {
|
|
15
|
+
tag: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create a TSDoc `@<props.tag>` tag.
|
|
19
|
+
*/
|
|
20
|
+
declare function TSDocTag(props: TSDocTagProps): Children;
|
|
21
|
+
interface TSDocParamsProps {
|
|
22
|
+
parameters: ParameterDescriptor[] | string[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A component that creates a TSDoc block with `@param` tags for each parameter.
|
|
26
|
+
*/
|
|
27
|
+
declare function TSDocParams(props: TSDocParamsProps): Children;
|
|
28
|
+
/**
|
|
29
|
+
* Create a TSDoc `@title` tag.
|
|
30
|
+
*/
|
|
31
|
+
declare function TSDocTitle(props: ComponentProps): Children;
|
|
32
|
+
/**
|
|
33
|
+
* Create a TSDoc `@domain` tag.
|
|
34
|
+
*/
|
|
35
|
+
declare function TSDocDomain(props: ComponentProps): Children;
|
|
36
|
+
/**
|
|
37
|
+
* Create a TSDoc `@alias` tag.
|
|
38
|
+
*/
|
|
39
|
+
declare function TSDocAlias(props: ComponentProps): Children;
|
|
40
|
+
/**
|
|
41
|
+
* Create a TSDoc `@permission` tag.
|
|
42
|
+
*/
|
|
43
|
+
declare function TSDocPermission(props: ComponentProps): Children;
|
|
44
|
+
interface TSDocDefaultValueProps extends ComponentProps {
|
|
45
|
+
type: ReflectionKind | ReflectionProperty | ReflectionParameter;
|
|
46
|
+
defaultValue: any;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Create a TSDoc `@defaultValue` tag.
|
|
50
|
+
*/
|
|
51
|
+
declare function TSDocDefaultValue(props: TSDocDefaultValueProps): Children;
|
|
52
|
+
/**
|
|
53
|
+
* Create a TSDoc `@remarks` tag.
|
|
54
|
+
*/
|
|
55
|
+
declare function TSDocRemarks(props: ComponentProps): Children;
|
|
56
|
+
/**
|
|
57
|
+
* Create a TSDoc `@see` tag.
|
|
58
|
+
*/
|
|
59
|
+
declare function TSDocLink(props: ComponentProps): Children;
|
|
60
|
+
interface TSDocExampleProps extends JSDocExampleProps {
|
|
61
|
+
/**
|
|
62
|
+
* Whether the file is a TSX file.
|
|
63
|
+
*
|
|
64
|
+
* @defaultValue false
|
|
65
|
+
*/
|
|
66
|
+
tsx?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create a TSDoc `@example` tag.
|
|
70
|
+
*/
|
|
71
|
+
declare function TSDocExample(props: TSDocExampleProps): Children;
|
|
72
|
+
/**
|
|
73
|
+
* Create a TSDoc `@readonly` tag.
|
|
74
|
+
*/
|
|
75
|
+
declare function TSDocReadonly(): Children;
|
|
76
|
+
/**
|
|
77
|
+
* Create a TSDoc `@internal` tag.
|
|
78
|
+
*/
|
|
79
|
+
declare function TSDocInternal(): Children;
|
|
80
|
+
/**
|
|
81
|
+
* Create a TSDoc `@ignore` tag.
|
|
82
|
+
*/
|
|
83
|
+
declare function TSDocIgnore(): Children;
|
|
84
|
+
/**
|
|
85
|
+
* Create a TSDoc `@hidden` tag.
|
|
86
|
+
*/
|
|
87
|
+
declare function TSDocHidden(): Children;
|
|
88
|
+
interface TSDocAttributesTagsProps {
|
|
89
|
+
type?: ReflectionKind | ReflectionProperty | ReflectionParameter;
|
|
90
|
+
title?: string;
|
|
91
|
+
alias?: string[];
|
|
92
|
+
permission?: string[];
|
|
93
|
+
domain?: string;
|
|
94
|
+
readonly?: boolean;
|
|
95
|
+
internal?: boolean;
|
|
96
|
+
ignore?: boolean;
|
|
97
|
+
hidden?: boolean;
|
|
98
|
+
defaultValue?: any;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
102
|
+
*/
|
|
103
|
+
declare function TSDocAttributesTags(props: TSDocAttributesTagsProps): Children;
|
|
104
|
+
interface TSDocParamProps {
|
|
105
|
+
name: Children;
|
|
106
|
+
children?: Children;
|
|
107
|
+
optional?: boolean;
|
|
108
|
+
defaultValue?: Children;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Create a TSDoc parameter set off with `@param`.
|
|
112
|
+
*/
|
|
113
|
+
declare function TSDocParam(props: TSDocParamProps): Children;
|
|
114
|
+
/**
|
|
115
|
+
* Create a TSDoc `@returns` tag.
|
|
116
|
+
*/
|
|
117
|
+
declare function TSDocReturns(props: ComponentProps): Children;
|
|
118
|
+
/**
|
|
119
|
+
* Create a TSDoc `@throws` tag.
|
|
120
|
+
*/
|
|
121
|
+
declare function TSDocThrows(props: ComponentProps): Children;
|
|
122
|
+
interface TSDocModuleProps extends ComponentProps {
|
|
123
|
+
/**
|
|
124
|
+
* The prefix for the builtin module name
|
|
125
|
+
*
|
|
126
|
+
* @remarks
|
|
127
|
+
* This value is populated from the Powerlines configuration output builtin prefix by default.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* /**
|
|
132
|
+
* @module powerlines:my-module
|
|
133
|
+
* \/
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
prefix?: string;
|
|
137
|
+
/**
|
|
138
|
+
* The name of the module
|
|
139
|
+
*
|
|
140
|
+
* @remarks
|
|
141
|
+
* This will be used in the `@module` tag as well as the import path for the module, e.g. `storm:<name>`.
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```ts
|
|
145
|
+
* import { MyModule } from "powerlines:my-module";
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
name: Children;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Generates a TSDoc `@module` tag for the given module name.
|
|
152
|
+
*/
|
|
153
|
+
declare function TSDocModule(props: TSDocModuleProps): Children;
|
|
154
|
+
declare type __ΩTSDocProps = any[];
|
|
155
|
+
declare type __ΩTSDocTagProps = any[];
|
|
156
|
+
declare type __ΩTSDocParamsProps = any[];
|
|
157
|
+
declare type __ΩTSDocDefaultValueProps = any[];
|
|
158
|
+
declare type __ΩTSDocExampleProps = any[];
|
|
159
|
+
declare type __ΩTSDocAttributesTagsProps = any[];
|
|
160
|
+
declare type __ΩTSDocParamProps = any[];
|
|
161
|
+
declare type __ΩTSDocModuleProps = any[];
|
|
162
|
+
//#endregion
|
|
163
|
+
export { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle, __ΩTSDocAttributesTagsProps, __ΩTSDocDefaultValueProps, __ΩTSDocExampleProps, __ΩTSDocModuleProps, __ΩTSDocParamProps, __ΩTSDocParamsProps, __ΩTSDocProps, __ΩTSDocTagProps };
|
|
164
|
+
//# s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;;;;;iBAY3B,YAAA,QAAoB,oBAAiB;;;;iBA4BrC,aAAA,CAAA,GAAa;;;;iBAOb,aAAA,CAAA,GAAa;;;;iBAOb,WAAA,CAAA,GAAW;;;;iBAOX,WAAA,CAAA,GAAW;UAIV,wBAAA;SACR,iBAAiB,qBAAqB;;;;;;;;;;;;;;iBAe/B,mBAAA,QAA2B,2BAAwB;UA8ElD,eAAA;QACT;aACK;;iBAEI;;;;;iBAMD,UAAA,QAAkB,kBAAe;;;;iBAiDjC,YAAA,QAAoB,iBAAc;;;;iBAOlC,WAAA,QAAmB,iBAAc;UAIhC,gBAAA,SAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;QA2BlC;;;;;iBAMQ,WAAA,QAAmB,mBAAgB"}
|
|
@@ -453,4 +453,5 @@ function TSDocModule(props) {
|
|
|
453
453
|
}
|
|
454
454
|
|
|
455
455
|
//#endregion
|
|
456
|
-
export { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocDefaultValue, TSDocDomain, TSDocExample, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocParam, TSDocParams, TSDocPermission, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocTag, TSDocThrows, TSDocTitle };
|
|
456
|
+
export { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocDefaultValue, TSDocDomain, TSDocExample, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocParam, TSDocParams, TSDocPermission, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocTag, TSDocThrows, TSDocTitle };
|
|
457
|
+
//# sourceMappingURL=tsdoc.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsdoc.mjs","names":["childrenArray","computed","For","List","Prose","Show","splitProps","stringifyDefaultValue","isSetString","isUndefined","Spacing","usePowerlinesSafe","TSDoc","props","children","heading","_$createIntrinsic","string","_$createComponent","when","_$memo","filter","Boolean","length","TSDocTag","tag","width","TSDocParams","parameters","normalizeParametersForDoc","each","param","TSDocParam","name","optional","doc","some","p","TSDocTitle","rest","_$mergeProps","TSDocDomain","TSDocAlias","TSDocPermission","TSDocDefaultValue","type","defaultValue","TSDocRemarks","hardline","TSDocLink","TSDocExample","tsx","fenced","language","TSDocReadonly","TSDocInternal","TSDocIgnore","TSDocHidden","TSDocAttributesTags","alias","permission","readonly","internal","ignore","hidden","title","trim","domain","value","a","TSDocParamName","TSDocParamDescription","TSDocReturns","TSDocThrows","TSDocModule","prefix","context","config","framework"],"sources":["../../../src/typescript/components/tsdoc.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Children,\n childrenArray,\n computed,\n For,\n List,\n Prose,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport { JSDocExampleProps, ParameterDescriptor } from \"@alloy-js/typescript\";\nimport { stringifyDefaultValue } from \"@powerlines/deepkit/utilities\";\nimport {\n ReflectionKind,\n ReflectionParameter,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { Spacing } from \"../../core/components/spacing\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport interface TSDocProps extends ComponentProps {\n heading?: Children;\n}\n\n/**\n * Generates a TypeScript interface for the given reflection class.\n */\nexport function TSDoc(props: TSDocProps) {\n const [{ children, heading }] = splitProps(props, [\"children\", \"heading\"]);\n\n return (\n <>\n /**\n <align string=\" * \">\n <hbr />\n <Show when={!isUndefined(heading)}>{heading}</Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={!isUndefined(heading)}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </align>\n <hbr />\n {`*/`}\n <hbr />\n </>\n );\n}\n\nexport interface TSDocTagProps extends ComponentProps {\n tag: string;\n}\n\n/**\n * Create a TSDoc `@<props.tag>` tag.\n */\nexport function TSDocTag(props: TSDocTagProps) {\n const [{ children, tag }] = splitProps(props, [\"children\", \"tag\"]);\n\n return (\n <>\n {`@${tag} `}\n <Show when={Boolean(children)}>\n <align width={2}>\n <Prose>{children}</Prose>\n </align>\n </Show>\n <sbr />\n </>\n );\n}\n\nexport interface TSDocParamsProps {\n parameters: ParameterDescriptor[] | string[];\n}\n\n/**\n * A component that creates a TSDoc block with `@param` tags for each parameter.\n */\nexport function TSDocParams(props: TSDocParamsProps) {\n const parameters = normalizeParametersForDoc(props.parameters);\n\n return (\n <For each={parameters}>\n {param => (\n <TSDocParam name={param.name} optional={param.optional}>\n {param.doc}\n </TSDocParam>\n )}\n </For>\n );\n}\n\nfunction normalizeParametersForDoc(\n parameters: ParameterDescriptor[] | string[]\n): ParameterDescriptor[] {\n if (parameters.some(p => typeof p === \"string\")) {\n return [];\n }\n\n return parameters as ParameterDescriptor[];\n}\n\n/**\n * Create a TSDoc `@title` tag.\n */\nexport function TSDocTitle(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"title\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@domain` tag.\n */\nexport function TSDocDomain(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"domain\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@alias` tag.\n */\nexport function TSDocAlias(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"alias\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@permission` tag.\n */\nexport function TSDocPermission(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"permission\">\n {children}\n </TSDocTag>\n );\n}\n\nexport interface TSDocDefaultValueProps extends ComponentProps {\n type: ReflectionKind | ReflectionProperty | ReflectionParameter;\n defaultValue: any;\n}\n\n/**\n * Create a TSDoc `@defaultValue` tag.\n */\nexport function TSDocDefaultValue(props: TSDocDefaultValueProps) {\n const [{ type, defaultValue }] = splitProps(props, [\"type\", \"defaultValue\"]);\n\n return (\n <>\n {\"@defaultValue \"}\n <Show when={!isUndefined(defaultValue)}>\n <align width={2}>\n <Prose>{stringifyDefaultValue(type, defaultValue)}</Prose>\n </align>\n </Show>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@remarks` tag.\n */\nexport function TSDocRemarks(props: ComponentProps) {\n return (\n <>\n {\"@remarks \"}\n <hbr />\n <List hardline={true}>{childrenArray(() => props.children)}</List>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@see` tag.\n */\nexport function TSDocLink(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"see\" />;\n}\n\nexport interface TSDocExampleProps extends JSDocExampleProps {\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n}\n\n/**\n * Create a TSDoc `@example` tag.\n */\nexport function TSDocExample(props: TSDocExampleProps) {\n const [{ tsx, fenced = true, language, children }] = splitProps(props, [\n \"tsx\",\n \"fenced\",\n \"language\",\n \"children\"\n ]);\n\n return (\n <>\n {\"@example \"}\n <hbr />\n <Show when={fenced}>\n ```{language || (tsx ? \"tsx\" : \"ts\")}\n <hbr />\n </Show>\n {children}\n <Show when={fenced}>\n <hbr />\n ```\n </Show>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@readonly` tag.\n */\nexport function TSDocReadonly() {\n return <TSDocTag tag=\"readonly\" />;\n}\n\n/**\n * Create a TSDoc `@internal` tag.\n */\nexport function TSDocInternal() {\n return <TSDocTag tag=\"internal\" />;\n}\n\n/**\n * Create a TSDoc `@ignore` tag.\n */\nexport function TSDocIgnore() {\n return <TSDocTag tag=\"ignore\" />;\n}\n\n/**\n * Create a TSDoc `@hidden` tag.\n */\nexport function TSDocHidden() {\n return <TSDocTag tag=\"hidden\" />;\n}\n\nexport interface TSDocAttributesTagsProps {\n type?: ReflectionKind | ReflectionProperty | ReflectionParameter;\n title?: string;\n alias?: string[];\n permission?: string[];\n domain?: string;\n readonly?: boolean;\n internal?: boolean;\n ignore?: boolean;\n hidden?: boolean;\n defaultValue?: any;\n}\n\n/**\n * Generates a TypeScript interface property for the given reflection class.\n */\nexport function TSDocAttributesTags(props: TSDocAttributesTagsProps) {\n const [\n {\n type,\n alias,\n permission,\n readonly,\n internal,\n ignore,\n hidden,\n defaultValue\n }\n ] = splitProps(props, [\n \"type\",\n \"alias\",\n \"permission\",\n \"readonly\",\n \"internal\",\n \"ignore\",\n \"hidden\",\n \"defaultValue\"\n ]);\n\n const title = computed(() => props.title?.trim() || \"\");\n const domain = computed(() => props.domain?.trim() || \"\");\n\n return (\n <>\n <Show when={isSetString(title.value)}>\n <TSDocTitle>{title.value}</TSDocTitle>\n </Show>\n <Show\n when={\n !isUndefined(alias) &&\n alias.length > 0 &&\n alias.some(a => isSetString(a?.trim()))\n }>\n <For each={alias?.filter(a => isSetString(a?.trim())) ?? []}>\n {alias => <TSDocAlias>{alias}</TSDocAlias>}\n </For>\n </Show>\n <Show when={isSetString(domain.value)}>\n <TSDocDomain>{domain.value}</TSDocDomain>\n </Show>\n <Show\n when={\n !isUndefined(permission) &&\n permission.length > 0 &&\n permission.some(p => isSetString(p?.trim()))\n }>\n <For each={permission?.filter(p => isSetString(p?.trim())) ?? []}>\n {permission => <TSDocPermission>{permission}</TSDocPermission>}\n </For>\n </Show>\n <Show when={readonly === true}>\n <TSDocReadonly />\n </Show>\n <Show when={internal === true}>\n <TSDocInternal />\n </Show>\n <Show when={ignore === true}>\n <TSDocIgnore />\n </Show>\n <Show when={hidden === true}>\n <TSDocHidden />\n </Show>\n <Show when={!isUndefined(type) && !isUndefined(defaultValue)}>\n <TSDocDefaultValue\n type={\n type as ReflectionKind | ReflectionProperty | ReflectionParameter\n }\n defaultValue={defaultValue}\n />\n </Show>\n </>\n );\n}\n\nexport interface TSDocParamProps {\n name: Children;\n children?: Children;\n optional?: boolean;\n defaultValue?: Children;\n}\n\n/**\n * Create a TSDoc parameter set off with `@param`.\n */\nexport function TSDocParam(props: TSDocParamProps) {\n return (\n <>\n {\"@param \"}\n <TSDocParamName\n name={props.name}\n optional={props.optional}\n defaultValue={props.defaultValue}\n />\n <TSDocParamDescription children={props.children} />\n </>\n );\n}\n\ninterface TSDocParamNameProps {\n name: Children;\n optional?: boolean;\n defaultValue?: Children;\n}\n\nfunction TSDocParamName(props: TSDocParamNameProps) {\n return (\n <>\n <Show when={props.optional}>{\"[\"}</Show>\n {props.name}\n <Show when={Boolean(props.defaultValue)}>={props.defaultValue}</Show>\n <Show when={props.optional}>{\"]\"}</Show>\n </>\n );\n}\n\ninterface TSDocParamDescriptionProps {\n children?: Children;\n}\n\nfunction TSDocParamDescription(props: TSDocParamDescriptionProps) {\n return (\n <Show when={Boolean(props.children)}>\n {\" - \"}\n <align width={2}>\n <Prose>{props.children}</Prose>\n </align>\n </Show>\n );\n}\n\n/**\n * Create a TSDoc `@returns` tag.\n */\nexport function TSDocReturns(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"returns\" />;\n}\n\n/**\n * Create a TSDoc `@throws` tag.\n */\nexport function TSDocThrows(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"throws\" />;\n}\n\nexport interface TSDocModuleProps extends ComponentProps {\n /**\n * The prefix for the builtin module name\n *\n * @remarks\n * This value is populated from the Powerlines configuration output builtin prefix by default.\n *\n * @example\n * ```ts\n * /**\n * @module powerlines:my-module\n * \\/\n * ```\n */\n prefix?: string;\n\n /**\n * The name of the module\n *\n * @remarks\n * This will be used in the `@module` tag as well as the import path for the module, e.g. `storm:<name>`.\n *\n * @example\n * ```ts\n * import { MyModule } from \"powerlines:my-module\";\n * ```\n */\n name: Children;\n}\n\n/**\n * Generates a TSDoc `@module` tag for the given module name.\n */\nexport function TSDocModule(props: TSDocModuleProps) {\n const [{ children, name, prefix }] = splitProps(props, [\n \"children\",\n \"name\",\n \"prefix\"\n ]);\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n /**\n <align string=\" * \">\n <hbr />\n <Show when={Boolean(children)}>\n <List hardline={true}>{childrenArray(() => children)}</List>\n <Spacing />\n </Show>\n {\"@module \"}\n {prefix || context?.config?.framework || \"powerlines\"}:{name}\n </align>\n <hbr />\n {` */`}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiIA;EAAA,gBAAA,OAAA,EAAA,CAAA;EAAA;;;;;SAeA,SAAA,OAAA;OAAA,CAAA,EAAA,UAAA,SAAA,WAAA,OAAA,CAAA,YAAA,MAAA,CAAA;AAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;wBAgCe,KAAA;EAAA;EAAA,WAAA,UAAA;;;;;;;;;;;;;SAc+D,0BAAA;KAKlC,WAAA,MAAA,MAAA,OAAA,MAAA,SAAA,CAAA,QAAA,EAAA;;;;;;SAO5C,WAAA,OAAA;CAAA,MAAA,CAAA,EAAA,YAAA,QAAA,WAAA,OAAA,CAAA,WAAA,CAAA;wBAKoD,UAAA,WAAA,MAAA;EAAA,KAAA;EAAA;EAAA,CAAA,CAAA;;;;;SAQpD,YAAA,OAAA;CAAA,MAAA,CAAA,EAAA,YAAA,QAAA,WAAA,OAAA,CAAA,WAAA,CAAA;wBAKiD,UAAA,WAAA,MAAA;EAAA,KAAA;EAAA;EAAA,CAA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A,MAAA;;GAAA,CAAA;EAAA,uCAAA,EAAA,IAAA,WAAA;AAAA,UAAA,MAAA;KAAA,CAAA;EAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as _alloy_js_core22 from "@alloy-js/core";
|
|
2
|
+
import { CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
3
|
+
|
|
4
|
+
//#region src/typescript/components/type-declaration.d.ts
|
|
5
|
+
interface TypeDeclarationProps extends CommonDeclarationProps {
|
|
6
|
+
/**
|
|
7
|
+
* The generic type parameters of the interface.
|
|
8
|
+
*/
|
|
9
|
+
typeParameters?: TypeParameterDescriptor[] | string[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Renders a TypeScript type declaration, including its name, optional TSDoc comment, and generic type parameters.
|
|
13
|
+
*/
|
|
14
|
+
declare const TypeDeclaration: _alloy_js_core22.Component<TypeDeclarationProps>;
|
|
15
|
+
declare type __ΩTypeDeclarationProps = any[];
|
|
16
|
+
//#endregion
|
|
17
|
+
export { TypeDeclaration, TypeDeclarationProps, __ΩTypeDeclarationProps };
|
|
18
|
+
//# sourceMappingURL=type-declaration.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-declaration.d.cts","names":[],"sources":["../../../src/typescript/components/type-declaration.tsx"],"sourcesContent":[],"mappings":";;;;UA4BiB,oBAAA,SAA6B;;;AAA9C;EAUa,cAAA,CAAA,EANM,uBAMS,EAAA,GAAA,MAAA,EAAA;;;;;cAAf,iBAAe,gBAAA,CAAA,UAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as _alloy_js_core9 from "@alloy-js/core";
|
|
2
|
+
import { CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
3
|
+
|
|
4
|
+
//#region src/typescript/components/type-declaration.d.ts
|
|
5
|
+
interface TypeDeclarationProps extends CommonDeclarationProps {
|
|
6
|
+
/**
|
|
7
|
+
* The generic type parameters of the interface.
|
|
8
|
+
*/
|
|
9
|
+
typeParameters?: TypeParameterDescriptor[] | string[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Renders a TypeScript type declaration, including its name, optional TSDoc comment, and generic type parameters.
|
|
13
|
+
*/
|
|
14
|
+
declare const TypeDeclaration: _alloy_js_core9.Component<TypeDeclarationProps>;
|
|
15
|
+
declare type __ΩTypeDeclarationProps = any[];
|
|
16
|
+
//#endregion
|
|
17
|
+
export { TypeDeclaration, TypeDeclarationProps, __ΩTypeDeclarationProps };
|
|
18
|
+
//# sourceMappingURL=type-declaration.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/type-declaration.tsx"],"sourcesContent":[],"mappings":";;;;UA4BiB,oBAAA,SAA6B;;;AAA9C;EAUa,cAAA,CAAA,EANM,uBAMS,EAAA,GAAA,MAAA,EAAA;;;;;cAAf,iBAAe,eAAA,CAAA,UAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-declaration.mjs","names":["Name","Show","Declaration","ensureTypeRefContext","TSDoc","TypeParameters","TypeDeclaration","props","children","doc","typeParameters","rest","_$createComponent","when","Boolean","heading","_$mergeProps","kind","nameKind","_$memo","parameters"],"sources":["../../../src/typescript/components/type-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Name, Show } from \"@alloy-js/core\";\nimport {\n CommonDeclarationProps,\n Declaration,\n ensureTypeRefContext,\n TypeParameterDescriptor\n} from \"@alloy-js/typescript\";\nimport { TSDoc } from \"./tsdoc\";\nimport { TypeParameters } from \"./type-parameters\";\n\nexport interface TypeDeclarationProps extends CommonDeclarationProps {\n /**\n * The generic type parameters of the interface.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n}\n\n/**\n * Renders a TypeScript type declaration, including its name, optional TSDoc comment, and generic type parameters.\n */\nexport const TypeDeclaration = ensureTypeRefContext(function TypeDeclaration(\n props: TypeDeclarationProps\n) {\n const { children, doc, typeParameters, ...rest } = props;\n\n return (\n <>\n <Show when={Boolean(doc)}>\n <TSDoc heading={doc} />\n </Show>\n <Declaration {...rest} kind=\"type\" nameKind=\"type\">\n type <Name />\n {typeParameters && (\n <TypeParameters parameters={typeParameters} />\n )} = {children};\n </Declaration>\n </>\n );\n});\n"],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Children } from "@alloy-js/core";
|
|
2
|
+
import { TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
3
|
+
|
|
4
|
+
//#region src/typescript/components/type-parameters.d.ts
|
|
5
|
+
/** Props for type parameters */
|
|
6
|
+
interface TypeParametersProps {
|
|
7
|
+
/** Parameters */
|
|
8
|
+
parameters?: TypeParameterDescriptor[] | string[];
|
|
9
|
+
/** Jsx Children */
|
|
10
|
+
children?: Children;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Represent type parameters
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* <A, B extends string>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare function TypeParameters(props: TypeParametersProps): Children;
|
|
21
|
+
declare type __ΩTypeParametersProps = any[];
|
|
22
|
+
//#endregion
|
|
23
|
+
export { TypeParameters, TypeParametersProps, __ΩTypeParametersProps };
|
|
24
|
+
//# sourceMappingURL=type-parameters.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-parameters.d.cts","names":[],"sources":["../../../src/typescript/components/type-parameters.tsx"],"sourcesContent":[],"mappings":";;;;;UAsBiB,mBAAA;EAAA;EAyCD,UAAA,CAAA,EAvCD,uBAuCuB,EAAA,GAAA,MAAA,EAAA;;aArCzB;;;;;;;;;;iBAqCG,cAAA,QAAsB,sBAAmB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Children } from "@alloy-js/core";
|
|
2
|
+
import { TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
3
|
+
|
|
4
|
+
//#region src/typescript/components/type-parameters.d.ts
|
|
5
|
+
/** Props for type parameters */
|
|
6
|
+
interface TypeParametersProps {
|
|
7
|
+
/** Parameters */
|
|
8
|
+
parameters?: TypeParameterDescriptor[] | string[];
|
|
9
|
+
/** Jsx Children */
|
|
10
|
+
children?: Children;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Represent type parameters
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* <A, B extends string>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare function TypeParameters(props: TypeParametersProps): Children;
|
|
21
|
+
declare type __ΩTypeParametersProps = any[];
|
|
22
|
+
//#endregion
|
|
23
|
+
export { TypeParameters, TypeParametersProps, __ΩTypeParametersProps };
|
|
24
|
+
//# sourceMappingURL=type-parameters.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-parameters.d.mts","names":[],"sources":["../../../src/typescript/components/type-parameters.tsx"],"sourcesContent":[],"mappings":";;;;;UAsBiB,mBAAA;EAAA;EAyCD,UAAA,CAAA,EAvCD,uBAuCuB,EAAA,GAAA,MAAA,EAAA;;aArCzB;;;;;;;;;;iBAqCG,cAAA,QAAsB,sBAAmB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-parameters.mjs","names":["For","Indent","Show","TypeRefContext","typeParameter","param","_$createComponent","when","fallback","children","_$createIntrinsic","_$memo","name","extends","default","TypeParameters","props","parameters","undefined","softline","each","comma","line"],"sources":["../../../src/typescript/components/type-parameters.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Children, For, Indent, Show } from \"@alloy-js/core\";\nimport { TypeParameterDescriptor, TypeRefContext } from \"@alloy-js/typescript\";\n\n/** Props for type parameters */\nexport interface TypeParametersProps {\n /** Parameters */\n parameters?: TypeParameterDescriptor[] | string[];\n /** Jsx Children */\n children?: Children;\n}\n\nfunction typeParameter(param: TypeParameterDescriptor | string) {\n return (\n <Show when={typeof param === \"object\"} fallback={<>{param}</>}>\n <group>\n {(param as TypeParameterDescriptor).name}\n <Show when={!!(param as TypeParameterDescriptor).extends}>\n {\" \"}\n extends\n <indent>\n {\" \"}\n <TypeRefContext>\n {(param as TypeParameterDescriptor).extends}\n </TypeRefContext>\n </indent>\n </Show>\n <Show when={!!(param as TypeParameterDescriptor).default}>\n {\" = \"}\n <TypeRefContext>\n {(param as TypeParameterDescriptor).default}\n </TypeRefContext>\n </Show>\n </group>{\" \"}\n </Show>\n );\n}\n\n/**\n * Represent type parameters\n *\n * @example\n * ```ts\n * <A, B extends string>\n * ```\n */\nexport function TypeParameters(props: TypeParametersProps) {\n if (props.children) {\n return props.children;\n }\n\n if (!props.parameters) {\n return undefined;\n }\n\n return (\n <>\n {\"<\"}\n <group>\n <Indent softline>\n <For each={props.parameters} comma line>\n {param => typeParameter(param)}\n </For>\n <ifBreak>,</ifBreak>\n </Indent>\n </group>\n {\">\"}\n </>\n );\n}\n"],"mappings":";;;;;;SA+B6D,cAAA,OAAA;8BAAA;EAAA,MAAA,OAAA,UAAA;EAAA,IAAA,WAAA;AAAA,UAAA,CAAA,MAAA;;EAAA,IAAA,WAAA;AAAA,UAAA,CAAA,gBAAA,SAAA,EAAA,IAAA,WAAA;AAAA,WAAA;KAAA,WAAA,MAEbM,KAAAA;KAAAA,sBACnC;MAAA,IAAA,OAAA;AAAA,cAAA,CAAA,CAAA,MAAA;;MAAA,IAAA,WAAA;AAAA,cAAA;;QAAA;QAAA,gBAAA,UAAA,EAAA,IAAA,WAAA;AAAA,gBAAA,MAAA,gCAAA,EAAA,IAAA,WAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKAH;EAAAA,gBAAAA,SAAAA,EAAAA,IAAAA,WAAAA;AAAAA,UAAAA;;;;;;;;;;;;;;EAC4C;EAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ComponentProps, SourceFileHeaderProps, TypescriptFileImports } from "../../types/components.cjs";
|
|
2
|
+
import { SourceFileProps as SourceFileProps$1 } from "../../core/components/source-file.cjs";
|
|
3
|
+
import { Children } from "@alloy-js/core";
|
|
4
|
+
import { TSModuleScope } from "@alloy-js/typescript";
|
|
5
|
+
|
|
6
|
+
//#region src/typescript/components/typescript-file.d.ts
|
|
7
|
+
type TypescriptFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps & {
|
|
8
|
+
hashbang?: Children | true;
|
|
9
|
+
header?: Children;
|
|
10
|
+
imports?: TypescriptFileImports;
|
|
11
|
+
builtinImports?: TypescriptFileImports;
|
|
12
|
+
export?: boolean | string;
|
|
13
|
+
tsx?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A base component representing a Powerlines generated Typescript source file.
|
|
17
|
+
*
|
|
18
|
+
* @param props - The properties for the source file.
|
|
19
|
+
* @returns The rendered source file component.
|
|
20
|
+
*/
|
|
21
|
+
declare function TypescriptFile(props: TypescriptFileProps): Children;
|
|
22
|
+
interface TypescriptFileHeaderProps extends SourceFileHeaderProps {
|
|
23
|
+
header?: Children;
|
|
24
|
+
hashbang?: Children | true;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
28
|
+
*
|
|
29
|
+
* @param props - The properties for the source file header.
|
|
30
|
+
* @returns The rendered source file header.
|
|
31
|
+
*/
|
|
32
|
+
declare function TypescriptFileHeader(props: TypescriptFileHeaderProps): Children;
|
|
33
|
+
interface TypescriptFileHeaderImportsProps extends SourceFileHeaderProps {
|
|
34
|
+
imports?: TypescriptFileImports;
|
|
35
|
+
builtinImports?: TypescriptFileImports;
|
|
36
|
+
scope?: TSModuleScope;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
40
|
+
*
|
|
41
|
+
* @param props - The properties for the source file header.
|
|
42
|
+
* @returns The rendered source file header.
|
|
43
|
+
*/
|
|
44
|
+
declare function TypescriptFileHeaderImports(props: TypescriptFileHeaderImportsProps): Children;
|
|
45
|
+
declare type __ΩTypescriptFileProps = any[];
|
|
46
|
+
declare type __ΩTypescriptFileHeaderProps = any[];
|
|
47
|
+
declare type __ΩTypescriptFileHeaderImportsProps = any[];
|
|
48
|
+
//#endregion
|
|
49
|
+
export { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps, __ΩTypescriptFileHeaderImportsProps, __ΩTypescriptFileHeaderProps, __ΩTypescriptFileProps };
|
|
50
|
+
//# sourceMappingURL=typescript-file.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-file.d.cts","names":[],"sources":["../../../src/typescript/components/typescript-file.tsx"],"sourcesContent":[],"mappings":";;;;;;KAsDY,mBAAA,GAAsB,KAAK,iCACrC;aACa;EAFH,MAAA,CAAA,EAGC,QAHD;EAA2B,OAAA,CAAA,EAIzB,qBAJyB;EAAL,cAAA,CAAA,EAKb,qBALa;EAChC,MAAA,CAAA,EAAA,OAAA,GAAA,MAAA;EACa,GAAA,CAAA,EAAA,OAAA;CACF;;;;AAab;AAgEA;;AAEa,iBAlEG,cAAA,CAkEH,KAAA,EAlEyB,mBAkEzB,CAAA,EAlE4C,QAkE5C;AAFsC,UAAlC,yBAAA,SAAkC,qBAAA,CAAA;EAAqB,MAAA,CAAA,EAC7D,QAD6D;EAWxD,QAAA,CAAA,EATH,QASG,GAAA,IAAoB;AAqEpC;;;;;;AAYA;iBAjFgB,oBAAA,QAA4B,4BAAyB;UAqEpD,gCAAA,SAAyC;YAC9C;mBACO;UACT;;;;;;;;iBASM,2BAAA,QACP,mCAAgC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ComponentProps, SourceFileHeaderProps, TypescriptFileImports } from "../../types/components.mjs";
|
|
2
|
+
import { SourceFileProps as SourceFileProps$1 } from "../../core/components/source-file.mjs";
|
|
3
|
+
import { Children } from "@alloy-js/core";
|
|
4
|
+
import { TSModuleScope } from "@alloy-js/typescript";
|
|
5
|
+
|
|
6
|
+
//#region src/typescript/components/typescript-file.d.ts
|
|
7
|
+
type TypescriptFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps & {
|
|
8
|
+
hashbang?: Children | true;
|
|
9
|
+
header?: Children;
|
|
10
|
+
imports?: TypescriptFileImports;
|
|
11
|
+
builtinImports?: TypescriptFileImports;
|
|
12
|
+
export?: boolean | string;
|
|
13
|
+
tsx?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A base component representing a Powerlines generated Typescript source file.
|
|
17
|
+
*
|
|
18
|
+
* @param props - The properties for the source file.
|
|
19
|
+
* @returns The rendered source file component.
|
|
20
|
+
*/
|
|
21
|
+
declare function TypescriptFile(props: TypescriptFileProps): Children;
|
|
22
|
+
interface TypescriptFileHeaderProps extends SourceFileHeaderProps {
|
|
23
|
+
header?: Children;
|
|
24
|
+
hashbang?: Children | true;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
28
|
+
*
|
|
29
|
+
* @param props - The properties for the source file header.
|
|
30
|
+
* @returns The rendered source file header.
|
|
31
|
+
*/
|
|
32
|
+
declare function TypescriptFileHeader(props: TypescriptFileHeaderProps): Children;
|
|
33
|
+
interface TypescriptFileHeaderImportsProps extends SourceFileHeaderProps {
|
|
34
|
+
imports?: TypescriptFileImports;
|
|
35
|
+
builtinImports?: TypescriptFileImports;
|
|
36
|
+
scope?: TSModuleScope;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
40
|
+
*
|
|
41
|
+
* @param props - The properties for the source file header.
|
|
42
|
+
* @returns The rendered source file header.
|
|
43
|
+
*/
|
|
44
|
+
declare function TypescriptFileHeaderImports(props: TypescriptFileHeaderImportsProps): Children;
|
|
45
|
+
declare type __ΩTypescriptFileProps = any[];
|
|
46
|
+
declare type __ΩTypescriptFileHeaderProps = any[];
|
|
47
|
+
declare type __ΩTypescriptFileHeaderImportsProps = any[];
|
|
48
|
+
//#endregion
|
|
49
|
+
export { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps, __ΩTypescriptFileHeaderImportsProps, __ΩTypescriptFileHeaderProps, __ΩTypescriptFileProps };
|
|
50
|
+
//# sourceMappingURL=typescript-file.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-file.d.mts","names":[],"sources":["../../../src/typescript/components/typescript-file.tsx"],"sourcesContent":[],"mappings":";;;;;;KAsDY,mBAAA,GAAsB,KAAK,iCACrC;aACa;EAFH,MAAA,CAAA,EAGC,QAHD;EAA2B,OAAA,CAAA,EAIzB,qBAJyB;EAAL,cAAA,CAAA,EAKb,qBALa;EAChC,MAAA,CAAA,EAAA,OAAA,GAAA,MAAA;EACa,GAAA,CAAA,EAAA,OAAA;CACF;;;;AAab;AAgEA;;AAEa,iBAlEG,cAAA,CAkEH,KAAA,EAlEyB,mBAkEzB,CAAA,EAlE4C,QAkE5C;AAFsC,UAAlC,yBAAA,SAAkC,qBAAA,CAAA;EAAqB,MAAA,CAAA,EAC7D,QAD6D;EAWxD,QAAA,CAAA,EATH,QASG,GAAA,IAAoB;AAqEpC;;;;;;AAYA;iBAjFgB,oBAAA,QAA4B,4BAAyB;UAqEpD,gCAAA,SAAyC;YAC9C;mBACO;UACT;;;;;;;;iBASM,2BAAA,QACP,mCAAgC"}
|
|
@@ -224,4 +224,5 @@ function TypescriptFileHeaderImports(props) {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
//#endregion
|
|
227
|
-
export { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports };
|
|
227
|
+
export { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports };
|
|
228
|
+
//# sourceMappingURL=typescript-file.mjs.map
|