@alloy-js/csharp 0.18.0-dev.24 → 0.18.0-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/Class.d.ts +26 -0
- package/dist/src/components/Class.d.ts.map +1 -0
- package/dist/src/components/{ClassDeclaration.js → Class.js} +38 -70
- package/dist/src/components/ClassMethod.d.ts +5 -44
- package/dist/src/components/ClassMethod.d.ts.map +1 -1
- package/dist/src/components/ClassMethod.js +9 -33
- package/dist/src/components/Enum.d.ts +15 -0
- package/dist/src/components/Enum.d.ts.map +1 -0
- package/dist/src/components/{EnumDeclaration.js → Enum.js} +5 -25
- package/dist/src/components/Parameters.d.ts +13 -0
- package/dist/src/components/Parameters.d.ts.map +1 -0
- package/dist/src/components/Parameters.js +34 -0
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js +0 -1
- package/dist/src/components/index.d.ts +4 -14
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +5 -15
- package/dist/src/components/stc/index.d.ts +2 -2
- package/dist/src/components/stc/index.d.ts.map +1 -1
- package/dist/src/components/stc/index.js +2 -2
- package/dist/src/modifiers.d.ts +4 -10
- package/dist/src/modifiers.d.ts.map +1 -1
- package/dist/src/modifiers.js +32 -9
- package/dist/src/name-policy.d.ts +1 -1
- package/dist/src/name-policy.d.ts.map +1 -1
- package/dist/src/name-policy.js +0 -2
- package/dist/test/class-method.test.js +14 -37
- package/dist/test/class.test.d.ts +2 -0
- package/dist/test/class.test.d.ts.map +1 -0
- package/dist/test/class.test.js +298 -0
- package/dist/test/enum.test.js +12 -12
- package/dist/test/namespace.test.js +8 -8
- package/dist/test/projectdirectory.test.d.ts +2 -0
- package/dist/test/projectdirectory.test.d.ts.map +1 -0
- package/dist/test/{project-directory.test.js → projectdirectory.test.js} +8 -8
- package/dist/test/sourcefile.test.js +4 -4
- package/dist/test/using.test.js +9 -9
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -4
- package/src/components/Class.tsx +149 -0
- package/src/components/ClassMethod.tsx +15 -74
- package/src/components/{EnumDeclaration.tsx → Enum.tsx} +6 -30
- package/src/components/Parameters.tsx +51 -0
- package/src/components/SourceFile.tsx +0 -1
- package/src/components/index.ts +4 -14
- package/src/components/stc/index.ts +2 -2
- package/src/modifiers.ts +42 -25
- package/src/name-policy.ts +0 -5
- package/temp/api.json +1298 -6463
- package/test/class-method.test.tsx +14 -24
- package/test/class.test.tsx +292 -0
- package/test/enum.test.tsx +11 -11
- package/test/namespace.test.tsx +4 -4
- package/test/{project-directory.test.tsx → projectdirectory.test.tsx} +4 -4
- package/test/sourcefile.test.tsx +2 -2
- package/test/using.test.tsx +9 -9
- package/vitest.config.ts +0 -3
- package/dist/src/components/ClassDeclaration.d.ts +0 -92
- package/dist/src/components/ClassDeclaration.d.ts.map +0 -1
- package/dist/src/components/EnumDeclaration.d.ts +0 -34
- package/dist/src/components/EnumDeclaration.d.ts.map +0 -1
- package/dist/src/components/attributes/attributes.d.ts +0 -39
- package/dist/src/components/attributes/attributes.d.ts.map +0 -1
- package/dist/src/components/attributes/attributes.js +0 -62
- package/dist/src/components/attributes/attributes.test.d.ts +0 -2
- package/dist/src/components/attributes/attributes.test.d.ts.map +0 -1
- package/dist/src/components/attributes/attributes.test.js +0 -75
- package/dist/src/components/doc/comment.d.ts +0 -70
- package/dist/src/components/doc/comment.d.ts.map +0 -1
- package/dist/src/components/doc/comment.js +0 -88
- package/dist/src/components/doc/comment.test.d.ts +0 -2
- package/dist/src/components/doc/comment.test.d.ts.map +0 -1
- package/dist/src/components/doc/comment.test.js +0 -348
- package/dist/src/components/doc/from-markdown.d.ts +0 -6
- package/dist/src/components/doc/from-markdown.d.ts.map +0 -1
- package/dist/src/components/doc/from-markdown.js +0 -58
- package/dist/src/components/doc/from-markdown.test.d.ts +0 -2
- package/dist/src/components/doc/from-markdown.test.d.ts.map +0 -1
- package/dist/src/components/doc/from-markdown.test.js +0 -83
- package/dist/src/components/interface/declaration.d.ts +0 -65
- package/dist/src/components/interface/declaration.d.ts.map +0 -1
- package/dist/src/components/interface/declaration.js +0 -83
- package/dist/src/components/interface/declaration.test.d.ts +0 -2
- package/dist/src/components/interface/declaration.test.d.ts.map +0 -1
- package/dist/src/components/interface/declaration.test.js +0 -171
- package/dist/src/components/interface/method.d.ts +0 -50
- package/dist/src/components/interface/method.d.ts.map +0 -1
- package/dist/src/components/interface/method.js +0 -74
- package/dist/src/components/interface/method.test.d.ts +0 -2
- package/dist/src/components/interface/method.test.d.ts.map +0 -1
- package/dist/src/components/interface/method.test.js +0 -300
- package/dist/src/components/interface/property.d.ts +0 -56
- package/dist/src/components/interface/property.d.ts.map +0 -1
- package/dist/src/components/interface/property.js +0 -73
- package/dist/src/components/interface/property.test.d.ts +0 -2
- package/dist/src/components/interface/property.test.d.ts.map +0 -1
- package/dist/src/components/interface/property.test.js +0 -189
- package/dist/src/components/parameters/parameters.d.ts +0 -19
- package/dist/src/components/parameters/parameters.d.ts.map +0 -1
- package/dist/src/components/parameters/parameters.js +0 -43
- package/dist/src/components/property/property.d.ts +0 -80
- package/dist/src/components/property/property.d.ts.map +0 -1
- package/dist/src/components/property/property.js +0 -76
- package/dist/src/components/property/property.test.d.ts +0 -2
- package/dist/src/components/property/property.test.d.ts.map +0 -1
- package/dist/src/components/property/property.test.js +0 -242
- package/dist/src/components/record/declaration.d.ts +0 -35
- package/dist/src/components/record/declaration.d.ts.map +0 -1
- package/dist/src/components/record/declaration.js +0 -90
- package/dist/src/components/record/declaration.test.d.ts +0 -2
- package/dist/src/components/record/declaration.test.d.ts.map +0 -1
- package/dist/src/components/record/declaration.test.js +0 -94
- package/dist/src/components/type-parameters/type-parameter-constraints.d.ts +0 -8
- package/dist/src/components/type-parameters/type-parameter-constraints.d.ts.map +0 -1
- package/dist/src/components/type-parameters/type-parameter-constraints.js +0 -44
- package/dist/src/components/type-parameters/type-parameter-constraints.test.d.ts +0 -2
- package/dist/src/components/type-parameters/type-parameter-constraints.test.d.ts.map +0 -1
- package/dist/src/components/type-parameters/type-parameter-constraints.test.js +0 -67
- package/dist/src/components/type-parameters/type-parameter.d.ts +0 -20
- package/dist/src/components/type-parameters/type-parameter.d.ts.map +0 -1
- package/dist/src/components/type-parameters/type-parameter.js +0 -22
- package/dist/src/components/type-parameters/type-parameters.d.ts +0 -17
- package/dist/src/components/type-parameters/type-parameters.d.ts.map +0 -1
- package/dist/src/components/type-parameters/type-parameters.js +0 -54
- package/dist/src/components/type-parameters/type-parameters.test.d.ts +0 -2
- package/dist/src/components/type-parameters/type-parameters.test.d.ts.map +0 -1
- package/dist/src/components/type-parameters/type-parameters.test.js +0 -48
- package/dist/src/components/var/declaration.d.ts +0 -35
- package/dist/src/components/var/declaration.d.ts.map +0 -1
- package/dist/src/components/var/declaration.js +0 -40
- package/dist/src/components/var/declaration.test.d.ts +0 -2
- package/dist/src/components/var/declaration.test.d.ts.map +0 -1
- package/dist/src/components/var/declaration.test.js +0 -73
- package/dist/test/class-declaration.test.d.ts +0 -2
- package/dist/test/class-declaration.test.d.ts.map +0 -1
- package/dist/test/class-declaration.test.js +0 -481
- package/dist/test/project-directory.test.d.ts +0 -2
- package/dist/test/project-directory.test.d.ts.map +0 -1
- package/dist/test/vitest.setup.d.ts +0 -2
- package/dist/test/vitest.setup.d.ts.map +0 -1
- package/dist/test/vitest.setup.js +0 -1
- package/src/components/ClassDeclaration.tsx +0 -233
- package/src/components/attributes/attributes.test.tsx +0 -61
- package/src/components/attributes/attributes.tsx +0 -100
- package/src/components/doc/comment.test.tsx +0 -337
- package/src/components/doc/comment.tsx +0 -152
- package/src/components/doc/from-markdown.test.tsx +0 -103
- package/src/components/doc/from-markdown.tsx +0 -58
- package/src/components/interface/declaration.test.tsx +0 -158
- package/src/components/interface/declaration.tsx +0 -125
- package/src/components/interface/method.test.tsx +0 -293
- package/src/components/interface/method.tsx +0 -122
- package/src/components/interface/property.test.tsx +0 -165
- package/src/components/interface/property.tsx +0 -127
- package/src/components/parameters/parameters.tsx +0 -74
- package/src/components/property/property.test.tsx +0 -209
- package/src/components/property/property.tsx +0 -172
- package/src/components/record/declaration.test.tsx +0 -73
- package/src/components/record/declaration.tsx +0 -109
- package/src/components/type-parameters/type-parameter-constraints.test.tsx +0 -93
- package/src/components/type-parameters/type-parameter-constraints.tsx +0 -46
- package/src/components/type-parameters/type-parameter.tsx +0 -35
- package/src/components/type-parameters/type-parameters.test.tsx +0 -46
- package/src/components/type-parameters/type-parameters.tsx +0 -63
- package/src/components/var/declaration.test.tsx +0 -59
- package/src/components/var/declaration.tsx +0 -47
- package/test/class-declaration.test.tsx +0 -430
- package/test/vitest.setup.ts +0 -1
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import * as core from "@alloy-js/core";
|
|
2
|
-
import { AccessModifiers } from "../modifiers.js";
|
|
3
|
-
export interface EnumDeclarationProps extends AccessModifiers {
|
|
4
|
-
name: string;
|
|
5
|
-
refkey?: core.Refkey;
|
|
6
|
-
children?: core.Children;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* A C# enum declaration
|
|
10
|
-
* @example
|
|
11
|
-
* ```tsx
|
|
12
|
-
* <EnumDeclaration public name="Color">
|
|
13
|
-
* <EnumMember name="Red" />
|
|
14
|
-
* <EnumMember name="Green" />
|
|
15
|
-
* <EnumMember name="Blue" />
|
|
16
|
-
* </EnumDeclaration>
|
|
17
|
-
* ```
|
|
18
|
-
* This will produce:
|
|
19
|
-
* ```csharp
|
|
20
|
-
* public enum Color
|
|
21
|
-
* {
|
|
22
|
-
* Red,
|
|
23
|
-
* Green,
|
|
24
|
-
* Blue
|
|
25
|
-
* }
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare function EnumDeclaration(props: EnumDeclarationProps): core.Children;
|
|
29
|
-
export interface EnumMemberProps {
|
|
30
|
-
name: string;
|
|
31
|
-
refkey?: core.Refkey;
|
|
32
|
-
}
|
|
33
|
-
export declare function EnumMember(props: EnumMemberProps): core.Children;
|
|
34
|
-
//# sourceMappingURL=EnumDeclaration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EnumDeclaration.d.ts","sourceRoot":"","sources":["../../../src/components/EnumDeclaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,EACL,eAAe,EAGhB,MAAM,iBAAiB,CAAC;AAOzB,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,iBAgC1D;AAGD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;CACtB;AAGD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,iBAmBhD"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Children } from "@alloy-js/core";
|
|
2
|
-
export interface AttributeItem {
|
|
3
|
-
name: string;
|
|
4
|
-
args?: string[];
|
|
5
|
-
}
|
|
6
|
-
export type AttributesProp = Array<string | AttributeProps | Children>;
|
|
7
|
-
export interface AttributeListProps {
|
|
8
|
-
/** If the attribute list should finish with a hard line if there is any attribute */
|
|
9
|
-
endline?: boolean;
|
|
10
|
-
attributes?: AttributesProp;
|
|
11
|
-
children?: Children[];
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Render each attributes in a new line.
|
|
15
|
-
*/
|
|
16
|
-
export declare function AttributeList(props: AttributeListProps): Children;
|
|
17
|
-
export interface AttributeProps {
|
|
18
|
-
/** Attribute name */
|
|
19
|
-
name: Children;
|
|
20
|
-
/** Argument */
|
|
21
|
-
args?: Children[];
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Render a csharp attribute.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```tsx
|
|
28
|
-
* <Attribute name="Test" /><hbr/>
|
|
29
|
-
* <Attribute name="Test" args={["arg1", "arg2"]} />
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* will render:
|
|
33
|
-
* ```csharp
|
|
34
|
-
* [Test]
|
|
35
|
-
* [Test("arg1", "arg2")]
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export declare const Attribute: import("@alloy-js/core").Component<AttributeProps> & Required<Pick<import("@alloy-js/core").Component<AttributeProps>, "tag">>;
|
|
39
|
-
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../../src/components/attributes/attributes.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAKT,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,GAAG,cAAc,GAAG,QAAQ,CAAC,CAAC;AAEvE,MAAM,WAAW,kBAAkB;IACjC,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,YAiBtD;AAYD,MAAM,WAAW,cAAc;IAC7B,qBAAqB;IACrB,IAAI,EAAE,QAAQ,CAAC;IAEf,eAAe;IACf,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;CACnB;AAGD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,SAAS,gIAqBrB,CAAC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { createComponent as _$createComponent, memo as _$memo, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { findKeyedChildren, For, Indent, taggedComponent } from "@alloy-js/core";
|
|
3
|
-
/**
|
|
4
|
-
* Render each attributes in a new line.
|
|
5
|
-
*/
|
|
6
|
-
export function AttributeList(props) {
|
|
7
|
-
const attributes = props.attributes ?? (props.children && findKeyedChildren(props.children, Attribute.tag));
|
|
8
|
-
if (!attributes) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
return [_$createComponent(For, {
|
|
12
|
-
each: attributes,
|
|
13
|
-
line: true,
|
|
14
|
-
children: arg => renderAttribute(arg)
|
|
15
|
-
}), _$memo(() => _$memo(() => !!(props.endline && attributes.length > 0))() && _$createIntrinsic("hbr", {}))];
|
|
16
|
-
}
|
|
17
|
-
function renderAttribute(attr) {
|
|
18
|
-
if (typeof attr === "string") {
|
|
19
|
-
return _$createComponent(Attribute, {
|
|
20
|
-
name: attr
|
|
21
|
-
});
|
|
22
|
-
} else if (typeof attr === "object" && attr && "name" in attr) {
|
|
23
|
-
return _$createComponent(Attribute, attr);
|
|
24
|
-
} else {
|
|
25
|
-
return attr;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const AttributeTag = Symbol("AttributeTag");
|
|
29
|
-
/**
|
|
30
|
-
* Render a csharp attribute.
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```tsx
|
|
34
|
-
* <Attribute name="Test" /><hbr/>
|
|
35
|
-
* <Attribute name="Test" args={["arg1", "arg2"]} />
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* will render:
|
|
39
|
-
* ```csharp
|
|
40
|
-
* [Test]
|
|
41
|
-
* [Test("arg1", "arg2")]
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export const Attribute = taggedComponent(AttributeTag, props => {
|
|
45
|
-
return _$createIntrinsic("group", {
|
|
46
|
-
get children() {
|
|
47
|
-
return ["[", _$memo(() => props.name), _$memo(() => _$memo(() => !!(props.args && props.args.length > 0))() && ["(", _$createComponent(Indent, {
|
|
48
|
-
softline: true,
|
|
49
|
-
get children() {
|
|
50
|
-
return _$createComponent(For, {
|
|
51
|
-
get each() {
|
|
52
|
-
return props.args ?? [];
|
|
53
|
-
},
|
|
54
|
-
comma: true,
|
|
55
|
-
line: true,
|
|
56
|
-
children: arg => arg
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}), ")"]), "]"];
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attributes.test.d.ts","sourceRoot":"","sources":["../../../../src/components/attributes/attributes.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { expect, it } from "vitest";
|
|
3
|
-
import { Attribute, AttributeList } from "./attributes.js";
|
|
4
|
-
it("define attribute", () => {
|
|
5
|
-
expect(_$createComponent(Attribute, {
|
|
6
|
-
name: "Test"
|
|
7
|
-
})).toRenderTo(`
|
|
8
|
-
[Test]
|
|
9
|
-
`);
|
|
10
|
-
});
|
|
11
|
-
it("define attribute with single arg", () => {
|
|
12
|
-
expect(_$createComponent(Attribute, {
|
|
13
|
-
name: "Test",
|
|
14
|
-
args: [`"abc"`]
|
|
15
|
-
})).toRenderTo(`
|
|
16
|
-
[Test("abc")]
|
|
17
|
-
`);
|
|
18
|
-
});
|
|
19
|
-
it("define attribute with multiple arg", () => {
|
|
20
|
-
expect(_$createComponent(Attribute, {
|
|
21
|
-
name: "Test",
|
|
22
|
-
args: [`"abc"`, `"def"`]
|
|
23
|
-
})).toRenderTo(`
|
|
24
|
-
[Test("abc", "def")]
|
|
25
|
-
`);
|
|
26
|
-
});
|
|
27
|
-
it("define attribute list with Attribute components", () => {
|
|
28
|
-
expect(_$createComponent(AttributeList, {
|
|
29
|
-
get attributes() {
|
|
30
|
-
return [_$createComponent(Attribute, {
|
|
31
|
-
name: "TestA"
|
|
32
|
-
}), _$createComponent(Attribute, {
|
|
33
|
-
name: "TestB"
|
|
34
|
-
})];
|
|
35
|
-
}
|
|
36
|
-
})).toRenderTo(`
|
|
37
|
-
[TestA]
|
|
38
|
-
[TestB]
|
|
39
|
-
`);
|
|
40
|
-
});
|
|
41
|
-
it("define attribute list with attribute names", () => {
|
|
42
|
-
expect(_$createComponent(AttributeList, {
|
|
43
|
-
attributes: ["TestA", "TestB"]
|
|
44
|
-
})).toRenderTo(`
|
|
45
|
-
[TestA]
|
|
46
|
-
[TestB]
|
|
47
|
-
`);
|
|
48
|
-
});
|
|
49
|
-
it("define attribute list with attribute props", () => {
|
|
50
|
-
expect(_$createComponent(AttributeList, {
|
|
51
|
-
attributes: [{
|
|
52
|
-
name: "TestA"
|
|
53
|
-
}, {
|
|
54
|
-
name: "TestB",
|
|
55
|
-
args: [`"test"`]
|
|
56
|
-
}]
|
|
57
|
-
})).toRenderTo(`
|
|
58
|
-
[TestA]
|
|
59
|
-
[TestB("test")]
|
|
60
|
-
`);
|
|
61
|
-
});
|
|
62
|
-
it("define attribute list with children", () => {
|
|
63
|
-
expect(_$createComponent(AttributeList, {
|
|
64
|
-
get children() {
|
|
65
|
-
return [_$createComponent(Attribute, {
|
|
66
|
-
name: "TestA"
|
|
67
|
-
}), _$createComponent(Attribute, {
|
|
68
|
-
name: "TestB"
|
|
69
|
-
})];
|
|
70
|
-
}
|
|
71
|
-
})).toRenderTo(`
|
|
72
|
-
[TestA]
|
|
73
|
-
[TestB]
|
|
74
|
-
`);
|
|
75
|
-
});
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Children } from "@alloy-js/core";
|
|
2
|
-
export interface DocCommentProps {
|
|
3
|
-
children: Children;
|
|
4
|
-
}
|
|
5
|
-
export declare function DocComment(props: DocCommentProps): Children;
|
|
6
|
-
export interface DocWhenProps {
|
|
7
|
-
doc: Children | undefined;
|
|
8
|
-
}
|
|
9
|
-
/** Conditionally render the given doc in a <DocComment /> component and tail with a line */
|
|
10
|
-
export declare function DocWhen(props: DocWhenProps): Children;
|
|
11
|
-
export interface DocCommentTagProps {
|
|
12
|
-
children: Children;
|
|
13
|
-
}
|
|
14
|
-
export declare function makeDocCommentTag(name: string): (props: DocCommentProps) => Children;
|
|
15
|
-
export declare function makeInlineDocCommentTag(name: string): (props: DocCommentProps) => string;
|
|
16
|
-
export declare const DocSummary: (props: DocCommentProps) => Children;
|
|
17
|
-
export declare const DocCode: (props: DocCommentProps) => Children;
|
|
18
|
-
export declare const DocC: (props: DocCommentProps) => string;
|
|
19
|
-
export declare const DocExample: (props: DocCommentProps) => Children;
|
|
20
|
-
export declare const DocException: (props: DocCommentProps) => Children;
|
|
21
|
-
export interface DocIncludeProps {
|
|
22
|
-
/** is the file name of an external XML file. The file name is interpreted relative to the file that contains the include tag. */
|
|
23
|
-
file: string;
|
|
24
|
-
/** is an XPath expression that selects some of the XML in the external XML file. */
|
|
25
|
-
path?: string;
|
|
26
|
-
}
|
|
27
|
-
export declare const DocInclude: (props: DocIncludeProps) => string;
|
|
28
|
-
export interface DocParamProps {
|
|
29
|
-
name: string;
|
|
30
|
-
children: Children;
|
|
31
|
-
}
|
|
32
|
-
export declare const DocParam: (props: DocParamProps) => Children;
|
|
33
|
-
export interface DocTypeParamProps {
|
|
34
|
-
name: string;
|
|
35
|
-
children: Children;
|
|
36
|
-
}
|
|
37
|
-
export declare const DocTypeParam: (props: DocTypeParamProps) => Children;
|
|
38
|
-
export declare const DocReturns: (props: DocCommentProps) => Children;
|
|
39
|
-
export declare const DocRemarks: (props: DocCommentProps) => Children;
|
|
40
|
-
export declare const DocValue: (props: DocCommentProps) => Children;
|
|
41
|
-
export declare const DocPermission: (props: DocCommentProps) => Children;
|
|
42
|
-
export declare const DocDescription: (props: DocCommentProps) => Children;
|
|
43
|
-
export declare const DocPara: (props: DocCommentProps) => Children;
|
|
44
|
-
export interface DocSeeProps {
|
|
45
|
-
cref?: string;
|
|
46
|
-
href?: string;
|
|
47
|
-
langword?: string;
|
|
48
|
-
children?: Children;
|
|
49
|
-
}
|
|
50
|
-
export declare const DocSee: (props: DocSeeProps) => Children;
|
|
51
|
-
export interface DocSeeAlsoProps {
|
|
52
|
-
cref?: string;
|
|
53
|
-
href?: string;
|
|
54
|
-
children?: Children;
|
|
55
|
-
}
|
|
56
|
-
export declare const DocSeeAlso: (props: DocSeeAlsoProps) => Children;
|
|
57
|
-
export interface DocParamRefProps {
|
|
58
|
-
name: string;
|
|
59
|
-
}
|
|
60
|
-
export declare const DocParamRef: (props: DocParamRefProps) => string;
|
|
61
|
-
export interface DocTypeParamRefProps {
|
|
62
|
-
name: string;
|
|
63
|
-
}
|
|
64
|
-
export declare const DocTypeParamRef: (props: DocTypeParamRefProps) => string;
|
|
65
|
-
export interface DocListProps {
|
|
66
|
-
type?: "bullet" | "number";
|
|
67
|
-
items: Children[];
|
|
68
|
-
}
|
|
69
|
-
export declare function DocList(props: DocListProps): Children;
|
|
70
|
-
//# sourceMappingURL=comment.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../../../../src/components/doc/comment.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { createComponent as _$createComponent, createIntrinsic as _$createIntrinsic, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { code, For, Indent, List, Prose, Show } from "@alloy-js/core";
|
|
3
|
-
export function DocComment(props) {
|
|
4
|
-
return ["/// ", _$createIntrinsic("align", {
|
|
5
|
-
string: "/// ",
|
|
6
|
-
get children() {
|
|
7
|
-
return _$createComponent(List, {
|
|
8
|
-
get children() {
|
|
9
|
-
return props.children;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
})];
|
|
14
|
-
}
|
|
15
|
-
/** Conditionally render the given doc in a <DocComment /> component and tail with a line */
|
|
16
|
-
export function DocWhen(props) {
|
|
17
|
-
return _$createComponent(Show, {
|
|
18
|
-
get when() {
|
|
19
|
-
return Boolean(props.doc);
|
|
20
|
-
},
|
|
21
|
-
get children() {
|
|
22
|
-
return [_$createComponent(DocComment, {
|
|
23
|
-
get children() {
|
|
24
|
-
return props.doc;
|
|
25
|
-
}
|
|
26
|
-
}), _$createIntrinsic("hbr", {})];
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
export function makeDocCommentTag(name) {
|
|
31
|
-
return function DocCommentTag(props) {
|
|
32
|
-
return _$createComponent(Prose, {
|
|
33
|
-
get children() {
|
|
34
|
-
return code`
|
|
35
|
-
<${name}>
|
|
36
|
-
${props.children}
|
|
37
|
-
</${name}>`;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
export function makeInlineDocCommentTag(name) {
|
|
43
|
-
return function DocCommentTag(props) {
|
|
44
|
-
return `<${name}>${props.children}</${name}>`;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
export const DocSummary = makeDocCommentTag("summary");
|
|
48
|
-
export const DocCode = makeDocCommentTag("code");
|
|
49
|
-
export const DocC = makeInlineDocCommentTag("c");
|
|
50
|
-
export const DocExample = makeDocCommentTag("example");
|
|
51
|
-
export const DocException = makeDocCommentTag("exception");
|
|
52
|
-
export const DocInclude = props => {
|
|
53
|
-
return `<include file="${props.file}" path="${props.path}" />`;
|
|
54
|
-
};
|
|
55
|
-
export const DocParam = props => code`<param name="${props.name}">${props.children}</param>`;
|
|
56
|
-
export const DocTypeParam = props => code`<typeparam name="${props.name}">${props.children}</typeparam>`;
|
|
57
|
-
export const DocReturns = makeDocCommentTag("returns");
|
|
58
|
-
export const DocRemarks = makeDocCommentTag("remarks");
|
|
59
|
-
export const DocValue = makeDocCommentTag("value");
|
|
60
|
-
export const DocPermission = makeDocCommentTag("permission");
|
|
61
|
-
export const DocDescription = makeDocCommentTag("description");
|
|
62
|
-
export const DocPara = makeDocCommentTag("para");
|
|
63
|
-
export const DocSee = props => {
|
|
64
|
-
const attributes = [props.cref ? `cref="${props.cref}"` : undefined, props.href ? `href="${props.href}"` : undefined, props.langword ? `langword="${props.langword}"` : undefined].filter(Boolean).join(" ");
|
|
65
|
-
return code`<see ${attributes}${props.children ? code`>${props.children}</see>` : " />"}`;
|
|
66
|
-
};
|
|
67
|
-
export const DocSeeAlso = props => {
|
|
68
|
-
const attributes = [props.cref ? `cref="${props.cref}"` : undefined, props.href ? `href="${props.href}"` : undefined].filter(Boolean).join(" ");
|
|
69
|
-
return code`<seealso ${attributes}${props.children ? code`>${props.children}</seealso>` : " />"}`;
|
|
70
|
-
};
|
|
71
|
-
export const DocParamRef = props => `<paramref name="${props.name}" />`;
|
|
72
|
-
export const DocTypeParamRef = props => `<typeparamref name="${props.name}" />`;
|
|
73
|
-
export function DocList(props) {
|
|
74
|
-
return _$createComponent(Prose, {
|
|
75
|
-
get children() {
|
|
76
|
-
return [_$memo(() => `<list type="${props.type ?? "bullet"}">`), _$createComponent(Indent, {
|
|
77
|
-
get children() {
|
|
78
|
-
return _$createComponent(For, {
|
|
79
|
-
get each() {
|
|
80
|
-
return props.items;
|
|
81
|
-
},
|
|
82
|
-
children: item => code`<item><description>${item}</description></item>`
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
}), _$createIntrinsic("hbr", {}), `</list>`];
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"comment.test.d.ts","sourceRoot":"","sources":["../../../../src/components/doc/comment.test.tsx"],"names":[],"mappings":""}
|