@powerlines/plugin-alloy 0.21.2 → 0.21.4
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/output.d.cts +2 -2
- package/dist/core/components/output.d.mts +2 -2
- package/dist/core/components/single-line-comment.d.cts +2 -2
- package/dist/core/components/single-line-comment.d.mts +2 -2
- package/dist/core/components/source-file.d.cts +2 -2
- package/dist/helpers/index.cjs +1 -1
- package/dist/helpers/index.d.cts +2 -2
- package/dist/helpers/index.d.mts +2 -2
- package/dist/helpers/index.mjs +2 -2
- package/dist/helpers/typescript.cjs +2 -2
- package/dist/helpers/typescript.d.cts +6 -6
- package/dist/helpers/typescript.d.cts.map +1 -1
- package/dist/helpers/typescript.d.mts +6 -6
- package/dist/helpers/typescript.d.mts.map +1 -1
- package/dist/helpers/typescript.mjs +2 -2
- package/dist/helpers/typescript.mjs.map +1 -1
- package/dist/markdown/components/front-matter.d.cts +2 -2
- package/dist/markdown/components/front-matter.d.mts +2 -2
- package/dist/markdown/components/markdown-file.d.cts +3 -3
- package/dist/markdown/components/markdown-file.d.mts +3 -3
- package/dist/markdown/components/markdown-table.d.mts +4 -4
- package/dist/markdown/contexts/markdown-table.d.cts.map +1 -1
- package/dist/typescript/components/builtin-file.d.cts +2 -2
- package/dist/typescript/components/builtin-file.d.mts +2 -2
- package/dist/typescript/components/class-declaration.cjs +43 -18
- package/dist/typescript/components/class-declaration.d.cts +33 -3
- package/dist/typescript/components/class-declaration.d.cts.map +1 -1
- package/dist/typescript/components/class-declaration.d.mts +33 -3
- package/dist/typescript/components/class-declaration.d.mts.map +1 -1
- package/dist/typescript/components/class-declaration.mjs +45 -20
- package/dist/typescript/components/class-declaration.mjs.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.d.cts +2 -2
- package/dist/typescript/components/dynamic-import-statement.d.mts +2 -2
- package/dist/typescript/components/entry-file.d.cts +2 -2
- package/dist/typescript/components/entry-file.d.cts.map +1 -1
- package/dist/typescript/components/entry-file.d.mts +2 -2
- package/dist/typescript/components/index.cjs +12 -10
- package/dist/typescript/components/index.d.cts +4 -4
- package/dist/typescript/components/index.d.mts +4 -4
- package/dist/typescript/components/index.mjs +5 -5
- package/dist/typescript/components/interface-declaration.cjs +225 -0
- package/dist/typescript/components/interface-declaration.d.cts +82 -0
- package/dist/typescript/components/interface-declaration.d.cts.map +1 -0
- package/dist/typescript/components/interface-declaration.d.mts +82 -0
- package/dist/typescript/components/interface-declaration.d.mts.map +1 -0
- package/dist/typescript/components/interface-declaration.mjs +222 -0
- package/dist/typescript/components/interface-declaration.mjs.map +1 -0
- package/dist/typescript/components/{typescript-object.cjs → object-declaration.cjs} +6 -6
- 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/{typescript-object.mjs → object-declaration.mjs} +6 -6
- package/dist/typescript/components/object-declaration.mjs.map +1 -0
- package/dist/typescript/components/{typescript-property-name.cjs → property-name.cjs} +3 -3
- package/dist/typescript/components/{typescript-property-name.d.mts → property-name.d.cts} +7 -7
- package/dist/typescript/components/property-name.d.cts.map +1 -0
- package/dist/typescript/components/{typescript-property-name.d.cts → property-name.d.mts} +6 -6
- package/dist/typescript/components/property-name.d.mts.map +1 -0
- package/dist/typescript/components/{typescript-property-name.mjs → property-name.mjs} +4 -4
- package/dist/typescript/components/property-name.mjs.map +1 -0
- package/dist/typescript/components/tsdoc-reflection.d.cts +4 -4
- package/dist/typescript/components/tsdoc-reflection.d.cts.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.d.mts +4 -4
- package/dist/typescript/components/tsdoc-reflection.d.mts.map +1 -1
- package/dist/typescript/components/tsdoc.cjs +1 -1
- package/dist/typescript/components/tsdoc.mjs +1 -1
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/components/type-parameters.cjs +42 -67
- package/dist/typescript/components/type-parameters.d.cts +1 -2
- package/dist/typescript/components/type-parameters.d.cts.map +1 -1
- package/dist/typescript/components/type-parameters.d.mts +1 -2
- package/dist/typescript/components/type-parameters.d.mts.map +1 -1
- package/dist/typescript/components/type-parameters.mjs +44 -69
- package/dist/typescript/components/type-parameters.mjs.map +1 -1
- package/dist/typescript/contexts/lexical-scope.d.cts +2 -2
- package/dist/typescript/contexts/lexical-scope.d.cts.map +1 -1
- package/dist/typescript/contexts/lexical-scope.d.mts +2 -2
- package/dist/typescript/contexts/lexical-scope.d.mts.map +1 -1
- package/dist/typescript/index.cjs +11 -9
- package/dist/typescript/index.d.cts +4 -4
- package/dist/typescript/index.d.mts +4 -4
- package/dist/typescript/index.mjs +5 -5
- package/package.json +48 -48
- package/dist/typescript/components/typescript-interface.cjs +0 -73
- package/dist/typescript/components/typescript-interface.d.cts +0 -26
- package/dist/typescript/components/typescript-interface.d.cts.map +0 -1
- package/dist/typescript/components/typescript-interface.d.mts +0 -26
- package/dist/typescript/components/typescript-interface.d.mts.map +0 -1
- package/dist/typescript/components/typescript-interface.mjs +0 -72
- package/dist/typescript/components/typescript-interface.mjs.map +0 -1
- package/dist/typescript/components/typescript-object.d.cts +0 -30
- package/dist/typescript/components/typescript-object.d.cts.map +0 -1
- package/dist/typescript/components/typescript-object.d.mts +0 -30
- package/dist/typescript/components/typescript-object.d.mts.map +0 -1
- package/dist/typescript/components/typescript-object.mjs.map +0 -1
- package/dist/typescript/components/typescript-property-name.d.cts.map +0 -1
- package/dist/typescript/components/typescript-property-name.d.mts.map +0 -1
- package/dist/typescript/components/typescript-property-name.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MetaItem } from "../contexts/meta.cjs";
|
|
2
2
|
import "../contexts/index.cjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core7 from "@alloy-js/core";
|
|
4
4
|
import { OutputProps as OutputProps$1 } from "@alloy-js/core";
|
|
5
5
|
import { PluginContext } from "powerlines/types/context";
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ interface OutputProps<TContext extends PluginContext = PluginContext> extends Om
|
|
|
18
18
|
/**
|
|
19
19
|
* Output component for rendering the Powerlines plugin's output files via templates.
|
|
20
20
|
*/
|
|
21
|
-
declare function Output<TContext extends PluginContext = PluginContext>(props: OutputProps<TContext>):
|
|
21
|
+
declare function Output<TContext extends PluginContext = PluginContext>(props: OutputProps<TContext>): _alloy_js_core7.Children;
|
|
22
22
|
declare type __ΩOutputProps = any[];
|
|
23
23
|
//#endregion
|
|
24
24
|
export { Output, OutputProps, __ΩOutputProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MetaItem } from "../contexts/meta.mjs";
|
|
2
2
|
import "../contexts/index.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core1 from "@alloy-js/core";
|
|
4
4
|
import { OutputProps as OutputProps$1 } from "@alloy-js/core";
|
|
5
5
|
import { PluginContext } from "powerlines/types/context";
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ interface OutputProps<TContext extends PluginContext = PluginContext> extends Om
|
|
|
18
18
|
/**
|
|
19
19
|
* Output component for rendering the Powerlines plugin's output files via templates.
|
|
20
20
|
*/
|
|
21
|
-
declare function Output<TContext extends PluginContext = PluginContext>(props: OutputProps<TContext>):
|
|
21
|
+
declare function Output<TContext extends PluginContext = PluginContext>(props: OutputProps<TContext>): _alloy_js_core1.Children;
|
|
22
22
|
declare type __ΩOutputProps = any[];
|
|
23
23
|
//#endregion
|
|
24
24
|
export { Output, OutputProps, __ΩOutputProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core8 from "@alloy-js/core";
|
|
3
3
|
|
|
4
4
|
//#region src/core/components/single-line-comment.d.ts
|
|
5
5
|
type SingleLineCommentVariant = "double-slash" | "triple-slash" | "slash-star" | "slash-star-star" | "markdown";
|
|
@@ -15,7 +15,7 @@ interface SingleLineCommentProps extends ComponentProps {
|
|
|
15
15
|
* A single line comment block. The children are rendered as a prose element, which means that they
|
|
16
16
|
* are broken into multiple lines
|
|
17
17
|
*/
|
|
18
|
-
declare function SingleLineComment(props: SingleLineCommentProps):
|
|
18
|
+
declare function SingleLineComment(props: SingleLineCommentProps): _alloy_js_core8.Children;
|
|
19
19
|
declare type __ΩSingleLineCommentVariant = any[];
|
|
20
20
|
declare type __ΩSingleLineCommentProps = any[];
|
|
21
21
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
3
|
|
|
4
4
|
//#region src/core/components/single-line-comment.d.ts
|
|
5
5
|
type SingleLineCommentVariant = "double-slash" | "triple-slash" | "slash-star" | "slash-star-star" | "markdown";
|
|
@@ -15,7 +15,7 @@ interface SingleLineCommentProps extends ComponentProps {
|
|
|
15
15
|
* A single line comment block. The children are rendered as a prose element, which means that they
|
|
16
16
|
* are broken into multiple lines
|
|
17
17
|
*/
|
|
18
|
-
declare function SingleLineComment(props: SingleLineCommentProps):
|
|
18
|
+
declare function SingleLineComment(props: SingleLineCommentProps): _alloy_js_core0.Children;
|
|
19
19
|
declare type __ΩSingleLineCommentVariant = any[];
|
|
20
20
|
declare type __ΩSingleLineCommentProps = any[];
|
|
21
21
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core6 from "@alloy-js/core";
|
|
3
3
|
import { SourceFileProps as SourceFileProps$1 } from "@alloy-js/core";
|
|
4
4
|
import { StoragePreset } from "powerlines/types/fs";
|
|
5
5
|
|
|
@@ -26,7 +26,7 @@ type SourceFileProps = SourceFileProps$1 & ComponentProps & {
|
|
|
26
26
|
* @param props - The properties for the source file.
|
|
27
27
|
* @returns The rendered source file component.
|
|
28
28
|
*/
|
|
29
|
-
declare function SourceFile(props: SourceFileProps):
|
|
29
|
+
declare function SourceFile(props: SourceFileProps): _alloy_js_core6.Children;
|
|
30
30
|
declare type __ΩSourceFileProps = any[];
|
|
31
31
|
//#endregion
|
|
32
32
|
export { SourceFile, SourceFileProps, __ΩSourceFileProps };
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -14,7 +14,7 @@ exports.generateCapnpMethodSchema = require_helpers_capnp.generateCapnpMethodSch
|
|
|
14
14
|
exports.generateCapnpPrimitive = require_helpers_capnp.generateCapnpPrimitive;
|
|
15
15
|
exports.generateCapnpSchema = require_helpers_capnp.generateCapnpSchema;
|
|
16
16
|
exports.generateCapnpStruct = require_helpers_capnp.generateCapnpStruct;
|
|
17
|
-
exports.
|
|
17
|
+
exports.generateObjectDeclaration = require_helpers_typescript.generateObjectDeclaration;
|
|
18
18
|
exports.getCapnpEnumTypes = require_helpers_capnp.getCapnpEnumTypes;
|
|
19
19
|
exports.getCapnpUnionTypes = require_helpers_capnp.getCapnpUnionTypes;
|
|
20
20
|
exports.isCapnpStringUnion = require_helpers_capnp.isCapnpStringUnion;
|
package/dist/helpers/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenerateCapnpOptions, GenerateCapnpStructOptions, IOType, LARGE_BUFFER, StdioOptions, __ΩGenerateCapnpOptions, __ΩGenerateCapnpStructOptions, __ΩIOType, __ΩStdioOptions, compile, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, stringifyCapnpDefaultValue, stringifyCapnpValue } from "./capnp.cjs";
|
|
2
2
|
import { CreateBuiltinOptions, __ΩCreateBuiltinOptions, createBuiltin } from "./create-builtin.cjs";
|
|
3
3
|
import { refkey } from "./refkey.cjs";
|
|
4
|
-
import {
|
|
5
|
-
export { CreateBuiltinOptions, GenerateCapnpOptions, GenerateCapnpStructOptions,
|
|
4
|
+
import { GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, generateObjectDeclaration } from "./typescript.cjs";
|
|
5
|
+
export { CreateBuiltinOptions, GenerateCapnpOptions, GenerateCapnpStructOptions, GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, IOType, LARGE_BUFFER, StdioOptions, __ΩCreateBuiltinOptions, __ΩGenerateCapnpOptions, __ΩGenerateCapnpStructOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, __ΩIOType, __ΩStdioOptions, compile, createBuiltin, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, generateObjectDeclaration, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, refkey, stringifyCapnpDefaultValue, stringifyCapnpValue };
|
package/dist/helpers/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenerateCapnpOptions, GenerateCapnpStructOptions, IOType, LARGE_BUFFER, StdioOptions, __ΩGenerateCapnpOptions, __ΩGenerateCapnpStructOptions, __ΩIOType, __ΩStdioOptions, compile, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, stringifyCapnpDefaultValue, stringifyCapnpValue } from "./capnp.mjs";
|
|
2
2
|
import { CreateBuiltinOptions, __ΩCreateBuiltinOptions, createBuiltin } from "./create-builtin.mjs";
|
|
3
3
|
import { refkey } from "./refkey.mjs";
|
|
4
|
-
import {
|
|
5
|
-
export { CreateBuiltinOptions, GenerateCapnpOptions, GenerateCapnpStructOptions,
|
|
4
|
+
import { GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, generateObjectDeclaration } from "./typescript.mjs";
|
|
5
|
+
export { CreateBuiltinOptions, GenerateCapnpOptions, GenerateCapnpStructOptions, GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, IOType, LARGE_BUFFER, StdioOptions, __ΩCreateBuiltinOptions, __ΩGenerateCapnpOptions, __ΩGenerateCapnpStructOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, __ΩIOType, __ΩStdioOptions, compile, createBuiltin, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, generateObjectDeclaration, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, refkey, stringifyCapnpDefaultValue, stringifyCapnpValue };
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { generateObjectDeclaration } from "./typescript.mjs";
|
|
2
2
|
import { refkey } from "./refkey.mjs";
|
|
3
3
|
import { LARGE_BUFFER, compile, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, stringifyCapnpDefaultValue, stringifyCapnpValue } from "./capnp.mjs";
|
|
4
4
|
import { createBuiltin } from "./create-builtin.mjs";
|
|
5
5
|
|
|
6
|
-
export { LARGE_BUFFER, compile, createBuiltin, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct,
|
|
6
|
+
export { LARGE_BUFFER, compile, createBuiltin, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, generateObjectDeclaration, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, refkey, stringifyCapnpDefaultValue, stringifyCapnpValue };
|
|
@@ -12,7 +12,7 @@ let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefine
|
|
|
12
12
|
* @param options - Options for generating the object.
|
|
13
13
|
* @returns A string containing the TypeScript object definition.
|
|
14
14
|
*/
|
|
15
|
-
function
|
|
15
|
+
function generateObjectDeclaration(reflection, options = {}) {
|
|
16
16
|
if (!reflection) return "";
|
|
17
17
|
return `
|
|
18
18
|
/**
|
|
@@ -43,4 +43,4 @@ export const ${(0, __stryke_string_format_camel_case.camelCase)(options.override
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
//#endregion
|
|
46
|
-
exports.
|
|
46
|
+
exports.generateObjectDeclaration = generateObjectDeclaration;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
|
|
2
2
|
|
|
3
3
|
//#region src/helpers/typescript.d.ts
|
|
4
|
-
interface
|
|
4
|
+
interface GenerateInterfaceDeclarationOptions<T> {
|
|
5
5
|
overrideName?: string;
|
|
6
6
|
overrideExtends?: string | false;
|
|
7
7
|
defaultValues?: Partial<T>;
|
|
8
8
|
}
|
|
9
|
-
interface
|
|
9
|
+
interface GenerateObjectDeclarationOptions<T> {
|
|
10
10
|
overrideName?: string;
|
|
11
11
|
overrideExtends?: string | false;
|
|
12
12
|
defaultValues?: Partial<T>;
|
|
@@ -18,9 +18,9 @@ interface GenerateTypeScriptObjectOptions<T> {
|
|
|
18
18
|
* @param options - Options for generating the object.
|
|
19
19
|
* @returns A string containing the TypeScript object definition.
|
|
20
20
|
*/
|
|
21
|
-
declare function
|
|
22
|
-
declare type __Ω
|
|
23
|
-
declare type __Ω
|
|
21
|
+
declare function generateObjectDeclaration<T extends Record<string, any>>(reflection: ReflectionClass<T>, options?: GenerateObjectDeclarationOptions<T>): string;
|
|
22
|
+
declare type __ΩGenerateInterfaceDeclarationOptions = any[];
|
|
23
|
+
declare type __ΩGenerateObjectDeclarationOptions = any[];
|
|
24
24
|
//#endregion
|
|
25
|
-
export {
|
|
25
|
+
export { GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, generateObjectDeclaration };
|
|
26
26
|
//# sourceMappingURL=typescript.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.cts","names":[],"sources":["../../src/helpers/typescript.ts"],"sourcesContent":[],"mappings":";;;UAwBiB;;EAAA,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAwJA,aAAA,CAAA,EArJC,OAqJD,CArJS,CAqJT,CAAA;AAajB;
|
|
1
|
+
{"version":3,"file":"typescript.d.cts","names":[],"sources":["../../src/helpers/typescript.ts"],"sourcesContent":[],"mappings":";;;UAwBiB;;EAAA,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAwJA,aAAA,CAAA,EArJC,OAqJD,CArJS,CAqJT,CAAA;AAajB;AAAoD,UAbnC,gCAamC,CAAA,CAAA,CAAA,CAAA;EACtB,YAAA,CAAA,EAAA,MAAA;EAAhB,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAC8B,aAAA,CAAA,EAZ1B,OAY0B,CAZlB,CAYkB,CAAA;;;;;;;;;iBAF5B,oCAAoC,iCACtC,gBAAgB,cACnB,iCAAiC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
|
|
2
2
|
|
|
3
3
|
//#region src/helpers/typescript.d.ts
|
|
4
|
-
interface
|
|
4
|
+
interface GenerateInterfaceDeclarationOptions<T> {
|
|
5
5
|
overrideName?: string;
|
|
6
6
|
overrideExtends?: string | false;
|
|
7
7
|
defaultValues?: Partial<T>;
|
|
8
8
|
}
|
|
9
|
-
interface
|
|
9
|
+
interface GenerateObjectDeclarationOptions<T> {
|
|
10
10
|
overrideName?: string;
|
|
11
11
|
overrideExtends?: string | false;
|
|
12
12
|
defaultValues?: Partial<T>;
|
|
@@ -18,9 +18,9 @@ interface GenerateTypeScriptObjectOptions<T> {
|
|
|
18
18
|
* @param options - Options for generating the object.
|
|
19
19
|
* @returns A string containing the TypeScript object definition.
|
|
20
20
|
*/
|
|
21
|
-
declare function
|
|
22
|
-
declare type __Ω
|
|
23
|
-
declare type __Ω
|
|
21
|
+
declare function generateObjectDeclaration<T extends Record<string, any>>(reflection: ReflectionClass<T>, options?: GenerateObjectDeclarationOptions<T>): string;
|
|
22
|
+
declare type __ΩGenerateInterfaceDeclarationOptions = any[];
|
|
23
|
+
declare type __ΩGenerateObjectDeclarationOptions = any[];
|
|
24
24
|
//#endregion
|
|
25
|
-
export {
|
|
25
|
+
export { GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, generateObjectDeclaration };
|
|
26
26
|
//# sourceMappingURL=typescript.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.mts","names":[],"sources":["../../src/helpers/typescript.ts"],"sourcesContent":[],"mappings":";;;UAwBiB;;EAAA,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAwJA,aAAA,CAAA,EArJC,OAqJD,CArJS,CAqJT,CAAA;AAajB;
|
|
1
|
+
{"version":3,"file":"typescript.d.mts","names":[],"sources":["../../src/helpers/typescript.ts"],"sourcesContent":[],"mappings":";;;UAwBiB;;EAAA,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAwJA,aAAA,CAAA,EArJC,OAqJD,CArJS,CAqJT,CAAA;AAajB;AAAoD,UAbnC,gCAamC,CAAA,CAAA,CAAA,CAAA;EACtB,YAAA,CAAA,EAAA,MAAA;EAAhB,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAC8B,aAAA,CAAA,EAZ1B,OAY0B,CAZlB,CAYkB,CAAA;;;;;;;;;iBAF5B,oCAAoC,iCACtC,gBAAgB,cACnB,iCAAiC"}
|
|
@@ -11,7 +11,7 @@ import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
|
11
11
|
* @param options - Options for generating the object.
|
|
12
12
|
* @returns A string containing the TypeScript object definition.
|
|
13
13
|
*/
|
|
14
|
-
function
|
|
14
|
+
function generateObjectDeclaration(reflection, options = {}) {
|
|
15
15
|
if (!reflection) return "";
|
|
16
16
|
return `
|
|
17
17
|
/**
|
|
@@ -42,5 +42,5 @@ export const ${camelCase(options.overrideName || reflection.getName())}${options
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
//#endregion
|
|
45
|
-
export {
|
|
45
|
+
export { generateObjectDeclaration };
|
|
46
46
|
//# sourceMappingURL=typescript.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.mjs","names":["stringifyValue","camelCase","titleCase","isUndefined","
|
|
1
|
+
{"version":3,"file":"typescript.mjs","names":["stringifyValue","camelCase","titleCase","isUndefined","generateObjectDeclaration","reflection","options","getDescription","overrideName","getClassName","getName","overrideExtends","getSuperReflectionClass","getProperties","filter","item","isIgnored","defaultValues","getNameAsString","getAlias","reduce","ret","alias","undefined","getDefaultValue","sort","a","b","isReadonly","localeCompare","map","getTitle","length","join","getDomain","getPermission","permission","isInternal","isHidden","getType"],"sources":["../../src/helpers/typescript.ts"],"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 { stringifyValue } from \"@powerlines/deepkit/utilities\";\nimport type { ReflectionClass } from \"@powerlines/deepkit/vendor/type\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\n\nexport interface GenerateInterfaceDeclarationOptions<T> {\n overrideName?: string;\n overrideExtends?: string | false;\n defaultValues?: Partial<T>;\n}\n\n// /**\n// * Generates a TypeScript interface for the given reflection class.\n// *\n// * @param reflection - The reflection class to generate the interface for.\n// * @returns A string containing the TypeScript interface definition.\n// */\n// export function InterfaceDeclaration<T>(\n// reflection: ReflectionClass<T>,\n// options: GenerateInterfaceDeclarationOptions<T> = {}\n// ): string {\n// if (!reflection) {\n// return \"\";\n// }\n\n// return `\n// /**\n// * Interface for ${reflection.getTitle() || titleCase(options.overrideName || reflection.getName())}.\n// *\n// * @title ${reflection.getTitle() || titleCase(reflection.getName())}${\n// reflection.getAlias().length\n// ? ` ${reflection\n// .getAlias()\n// .map(alias => ` * @alias ${alias}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${reflection.getDomain() ? ` * @domain ${reflection.getDomain()}` : \"\"}${\n// reflection.getPermission().length\n// ? `\n// ${reflection\n// .getPermission()\n// .map(permission => ` * @permission ${permission}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// reflection.isInternal()\n// ? `\n// * @internal`\n// : \"\"\n// }${\n// reflection.isReadonly()\n// ? `\n// * @readonly`\n// : \"\"\n// }${\n// reflection.isIgnored()\n// ? `\n// * @ignored`\n// : \"\"\n// }${\n// reflection.isHidden()\n// ? `\n// * @hidden`\n// : \"\"\n// }\n// */\n// export interface ${pascalCase(options.overrideName || reflection.getName())}${\n// options.overrideExtends !== false &&\n// (options.overrideExtends || reflection.getSuperReflectionClass()?.getName())\n// ? ` extends ${options.overrideExtends || reflection.getSuperReflectionClass()?.getName()}`\n// : \"\"\n// } {\n// ${reflection\n// .getProperties()\n// .filter(item => !item.isIgnored())\n// .sort((a, b) =>\n// (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n// ? a.getNameAsString().localeCompare(b.getNameAsString())\n// : a.isReadonly()\n// ? 1\n// : -1\n// )\n// .map(\n// item =>\n// ` /**\n// * ${\n// item.getDescription() ||\n// item.getTitle() ||\n// titleCase(item.getNameAsString())\n// }\n// *\n// * @title ${item.getTitle() || titleCase(item.getNameAsString())}${\n// item.getAlias().length\n// ? `\n// ${item\n// .getAlias()\n// .map(alias => ` * @alias ${alias}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// item.getDomain()\n// ? `\n// * @domain ${item.getDomain()}`\n// : \"\"\n// }${\n// item.getPermission().length\n// ? `\n// ${item\n// .getPermission()\n// .map(permission => ` * @permission ${permission}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// !isUndefined(item.getDefaultValue()) && item.getDefaultValue() !== \"\"\n// ? `\n// * @defaultValue ${item.getDefaultValue()}`\n// : \"\"\n// }${\n// item.isInternal()\n// ? `\n// * @internal`\n// : \"\"\n// }${\n// item.isReadonly()\n// ? `\n// * @readonly`\n// : \"\"\n// }${\n// item.isHidden()\n// ? `\n// * @hidden`\n// : \"\"\n// }\n// */\n// ${item.isReadonly() ? \"readonly \" : \"\"}${item.getNameAsString()}${\n// isUndefined(\n// (options.defaultValues as Record<string, any>)?.[item.getNameAsString()]\n// ) &&\n// isUndefined(item.getDefaultValue()) &&\n// !item\n// .getAlias()\n// .some(\n// alias =>\n// !isUndefined(\n// (options.defaultValues as Record<string, any>)?.[alias]\n// )\n// ) &&\n// item.isOptional()\n// ? \"?\"\n// : \"\"\n// }: ${stringifyType(item.getType())}`\n// )\n// .join(\", \\n\")}\n// }\n// `;\n// }\n\nexport interface GenerateObjectDeclarationOptions<T> {\n overrideName?: string;\n overrideExtends?: string | false;\n defaultValues?: Partial<T>;\n}\n\n/**\n * Generates a TypeScript object for the given reflection class.\n *\n * @param reflection - The reflection class to generate the object for.\n * @param options - Options for generating the object.\n * @returns A string containing the TypeScript object definition.\n */\nexport function generateObjectDeclaration<T extends Record<string, any>>(\n reflection: ReflectionClass<T>,\n options: GenerateObjectDeclarationOptions<T> = {}\n) {\n if (!reflection) {\n return \"\";\n }\n\n return `\n/**\n * ${\n reflection.getDescription() ||\n `${titleCase(options.overrideName || reflection.getClassName() || reflection.getName())} object instance`\n }.\n */\nexport const ${camelCase(options.overrideName || reflection.getName())}${\n options.overrideExtends !== false &&\n (options.overrideExtends || reflection.getSuperReflectionClass()?.getName())\n ? `: ${options.overrideExtends || reflection.getSuperReflectionClass()?.getName()}`\n : \"\"\n } = {\n ${reflection\n .getProperties()\n .filter(\n item =>\n !item.isIgnored() &&\n !isUndefined(\n options.defaultValues?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined(\n (options.defaultValues as Record<string, any>)?.[alias]\n )\n ) {\n return (options.defaultValues as Record<string, any>)?.[alias];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n .map(\n item =>\n ` /**\n * ${\n item.getDescription() ||\n item.getTitle() ||\n titleCase(item.getNameAsString())\n }\n *\n * @title ${item.getTitle() || titleCase(item.getNameAsString())}${\n item.getAlias().length\n ? `\n ${item\n .getAlias()\n .map(alias => ` * @alias ${alias}`)\n .join(\"\\n\")}`\n : \"\"\n }${\n item.getDomain()\n ? `\n * @domain ${item.getDomain()}`\n : \"\"\n }${\n item.getPermission().length\n ? `\n ${item\n .getPermission()\n .map(permission => ` * @permission ${permission}`)\n .join(\"\\n\")}`\n : \"\"\n }${\n item.isInternal()\n ? `\n * @internal`\n : \"\"\n }${\n item.isReadonly()\n ? `\n * @readonly`\n : \"\"\n }${\n item.isIgnored()\n ? `\n * @ignored`\n : \"\"\n }${\n item.isHidden()\n ? `\n * @hidden`\n : \"\"\n }\n */\n ${item.getNameAsString()}: ${stringifyValue(\n item.getType(),\n options.defaultValues?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined((options.defaultValues as Record<string, any>)?.[alias])\n ) {\n return (options.defaultValues as Record<string, any>)?.[alias];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )}`\n )\n .join(\", \\n\")}\n};\n`;\n}\n"],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core1 from "@alloy-js/core";
|
|
2
2
|
|
|
3
3
|
//#region src/markdown/components/front-matter.d.ts
|
|
4
4
|
interface FrontMatterProps {
|
|
@@ -9,7 +9,7 @@ interface FrontMatterProps {
|
|
|
9
9
|
*
|
|
10
10
|
* @see https://jekyllrb.com/docs/front-matter/
|
|
11
11
|
*/
|
|
12
|
-
declare function FrontMatter(props: FrontMatterProps):
|
|
12
|
+
declare function FrontMatter(props: FrontMatterProps): _alloy_js_core1.Children;
|
|
13
13
|
declare type __ΩFrontMatterProps = any[];
|
|
14
14
|
//#endregion
|
|
15
15
|
export { FrontMatter, FrontMatterProps, __ΩFrontMatterProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core5 from "@alloy-js/core";
|
|
2
2
|
|
|
3
3
|
//#region src/markdown/components/front-matter.d.ts
|
|
4
4
|
interface FrontMatterProps {
|
|
@@ -9,7 +9,7 @@ interface FrontMatterProps {
|
|
|
9
9
|
*
|
|
10
10
|
* @see https://jekyllrb.com/docs/front-matter/
|
|
11
11
|
*/
|
|
12
|
-
declare function FrontMatter(props: FrontMatterProps):
|
|
12
|
+
declare function FrontMatter(props: FrontMatterProps): _alloy_js_core5.Children;
|
|
13
13
|
declare type __ΩFrontMatterProps = any[];
|
|
14
14
|
//#endregion
|
|
15
15
|
export { FrontMatter, FrontMatterProps, __ΩFrontMatterProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps, SourceFileHeaderProps } from "../../types/components.cjs";
|
|
2
2
|
import { SourceFileProps as SourceFileProps$1 } from "../../core/components/source-file.cjs";
|
|
3
3
|
import { FrontMatterProps } from "./front-matter.cjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
5
5
|
|
|
6
6
|
//#region src/markdown/components/markdown-file.d.ts
|
|
7
7
|
type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps & MarkdownFileHeaderProps;
|
|
@@ -11,7 +11,7 @@ type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps &
|
|
|
11
11
|
* @param props - The properties for the source file.
|
|
12
12
|
* @returns The rendered source file component.
|
|
13
13
|
*/
|
|
14
|
-
declare function MarkdownFile(props: MarkdownFileProps):
|
|
14
|
+
declare function MarkdownFile(props: MarkdownFileProps): _alloy_js_core0.Children;
|
|
15
15
|
type MarkdownFileHeaderProps = SourceFileHeaderProps & {
|
|
16
16
|
frontMatter?: FrontMatterProps["data"];
|
|
17
17
|
};
|
|
@@ -21,7 +21,7 @@ type MarkdownFileHeaderProps = SourceFileHeaderProps & {
|
|
|
21
21
|
* @param props - The properties for the source file header.
|
|
22
22
|
* @returns The rendered source file header.
|
|
23
23
|
*/
|
|
24
|
-
declare function MarkdownFileHeader(props: MarkdownFileHeaderProps):
|
|
24
|
+
declare function MarkdownFileHeader(props: MarkdownFileHeaderProps): _alloy_js_core0.Children;
|
|
25
25
|
declare type __ΩMarkdownFileProps = any[];
|
|
26
26
|
declare type __ΩMarkdownFileHeaderProps = any[];
|
|
27
27
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps, SourceFileHeaderProps } from "../../types/components.mjs";
|
|
2
2
|
import { SourceFileProps as SourceFileProps$1 } from "../../core/components/source-file.mjs";
|
|
3
3
|
import { FrontMatterProps } from "./front-matter.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as _alloy_js_core6 from "@alloy-js/core";
|
|
5
5
|
|
|
6
6
|
//#region src/markdown/components/markdown-file.d.ts
|
|
7
7
|
type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps & MarkdownFileHeaderProps;
|
|
@@ -11,7 +11,7 @@ type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps &
|
|
|
11
11
|
* @param props - The properties for the source file.
|
|
12
12
|
* @returns The rendered source file component.
|
|
13
13
|
*/
|
|
14
|
-
declare function MarkdownFile(props: MarkdownFileProps):
|
|
14
|
+
declare function MarkdownFile(props: MarkdownFileProps): _alloy_js_core6.Children;
|
|
15
15
|
type MarkdownFileHeaderProps = SourceFileHeaderProps & {
|
|
16
16
|
frontMatter?: FrontMatterProps["data"];
|
|
17
17
|
};
|
|
@@ -21,7 +21,7 @@ type MarkdownFileHeaderProps = SourceFileHeaderProps & {
|
|
|
21
21
|
* @param props - The properties for the source file header.
|
|
22
22
|
* @returns The rendered source file header.
|
|
23
23
|
*/
|
|
24
|
-
declare function MarkdownFileHeader(props: MarkdownFileHeaderProps):
|
|
24
|
+
declare function MarkdownFileHeader(props: MarkdownFileHeaderProps): _alloy_js_core6.Children;
|
|
25
25
|
declare type __ΩMarkdownFileProps = any[];
|
|
26
26
|
declare type __ΩMarkdownFileHeaderProps = any[];
|
|
27
27
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.mjs";
|
|
2
2
|
import { MarkdownTableColumnContextInterface } from "../contexts/markdown-table.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core2 from "@alloy-js/core";
|
|
4
4
|
|
|
5
5
|
//#region src/markdown/components/markdown-table.d.ts
|
|
6
6
|
interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>> extends ComponentProps {
|
|
@@ -9,18 +9,18 @@ interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>
|
|
|
9
9
|
/**
|
|
10
10
|
* Component that provides a context for rendering markdown tables.
|
|
11
11
|
*/
|
|
12
|
-
declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>):
|
|
12
|
+
declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>): _alloy_js_core2.Children;
|
|
13
13
|
type MarkdownTableColumnProps = ComponentProps & Partial<Pick<MarkdownTableColumnContextInterface, "align">> & Required<Pick<MarkdownTableColumnContextInterface, "name">> & {
|
|
14
14
|
width?: number;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Component that provides a context for rendering markdown tables.
|
|
18
18
|
*/
|
|
19
|
-
declare function MarkdownTableColumn(props: MarkdownTableColumnProps):
|
|
19
|
+
declare function MarkdownTableColumn(props: MarkdownTableColumnProps): _alloy_js_core2.Children;
|
|
20
20
|
/**
|
|
21
21
|
* Component that provides a context for rendering markdown tables.
|
|
22
22
|
*/
|
|
23
|
-
declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps):
|
|
23
|
+
declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps): _alloy_js_core2.Children;
|
|
24
24
|
declare type __ΩMarkdownTableProps = any[];
|
|
25
25
|
declare type __ΩMarkdownTableColumnProps = any[];
|
|
26
26
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-table.d.cts","names":[],"sources":["../../../src/markdown/contexts/markdown-table.ts"],"sourcesContent":[],"mappings":";;;UAqBiB,8CACL,sBAAsB;;EADjB,IAAA,EAAA,MAIH,CAJG;EACL,KAAA,EAAA,MAAA,GAAA,OAAA,GAAA,QAAA;EAAsB,KAAA,EAAA,MAAA;;;AAWlC;AAWA;AAMiB,cAjBJ,0BAiBiC,EAjBL,gBAiBK,CAjBY,mCAiBZ,CAAA;;;;;;AAIrC,iBAVO,sBAAA,CAAA,CAUP,EAV6B,mCAU7B,CAV6B,MAU7B,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,GAAA,SAAA;AAMI,UAVI,6BAUmC,CAAA,UATxC,MASwC,CAAA,
|
|
1
|
+
{"version":3,"file":"markdown-table.d.cts","names":[],"sources":["../../../src/markdown/contexts/markdown-table.ts"],"sourcesContent":[],"mappings":";;;UAqBiB,8CACL,sBAAsB;;EADjB,IAAA,EAAA,MAIH,CAJG;EACL,KAAA,EAAA,MAAA,GAAA,OAAA,GAAA,QAAA;EAAsB,KAAA,EAAA,MAAA;;;AAWlC;AAWA;AAMiB,cAjBJ,0BAiBiC,EAjBL,gBAiBK,CAjBY,mCAiBZ,CAAA;;;;;;AAIrC,iBAVO,sBAAA,CAAA,CAUP,EAV6B,mCAU7B,CAV6B,MAU7B,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,GAAA,SAAA;AAMI,UAVI,6BAUmC,CAAA,UATxC,MASwC,CAAA,MAAjB,EAAA,GAAA,CAAA,GATD,MASC,CAAA,MAAgB,EAAA,GAAA,CAAA,CAAA,CAAA;EAWnC,OAAA,EAlBL,mCAkBqB,CAlBe,CAkBf,CAAA,EAAA;QAjBxB;;;;;cAMK,sBAAsB,iBAAiB;;;;;;iBAWpC,gBAAA,CAAA,GAAgB,8BAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TSDocModuleProps } from "./tsdoc.cjs";
|
|
2
2
|
import { TypescriptFileProps } from "./typescript-file.cjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core15 from "@alloy-js/core";
|
|
4
4
|
|
|
5
5
|
//#region src/typescript/components/builtin-file.d.ts
|
|
6
6
|
type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
|
|
@@ -28,7 +28,7 @@ type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProp
|
|
|
28
28
|
* @param props - The properties for the source file.
|
|
29
29
|
* @returns The rendered source file component.
|
|
30
30
|
*/
|
|
31
|
-
declare function BuiltinFile(props: BuiltinFileProps):
|
|
31
|
+
declare function BuiltinFile(props: BuiltinFileProps): _alloy_js_core15.Children;
|
|
32
32
|
declare type __ΩBuiltinFileProps = any[];
|
|
33
33
|
//#endregion
|
|
34
34
|
export { BuiltinFile, BuiltinFileProps, __ΩBuiltinFileProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TSDocModuleProps } from "./tsdoc.mjs";
|
|
2
2
|
import { TypescriptFileProps } from "./typescript-file.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core18 from "@alloy-js/core";
|
|
4
4
|
|
|
5
5
|
//#region src/typescript/components/builtin-file.d.ts
|
|
6
6
|
type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
|
|
@@ -28,7 +28,7 @@ type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProp
|
|
|
28
28
|
* @param props - The properties for the source file.
|
|
29
29
|
* @returns The rendered source file component.
|
|
30
30
|
*/
|
|
31
|
-
declare function BuiltinFile(props: BuiltinFileProps):
|
|
31
|
+
declare function BuiltinFile(props: BuiltinFileProps): _alloy_js_core18.Children;
|
|
32
32
|
declare type __ΩBuiltinFileProps = any[];
|
|
33
33
|
//#endregion
|
|
34
34
|
export { BuiltinFile, BuiltinFileProps, __ΩBuiltinFileProps };
|
|
@@ -5,14 +5,17 @@ require('../contexts/index.cjs');
|
|
|
5
5
|
const require_typescript_contexts_member_scope = require('../contexts/member-scope.cjs');
|
|
6
6
|
const require_typescript_helpers_get_call_signature_props = require('../helpers/get-call-signature-props.cjs');
|
|
7
7
|
require('../helpers/index.cjs');
|
|
8
|
+
const require_typescript_components_property_name = require('./property-name.cjs');
|
|
8
9
|
const require_typescript_components_type_parameters = require('./type-parameters.cjs');
|
|
9
|
-
const require_typescript_components_typescript_property_name = require('./typescript-property-name.cjs');
|
|
10
10
|
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
11
11
|
let __alloy_js_core = require("@alloy-js/core");
|
|
12
12
|
let __alloy_js_typescript = require("@alloy-js/typescript");
|
|
13
13
|
|
|
14
14
|
//#region src/typescript/components/class-declaration.tsx
|
|
15
15
|
/**
|
|
16
|
+
* Props for the ClassDeclaration component, which represents a TypeScript class declaration
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
16
19
|
* Create a TypeScript class declaration.
|
|
17
20
|
*
|
|
18
21
|
* @example
|
|
@@ -65,22 +68,14 @@ function ClassDeclaration(props) {
|
|
|
65
68
|
hasInstanceMembers: true,
|
|
66
69
|
namePolicy: (0, __alloy_js_typescript.useTSNamePolicy)().for("class")
|
|
67
70
|
});
|
|
68
|
-
const typeParametersChildren = props.children ? (0, __alloy_js_core.findKeyedChild)(props.children, require_typescript_components_type_parameters.TypeParameters.tag) : void 0;
|
|
69
|
-
const sTypeParameters = typeParametersChildren ? [
|
|
70
|
-
"<",
|
|
71
|
-
typeParametersChildren,
|
|
72
|
-
">"
|
|
73
|
-
] : (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_type_parameters.TypeParameters, { get parameters() {
|
|
74
|
-
return props.typeParameters;
|
|
75
|
-
} });
|
|
76
71
|
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
77
72
|
get when() {
|
|
78
73
|
return Boolean(props.doc);
|
|
79
74
|
},
|
|
80
75
|
get children() {
|
|
81
|
-
return
|
|
76
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { get heading() {
|
|
82
77
|
return props.doc;
|
|
83
|
-
} })
|
|
78
|
+
} });
|
|
84
79
|
}
|
|
85
80
|
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.Declaration, {
|
|
86
81
|
symbol: sym,
|
|
@@ -98,7 +93,9 @@ function ClassDeclaration(props) {
|
|
|
98
93
|
(0, __alloy_js_core_jsx_runtime.memo)(() => props.abstract && __alloy_js_core.code`abstract `),
|
|
99
94
|
" class ",
|
|
100
95
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Name, {}),
|
|
101
|
-
|
|
96
|
+
(0, __alloy_js_core_jsx_runtime.memo)(() => (0, __alloy_js_core_jsx_runtime.memo)(() => !!props.typeParameters)() && (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_type_parameters.TypeParameters, { get parameters() {
|
|
97
|
+
return props.typeParameters;
|
|
98
|
+
} })),
|
|
102
99
|
extendsPart,
|
|
103
100
|
implementsPart,
|
|
104
101
|
" ",
|
|
@@ -112,6 +109,15 @@ function ClassDeclaration(props) {
|
|
|
112
109
|
})];
|
|
113
110
|
}
|
|
114
111
|
ClassDeclaration.TypeParameters = require_typescript_components_type_parameters.TypeParameters;
|
|
112
|
+
/**
|
|
113
|
+
* Generates a TypeScript class member declaration for the given reflection class.
|
|
114
|
+
*/
|
|
115
|
+
/**
|
|
116
|
+
* Generates a TypeScript class member declaration for the given reflection class.
|
|
117
|
+
*
|
|
118
|
+
* @param props - The properties of the class member, including its name, visibility, and other modifiers.
|
|
119
|
+
* @returns A JSX element representing the class member declaration, which can be used within a ClassDeclaration component.
|
|
120
|
+
*/
|
|
115
121
|
function ClassMember(props) {
|
|
116
122
|
let tsFlags = __alloy_js_typescript.TSSymbolFlags.None;
|
|
117
123
|
if (props.nullish) tsFlags |= __alloy_js_typescript.TSSymbolFlags.Nullish;
|
|
@@ -125,9 +131,9 @@ function ClassMember(props) {
|
|
|
125
131
|
return Boolean(props.doc);
|
|
126
132
|
},
|
|
127
133
|
get children() {
|
|
128
|
-
return
|
|
134
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { get heading() {
|
|
129
135
|
return props.doc;
|
|
130
|
-
} })
|
|
136
|
+
} });
|
|
131
137
|
}
|
|
132
138
|
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.MemberDeclaration, {
|
|
133
139
|
symbol: sym,
|
|
@@ -136,12 +142,22 @@ function ClassMember(props) {
|
|
|
136
142
|
(0, __alloy_js_core_jsx_runtime.memo)(() => props.public && "public "),
|
|
137
143
|
(0, __alloy_js_core_jsx_runtime.memo)(() => props.private && "private "),
|
|
138
144
|
(0, __alloy_js_core_jsx_runtime.memo)(() => props.protected && "protected "),
|
|
145
|
+
(0, __alloy_js_core_jsx_runtime.memo)(() => props.abstract && "abstract "),
|
|
139
146
|
(0, __alloy_js_core_jsx_runtime.memo)(() => props.static && "static "),
|
|
140
147
|
(0, __alloy_js_core_jsx_runtime.memo)(() => props.children)
|
|
141
148
|
];
|
|
142
149
|
}
|
|
143
150
|
})];
|
|
144
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Props for a class field, which is a specific type of class member that represents a property of the class.
|
|
154
|
+
*/
|
|
155
|
+
/**
|
|
156
|
+
* Generates a TypeScript class field declaration for the given reflection class.
|
|
157
|
+
*
|
|
158
|
+
* @param props - The properties of the class field, including its name, type, optionality, and other modifiers.
|
|
159
|
+
* @returns A JSX element representing the class field declaration, which can be used within a ClassDeclaration component.
|
|
160
|
+
*/
|
|
145
161
|
function ClassField(props) {
|
|
146
162
|
const optionality = props.optional ? "?" : "";
|
|
147
163
|
const typeSection = props.type && [
|
|
@@ -156,13 +172,22 @@ function ClassField(props) {
|
|
|
156
172
|
nullish: props.nullish ?? props.optional,
|
|
157
173
|
get children() {
|
|
158
174
|
return [
|
|
159
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(
|
|
175
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_property_name.PropertyName, {}),
|
|
160
176
|
typeSection,
|
|
161
177
|
initializerSection
|
|
162
178
|
];
|
|
163
179
|
}
|
|
164
180
|
}));
|
|
165
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Props for a class method, which is a specific type of class member that represents a function defined within the class.
|
|
184
|
+
*/
|
|
185
|
+
/**
|
|
186
|
+
* Generates a TypeScript class method declaration for the given reflection class.
|
|
187
|
+
*
|
|
188
|
+
* @param props - The properties of the class method, including its name, visibility, and other modifiers.
|
|
189
|
+
* @returns A JSX element representing the class method declaration, which can be used within a ClassDeclaration component.
|
|
190
|
+
*/
|
|
166
191
|
function ClassMethod(props) {
|
|
167
192
|
const callProps = require_typescript_helpers_get_call_signature_props.getCallSignatureProps(props);
|
|
168
193
|
const [_, rest] = (0, __alloy_js_core.splitProps)(props, ["doc"]);
|
|
@@ -171,18 +196,18 @@ function ClassMethod(props) {
|
|
|
171
196
|
return Boolean(props.doc);
|
|
172
197
|
},
|
|
173
198
|
get children() {
|
|
174
|
-
return
|
|
199
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { get children() {
|
|
175
200
|
return [(0, __alloy_js_core_jsx_runtime.memo)(() => (0, __alloy_js_core_jsx_runtime.memo)(() => !!props.doc)() && (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Prose, { get children() {
|
|
176
201
|
return props.doc;
|
|
177
202
|
} })), (0, __alloy_js_core_jsx_runtime.memo)(() => (0, __alloy_js_core_jsx_runtime.memo)(() => !!Array.isArray(rest.parameters))() && (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDocParams, { get parameters() {
|
|
178
203
|
return rest.parameters;
|
|
179
204
|
} }))];
|
|
180
|
-
} })
|
|
205
|
+
} });
|
|
181
206
|
}
|
|
182
207
|
}), (0, __alloy_js_core_jsx_runtime.createComponent)(ClassMember, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, { get children() {
|
|
183
208
|
return [
|
|
184
209
|
(0, __alloy_js_core_jsx_runtime.memo)(() => props.async && "async "),
|
|
185
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(
|
|
210
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_property_name.PropertyName, {}),
|
|
186
211
|
(0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_contexts_lexical_scope.LexicalScope, { get children() {
|
|
187
212
|
return [
|
|
188
213
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.CallSignature, callProps),
|