mnemonica 1.3.5 → 1.3.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/README.md +1 -1
- package/SKILL.md +11 -1
- package/build/api/types/index.js +1 -1
- package/build/index.d.ts +4 -4
- package/build/index.js +1 -1
- package/build/types/index.d.ts +18 -14
- package/build/types/index.js +1 -1
- package/docs/typed-lookup.md +101 -0
- package/package.json +135 -134
- package/src/api/types/index.ts +3 -3
- package/src/index.ts +16 -4
- package/src/types/index.ts +51 -17
package/package.json
CHANGED
|
@@ -1,136 +1,137 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
2
|
+
"name": "mnemonica",
|
|
3
|
+
"version": "1.3.6",
|
|
4
|
+
"description": "AI-agent ready instance inheritance system for JavaScript/TypeScript via prototype chains",
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "./build/index.js",
|
|
7
|
+
"types": "./build/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./build/index.d.ts",
|
|
11
|
+
"default": "./build/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./module": {
|
|
14
|
+
"types": "./build/index.d.ts",
|
|
15
|
+
"import": "./module/index.js",
|
|
16
|
+
"browser": "./module/index.js",
|
|
17
|
+
"require": "./build/index.js",
|
|
18
|
+
"default": "./build/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"README.md",
|
|
24
|
+
"SKILL.md",
|
|
25
|
+
"FOR_HUMANS.md",
|
|
26
|
+
"LICENSE",
|
|
27
|
+
"docs",
|
|
28
|
+
"src",
|
|
29
|
+
"module",
|
|
30
|
+
"build"
|
|
31
|
+
],
|
|
32
|
+
"directories": {
|
|
33
|
+
"build": "build/",
|
|
34
|
+
"module": "module/"
|
|
35
|
+
},
|
|
36
|
+
"contributors": [
|
|
37
|
+
"laplandin <laplandin.denis@gmail.com>",
|
|
38
|
+
"petrgrishin <iam@petrgrishin.com>",
|
|
39
|
+
"Mobydack <devzetsubou@gmail.com>"
|
|
40
|
+
],
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "rm -rf ./build && npx tsc --pretty --project tsconfig.json",
|
|
43
|
+
"build:all": "npm run build && npm run decorate:ts",
|
|
44
|
+
"verify": "npm run build && npm run lint:check",
|
|
45
|
+
"example": "npm run build && node ./test/example.js",
|
|
46
|
+
"example:async": "npm run build && node ./examples/AsyncNewTest.js",
|
|
47
|
+
"example:rename": "npm run build && node ./examples/ClassReName.js",
|
|
48
|
+
"example:v8bug": "npm run build && node ./examples/v8bug.js",
|
|
49
|
+
"example:ts": "npx tsc --ignoreConfig --noCheck --experimentalDecorators --target ES2021 --module CommonJS ./test-ts/test-decorate.ts ./test-ts/test-decorate-typings.ts ./test-ts/test-example.ts ./test-ts/test-no-types.ts ./test-ts/typed-collections.ts ./test-ts/typed-utils.ts ./test-ts/typed-utils-registry.ts && npx eslint --fix ./test-ts/*.js && node ./test-ts/test-no-types.js && node ./test-ts/test-decorate-typings.js",
|
|
50
|
+
"test:ts:strict": "npx tsc -p ./test-ts/tsconfig.strict.json",
|
|
51
|
+
"test:ts:consumers": "node scripts/check-consumers.js",
|
|
52
|
+
"deopt": "node --trace-deopt --trace-opt ./node_modules/mocha/bin/mocha.js ./test/index.js",
|
|
53
|
+
"decorate:ts": "npx tsc --ignoreConfig --target ES2021 --moduleResolution NodeNext --module NodeNext --sourceMap ./test/decorate.ts ./test/decorate-builder.ts",
|
|
54
|
+
"lint:md": "node scripts/check-published-links.js && find . -name '*.md' -not -path '*/node_modules/*' | xargs markdown-link-check -q --config .markdown-link-check.json",
|
|
55
|
+
"lint": "npx eslint",
|
|
56
|
+
"lint:check": "npx eslint ./src ./test",
|
|
57
|
+
"lint:src": "npx eslint --fix ./src",
|
|
58
|
+
"lint:test": "npx eslint --fix ./test",
|
|
59
|
+
"lint:fix": "npm run lint:src && npm run lint:test",
|
|
60
|
+
"pretest": "npm run decorate:ts",
|
|
61
|
+
"test": "mocha --allow-uncaught --enable-source-maps test/index.js",
|
|
62
|
+
"test:cov": "npm run build:all && nyc --reporter=text-summary --reporter=lcov mocha --allow-uncaught --enable-source-maps --ui bdd --reporter spec ./test/index.js",
|
|
63
|
+
"debug": "npx tsc --pretty --project tsconfig.json && npx mocha --allow-uncaught --enable-source-maps --reporter spec --inspect-brk test/index",
|
|
64
|
+
"test:jest": "npx jest",
|
|
65
|
+
"test:async_init": "mocha --allow-uncaught test_async/index.js",
|
|
66
|
+
"test:yields": "mocha --allow-uncaught test_yields/index.js",
|
|
67
|
+
"test:jest:cov": "npx jest --collectCoverage",
|
|
68
|
+
"test:jest:debug": "npx --node-options=--inspect-brk jest",
|
|
69
|
+
"test:mjs": "npm run build && node --experimental-modules ./test/test.mjs",
|
|
70
|
+
"watch": "npx tsc --pretty --project tsconfig.json -w",
|
|
71
|
+
"prepare": "husky"
|
|
72
|
+
},
|
|
73
|
+
"repository": {
|
|
74
|
+
"type": "git",
|
|
75
|
+
"url": "git+https://github.com/wentout/mnemonica.git"
|
|
76
|
+
},
|
|
77
|
+
"keywords": [
|
|
78
|
+
"ETL",
|
|
79
|
+
"DFD",
|
|
80
|
+
"inheritance",
|
|
81
|
+
"instance-inheritance",
|
|
82
|
+
"prototype-inheritance",
|
|
83
|
+
"prototype-chain",
|
|
84
|
+
"typescript",
|
|
85
|
+
"nodejs",
|
|
86
|
+
"decorator",
|
|
87
|
+
"data-flow",
|
|
88
|
+
"mnemonica",
|
|
89
|
+
"ai-agents",
|
|
90
|
+
"agent-ready"
|
|
91
|
+
],
|
|
92
|
+
"author": "went.out@gmail.com",
|
|
93
|
+
"license": "MIT",
|
|
94
|
+
"bugs": {
|
|
95
|
+
"url": "https://github.com/wentout/mnemonica/issues"
|
|
96
|
+
},
|
|
97
|
+
"homepage": "https://github.com/wentout/mnemonica#readme",
|
|
98
|
+
"devDependencies": {
|
|
99
|
+
"@eslint/eslintrc": "^3.3.7",
|
|
100
|
+
"@eslint/js": "^9.21.0",
|
|
101
|
+
"@mnemonica/tactica": "^0.4.4",
|
|
102
|
+
"@types/jest": "^29.5.14",
|
|
103
|
+
"@types/node": "^22.20.4",
|
|
104
|
+
"@typescript-eslint/eslint-plugin": "^8.70.1",
|
|
105
|
+
"@typescript-eslint/parser": "^8.70.1",
|
|
106
|
+
"chai": "^5.3.3",
|
|
107
|
+
"eslint": "^9.39.5",
|
|
108
|
+
"eslint-plugin-import": "^2.32.0",
|
|
109
|
+
"eslint-plugin-mocha": "^10.5.0",
|
|
110
|
+
"eslint-plugin-no-arrow-this": "^1.3.0",
|
|
111
|
+
"globals": "^15.15.0",
|
|
112
|
+
"husky": "^9.1.7",
|
|
113
|
+
"jest": "^29.7.0",
|
|
114
|
+
"json5": "^2.2.3",
|
|
115
|
+
"lint-staged": "^15.5.2",
|
|
116
|
+
"markdown-link-check": "^3.15.0",
|
|
117
|
+
"mocha": "^11.8.0",
|
|
118
|
+
"mocha-lcov-reporter": "^1.3.0",
|
|
119
|
+
"nyc": "^17.1.0",
|
|
120
|
+
"oxlint": "^0.16.12",
|
|
121
|
+
"ts-jest": "^29.4.14",
|
|
122
|
+
"typeomatica": "^0.3.63",
|
|
123
|
+
"typescript": "^6.0.3"
|
|
124
|
+
},
|
|
125
|
+
"engines": {
|
|
126
|
+
"node": ">=18 <26"
|
|
127
|
+
},
|
|
128
|
+
"overrides": {
|
|
129
|
+
"serialize-javascript": "^7.0.5",
|
|
130
|
+
"uuid": "^11.1.1",
|
|
131
|
+
"diff": "^9.0.0"
|
|
132
|
+
},
|
|
133
|
+
"lint-staged": {
|
|
134
|
+
"src/**/*.ts": "eslint --fix",
|
|
135
|
+
"test/**/*.js": "eslint --fix"
|
|
136
|
+
}
|
|
136
137
|
}
|
package/src/api/types/index.ts
CHANGED
|
@@ -265,9 +265,9 @@ TypeDescriptor.prototype.lookup = function (
|
|
|
265
265
|
// collection, e.g. AdminType.lookup('UserType.AdminType'),
|
|
266
266
|
// which is what the TypeLookup<Registry> type contract promises
|
|
267
267
|
const collection = this.collection as CollectionDef;
|
|
268
|
-
// the
|
|
269
|
-
//
|
|
270
|
-
const rootResult = collection.lookup(TypeNestedPath)
|
|
268
|
+
// CollectionDef.lookup is the runtime contract (CollectionLookup), so a
|
|
269
|
+
// plain string path yields TypeClass | undefined with no cast
|
|
270
|
+
const rootResult = collection.lookup(TypeNestedPath);
|
|
271
271
|
return rootResult;
|
|
272
272
|
};
|
|
273
273
|
|
package/src/index.ts
CHANGED
|
@@ -19,9 +19,9 @@ import type {
|
|
|
19
19
|
InstanceResult,
|
|
20
20
|
Merge,
|
|
21
21
|
TypeLookup,
|
|
22
|
-
LookupResult,
|
|
23
22
|
RegistryHolderBase,
|
|
24
|
-
|
|
23
|
+
RegistryEntry,
|
|
24
|
+
LookedUpConstructor
|
|
25
25
|
} from './types';
|
|
26
26
|
|
|
27
27
|
import TypesUtils from './api/utils/index';
|
|
@@ -55,6 +55,12 @@ export type {
|
|
|
55
55
|
LookupResult,
|
|
56
56
|
RegistryOf,
|
|
57
57
|
MnemonicaModule,
|
|
58
|
+
// Deliberate public vocabulary for builder-mode consumers (TS 6
|
|
59
|
+
// declaration emit names ONLY entry exports; these three stand in
|
|
60
|
+
// for the internal registry/lookup machinery):
|
|
61
|
+
RegistryEntry,
|
|
62
|
+
LookedUpConstructor,
|
|
63
|
+
LookedUpInstance,
|
|
58
64
|
} from './types';
|
|
59
65
|
|
|
60
66
|
/**
|
|
@@ -75,6 +81,12 @@ export type {
|
|
|
75
81
|
* Once augmented, `lookup('MyType')` and `utils.parent(instance, 'MyType')`
|
|
76
82
|
* resolve keys against this registry. Unaugmented keys fall back to the broad
|
|
77
83
|
* `TypeClass | undefined` return type.
|
|
84
|
+
*
|
|
85
|
+
* Internal on purpose: if you are here from a TS2883 error
|
|
86
|
+
* ("cannot be named without a reference to 'GlobalRegistry'"), the project
|
|
87
|
+
* exports free define() results without merging them into this registry.
|
|
88
|
+
* The error is the guard rail, not a missing export — see
|
|
89
|
+
* docs/typed-lookup.md, "Declaration emit on TypeScript 6".
|
|
78
90
|
*/
|
|
79
91
|
export interface TypeRegistry {
|
|
80
92
|
// Intentionally empty. Augment this interface via declaration merging
|
|
@@ -136,7 +148,7 @@ export function define <
|
|
|
136
148
|
): IDefinitorInstance<
|
|
137
149
|
F,
|
|
138
150
|
InstanceResult<F>,
|
|
139
|
-
Reg & Record<ChildPath,
|
|
151
|
+
Reg & Record<ChildPath, RegistryEntry<F, ChildPath>>,
|
|
140
152
|
ChildPath
|
|
141
153
|
>;
|
|
142
154
|
export function define <
|
|
@@ -264,7 +276,7 @@ export function lookup<Reg extends object, const K extends keyof Reg & string>(
|
|
|
264
276
|
// resolves against the registry carried by a builder/collection value
|
|
265
277
|
source: { lookup: TypeLookup<Reg> },
|
|
266
278
|
TypeNestedPath: K
|
|
267
|
-
):
|
|
279
|
+
): LookedUpConstructor<Reg, K>;
|
|
268
280
|
export function lookup(this: unknown, TypeNestedPath: string): TypeClass | undefined;
|
|
269
281
|
export function lookup(
|
|
270
282
|
source: { lookup: (path: string) => TypeClass | undefined },
|
package/src/types/index.ts
CHANGED
|
@@ -280,10 +280,18 @@ export type TypeDef = {
|
|
|
280
280
|
[Symbol.hasInstance]: (instance: object) => boolean;
|
|
281
281
|
};
|
|
282
282
|
|
|
283
|
+
// Runtime lookup contract of a collection: a dotted path in, a registered
|
|
284
|
+
// TypeClass (or undefined) out. Internal code uses this, not the public
|
|
285
|
+
// TypeLookup — with the default GlobalRegistry (a string index) a plain
|
|
286
|
+
// `string` path would match TypeLookup's typed overload and need a cast back.
|
|
287
|
+
export interface CollectionLookup extends CallableFunction {
|
|
288
|
+
(this: unknown, TypeNestedPath: string): TypeClass | undefined;
|
|
289
|
+
}
|
|
290
|
+
|
|
283
291
|
// Collection definition
|
|
284
292
|
export type CollectionDef = Hookable & {
|
|
285
293
|
define: TypeAbsorber;
|
|
286
|
-
lookup:
|
|
294
|
+
lookup: CollectionLookup;
|
|
287
295
|
subtypes: SubtypesMap;
|
|
288
296
|
[key: string]: unknown;
|
|
289
297
|
};
|
|
@@ -292,6 +300,10 @@ export type CollectionDef = Hookable & {
|
|
|
292
300
|
// Global registry shape used as the default for TypeLookup. It combines any
|
|
293
301
|
// augmented TypeRegistry entries with a broad string index signature so the
|
|
294
302
|
// generic TypeLookup constraint is satisfied.
|
|
303
|
+
// Internal on purpose: if you are here from a TS2883 error ("cannot be
|
|
304
|
+
// named without a reference to 'GlobalRegistry'"), the consumer exports free
|
|
305
|
+
// define() results without a TypeRegistry merge — see docs/typed-lookup.md,
|
|
306
|
+
// "Declaration emit on TypeScript 6". Do not re-export this.
|
|
295
307
|
export type GlobalRegistry = TypeRegistry & Record<string, TypeConstructorBase>;
|
|
296
308
|
|
|
297
309
|
// Extract the instance type returned by a mnemonica-compatible constructor.
|
|
@@ -311,9 +323,7 @@ export type SubTypeConstructors<
|
|
|
311
323
|
Path extends string
|
|
312
324
|
> = {
|
|
313
325
|
[K in keyof Registry as K extends `${Path}.${infer Child}` ? Child : never]:
|
|
314
|
-
|
|
315
|
-
lookup: NestedTypeLookup<Registry, K & string>;
|
|
316
|
-
};
|
|
326
|
+
LookedUpConstructor<Registry, K & string, true>;
|
|
317
327
|
};
|
|
318
328
|
|
|
319
329
|
// Reconstruct a constructor with a new instance type while preserving every
|
|
@@ -369,23 +379,45 @@ export type AugmentedConstructor<
|
|
|
369
379
|
CallConstructs extends boolean = false
|
|
370
380
|
> = ReplaceConstructorInstance<
|
|
371
381
|
Registry[Path],
|
|
372
|
-
|
|
382
|
+
LookedUpInstance<Registry, Path>,
|
|
373
383
|
CallConstructs
|
|
374
384
|
>;
|
|
375
385
|
|
|
386
|
+
// Instance type produced by a typed lookup (public vocabulary): the
|
|
387
|
+
// constructor's own instance shape plus child-constructor properties for
|
|
388
|
+
// every registered subtype. Referencing this name — instead of the internal
|
|
389
|
+
// WithSubTypes alias — keeps consumer declaration emit portable (TS names
|
|
390
|
+
// alias instantiations in emit; only entry-exported names are nameable).
|
|
391
|
+
export type LookedUpInstance<
|
|
392
|
+
Registry extends object,
|
|
393
|
+
Path extends string
|
|
394
|
+
> = WithSubTypes<ExtractConstructorInstance<Registry[Path & keyof Registry]>, Registry, Path>;
|
|
395
|
+
|
|
396
|
+
// Lookup result type (public vocabulary): the augmented constructor plus a
|
|
397
|
+
// lookup method scoped to the constructor's own type path. Non-conditional
|
|
398
|
+
// on purpose: a conditional alias resolves during inference and its
|
|
399
|
+
// expansion (internal helpers) would leak into consumer declaration emit.
|
|
400
|
+
// CallConstructs mirrors the SubTypeProxy distinction (true drops the this
|
|
401
|
+
// demand for instance-carried child constructors).
|
|
402
|
+
export type LookedUpConstructor<
|
|
403
|
+
Registry extends object,
|
|
404
|
+
Path extends keyof Registry & string,
|
|
405
|
+
CallConstructs extends boolean = false
|
|
406
|
+
> = AugmentedConstructor<Registry, Path, CallConstructs> & {
|
|
407
|
+
lookup: NestedTypeLookup<Registry, Path>;
|
|
408
|
+
};
|
|
409
|
+
|
|
376
410
|
// Result of a typed lookup: the augmented constructor plus a `lookup` method
|
|
377
411
|
// scoped to the constructor's own type path for relative subtype lookups.
|
|
378
412
|
export type LookupResult<
|
|
379
413
|
Registry extends object,
|
|
380
414
|
Path extends keyof Registry & string
|
|
381
415
|
> = Registry[Path] extends AnyConstructor
|
|
382
|
-
?
|
|
383
|
-
lookup: NestedTypeLookup<Registry, Path>;
|
|
384
|
-
}
|
|
416
|
+
? LookedUpConstructor<Registry, Path>
|
|
385
417
|
: never;
|
|
386
418
|
|
|
387
419
|
export interface TypeLookup<T extends object = GlobalRegistry> extends CallableFunction {
|
|
388
|
-
<const K extends keyof T & string>(this: unknown, TypeNestedPath: K):
|
|
420
|
+
<const K extends keyof T & string>(this: unknown, TypeNestedPath: K): LookedUpConstructor<T, K>;
|
|
389
421
|
(this: unknown, TypeNestedPath: string): TypeClass | undefined;
|
|
390
422
|
}
|
|
391
423
|
|
|
@@ -429,13 +461,13 @@ export type NestedTypeLookup<
|
|
|
429
461
|
Path extends string = ''
|
|
430
462
|
> = (Path extends ''
|
|
431
463
|
? {
|
|
432
|
-
<const K extends keyof Registry & string>(this: unknown, TypeNestedPath: K):
|
|
464
|
+
<const K extends keyof Registry & string>(this: unknown, TypeNestedPath: K): LookedUpConstructor<Registry, K>;
|
|
433
465
|
}
|
|
434
466
|
: {
|
|
435
467
|
<const K extends RelativeKeys<Registry, Path> & string>(
|
|
436
468
|
this: unknown,
|
|
437
469
|
TypeNestedPath: K
|
|
438
|
-
):
|
|
470
|
+
): LookedUpConstructor<Registry, Extract<keyof Registry & string, `${Path}.${K}`>>;
|
|
439
471
|
}) & {
|
|
440
472
|
(this: unknown, TypeNestedPath: string): TypeClass | undefined;
|
|
441
473
|
};
|
|
@@ -591,14 +623,16 @@ export type InstanceResult<
|
|
|
591
623
|
N extends object,
|
|
592
624
|
> = { [K in keyof N]: N[K] };
|
|
593
625
|
|
|
594
|
-
//
|
|
626
|
+
// The registry VALUE as public vocabulary: what a builder chain stores per
|
|
627
|
+
// defined path and what typed lookups read back. Interface (not alias) so
|
|
628
|
+
// consumer declaration emit names it instead of expanding the intersection.
|
|
595
629
|
// It preserves the dotted `Path` so that `.define()` on a looked-up constructor
|
|
596
630
|
// computes the correct child path, but it omits the full `GlobalRegistry`
|
|
597
631
|
// generic to keep hover tooltips readable.
|
|
598
|
-
export
|
|
632
|
+
export interface RegistryEntry<
|
|
599
633
|
F extends object,
|
|
600
634
|
Path extends string = ''
|
|
601
|
-
>
|
|
635
|
+
> extends _Internal_TC_<F>, RegistryHolderBase<{}, F, Path> {}
|
|
602
636
|
|
|
603
637
|
// Registry holder base - provides the accumulating .define() method.
|
|
604
638
|
// `Parent` tracks the instance type of the last defined constructor, so chained
|
|
@@ -632,7 +666,7 @@ export interface RegistryHolderBase<
|
|
|
632
666
|
): IDefinitorInstance<
|
|
633
667
|
F,
|
|
634
668
|
InstanceResult<F>,
|
|
635
|
-
T & Record<ChildPath,
|
|
669
|
+
T & Record<ChildPath, RegistryEntry<F, ChildPath>>,
|
|
636
670
|
ChildPath
|
|
637
671
|
>;
|
|
638
672
|
|
|
@@ -657,7 +691,7 @@ export interface RegistryHolderBase<
|
|
|
657
691
|
): IDefinitorInstance<
|
|
658
692
|
F,
|
|
659
693
|
InstanceResult<F>,
|
|
660
|
-
T & Record<ChildPath,
|
|
694
|
+
T & Record<ChildPath, RegistryEntry<F, ChildPath>>,
|
|
661
695
|
ChildPath
|
|
662
696
|
>;
|
|
663
697
|
}
|
|
@@ -790,7 +824,7 @@ export interface TypesCollection<
|
|
|
790
824
|
config?: constructorOptions
|
|
791
825
|
): <U extends Constructor<object>>(cstr: U) => DecoratedClass<
|
|
792
826
|
U,
|
|
793
|
-
T & Record<ConstructorName<U>,
|
|
827
|
+
T & Record<ConstructorName<U>, RegistryEntry<InstanceType<U>, ConstructorName<U>>>
|
|
794
828
|
>;
|
|
795
829
|
|
|
796
830
|
[key: string]: unknown;
|