ts-ref-kit 1.0.13 → 1.0.15
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/cjs/parser/index.cjs +3 -0
- package/dist/esm/parser/index.js +3 -3
- package/dist/types/index.d.ts +455 -0
- package/{types/parser/reflect-parser.d.ts → dist/types/parser/index.d.ts} +110 -77
- package/dist/types/tsdoc-metadata.json +11 -0
- package/package.json +15 -8
- package/dist/cjs/parser/index.js +0 -3
- package/types/index.d.ts +0 -2
- package/types/parser/index.d.ts +0 -3
- package/types/parser/path-match.d.ts +0 -7
- package/types/parser/reflect-loader.d.ts +0 -10
- package/types/parser/reflect-parser-plugin.d.ts +0 -7
- package/types/reflect-json/Mappable.d.ts +0 -13
- package/types/reflect-json/decorate.d.ts +0 -18
- package/types/reflect-json/index.d.ts +0 -6
- package/types/reflect-json/json-translation.d.ts +0 -38
- package/types/reflect-json/reflect-extension.d.ts +0 -13
- package/types/reflect-json/types.d.ts +0 -15
- package/types/reflect-json/utils.d.ts +0 -9
- package/types/reflect-types/ClassDefinition.d.ts +0 -28
- package/types/reflect-types/EnumDefinition.d.ts +0 -8
- package/types/reflect-types/InterfaceDefinition.d.ts +0 -18
- package/types/reflect-types/MethodDefinition.d.ts +0 -15
- package/types/reflect-types/PropertyDefinition.d.ts +0 -18
- package/types/reflect-types/assert-type.d.ts +0 -14
- package/types/reflect-types/function-validate.d.ts +0 -10
- package/types/reflect-types/index.d.ts +0 -11
- package/types/reflect-types/package.d.ts +0 -10
- package/types/reflect-types/reflect-context.d.ts +0 -16
- package/types/reflect-types/reflect-definitions.d.ts +0 -104
- package/types/reflect-types/reflect-types.d.ts +0 -20
- package/types/reflect-types/reflect-validate.d.ts +0 -24
- /package/dist/cjs/{index.js → index.cjs} +0 -0
|
@@ -1,77 +1,110 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}[];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
1
|
+
import { Plugin as Plugin_2 } from 'vite';
|
|
2
|
+
|
|
3
|
+
declare type Any = any;
|
|
4
|
+
|
|
5
|
+
export declare const DEBUG_CONFIG: {
|
|
6
|
+
OUTPUT_LOG: boolean;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
declare type FilePathRule = string | RegExp | (string | RegExp)[];
|
|
10
|
+
|
|
11
|
+
declare interface Options extends ReflectLoaderOptions {
|
|
12
|
+
entry: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export declare function parseSource(filePaths?: string | string[], exclude?: FilePathRule): {
|
|
16
|
+
classDefinitions: Map<string, RawClassDefinition>;
|
|
17
|
+
interfaceDefinitions: Map<string, RawInterfaceDefinition>;
|
|
18
|
+
enumDefinitions: Map<string, RawEnumDefinition>;
|
|
19
|
+
typeAliasDefinitions: Map<string, RawTypeDef>;
|
|
20
|
+
constTypeDefinitions: Map<string, RawTypeDef>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export declare interface RawClassDefinition {
|
|
24
|
+
name: string;
|
|
25
|
+
superClassName?: string;
|
|
26
|
+
implementations?: string[];
|
|
27
|
+
methods?: RawMethodDefinition[];
|
|
28
|
+
properties?: RawPropertyDefinition[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare interface RawEnumDefinition {
|
|
32
|
+
name: string;
|
|
33
|
+
members: {
|
|
34
|
+
name: string;
|
|
35
|
+
initializer: string | undefined;
|
|
36
|
+
}[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export declare interface RawInterfaceDefinition {
|
|
40
|
+
name: string;
|
|
41
|
+
implementations?: string[];
|
|
42
|
+
methods?: RawMethodDefinition[];
|
|
43
|
+
properties?: RawPropertyDefinition[];
|
|
44
|
+
indexElementType?: RawTypeDef;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export declare interface RawMethodDefinition {
|
|
48
|
+
name: string;
|
|
49
|
+
isPrivate?: boolean;
|
|
50
|
+
isStatic?: boolean;
|
|
51
|
+
isAsync?: boolean;
|
|
52
|
+
returnType?: RawTypeDef;
|
|
53
|
+
args?: {
|
|
54
|
+
name: string;
|
|
55
|
+
type?: RawTypeDef;
|
|
56
|
+
isOptional: boolean;
|
|
57
|
+
}[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export declare interface RawPropertyDefinition {
|
|
61
|
+
name: string;
|
|
62
|
+
isOptional?: boolean;
|
|
63
|
+
isPrivate?: boolean;
|
|
64
|
+
isStatic?: boolean;
|
|
65
|
+
type?: RawTypeDef;
|
|
66
|
+
accessor?: {
|
|
67
|
+
getter?: {
|
|
68
|
+
isPrivate: boolean;
|
|
69
|
+
};
|
|
70
|
+
setter?: {
|
|
71
|
+
isPrivate: boolean;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
declare type RawTypeDef = string | RawTypeDefinition;
|
|
77
|
+
|
|
78
|
+
export declare interface RawTypeDefinition {
|
|
79
|
+
arrayElementType?: RawTypeDef;
|
|
80
|
+
indexElementType?: RawTypeDef;
|
|
81
|
+
literalValue?: Any;
|
|
82
|
+
typeLiteralMembers?: RawPropertyDefinition[];
|
|
83
|
+
unionMembers?: RawTypeDef[];
|
|
84
|
+
intersectionMembers?: RawTypeDef[];
|
|
85
|
+
generics?: RawTypeDef[];
|
|
86
|
+
isFunction?: boolean;
|
|
87
|
+
tupleMembers?: RawTypeDef[];
|
|
88
|
+
isOptionalInTuple?: boolean;
|
|
89
|
+
isConstructor?: boolean;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export declare function reflectLoader(options: ReflectLoaderOptions): {
|
|
93
|
+
outputAllMetas: () => string;
|
|
94
|
+
transform: (sourceCode: string, sourceFileName: string) => string;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export declare interface ReflectLoaderOptions {
|
|
98
|
+
sourcePaths: string | string[];
|
|
99
|
+
exclude?: string | RegExp | (string | RegExp)[];
|
|
100
|
+
forEnabledClassOnly?: boolean;
|
|
101
|
+
outputLog?: boolean;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export declare function reflectParserPlugin(options: Options): Plugin_2;
|
|
105
|
+
|
|
106
|
+
export declare function setupReflectTypes(filePaths: string | string[], exclude?: FilePathRule, distFolder?: string): Promise<void>;
|
|
107
|
+
|
|
108
|
+
export declare function updateReflectModules(filePath: string, distFolder: string): Promise<void>;
|
|
109
|
+
|
|
110
|
+
export { }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.52.11"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-ref-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "Type reflection and validation library for TypeScript",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -14,32 +14,39 @@
|
|
|
14
14
|
],
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
|
+
"types": "./dist/types/index.d.ts",
|
|
17
18
|
"import": "./dist/esm/index.js",
|
|
18
|
-
"require": "./dist/cjs/index.
|
|
19
|
+
"require": "./dist/cjs/index.cjs"
|
|
19
20
|
},
|
|
20
21
|
"./parser": {
|
|
22
|
+
"types": "./dist/types/parser/index.d.ts",
|
|
21
23
|
"import": "./dist/esm/parser/index.js",
|
|
22
|
-
"require": "./dist/cjs/parser/index.
|
|
24
|
+
"require": "./dist/cjs/parser/index.cjs"
|
|
23
25
|
}
|
|
24
26
|
},
|
|
25
27
|
"typesVersions": {
|
|
26
28
|
"*": {
|
|
27
|
-
"parser": [
|
|
28
|
-
|
|
29
|
+
"parser": [
|
|
30
|
+
"types/parser/index.d.ts"
|
|
31
|
+
],
|
|
32
|
+
"*": [
|
|
33
|
+
"types/index.d.ts"
|
|
34
|
+
]
|
|
29
35
|
}
|
|
30
36
|
},
|
|
31
37
|
"scripts": {
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"build": "npm run clean && node esbuild.config.js && node esbuild.parser.config.js && tsc --emitDeclarationOnly --outDir types"
|
|
38
|
+
"clean": "rimraf dist types",
|
|
39
|
+
"build": "npm run clean && node esbuild.config.js && node esbuild.parser.config.js && tsc --emitDeclarationOnly && api-extractor run --local --config api-extractor.json && api-extractor run --local --config api-extractor.parser.json && rimraf types"
|
|
35
40
|
},
|
|
36
41
|
"dependencies": {
|
|
37
42
|
"reflect-metadata": "^0.2.2",
|
|
38
43
|
"tslib": "^2.8.1"
|
|
39
44
|
},
|
|
40
45
|
"devDependencies": {
|
|
46
|
+
"@microsoft/api-extractor": "^7.52.11",
|
|
41
47
|
"@types/node": "^24.2.0",
|
|
42
48
|
"esbuild": "^0.25.9",
|
|
49
|
+
"rimraf": "^6.0.1",
|
|
43
50
|
"typescript": "^5.9.2",
|
|
44
51
|
"vite": "^7.1.4"
|
|
45
52
|
},
|
package/dist/cjs/parser/index.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var ue=Object.create;var C=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var de=Object.getPrototypeOf,ge=Object.prototype.hasOwnProperty;var Te=(e,n)=>{for(var t in n)C(e,t,{get:n[t],enumerable:!0})},X=(e,n,t,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of ye(n))!ge.call(e,o)&&o!==t&&C(e,o,{get:()=>n[o],enumerable:!(s=me(n,o))||s.enumerable});return e};var A=(e,n,t)=>(t=e!=null?ue(de(e)):{},X(n||!e||!e.__esModule?C(t,"default",{value:e,enumerable:!0}):t,e)),De=e=>X(C({},"__esModule",{value:!0}),e);var U=(e,n,t)=>new Promise((s,o)=>{var r=m=>{try{w(t.next(m))}catch(D){o(D)}},l=m=>{try{w(t.throw(m))}catch(D){o(D)}},w=m=>m.done?s(m.value):Promise.resolve(m.value).then(r,l);w((t=t.apply(e,n)).next())});var ke={};Te(ke,{DEBUG_CONFIG:()=>I,parseSource:()=>j,reflectLoader:()=>H,reflectParserPlugin:()=>Me,setupReflectTypes:()=>we,updateReflectModules:()=>Q});module.exports=De(ke);var F=A(require("typescript"),1);var i=A(require("typescript"),1),E=A(require("fs"),1),$=A(require("process"),1),x=A(require("path"),1);var I={OUTPUT_LOG:!1},P=new Map,_=new Map,G=new Map,M=new Map,J=new Map,L=new Set,Y={[i.default.SyntaxKind.BooleanKeyword]:"boolean",[i.default.SyntaxKind.StringKeyword]:"string",[i.default.SyntaxKind.BigIntKeyword]:"bigint",[i.default.SyntaxKind.NumberKeyword]:"number",[i.default.SyntaxKind.SymbolKeyword]:"symbol",[i.default.SyntaxKind.VoidKeyword]:"void",[i.default.SyntaxKind.UndefinedKeyword]:"undefined",[i.default.SyntaxKind.UnknownKeyword]:"unknown",[i.default.SyntaxKind.AnyKeyword]:"any",[i.default.SyntaxKind.ObjectKeyword]:"object"},O="any",te=["string","number","boolean","bigint","symbol"],ie=["any","Promise","Date","Error","undefined","unknown","object","Map","Set"],se=["Mappable","EnableReflect"];[...te,...ie,...se].forEach(fe);se.forEach(e=>_.set(e,{name:e}));var v,Z=!1,h=Reflect;function we(s,o){return U(this,arguments,function*(e,n,t=$.cwd()){if(t=x.resolve(t),h.__classes===void 0){e=pe(e),j(e,n),h.__classes={};for(let[r,l]of P)h.__classes[r]=l;h.__interfaces={};for(let[r,l]of _)h.__interfaces[r]=l;h.__typeAliases={};for(let[r,l]of M)h.__typeAliases[r]=l;h.__constTypes={};for(let[r,l]of J)h.__constTypes[r]=l;yield Promise.all(e.map(r=>Q(r,t)))}})}function Q(e,n){return U(this,null,function*(){if(!E.existsSync(e))return;if(E.statSync(e).isDirectory()){E.readdirSync(e).forEach(r=>{Q(x.join(e,r),n)});return}let s=yield import(x.join(n,e).replace(/\.ts$/,".js"));h.__classDef={},Object.values(s).forEach(o=>{typeof o=="function"&&(h.__classDef[o.name]=o)})})}function j(e,n){if(e||(e=[$.cwd()]),e=pe(e),!Z){let t=re(e,n),s=i.default.createProgram(t,{});v=s.getTypeChecker(),t=t.map(r=>ee(r)),s.getSourceFiles().filter(r=>t.includes(ee(r.fileName))).forEach(r=>{b(`parse file: ${r.fileName}`),ae(r)});for(let r of L.keys())!P.has(r)&&!_.has(r)&&!G.has(r)&&!M.has(r)&&!te.includes(r)&&!ie.includes(r)&&(b(`remove unknown typeName: ${r}`),L.delete(r));Array.from(P.values()).forEach(Ne),Array.from(_.values()).forEach(Oe),[P,_,M].forEach(Pe),Z=!0}return{classDefinitions:P,interfaceDefinitions:_,enumDefinitions:G,typeAliasDefinitions:M,constTypeDefinitions:J}}function re(e,n){let t=[];return e.forEach(s=>{if(s=x.resolve(s),Ke(s,n)){b(`ignore excluded ${s}`);return}if(!E.existsSync(s)){console.error(`Path ${s} does not exist.`);return}if(E.statSync(s).isFile()){t.push(s);return}E.readdirSync(s).forEach(l=>t.push(...re([x.join(s,l)],n)))}),t}function ae(e){i.default.isClassDeclaration(e)?he(e):i.default.isInterfaceDeclaration(e)?Re(e):i.default.isEnumDeclaration(e)?xe(e):i.default.isTypeAliasDeclaration(e)?be(e):i.default.isConstTypeReference(e)?Ee(e):e.forEachChild(ae)}function he(e){var w,m,D,R,u,T,K,k,z,y,f,d;let n=c(e.name);if(!n)return;let t=c((D=(m=(w=e.heritageClauses)==null?void 0:w.find(a=>a.token===i.default.SyntaxKind.ExtendsKeyword))==null?void 0:m.types)==null?void 0:D[0].expression),s=(u=(R=e.heritageClauses)==null?void 0:R.find(a=>a.token===i.default.SyntaxKind.ImplementsKeyword))==null?void 0:u.types.map(a=>c(a.expression)),o=[],r=[];for(let a of e.members)if(i.default.isPropertyDeclaration(a))o.push({name:c(a.name),isOptional:a.questionToken!==void 0,type:g(a),isPrivate:(T=a.modifiers)==null?void 0:T.some(p=>p.kind===i.default.SyntaxKind.PrivateKeyword),isStatic:(K=a.modifiers)==null?void 0:K.some(p=>p.kind===i.default.SyntaxKind.StaticKeyword)});else if(i.default.isMethodDeclaration(a))r.push({name:c(a.name),returnType:g(a),isPrivate:(k=a.modifiers)==null?void 0:k.some(p=>p.kind===i.default.SyntaxKind.PrivateKeyword),isStatic:(z=a.modifiers)==null?void 0:z.some(p=>p.kind===i.default.SyntaxKind.StaticKeyword),isAsync:(y=a.modifiers)==null?void 0:y.some(p=>p.kind===i.default.SyntaxKind.AsyncKeyword),args:a.parameters.map(p=>({name:c(p.name),type:g(p),isOptional:p.questionToken!==void 0}))});else if(i.default.isGetAccessorDeclaration(a)){let p=o.find(N=>N.name===c(a.name));p||(p={name:c(a.name),isOptional:a.questionToken===void 0,type:g(a)},o.push(p)),p.accessor=p.accessor||{},p.accessor.getter={isPrivate:((f=a.modifiers)==null?void 0:f.some(N=>N.kind===i.default.SyntaxKind.PrivateKeyword))||!1},p.isPrivate=p.accessor.getter.isPrivate}else if(i.default.isSetAccessorDeclaration(a)){let p=o.find(N=>N.name===c(a.name));p||(p={name:c(a.name),isOptional:a.questionToken===void 0,type:g(a)},o.push(p)),p.accessor=p.accessor||{},p.accessor.setter={isPrivate:((d=a.modifiers)==null?void 0:d.some(N=>N.kind===i.default.SyntaxKind.PrivateKeyword))||!1}}let l={name:n,superClassName:t,implementations:s,properties:o,methods:r};b(`Define class: ${c(e.name)}`),P.set(n,l)}function Re(e){var w,m,D,R;let n=c(e.name);if(!n)return;let t=((m=(w=e.heritageClauses)==null?void 0:w.find(u=>u.token===i.default.SyntaxKind.ExtendsKeyword))==null?void 0:m.types.map(u=>c(u.expression)))||[],s=[],o=[],r;for(let u of e.members)i.default.isPropertySignature(u)?s.push({name:c(u.name),isOptional:u.questionToken!==void 0,type:g(u),isPrivate:((D=u.modifiers)==null?void 0:D.some(T=>T.kind===i.default.SyntaxKind.PrivateKeyword))||!1}):i.default.isMethodSignature(u)?o.push({name:u.name.text,returnType:g(u),isPrivate:((R=u.modifiers)==null?void 0:R.some(T=>T.kind===i.default.SyntaxKind.PrivateKeyword))||!1,args:u.parameters.map(T=>({name:c(T.name),type:g(T),isOptional:T.questionToken!==void 0}))}):i.default.isIndexSignatureDeclaration(u)&&(r=g(u));let l=_.get(n);l?(l.implementations=q(l.implementations||[],t),l.methods=q(l.methods||[],o,(u,T)=>u.name===T.name),l.properties=q(l.properties||[],s,(u,T)=>u.name===T.name),l.indexElementType=r,b(`Merge interface ${c(e.name)}`)):(l={name:n,implementations:t,methods:o,properties:s,indexElementType:r},_.set(n,l),b(`Define interface ${c(e.name)}`))}function xe(e){let n=c(e.name);n&&(G.set(n,{name:n,members:e.members.map(t=>({name:c(t.name),initializer:c(t.initializer)}))}),b(`Define enum: ${c(e.name)}`))}function be(e){b(`Define typeAlias: ${c(e.name)}`),M.set(c(e.name),g(e))}function Ee(e){let n=e.parent.parent;i.default.isVariableDeclaration(n)&&n.initializer&&i.default.isAsExpression(n.initializer)&&J.set(c(n.name),oe(n.initializer.expression))}function oe(e){return i.default.isArrayLiteralExpression(e)?Se(e):i.default.isObjectLiteralExpression(e)?_e(e):i.default.isNumericLiteral(e)?"number":i.default.isStringLiteral(e)?"string":i.default.isBigIntLiteral(e)?"bigint":[i.default.SyntaxKind.TrueKeyword,i.default.SyntaxKind.FalseKeyword].includes(e.kind)?"boolean":O}function Se(e){let n=[];return e.elements.forEach(t=>{if(i.default.isStringLiteral(t))return n.push(c(t))}),n.length===0?O:n.length===1?n[0]:{unionMembers:n}}function _e(e){let n=[];return e.properties.map(t=>{i.default.isPropertyAssignment(t)?n.push({name:c(t.name),type:oe(t.initializer)}):b(`unsupported property: ${t.name}`)}),{typeLiteralMembers:n}}function fe(e){L.add(e)}function g(e,n=!1){if(e.type&&!n)return S(e.type);if(!v)return console.error("TypeChecker not initialized!"),O;let t=v.getTypeAtLocation(e),s=v.typeToTypeNode(t,void 0,void 0);return s?S("type"in s?s.type:s):O}function S(e){let n={};if(e===void 0)return O;if(i.default.isUnionTypeNode(e))n.unionMembers=e.types.map(S);else if(i.default.isIntersectionTypeNode(e))n.intersectionMembers=e.types.map(S);else if(i.default.isLiteralTypeNode(e))n.literalValue=c(e.literal);else if(i.default.isTypeLiteralNode(e)){let t=[];e.members.forEach(s=>{i.default.isPropertySignature(s)?t.push({name:c(s.name),isOptional:s.questionToken!==void 0,type:g(s)}):i.default.isIndexSignatureDeclaration(s)?n.indexElementType=g(s):t.push({name:c(s.name)||"",isOptional:s.questionToken!==void 0,type:S()})}),n.typeLiteralMembers=t}else if(i.default.isArrayTypeNode(e))n.arrayElementType=S(e.elementType);else if(i.default.isFunctionTypeNode(e))n.isFunction=!0;else if(i.default.isTypeReferenceNode(e))if(fe(c(e.typeName)),e.typeArguments)n.generics=[c(e.typeName),...e.typeArguments.map(t=>S(t))];else return c(e.typeName);else{if(i.default.isIndexedAccessTypeNode(e))return g(e,!0);if(i.default.isThisTypeNode(e))return g(e);if(i.default.isParenthesizedTypeNode(e))return g(e);if(i.default.isConditionalTypeNode(e))return g(e);if(i.default.isTypeQueryNode(e))return g(e);if(i.default.isConstructorTypeNode(e))n.isConstructor=!0;else if(i.default.isTupleTypeNode(e))n.tupleMembers=e.elements.map(S);else{if(Object.keys(Y).includes(String(e.kind)))return Y[e.kind]||O;if(i.default.isOptionalTypeNode(e))Object.assign(n,g(e)),n.isOptionalInTuple=!0;else if(i.default.isNamedTupleMember(e))Object.assign(n,g(e));else return i.default.isTypeOperatorNode(e)&&e.operator===i.default.SyntaxKind.KeyOfKeyword,g(e,!0)}}return n}var q=(e,n,t)=>[...(e==null?void 0:e.filter(s=>!(n!=null&&n.some(o=>(t||(()=>o===s))(o,s)))))||[],...n||[]];function V(e){if(e!==void 0&&e!==O)return typeof e=="string"?L.has(e)?e:void 0:e}function Ne(e){var n,t;(n=e.methods)==null||n.forEach(le),(t=e.properties)==null||t.forEach(ce)}function Oe(e){var n,t;(n=e.methods)==null||n.forEach(le),(t=e.properties)==null||t.forEach(ce)}function ce(e){e.type=V(e.type)}function le(e){var n;(n=e.args)==null||n.forEach(t=>t.type=V(t.type)),e.returnType=V(e.returnType)}function c(e){if(!e)return e;if(e.end<0)return e.text;try{return i.default.isQualifiedName(e)?c(e.right):e.getText()}catch(n){return e.text}}function B(e){e&&Object.entries(e).forEach(n=>{let[t,s]=n;s instanceof Array&&s.length===0||s===!1||s===void 0?delete e[t]:s.constructor===Array?s.forEach(B):s.constructor===Object&&B(s)})}function Pe(e){for(let n of e.values())B(n)}function Ke(e,n){return n?(n=n instanceof Array?n:[n],n.some(t=>(t instanceof RegExp||(t=new RegExp(t.replace(/\./g,"\\.").replace(/\*/g,".*"))),e.match(t)))):!1}function ee(e,n=$.cwd()){return ne(e).replace(ne(n)+"/","")}function ne(e){let n=x.sep;return e.split(n).join("/")}function pe(e){return e instanceof Array?e:[e]}function b(e){I.OUTPUT_LOG&&console.log(e)}function W(e,n){let t=o=>{let r=e.replace(/\\/g,"/"),l=o.replace(/\\/g,"/");l=l.replace(/\*\*/g,"<<double_star>>");let m=l.replace(/([.+^${}()|[\]\\])/g,"\\$1").replace(/<<double_star>>/g,".*").replace(/\*/g,"[^/]*");return!o.startsWith("/")&&!o.startsWith("*")&&(m=".*"+m),m="^"+m+"$",new RegExp(m).test(r)};return(n instanceof Array?n:[n]).some(t)}function H(e){let{sourcePaths:n,exclude:t,forEnabledClassOnly:s,outputLog:o}=e;if(o&&(I.OUTPUT_LOG=!0),!n)throw new Error("need provide source paths for reflect loader");let{classDefinitions:r,interfaceDefinitions:l,enumDefinitions:w,typeAliasDefinitions:m}=j(n,t),D=[],R=[];function u(y){let f=r.get(y),d=[];return f?(f.superClassName&&d.push(f.superClassName),d.push(...f.implementations||[])):(f=l.get(y),f?d.push(...f.implementations||[]):(f=m.get(y),f&&d.push(...f.implementations||[]))),d.flatMap(a=>[a,...u(a)])||[]}function T(y,f){return u(y.name).includes(f)}function K(y){if(F.default.isClassDeclaration(y)&&y.name!==void 0){let f=y.name.text,d=r.get(f);if(!f||!d||s&&!T(d,"EnableReflect"))return;R.push(`Reflect.__classDef = Object.assign(Reflect.__classDef || {}, { ${f} })`);return}y.forEachChild(K)}function k(){let y=[];return r.forEach((f,d)=>{s&&!T(f,"EnableReflect")||y.push(`Reflect.__classes = Object.assign(Reflect.__classes || {}, { ${d}: ${JSON.stringify(f)} })`)}),l.forEach((f,d)=>{s&&!T(f,"EnableReflect")||y.push(`Reflect.__interfaces = Object.assign(Reflect.__interfaces || {}, { ${d}: ${JSON.stringify(f)} })`)}),w.forEach((f,d)=>{y.push(`Reflect.__enums = Object.assign(Reflect.__enums || {}, { ${d}: ${JSON.stringify(f)} })`)}),m.forEach((f,d)=>{y.push(`Reflect.__typeAliases = Object.assign(Reflect.__typeAliases || {}, { ${d}: ${JSON.stringify(f)} })`)}),y.join(`
|
|
2
|
-
`)}return{outputAllMetas:k,transform:(y,f)=>{let d=(typeof n=="string"?[n]:n).map(a=>a+"/**.ts");if(W(f,d))try{let a=F.default.createSourceFile(f,y,F.default.ScriptTarget.Latest,!1);return D.length=0,R.length=0,K(a),`${D.join(";")};${y};${R.join(";")}`}catch(a){return console.error(`[reflect-parser-plugin] Error processing ${f}:`,a),null}}}}var Ae=process.cwd().replace(/\\/g,"/")+"/";function Me(e){let n=H(e);return{name:"reflect-parser-plugin",enforce:"pre",transform:(t,s)=>(s=s.replace(Ae,""),s===e.entry?`${n.outputAllMetas()}
|
|
3
|
-
${t}`:n.transform(t,s))}}0&&(module.exports={DEBUG_CONFIG,parseSource,reflectLoader,reflectParserPlugin,setupReflectTypes,updateReflectModules});
|
package/types/index.d.ts
DELETED
package/types/parser/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface ReflectLoaderOptions {
|
|
2
|
-
sourcePaths: string | string[];
|
|
3
|
-
exclude?: string | RegExp | (string | RegExp)[];
|
|
4
|
-
forEnabledClassOnly?: boolean;
|
|
5
|
-
outputLog?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function reflectLoader(options: ReflectLoaderOptions): {
|
|
8
|
-
outputAllMetas: () => string;
|
|
9
|
-
transform: (sourceCode: string, sourceFileName: string) => string;
|
|
10
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type EnableReflect } from '../reflect-types';
|
|
2
|
-
import type { Class, JsonValue } from './types';
|
|
3
|
-
export interface Mappable extends EnableReflect {
|
|
4
|
-
mapping(map: Mapping<Mappable>): void;
|
|
5
|
-
}
|
|
6
|
-
export type Mapping<T extends Mappable> = {
|
|
7
|
-
[propName in keyof T]-?: (fieldName?: string | symbol, transform?: {
|
|
8
|
-
fromJSON?: (jsonValue: JsonValue) => Mappable;
|
|
9
|
-
toJSON?: (obj: Mappable) => JsonValue;
|
|
10
|
-
}) => void;
|
|
11
|
-
};
|
|
12
|
-
export declare function registerMappable<T extends Mappable>(mappableClass: Class<T>): void;
|
|
13
|
-
export declare function mapAllProperties<T extends Mappable>(target: T, map: Mapping<T>): void;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ReflectPropertyKey } from './reflect-extension';
|
|
2
|
-
import type { Any } from './types';
|
|
3
|
-
export declare function defineDecoratedProperty(metaKey: symbol): PropertyDecorator;
|
|
4
|
-
export declare function callDecoratedMethod<Self extends object>(self: Self, metaKey: symbol, ...args: Any[]): Any | undefined;
|
|
5
|
-
export declare function hasDecoratedMethod<Self extends object>(self: Self, metaKey: symbol): boolean;
|
|
6
|
-
export declare function getDecoratedProperty(target: object, metaKey: symbol): ReflectPropertyKey | undefined;
|
|
7
|
-
export declare function getDecoratedPropertyValue<V>(target: object, metaKey: symbol): V | undefined;
|
|
8
|
-
export declare const PropertyWrapper: IPropertyWrapper;
|
|
9
|
-
type IPropertyWrapper = {
|
|
10
|
-
getField: (owner: object, property: ReflectPropertyKey, fieldSymbol: symbol) => Any;
|
|
11
|
-
setField: (owner: object, property: ReflectPropertyKey, newValue: Any, fieldSymbol: symbol) => void;
|
|
12
|
-
} & (<T>({ getter, setter, fieldSymbol }: {
|
|
13
|
-
getter?: (self: object, property: ReflectPropertyKey) => T;
|
|
14
|
-
setter?: (self: object, newValue: T, property: ReflectPropertyKey) => void;
|
|
15
|
-
fieldSymbol: symbol;
|
|
16
|
-
}) => PropertyDecorator);
|
|
17
|
-
export declare function Lazy(creator: (self: object, property: ReflectPropertyKey) => Any): PropertyDecorator;
|
|
18
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
import { Any, AnyObject, Class, ClassOrInstance, JsonObject, JsonValue } from './types';
|
|
3
|
-
type FromJSON<T> = (jsonValue: JsonValue) => T;
|
|
4
|
-
type ToJSON<T> = (obj: T) => JsonValue;
|
|
5
|
-
type SerializedOptions<T> = {
|
|
6
|
-
name?: string;
|
|
7
|
-
class?: Class<T>;
|
|
8
|
-
fromJSON?: FromJSON<T>;
|
|
9
|
-
toJSON?: ToJSON<T>;
|
|
10
|
-
};
|
|
11
|
-
export declare function setDefaultIgnored(clazz: Class<Any>, defaultIgnored: boolean): void;
|
|
12
|
-
export declare function registerSerializedProperty(target: AnyObject, propName: string, options: SerializedOptions<Any>): void;
|
|
13
|
-
export declare const SerializedClass: PropertyDecorator;
|
|
14
|
-
export declare function Serialized<T extends object>(options?: SerializedOptions<T>): PropertyDecorator;
|
|
15
|
-
export declare function SerializedName(serializedName: string): PropertyDecorator;
|
|
16
|
-
export declare const IgnoreSerialization: PropertyDecorator;
|
|
17
|
-
/**
|
|
18
|
-
* serialize an object to json string
|
|
19
|
-
*/
|
|
20
|
-
export declare function serialize<T>(value: T): string;
|
|
21
|
-
export declare function serializeTo<T>(value: T): JsonValue;
|
|
22
|
-
/**
|
|
23
|
-
* convert an object to data object
|
|
24
|
-
*/
|
|
25
|
-
export declare function serializeToData<T extends object>(object: T): JsonObject | JsonObject[];
|
|
26
|
-
export declare function deserialize<T>(json: string | JsonValue, constructorOrTarget?: ClassOrInstance<T>): T;
|
|
27
|
-
export declare function deserializeArray<T>(json: string | JsonValue[], clazz?: Class<T>): T[];
|
|
28
|
-
export declare function deserializeFrom<T extends AnyObject>(data: JsonObject, target: T): void;
|
|
29
|
-
export declare function getSerializeSettings(clazz: Class<Any>): any;
|
|
30
|
-
export interface JsonValueTransform<T> {
|
|
31
|
-
fromJson: FromJSON<T>;
|
|
32
|
-
toJson: ToJSON<T>;
|
|
33
|
-
}
|
|
34
|
-
export declare function registerTransform<T>(clazz: Class<T>, transform: JsonValueTransform<T>): void;
|
|
35
|
-
export declare const itSelf: (some: Any) => any;
|
|
36
|
-
export declare const done: () => any;
|
|
37
|
-
export declare const AfterSerialized: PropertyDecorator;
|
|
38
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
import { Any, AnyConstructorFunction, AnyObject, Optional } from './types';
|
|
3
|
-
export type ReflectPropertyKey = string | symbol;
|
|
4
|
-
export type ReflectType = StringConstructor | NumberConstructor | BooleanConstructor | ObjectConstructor | ArrayConstructor | FunctionConstructor | AnyConstructorFunction;
|
|
5
|
-
declare global {
|
|
6
|
-
namespace Reflect {
|
|
7
|
-
function getDesignType<T extends AnyObject>(target: T, property: keyof T | ReflectPropertyKey): Optional<ReflectType>;
|
|
8
|
-
function getReturnType<T extends AnyObject>(target: T, property: keyof T | ReflectPropertyKey): Optional<ReflectType>;
|
|
9
|
-
function getParamTypes<T extends AnyObject>(target: T, property: keyof T | ReflectPropertyKey): Optional<ReflectType[]>;
|
|
10
|
-
function addMetadataList<T extends object>(key: symbol, value: Any, target: T): void;
|
|
11
|
-
function addMetadataList<T extends object>(key: symbol, value: Any, target: T, property: ReflectPropertyKey): void;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type Any = any;
|
|
2
|
-
export type AnyFunction = (...args: Any[]) => Any;
|
|
3
|
-
export type AnyConstructorFunction = new (...args: Any[]) => Any;
|
|
4
|
-
export type Class<T> = new (...args: Any[]) => T;
|
|
5
|
-
export type ClassOrInstance<T> = T | Class<T>;
|
|
6
|
-
export type Dictionary<T> = {
|
|
7
|
-
[key: string | symbol]: T;
|
|
8
|
-
};
|
|
9
|
-
export type AnyObject = Dictionary<Any>;
|
|
10
|
-
export type Optional<T> = T | undefined;
|
|
11
|
-
export type Nullable<T> = T | null;
|
|
12
|
-
export type JsonValue = string | number | boolean | null | JsonObject | JsonObject[];
|
|
13
|
-
export type JsonObject = {
|
|
14
|
-
[propName: string]: JsonValue;
|
|
15
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Any, Class } from "./types";
|
|
2
|
-
export declare function asBoolean(value: unknown): boolean;
|
|
3
|
-
export declare function asString(v: unknown): string;
|
|
4
|
-
export declare function asNumber(v: unknown): number;
|
|
5
|
-
export declare function setAnyValue<T>(target: Any, field: string | number | symbol, value: T): void;
|
|
6
|
-
export declare function getAnyValue<T>(target: Any, field: string | number | symbol): T | undefined;
|
|
7
|
-
export declare function getOrSetValue<T>(target: Any, field: string | number | symbol, defaultWith: () => T): T;
|
|
8
|
-
export declare function isDictionary(value: Any): boolean;
|
|
9
|
-
export declare function createNewInstance<T>(clazz: Class<T>): any;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { RawClassDefinition, TypeDefinition } from './index';
|
|
2
|
-
import { InterfaceDefinition, MethodDefinition, PropertyDefinition } from './index';
|
|
3
|
-
import type { AnyConstructorFunction, Dictionary } from './package';
|
|
4
|
-
type ImplementationOfClass = InterfaceDefinition | TypeDefinition;
|
|
5
|
-
export declare class ClassDefinition {
|
|
6
|
-
readonly name: string;
|
|
7
|
-
readonly superClassName: string;
|
|
8
|
-
readonly superClass: ClassDefinition | undefined;
|
|
9
|
-
readonly methods: MethodDefinition[];
|
|
10
|
-
readonly properties: PropertyDefinition[];
|
|
11
|
-
readonly jsClass: AnyConstructorFunction;
|
|
12
|
-
private readonly _implementationNames;
|
|
13
|
-
private readonly _implementations?;
|
|
14
|
-
private _allImplementations?;
|
|
15
|
-
constructor(def: RawClassDefinition & {
|
|
16
|
-
jsClass: AnyConstructorFunction;
|
|
17
|
-
});
|
|
18
|
-
get allMethods(): Dictionary<MethodDefinition>;
|
|
19
|
-
get allProperties(): Dictionary<PropertyDefinition>;
|
|
20
|
-
get implementations(): ImplementationOfClass[];
|
|
21
|
-
get allImplementations(): ImplementationOfClass[];
|
|
22
|
-
getProperty(propName: string): PropertyDefinition | undefined;
|
|
23
|
-
get type(): TypeDefinition;
|
|
24
|
-
isSubClassOf(typeName: string): boolean;
|
|
25
|
-
isSuperClassOf(typeName: string): boolean;
|
|
26
|
-
toString(): string;
|
|
27
|
-
}
|
|
28
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { RawEnumDefinition, TypeDefinition } from './reflect-definitions';
|
|
2
|
-
export declare class EnumDefinition {
|
|
3
|
-
readonly name: string;
|
|
4
|
-
readonly members: Map<string, TypeDefinition>;
|
|
5
|
-
constructor(def: RawEnumDefinition);
|
|
6
|
-
get type(): TypeDefinition;
|
|
7
|
-
get names(): string[];
|
|
8
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ClassDefinition, RawInterfaceDefinition, TypeDefinition } from './index';
|
|
2
|
-
import { MethodDefinition, PropertyDefinition } from './index';
|
|
3
|
-
type ImplementationOfInterface = InterfaceDefinition | ClassDefinition | TypeDefinition;
|
|
4
|
-
export declare class InterfaceDefinition {
|
|
5
|
-
readonly name: string;
|
|
6
|
-
readonly methods: MethodDefinition[];
|
|
7
|
-
readonly properties: PropertyDefinition[];
|
|
8
|
-
private readonly _implementationNames;
|
|
9
|
-
private _implementations?;
|
|
10
|
-
private _allImplementations?;
|
|
11
|
-
constructor(def: RawInterfaceDefinition);
|
|
12
|
-
get implementations(): ImplementationOfInterface[];
|
|
13
|
-
get allImplementations(): ImplementationOfInterface[];
|
|
14
|
-
get type(): TypeDefinition;
|
|
15
|
-
toString(): string;
|
|
16
|
-
buildBaseObject(): {};
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type RawMethodDefinition, type TypeDefinition } from './index';
|
|
2
|
-
export declare class MethodDefinition {
|
|
3
|
-
name: string;
|
|
4
|
-
isPrivate: boolean;
|
|
5
|
-
isStatic: boolean;
|
|
6
|
-
isAsync: boolean;
|
|
7
|
-
returnType: TypeDefinition;
|
|
8
|
-
args: {
|
|
9
|
-
name: string;
|
|
10
|
-
type?: TypeDefinition;
|
|
11
|
-
isOptional: boolean;
|
|
12
|
-
}[];
|
|
13
|
-
constructor(def: RawMethodDefinition);
|
|
14
|
-
}
|
|
15
|
-
export declare function fillMethod(rawMethod: RawMethodDefinition): MethodDefinition;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type RawPropertyDefinition, type TypeDefinition } from './index';
|
|
2
|
-
export declare class PropertyDefinition {
|
|
3
|
-
name: string;
|
|
4
|
-
isOptional: boolean;
|
|
5
|
-
isPrivate: boolean;
|
|
6
|
-
isStatic: boolean;
|
|
7
|
-
type: TypeDefinition;
|
|
8
|
-
accessor?: {
|
|
9
|
-
getter?: {
|
|
10
|
-
isPrivate: boolean;
|
|
11
|
-
};
|
|
12
|
-
setter?: {
|
|
13
|
-
isPrivate: boolean;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
constructor(def: RawPropertyDefinition);
|
|
17
|
-
}
|
|
18
|
-
export declare function fillProperty(rawProperty: RawPropertyDefinition): PropertyDefinition;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type TypeDefinition } from '.';
|
|
2
|
-
export type Type = string | {
|
|
3
|
-
array: Type;
|
|
4
|
-
} | {
|
|
5
|
-
union: Type[];
|
|
6
|
-
} | {
|
|
7
|
-
intersection: Type[];
|
|
8
|
-
} | {
|
|
9
|
-
tuple: Type[];
|
|
10
|
-
};
|
|
11
|
-
export declare function getTypeDef(type: Type | TypeDefinition): TypeDefinition;
|
|
12
|
-
export declare function assertType<T>(data: unknown, type: Type, depth?: number): T;
|
|
13
|
-
export declare function isNullable(type: Type | TypeDefinition): boolean;
|
|
14
|
-
export declare function isType(value: unknown, type: Type | TypeDefinition): boolean;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type AnyFunction } from './package';
|
|
2
|
-
declare const VALIDATE_WRAPPER: unique symbol;
|
|
3
|
-
declare global {
|
|
4
|
-
interface Function {
|
|
5
|
-
[VALIDATE_WRAPPER]: AnyFunction;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
export declare const ReflectValidate: MethodDecorator;
|
|
9
|
-
export declare function safeCall(target: object, methodName: string, ...args: unknown[]): unknown;
|
|
10
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './reflect-definitions';
|
|
2
|
-
export * from './reflect-context';
|
|
3
|
-
export * from './ClassDefinition';
|
|
4
|
-
export * from './InterfaceDefinition';
|
|
5
|
-
export * from './EnumDefinition';
|
|
6
|
-
export * from './MethodDefinition';
|
|
7
|
-
export * from './PropertyDefinition';
|
|
8
|
-
export * from './reflect-types';
|
|
9
|
-
export * from './reflect-validate';
|
|
10
|
-
export * from './assert-type';
|
|
11
|
-
export * from './function-validate';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type Dictionary<T> = {
|
|
2
|
-
[key: string]: T;
|
|
3
|
-
};
|
|
4
|
-
type Any = any;
|
|
5
|
-
export type AnyConstructorFunction = new (...args: Any[]) => Any;
|
|
6
|
-
export type AnyFunction = (...args: Any[]) => Any;
|
|
7
|
-
export declare function setValue<T>(target: unknown, field: string | symbol, value: T): void;
|
|
8
|
-
export declare function getValue<T>(target: unknown, field: string | symbol): T | undefined;
|
|
9
|
-
export declare function mapNotNull<T, U>(arr: T[] | undefined, mapper: (item: T) => U | undefined): U[];
|
|
10
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { AnyConstructorFunction } from './package';
|
|
2
|
-
import { type TypeDefinition } from './index';
|
|
3
|
-
import { ClassDefinition, EnumDefinition, InterfaceDefinition } from './index';
|
|
4
|
-
export declare const ReflectClass: ClassDecorator;
|
|
5
|
-
export declare const ReflectContext: {
|
|
6
|
-
getClassDefinition: typeof getClassDefinition;
|
|
7
|
-
getInterfaceDefinition: typeof getInterfaceDefinition;
|
|
8
|
-
getEnumDefinition: typeof getEnumDefinition;
|
|
9
|
-
getTypeAliasDefinition: typeof getTypeAliasDefinition;
|
|
10
|
-
};
|
|
11
|
-
export declare function getClassByName(className: string): AnyConstructorFunction | undefined;
|
|
12
|
-
declare function getClassDefinition(arg: AnyConstructorFunction | object | string): ClassDefinition | undefined;
|
|
13
|
-
declare function getInterfaceDefinition(name: string): InterfaceDefinition | undefined;
|
|
14
|
-
declare function getEnumDefinition(name: string): EnumDefinition | undefined;
|
|
15
|
-
declare function getTypeAliasDefinition(name: string): TypeDefinition | undefined;
|
|
16
|
-
export {};
|