@typespec/tspd 0.47.0-dev.0
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/LICENSE +21 -0
- package/cmd/tspd.js +2 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +99 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/ref-doc/api-docs.d.ts +4 -0
- package/dist/src/ref-doc/api-docs.d.ts.map +1 -0
- package/dist/src/ref-doc/api-docs.js +71 -0
- package/dist/src/ref-doc/api-docs.js.map +1 -0
- package/dist/src/ref-doc/emitters/docusaurus.d.ts +24 -0
- package/dist/src/ref-doc/emitters/docusaurus.d.ts.map +1 -0
- package/dist/src/ref-doc/emitters/docusaurus.js +232 -0
- package/dist/src/ref-doc/emitters/docusaurus.js.map +1 -0
- package/dist/src/ref-doc/emitters/markdown.d.ts +32 -0
- package/dist/src/ref-doc/emitters/markdown.d.ts.map +1 -0
- package/dist/src/ref-doc/emitters/markdown.js +229 -0
- package/dist/src/ref-doc/emitters/markdown.js.map +1 -0
- package/dist/src/ref-doc/experimental.d.ts +9 -0
- package/dist/src/ref-doc/experimental.d.ts.map +1 -0
- package/dist/src/ref-doc/experimental.js +63 -0
- package/dist/src/ref-doc/experimental.js.map +1 -0
- package/dist/src/ref-doc/extractor.d.ts +11 -0
- package/dist/src/ref-doc/extractor.d.ts.map +1 -0
- package/dist/src/ref-doc/extractor.js +497 -0
- package/dist/src/ref-doc/extractor.js.map +1 -0
- package/dist/src/ref-doc/index.d.ts +5 -0
- package/dist/src/ref-doc/index.d.ts.map +1 -0
- package/dist/src/ref-doc/index.js +5 -0
- package/dist/src/ref-doc/index.js.map +1 -0
- package/dist/src/ref-doc/lib.d.ts +63 -0
- package/dist/src/ref-doc/lib.d.ts.map +1 -0
- package/dist/src/ref-doc/lib.js +24 -0
- package/dist/src/ref-doc/lib.js.map +1 -0
- package/dist/src/ref-doc/types.d.ts +109 -0
- package/dist/src/ref-doc/types.d.ts.map +1 -0
- package/dist/src/ref-doc/types.js +2 -0
- package/dist/src/ref-doc/types.js.map +1 -0
- package/dist/src/ref-doc/utils/markdown.d.ts +27 -0
- package/dist/src/ref-doc/utils/markdown.d.ts.map +1 -0
- package/dist/src/ref-doc/utils/markdown.js +70 -0
- package/dist/src/ref-doc/utils/markdown.js.map +1 -0
- package/dist/src/ref-doc/utils/type-signature.d.ts +5 -0
- package/dist/src/ref-doc/utils/type-signature.d.ts.map +1 -0
- package/dist/src/ref-doc/utils/type-signature.js +136 -0
- package/dist/src/ref-doc/utils/type-signature.js.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Decorator, Enum, FunctionParameter, Interface, LinterRuleDefinition, LinterRuleSet, Model, NodePackage, Operation, Scalar, Union } from "@typespec/compiler";
|
|
2
|
+
export type TypeSpecRefDoc = TypeSpecLibraryRefDoc;
|
|
3
|
+
export type TypeSpecLibraryRefDoc = TypeSpecRefDocBase & {
|
|
4
|
+
/**
|
|
5
|
+
* Library name
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* Library package.json
|
|
10
|
+
*/
|
|
11
|
+
packageJson: NodePackage;
|
|
12
|
+
/**
|
|
13
|
+
* Library description
|
|
14
|
+
*/
|
|
15
|
+
description?: string;
|
|
16
|
+
emitter?: EmitterRefDoc;
|
|
17
|
+
/** Documentation about the linter rules and ruleset provided in this library. */
|
|
18
|
+
linter?: LinterRefDoc;
|
|
19
|
+
};
|
|
20
|
+
export type TypeSpecRefDocBase = {
|
|
21
|
+
namespaces: NamespaceRefDoc[];
|
|
22
|
+
};
|
|
23
|
+
export type EmitterRefDoc = {
|
|
24
|
+
options: EmitterOptionRefDoc[];
|
|
25
|
+
};
|
|
26
|
+
export type LinterRefDoc = {
|
|
27
|
+
/** List of rulesets provided. */
|
|
28
|
+
ruleSets?: LinterRuleSetRefDoc[];
|
|
29
|
+
rules: LinterRuleRefDoc[];
|
|
30
|
+
};
|
|
31
|
+
export type LinterRuleSetRefDoc = ReferencableElement & {
|
|
32
|
+
ruleSet: LinterRuleSet;
|
|
33
|
+
};
|
|
34
|
+
export type LinterRuleRefDoc = ReferencableElement & {
|
|
35
|
+
rule: LinterRuleDefinition<any, any>;
|
|
36
|
+
};
|
|
37
|
+
export type EmitterOptionRefDoc = {
|
|
38
|
+
name: string;
|
|
39
|
+
type: string;
|
|
40
|
+
doc: string;
|
|
41
|
+
};
|
|
42
|
+
export type NamespaceRefDoc = {
|
|
43
|
+
id: string;
|
|
44
|
+
decorators: DecoratorRefDoc[];
|
|
45
|
+
operations: OperationRefDoc[];
|
|
46
|
+
interfaces: InterfaceRefDoc[];
|
|
47
|
+
models: ModelRefDoc[];
|
|
48
|
+
enums: EnumRefDoc[];
|
|
49
|
+
unions: UnionRefDoc[];
|
|
50
|
+
scalars: ScalarRefDoc[];
|
|
51
|
+
};
|
|
52
|
+
export type ReferencableElement = {
|
|
53
|
+
/**
|
|
54
|
+
* Fully qualified id
|
|
55
|
+
*/
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
};
|
|
59
|
+
export type NamedTypeRefDoc = ReferencableElement & {
|
|
60
|
+
signature: string;
|
|
61
|
+
doc: string;
|
|
62
|
+
examples: ExampleRefDoc[];
|
|
63
|
+
};
|
|
64
|
+
export type DecoratorRefDoc = NamedTypeRefDoc & {
|
|
65
|
+
type: Decorator;
|
|
66
|
+
target: FunctionParameterRefDoc;
|
|
67
|
+
parameters: FunctionParameterRefDoc[];
|
|
68
|
+
otherTags: string[];
|
|
69
|
+
};
|
|
70
|
+
export type FunctionParameterRefDoc = {
|
|
71
|
+
type: FunctionParameter;
|
|
72
|
+
name: string;
|
|
73
|
+
doc: string;
|
|
74
|
+
optional: boolean;
|
|
75
|
+
rest: boolean;
|
|
76
|
+
};
|
|
77
|
+
export type ExampleRefDoc = {
|
|
78
|
+
title?: string;
|
|
79
|
+
content: string;
|
|
80
|
+
};
|
|
81
|
+
export type OperationRefDoc = NamedTypeRefDoc & {
|
|
82
|
+
type: Operation;
|
|
83
|
+
templateParameters?: TemplateParameterRefDoc[];
|
|
84
|
+
};
|
|
85
|
+
export type InterfaceRefDoc = NamedTypeRefDoc & {
|
|
86
|
+
type: Interface;
|
|
87
|
+
templateParameters?: TemplateParameterRefDoc[];
|
|
88
|
+
interfaceOperations: OperationRefDoc[];
|
|
89
|
+
};
|
|
90
|
+
export type TemplateParameterRefDoc = {
|
|
91
|
+
name: string;
|
|
92
|
+
doc: string;
|
|
93
|
+
};
|
|
94
|
+
export type ModelRefDoc = NamedTypeRefDoc & {
|
|
95
|
+
type: Model;
|
|
96
|
+
templateParameters?: TemplateParameterRefDoc[];
|
|
97
|
+
};
|
|
98
|
+
export type EnumRefDoc = NamedTypeRefDoc & {
|
|
99
|
+
type: Enum;
|
|
100
|
+
};
|
|
101
|
+
export type UnionRefDoc = NamedTypeRefDoc & {
|
|
102
|
+
type: Union;
|
|
103
|
+
templateParameters?: TemplateParameterRefDoc[];
|
|
104
|
+
};
|
|
105
|
+
export type ScalarRefDoc = NamedTypeRefDoc & {
|
|
106
|
+
type: Scalar;
|
|
107
|
+
templateParameters?: TemplateParameterRefDoc[];
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/ref-doc/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,iBAAiB,EACjB,SAAS,EACT,oBAAoB,EACpB,aAAa,EACb,KAAK,EACL,WAAW,EACX,SAAS,EACT,MAAM,EACN,KAAK,EACN,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAEnD,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,GAAG;IACvD;;OAEG;IACH,IAAI,EAAE,MAA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,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG;IACzC,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG;IAC1C,IAAI,EAAE,KAAK,CAAC;IAEZ,kBAAkB,CAAC,EAAE,uBAAuB,EAAE,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG;IAC3C,IAAI,EAAE,MAAM,CAAC;IAEb,kBAAkB,CAAC,EAAE,uBAAuB,EAAE,CAAC;CAChD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/ref-doc/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const headings: {
|
|
2
|
+
h1: (title: string) => string;
|
|
3
|
+
h2: (title: string) => string;
|
|
4
|
+
h3: (title: string) => string;
|
|
5
|
+
h4: (title: string) => string;
|
|
6
|
+
h5: (title: string) => string;
|
|
7
|
+
hx: (number: number, title: string) => string;
|
|
8
|
+
};
|
|
9
|
+
export declare function codeblock(code: string, lang?: string): string;
|
|
10
|
+
export declare function inlinecode(code: string): string;
|
|
11
|
+
export declare function link(text: string, url: string): string;
|
|
12
|
+
export declare function table([header, ...rows]: string[][]): string;
|
|
13
|
+
export type Tab = {
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
content: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function tabs(tabs: Tab[]): string;
|
|
19
|
+
export interface MarkdownSection {
|
|
20
|
+
kind: "section";
|
|
21
|
+
title: string;
|
|
22
|
+
body: MarkdownDoc;
|
|
23
|
+
}
|
|
24
|
+
export type MarkdownDoc = string | MarkdownSection | MarkdownDoc[];
|
|
25
|
+
export declare function renderMarkdowDoc(doc: MarkdownDoc, heading?: number): string;
|
|
26
|
+
export declare function section(title: string, body: MarkdownDoc): MarkdownSection;
|
|
27
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../../src/ref-doc/utils/markdown.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;gBAaJ,MAAM;gBAAN,MAAM;gBAAN,MAAM;gBAAN,MAAM;gBAAN,MAAM;iBAPR,MAAM,SAAS,MAAM;CAGnC,CAAC;AAOF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,MAAW,UAExD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,UAEtC;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAE7C;AAMD,wBAAgB,KAAK,CAAC,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,UAQlD;AAED,MAAM,MAAM,GAAG,GAAG;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,UAa/B;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,CAAC;CACnB;AACD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,eAAe,GAAG,WAAW,EAAE,CAAC;AAEnE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,SAAI,UAiB7D;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,eAAe,CAMzE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const headings = {
|
|
2
|
+
h1: hx(1),
|
|
3
|
+
h2: hx(2),
|
|
4
|
+
h3: hx(3),
|
|
5
|
+
h4: hx(4),
|
|
6
|
+
h5: hx(5),
|
|
7
|
+
hx: (number, title) => {
|
|
8
|
+
return "#".repeat(number) + " " + title;
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
function hx(number) {
|
|
12
|
+
const prefix = "#".repeat(number) + " ";
|
|
13
|
+
return (title) => prefix + title;
|
|
14
|
+
}
|
|
15
|
+
export function codeblock(code, lang = "") {
|
|
16
|
+
return "```" + lang + "\n" + code + "\n" + "```";
|
|
17
|
+
}
|
|
18
|
+
export function inlinecode(code) {
|
|
19
|
+
return "`" + code + "`";
|
|
20
|
+
}
|
|
21
|
+
export function link(text, url) {
|
|
22
|
+
return `[${text}](${url})`;
|
|
23
|
+
}
|
|
24
|
+
function escapeMarkdownTable(text) {
|
|
25
|
+
return text.replace(/(\|)/g, "\\$1").replace(/\n/g, "<br />");
|
|
26
|
+
}
|
|
27
|
+
export function table([header, ...rows]) {
|
|
28
|
+
const renderRow = (row) => `| ${row.map(escapeMarkdownTable).join(" | ")} |`;
|
|
29
|
+
return [
|
|
30
|
+
renderRow(header),
|
|
31
|
+
"|" + header.map((x) => "-".repeat(x.length + 2)).join("|") + "|",
|
|
32
|
+
...rows.map(renderRow),
|
|
33
|
+
].join("\n");
|
|
34
|
+
}
|
|
35
|
+
export function tabs(tabs) {
|
|
36
|
+
const result = ["<Tabs>"];
|
|
37
|
+
for (const tab of tabs) {
|
|
38
|
+
result.push(`<TabItem value="${tab.id}" label="${tab.label}" default>`, "", tab.content, "", "</TabItem>");
|
|
39
|
+
}
|
|
40
|
+
result.push("</Tabs>", "");
|
|
41
|
+
return result.join("\n");
|
|
42
|
+
}
|
|
43
|
+
export function renderMarkdowDoc(doc, heading = 1) {
|
|
44
|
+
const flattened = [];
|
|
45
|
+
let currentHeading = heading;
|
|
46
|
+
function render(doc) {
|
|
47
|
+
if (typeof doc === "string") {
|
|
48
|
+
flattened.push(doc);
|
|
49
|
+
}
|
|
50
|
+
else if (Array.isArray(doc)) {
|
|
51
|
+
doc.forEach(render);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
flattened.push(headings.hx(currentHeading, doc.title));
|
|
55
|
+
currentHeading++;
|
|
56
|
+
render(doc.body);
|
|
57
|
+
currentHeading--;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
render(doc);
|
|
61
|
+
return flattened.join("\n");
|
|
62
|
+
}
|
|
63
|
+
export function section(title, body) {
|
|
64
|
+
return {
|
|
65
|
+
kind: "section",
|
|
66
|
+
title,
|
|
67
|
+
body,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../../../src/ref-doc/utils/markdown.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACT,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACT,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACT,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACT,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACT,EAAE,EAAE,CAAC,MAAc,EAAE,KAAa,EAAE,EAAE;QACpC,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC;IAC1C,CAAC;CACF,CAAC;AAEF,SAAS,EAAE,CAAC,MAAc;IACxB,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;IACxC,OAAO,CAAC,KAAa,EAAE,EAAE,CAAC,MAAM,GAAG,KAAK,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,OAAe,EAAE;IACvD,OAAO,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KA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,GAAG,MAAM,CAAA;CAAE,CAAC,GAAG,SAAS,UAWnF"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { compilerAssert, getTypeName, } from "@typespec/compiler";
|
|
2
|
+
/** @internal */
|
|
3
|
+
export function getTypeSignature(type) {
|
|
4
|
+
if (type.kind === "Value") {
|
|
5
|
+
return `valueof ${getTypeSignature(type.target)}`;
|
|
6
|
+
}
|
|
7
|
+
if (isReflectionType(type)) {
|
|
8
|
+
return type.name;
|
|
9
|
+
}
|
|
10
|
+
switch (type.kind) {
|
|
11
|
+
case "Scalar":
|
|
12
|
+
case "Enum":
|
|
13
|
+
case "Union":
|
|
14
|
+
case "Model":
|
|
15
|
+
case "Namespace":
|
|
16
|
+
return `${type.kind.toLowerCase()} ${getTypeName(type)}`;
|
|
17
|
+
case "Interface":
|
|
18
|
+
return getInterfaceSignature(type);
|
|
19
|
+
case "Decorator":
|
|
20
|
+
return getDecoratorSignature(type);
|
|
21
|
+
case "Function":
|
|
22
|
+
return getFunctionSignature(type);
|
|
23
|
+
case "Operation":
|
|
24
|
+
return getOperationSignature(type);
|
|
25
|
+
case "String":
|
|
26
|
+
return `(string) ${`"${type.value}"`}`;
|
|
27
|
+
case "Boolean":
|
|
28
|
+
return `(boolean) ${type.value ? "true" : "false"}`;
|
|
29
|
+
case "Number":
|
|
30
|
+
return `(number) ${type.value.toString()}`;
|
|
31
|
+
case "Intrinsic":
|
|
32
|
+
return `(intrinsic) ${type.name}`;
|
|
33
|
+
case "FunctionParameter":
|
|
34
|
+
return getFunctionParameterSignature(type);
|
|
35
|
+
case "StringTemplate":
|
|
36
|
+
return `(string template)\n${getStringTemplateSignature(type)}`;
|
|
37
|
+
case "StringTemplateSpan":
|
|
38
|
+
return `(string template span)\n${getTypeName(type.type)}`;
|
|
39
|
+
case "ModelProperty":
|
|
40
|
+
return `(model property) ${`${type.name}: ${getTypeName(type.type)}`}`;
|
|
41
|
+
case "EnumMember":
|
|
42
|
+
return `(enum member) ${getEnumMemberSignature(type)}`;
|
|
43
|
+
case "TemplateParameter":
|
|
44
|
+
return type.node.id.sv;
|
|
45
|
+
case "UnionVariant":
|
|
46
|
+
return `(union variant) ${getUnionVariantSignature(type)}`;
|
|
47
|
+
case "Tuple":
|
|
48
|
+
return `(tuple) [${type.values.map(getTypeSignature).join(", ")}]`;
|
|
49
|
+
case "Projection":
|
|
50
|
+
return "(projection)";
|
|
51
|
+
case "Object":
|
|
52
|
+
return "(object)";
|
|
53
|
+
default:
|
|
54
|
+
const _assertNever = type;
|
|
55
|
+
compilerAssert(false, "Unexpected type kind");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function isReflectionType(type) {
|
|
59
|
+
var _a, _b, _c;
|
|
60
|
+
return (type.kind === "Model" &&
|
|
61
|
+
((_a = type.namespace) === null || _a === void 0 ? void 0 : _a.name) === "Reflection" &&
|
|
62
|
+
((_c = (_b = type.namespace) === null || _b === void 0 ? void 0 : _b.namespace) === null || _c === void 0 ? void 0 : _c.name) === "TypeSpec");
|
|
63
|
+
}
|
|
64
|
+
function getDecoratorSignature(type) {
|
|
65
|
+
const ns = getQualifier(type.namespace);
|
|
66
|
+
const name = type.name.slice(1);
|
|
67
|
+
const parameters = [...type.parameters].map((x) => getFunctionParameterSignature(x));
|
|
68
|
+
let signature = `@${ns}${name}`;
|
|
69
|
+
if (parameters.length > 0) {
|
|
70
|
+
signature += `(${parameters.join(", ")})`;
|
|
71
|
+
}
|
|
72
|
+
return signature;
|
|
73
|
+
}
|
|
74
|
+
function getFunctionSignature(type) {
|
|
75
|
+
const ns = getQualifier(type.namespace);
|
|
76
|
+
const parameters = type.parameters.map((x) => getFunctionParameterSignature(x));
|
|
77
|
+
return `fn ${ns}${type.name}(${parameters.join(", ")}): ${getTypeName(type.returnType)}`;
|
|
78
|
+
}
|
|
79
|
+
function getInterfaceSignature(type) {
|
|
80
|
+
const ns = getQualifier(type.namespace);
|
|
81
|
+
const templateParams = type.node.templateParameters
|
|
82
|
+
? getTemplateParameters(type.node.templateParameters)
|
|
83
|
+
: "";
|
|
84
|
+
return `interface ${ns}${type.name}${templateParams}`;
|
|
85
|
+
}
|
|
86
|
+
function getTemplateParameters(templateParameters) {
|
|
87
|
+
const params = templateParameters.map((x) => `${x.id.sv}`);
|
|
88
|
+
return `<${params.join(", ")}>`;
|
|
89
|
+
}
|
|
90
|
+
function getOperationSignature(type) {
|
|
91
|
+
var _a;
|
|
92
|
+
const qualifier = getQualifier((_a = type.interface) !== null && _a !== void 0 ? _a : type.namespace);
|
|
93
|
+
const parameters = [...type.parameters.properties.values()].map(getModelPropertySignature);
|
|
94
|
+
return `op ${qualifier}${type.name}(${parameters.join(", ")}): ${getTypeName(type.returnType)}`;
|
|
95
|
+
}
|
|
96
|
+
function getFunctionParameterSignature(parameter) {
|
|
97
|
+
const rest = parameter.rest ? "..." : "";
|
|
98
|
+
const optional = parameter.optional ? "?" : "";
|
|
99
|
+
return `${rest}${parameter.name}${optional}: ${getTypeName(parameter.type)}`;
|
|
100
|
+
}
|
|
101
|
+
function getStringTemplateSignature(stringTemplate) {
|
|
102
|
+
return ("`" +
|
|
103
|
+
[
|
|
104
|
+
stringTemplate.spans.map((span) => {
|
|
105
|
+
return span.isInterpolated ? "${" + getTypeName(span.type) + "}" : span.type.value;
|
|
106
|
+
}),
|
|
107
|
+
].join("") +
|
|
108
|
+
"`");
|
|
109
|
+
}
|
|
110
|
+
function getModelPropertySignature(property) {
|
|
111
|
+
const ns = getQualifier(property.model);
|
|
112
|
+
return `${ns}${property.name}: ${getTypeName(property.type)}`;
|
|
113
|
+
}
|
|
114
|
+
function getUnionVariantSignature(variant) {
|
|
115
|
+
if (typeof variant.name !== "string") {
|
|
116
|
+
return getTypeName(variant.type);
|
|
117
|
+
}
|
|
118
|
+
const ns = getQualifier(variant.union);
|
|
119
|
+
return `${ns}${variant.name}: ${getTypeName(variant.type)}`;
|
|
120
|
+
}
|
|
121
|
+
function getEnumMemberSignature(member) {
|
|
122
|
+
const ns = getQualifier(member.enum);
|
|
123
|
+
const value = typeof member.value === "string" ? `"${member.value}"` : member.value;
|
|
124
|
+
return value === undefined ? `${ns}${member.name}` : `${ns}${member.name}: ${value}`;
|
|
125
|
+
}
|
|
126
|
+
export function getQualifier(parent) {
|
|
127
|
+
if (!(parent === null || parent === void 0 ? void 0 : parent.name) || typeof parent.name !== "string") {
|
|
128
|
+
return "";
|
|
129
|
+
}
|
|
130
|
+
const parentName = getTypeName(parent);
|
|
131
|
+
if (!parentName || parentName === "TypeSpec") {
|
|
132
|
+
return "";
|
|
133
|
+
}
|
|
134
|
+
return parentName + ".";
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=type-signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-signature.js","sourceRoot":"","sources":["../../../../src/ref-doc/utils/type-signature.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAKd,WAAW,GAUZ,MAAM,oBAAoB,CAAC;AAE5B,gBAAgB;AAChB,MAAM,UAAU,gBAAgB,CAAC,IAAsB;IACrD,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC1B,OAAO,WAAW,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;IACpD,CAAC;IACD,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IACD,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,QAAQ,CAAC;QACd,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,CAAC;QACb,KAAK,WAAW;YACd,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3D,KAAK,WAAW;YACd,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC;QACrC,KAAK,WAAW;YACd,OAA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CAAC,MAAkB;IAChD,MAAM,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,KAAK,GAAG,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;IACpF,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;AACvF,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAuD;IAClF,IAAI,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAA,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QACrD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,IAAI,CAAC,UAAU,IAAI,UAAU,KAAK,UAAU,EAAE,CAAC;QAC7C,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,UAAU,GAAG,GAAG,CAAC;AAC1B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@typespec/tspd",
|
|
3
|
+
"version": "0.47.0-dev.0",
|
|
4
|
+
"author": "Microsoft Corporation",
|
|
5
|
+
"description": "TypeSpec library for generating TypeSpec docs",
|
|
6
|
+
"homepage": "https://microsoft.github.io/typespec",
|
|
7
|
+
"readme": "https://github.com/microsoft/typespec/blob/main/README.md",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/microsoft/typespec.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/microsoft/typespec/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"typespec"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"bin": {
|
|
21
|
+
"tspd": "./cmd/tspd.js"
|
|
22
|
+
},
|
|
23
|
+
"main": "./dist/src/index.js",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/src/index.d.ts",
|
|
27
|
+
"default": "./dist/src/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./ref-doc": {
|
|
30
|
+
"types": "./dist/src/ref-doc/index.d.ts",
|
|
31
|
+
"default": "./dist/src/ref-doc/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./ref-doc/emitters/docusaurus": {
|
|
34
|
+
"types": "./dist/src/ref-doc/emitters/docusaurus.d.ts",
|
|
35
|
+
"default": "./dist/src/ref-doc/emitters/docusaurus.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=18.0.0"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"lib/*.tsp",
|
|
43
|
+
"dist/**",
|
|
44
|
+
"!dist/test/**"
|
|
45
|
+
],
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@typespec/compiler": "~0.52.0 || >=0.53.0-dev <0.53.0",
|
|
48
|
+
"yaml": "~2.3.4",
|
|
49
|
+
"prettier": "~3.1.1",
|
|
50
|
+
"picocolors": "~1.0.0",
|
|
51
|
+
"yargs": "~17.7.2"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@typespec/compiler": "~0.52.0 || >=0.53.0-dev <0.53.0",
|
|
55
|
+
"@typespec/eslint-config-typespec": "~0.52.0 || >=0.53.0-dev <0.53.0",
|
|
56
|
+
"@typespec/prettier-plugin-typespec": "~0.52.0 || >=0.53.0-dev <0.53.0",
|
|
57
|
+
"@types/node": "~18.11.9",
|
|
58
|
+
"@types/yargs": "~17.0.32",
|
|
59
|
+
"c8": "~8.0.1",
|
|
60
|
+
"eslint": "^8.55.0",
|
|
61
|
+
"vitest": "^1.2.0",
|
|
62
|
+
"@vitest/coverage-v8": "^1.1.0",
|
|
63
|
+
"@vitest/ui": "~1.1.3",
|
|
64
|
+
"source-map-support": "~0.5.21",
|
|
65
|
+
"rimraf": "~5.0.1",
|
|
66
|
+
"typedoc-plugin-markdown": "~4.0.0-next.22",
|
|
67
|
+
"typedoc": "0.25.4",
|
|
68
|
+
"typescript": "~5.3.3"
|
|
69
|
+
},
|
|
70
|
+
"peerDependencies": {},
|
|
71
|
+
"scripts": {
|
|
72
|
+
"clean": "rimraf ./dist ./temp",
|
|
73
|
+
"build": "tsc -p .",
|
|
74
|
+
"watch": "tsc -p . --watch",
|
|
75
|
+
"test": "vitest run",
|
|
76
|
+
"test:ui": "vitest --ui",
|
|
77
|
+
"test-official": "vitest run --coverage --reporter=junit --reporter=default --no-file-parallelism",
|
|
78
|
+
"lint": "eslint . --ext .ts --max-warnings=0",
|
|
79
|
+
"lint:fix": "eslint . --fix --ext .ts"
|
|
80
|
+
}
|
|
81
|
+
}
|