@typespec/tspd 0.75.0-dev.0 → 0.75.0-dev.6
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/gen-extern-signatures/components/dollar-functions-type.d.ts +10 -0
- package/dist/src/gen-extern-signatures/components/dollar-functions-type.d.ts.map +1 -0
- package/dist/src/gen-extern-signatures/components/dollar-functions-type.js +40 -0
- package/dist/src/gen-extern-signatures/components/dollar-functions-type.js.map +1 -0
- package/dist/src/gen-extern-signatures/components/dollar-functions-type.jsx +18 -0
- package/dist/src/gen-extern-signatures/components/dollar-functions-type.jsx.map +1 -0
- package/dist/src/gen-extern-signatures/components/entity-signature-tests.d.ts +12 -0
- package/dist/src/gen-extern-signatures/components/entity-signature-tests.d.ts.map +1 -0
- package/dist/src/gen-extern-signatures/components/entity-signature-tests.js +40 -0
- package/dist/src/gen-extern-signatures/components/entity-signature-tests.js.map +1 -0
- package/dist/src/gen-extern-signatures/components/entity-signature-tests.jsx +25 -0
- package/dist/src/gen-extern-signatures/components/entity-signature-tests.jsx.map +1 -0
- package/dist/src/gen-extern-signatures/components/entity-signatures.d.ts +13 -0
- package/dist/src/gen-extern-signatures/components/entity-signatures.d.ts.map +1 -0
- package/dist/src/gen-extern-signatures/components/entity-signatures.js +144 -0
- package/dist/src/gen-extern-signatures/components/entity-signatures.js.map +1 -0
- package/dist/src/gen-extern-signatures/components/entity-signatures.jsx +75 -0
- package/dist/src/gen-extern-signatures/components/entity-signatures.jsx.map +1 -0
- package/dist/src/gen-extern-signatures/components/function-signature-type.d.ts +15 -0
- package/dist/src/gen-extern-signatures/components/function-signature-type.d.ts.map +1 -0
- package/dist/src/gen-extern-signatures/components/function-signature-type.js +372 -0
- package/dist/src/gen-extern-signatures/components/function-signature-type.js.map +1 -0
- package/dist/src/gen-extern-signatures/components/function-signature-type.jsx +281 -0
- package/dist/src/gen-extern-signatures/components/function-signature-type.jsx.map +1 -0
- package/dist/src/gen-extern-signatures/external-packages/compiler.d.ts +2 -0
- package/dist/src/gen-extern-signatures/external-packages/compiler.d.ts.map +1 -1
- package/dist/src/gen-extern-signatures/external-packages/compiler.js +1 -1
- package/dist/src/gen-extern-signatures/external-packages/compiler.js.map +1 -1
- package/dist/src/gen-extern-signatures/gen-extern-signatures.d.ts.map +1 -1
- package/dist/src/gen-extern-signatures/gen-extern-signatures.js +32 -9
- package/dist/src/gen-extern-signatures/gen-extern-signatures.js.map +1 -1
- package/dist/src/gen-extern-signatures/types.d.ts +11 -1
- package/dist/src/gen-extern-signatures/types.d.ts.map +1 -1
- package/dist/src/ref-doc/emitters/docusaurus.d.ts +2 -2
- package/dist/src/ref-doc/emitters/docusaurus.d.ts.map +1 -1
- package/dist/src/ref-doc/emitters/docusaurus.js +2 -8
- package/dist/src/ref-doc/emitters/docusaurus.js.map +1 -1
- package/dist/src/ref-doc/emitters/markdown.d.ts +9 -2
- package/dist/src/ref-doc/emitters/markdown.d.ts.map +1 -1
- package/dist/src/ref-doc/emitters/markdown.js +88 -4
- package/dist/src/ref-doc/emitters/markdown.js.map +1 -1
- package/dist/src/ref-doc/emitters/starlight.d.ts +2 -2
- package/dist/src/ref-doc/emitters/starlight.d.ts.map +1 -1
- package/dist/src/ref-doc/emitters/starlight.js +83 -8
- package/dist/src/ref-doc/emitters/starlight.js.map +1 -1
- package/dist/src/ref-doc/experimental.d.ts.map +1 -1
- package/dist/src/ref-doc/experimental.js +9 -1
- package/dist/src/ref-doc/experimental.js.map +1 -1
- package/dist/src/ref-doc/extractor.d.ts +5 -0
- package/dist/src/ref-doc/extractor.d.ts.map +1 -1
- package/dist/src/ref-doc/extractor.js +186 -8
- package/dist/src/ref-doc/extractor.js.map +1 -1
- package/dist/src/ref-doc/types.d.ts +27 -1
- package/dist/src/ref-doc/types.d.ts.map +1 -1
- package/dist/src/ref-doc/utils/type-signature.d.ts.map +1 -1
- package/dist/src/ref-doc/utils/type-signature.js +24 -1
- package/dist/src/ref-doc/utils/type-signature.js.map +1 -1
- package/package.json +27 -29
- package/dist/src/gen-extern-signatures/components/decorator-signature-tests.d.ts +0 -8
- package/dist/src/gen-extern-signatures/components/decorator-signature-tests.d.ts.map +0 -1
- package/dist/src/gen-extern-signatures/components/decorator-signature-tests.js +0 -17
- package/dist/src/gen-extern-signatures/components/decorator-signature-tests.js.map +0 -1
- package/dist/src/gen-extern-signatures/components/decorator-signature-tests.jsx +0 -12
- package/dist/src/gen-extern-signatures/components/decorator-signature-tests.jsx.map +0 -1
- package/dist/src/gen-extern-signatures/components/decorators-signatures.d.ts +0 -12
- package/dist/src/gen-extern-signatures/components/decorators-signatures.d.ts.map +0 -1
- package/dist/src/gen-extern-signatures/components/decorators-signatures.js +0 -108
- package/dist/src/gen-extern-signatures/components/decorators-signatures.js.map +0 -1
- package/dist/src/gen-extern-signatures/components/decorators-signatures.jsx +0 -60
- package/dist/src/gen-extern-signatures/components/decorators-signatures.jsx.map +0 -1
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { For, Output, refkey, render, StatementList, } from "@alloy-js/core";
|
|
2
|
-
import * as ts from "@alloy-js/typescript";
|
|
3
|
-
import { typespecCompiler } from "../external-packages/compiler.js";
|
|
4
|
-
import { DecoratorSignatureTests } from "./decorator-signature-tests.jsx";
|
|
5
|
-
import { DecoratorSignatureType, ValueOfModelTsInterfaceBody, } from "./decorator-signature-type.jsx";
|
|
6
|
-
import { DollarDecoratorsType } from "./dollar-decorators-type.jsx";
|
|
7
|
-
import { createTspdContext, TspdContext, useTspd } from "./tspd-context.js";
|
|
8
|
-
export function DecoratorSignatures({ namespaceName, decorators, dollarDecoratorsRefKey: dollarDecoratorsRefkey, }) {
|
|
9
|
-
return (<ts.TypeRefContext>
|
|
10
|
-
<LocalTypes />
|
|
11
|
-
<hbr />
|
|
12
|
-
<hbr />
|
|
13
|
-
<For each={decorators} doubleHardline>
|
|
14
|
-
{(signature) => {
|
|
15
|
-
return <DecoratorSignatureType signature={signature}/>;
|
|
16
|
-
}}
|
|
17
|
-
</For>
|
|
18
|
-
<hbr />
|
|
19
|
-
<hbr />
|
|
20
|
-
<DollarDecoratorsType namespaceName={namespaceName} decorators={decorators} refkey={dollarDecoratorsRefkey}/>
|
|
21
|
-
</ts.TypeRefContext>);
|
|
22
|
-
}
|
|
23
|
-
export function LocalTypes() {
|
|
24
|
-
const { localTypes } = useTspd();
|
|
25
|
-
return (<StatementList>
|
|
26
|
-
<For each={localTypes} doubleHardline>
|
|
27
|
-
{(type) => {
|
|
28
|
-
return (<ts.InterfaceDeclaration export name={type.name} refkey={refkey(type)}>
|
|
29
|
-
<ValueOfModelTsInterfaceBody model={type}/>
|
|
30
|
-
</ts.InterfaceDeclaration>);
|
|
31
|
-
}}
|
|
32
|
-
</For>
|
|
33
|
-
</StatementList>);
|
|
34
|
-
}
|
|
35
|
-
export function generateSignatures(program, decorators, libraryName, namespaceName) {
|
|
36
|
-
const context = createTspdContext(program);
|
|
37
|
-
const base = namespaceName === "" ? "__global__" : namespaceName;
|
|
38
|
-
const $decoratorsRef = refkey();
|
|
39
|
-
const userLib = ts.createPackage({
|
|
40
|
-
name: libraryName,
|
|
41
|
-
version: "0.0.0",
|
|
42
|
-
descriptor: {
|
|
43
|
-
".": {
|
|
44
|
-
named: ["$decorators"],
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
const jsxContent = (<TspdContext.Provider value={context}>
|
|
49
|
-
<Output externals={[typespecCompiler, userLib]}>
|
|
50
|
-
<ts.SourceFile path={`${base}.ts`}>
|
|
51
|
-
<DecoratorSignatures namespaceName={namespaceName} decorators={decorators} dollarDecoratorsRefKey={$decoratorsRef}/>
|
|
52
|
-
</ts.SourceFile>
|
|
53
|
-
{!base.includes(".Private") && (<ts.SourceFile path={`${base}.ts-test.ts`} headerComment="An error in the imports would mean that the decorator is not exported or doesn't have the right name.">
|
|
54
|
-
<DecoratorSignatureTests namespaceName={namespaceName} dollarDecoratorRefKey={userLib.$decorators} dollarDecoratorsTypeRefKey={$decoratorsRef}/>
|
|
55
|
-
</ts.SourceFile>)}
|
|
56
|
-
</Output>
|
|
57
|
-
</TspdContext.Provider>);
|
|
58
|
-
return render(jsxContent);
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=decorators-signatures.jsx.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decorators-signatures.jsx","sourceRoot":"","sources":["../../../../src/gen-extern-signatures/components/decorators-signatures.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,MAAM,EAGN,MAAM,EACN,MAAM,EACN,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EACL,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAQ5E,MAAM,UAAU,mBAAmB,CAAC,EAClC,aAAa,EACb,UAAU,EACV,sBAAsB,EAAE,sBAAsB,GACrB;IACzB,OAAO,CACL,CAAC,EAAE,CAAC,cAAc,CAChB;MAAA,CAAC,UAAU,CAAC,AAAD,EACX;MAAA,CAAC,GAAG,CAAC,AAAD,EACJ;MAAA,CAAC,GAAG,CAAC,AAAD,EACJ;MAAA,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,cAAc,CACnC;QAAA,CAAC,CAAC,SAAS,EAAE,EAAE;YACb,OAAO,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,EAAG,CAAC;QAC1D,CAAC,CACH;MAAA,EAAE,GAAG,CACL;MAAA,CAAC,GAAG,CAAC,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