@kosdev-code/kos-codegen-core 3.0.6 → 3.0.7
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/index.d.ts +2 -2
- package/index.d.ts.map +1 -1
- package/index.js +68 -4
- package/index.js.map +1 -1
- package/index.mjs +68 -4
- package/index.mjs.map +1 -1
- package/lib/generators/augment/ts-toolkit.d.ts +7 -0
- package/lib/generators/augment/ts-toolkit.d.ts.map +1 -1
- package/lib/generators/generate-container-model.d.ts +1 -0
- package/lib/generators/generate-container-model.d.ts.map +1 -1
- package/lib/generators/index.d.ts +1 -1
- package/lib/generators/index.d.ts.map +1 -1
- package/lib/generators/member-mutators/add-child.d.ts +20 -0
- package/lib/generators/member-mutators/add-child.d.ts.map +1 -0
- package/lib/generators/member-mutators/index.d.ts +1 -0
- package/lib/generators/member-mutators/index.d.ts.map +1 -1
- package/lib/generators/update-model-index.d.ts.map +1 -1
- package/package.json +2 -2
- package/templates/kos-container-model/model/__nameDashCase__-model.ts.template +14 -7
|
@@ -94,6 +94,13 @@ export interface DecoratedPropertySpec {
|
|
|
94
94
|
type?: string;
|
|
95
95
|
scope?: "private" | "protected" | "public";
|
|
96
96
|
hasExclamation?: boolean;
|
|
97
|
+
/** Initializer expression text, e.g. `new KosModelContainer<X>()` or `[]`. */
|
|
98
|
+
initializer?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Emit the decorator WITHOUT call parens — a DIRECT (non-factory) decorator like
|
|
101
|
+
* `@kosChild`. Default false (factory form `@name()` / `@name(args)`).
|
|
102
|
+
*/
|
|
103
|
+
bare?: boolean;
|
|
97
104
|
}
|
|
98
105
|
/**
|
|
99
106
|
* Add a decorated property to a class idempotently (skips if a property of that
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ts-toolkit.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/augment/ts-toolkit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAQD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAkBT;AAED,iDAAiD;AACjD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAW1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-container-model.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/generate-container-model.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAUjE,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,qBAAqB,CAAC;AAG7B,MAAM,WAAW,qBAAsB,SAAQ,uBAAuB;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,iBAAiB,EAC5B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,qBAAqB,EAC9B,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C,IAAI,CAwFN"}
|
|
1
|
+
{"version":3,"file":"generate-container-model.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/generate-container-model.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAUjE,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,qBAAqB,CAAC;AAG7B,MAAM,WAAW,qBAAsB,SAAQ,uBAAuB;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,iBAAiB,EAC5B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,qBAAqB,EAC9B,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C,IAAI,CAwFN"}
|
|
@@ -10,7 +10,7 @@ export { generateCompanionModel, type CompanionModelOptions, } from './generate-
|
|
|
10
10
|
export { generateModel, type ModelOptions, type GenerateModelParams, } from './generate-model';
|
|
11
11
|
export { addFutureToModel, type AddFutureToModelOptions, type NormalizedAddFutureToModelOptions, } from './add-future-to-model';
|
|
12
12
|
export { addContainerSupportToModel, type AddContainerSupportOptions, } from './add-container-support';
|
|
13
|
-
export { addModelEffectToModel, type AddModelEffectOptions, addDependencyToModel, type AddDependencyOptions, addTopicHandlerToModel, type AddTopicHandlerOptions, addConfigPropertyToModel, type AddConfigPropertyOptions, addServiceRequestToModel, type AddServiceRequestOptions, addPropertyToModel, type AddPropertyOptions, addComputedToModel, type AddComputedOptions, } from './member-mutators';
|
|
13
|
+
export { addModelEffectToModel, type AddModelEffectOptions, addDependencyToModel, type AddDependencyOptions, addChildToModel, type AddChildOptions, type ChildShape, addTopicHandlerToModel, type AddTopicHandlerOptions, addConfigPropertyToModel, type AddConfigPropertyOptions, addServiceRequestToModel, type AddServiceRequestOptions, addPropertyToModel, type AddPropertyOptions, addComputedToModel, type AddComputedOptions, } from './member-mutators';
|
|
14
14
|
export { transformSourceFile, ensureNamedImport, resolveSdkModuleSpecifier, getModelClass, addClassDecorator, ensureDeclarationMerge, ensureFileEslintDisable, addDecoratedMethod, addDecoratedProperty, addPlainProperty, addGetter, } from './augment/ts-toolkit';
|
|
15
15
|
export { validateModel, type ValidateModelOptions, type ValidationFinding, type ValidationResult, } from './validate';
|
|
16
16
|
export { describeModel, type DescribeModelOptions, type DescribedMember, type ModelDescription, } from './describe';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,oBAAoB,GAC1B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EACL,sBAAsB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,CAAC;AA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C;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,YAAY,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,oBAAoB,GAC1B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EACL,sBAAsB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,iCAAiC,GACvC,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,0BAA0B,EAC1B,KAAK,0BAA0B,GAChC,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,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CodegenFileSystem } from '../../codegen-filesystem';
|
|
2
|
+
import { ProjectConfiguration } from '../../project-discovery';
|
|
3
|
+
export type ChildShape = "single" | "container" | "array";
|
|
4
|
+
export interface AddChildOptions {
|
|
5
|
+
modelName: string;
|
|
6
|
+
modelProject: string;
|
|
7
|
+
/** Property name that holds the child(ren), e.g. `pages`, `pump`, `sensors`. */
|
|
8
|
+
propertyName: string;
|
|
9
|
+
/** Child model TS type, e.g. `PageModel`. */
|
|
10
|
+
childType: string;
|
|
11
|
+
/** How the child(ren) are held. Default `single`. */
|
|
12
|
+
shape?: ChildShape;
|
|
13
|
+
/** Package that owns the child model; when set, its type is imported from the root. */
|
|
14
|
+
childPackage?: string;
|
|
15
|
+
modelPath?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function addChildToModel(codegenFs: CodegenFileSystem, options: AddChildOptions, projects?: Map<string, ProjectConfiguration>): {
|
|
18
|
+
modelFilePath: string;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=add-child.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-child.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/member-mutators/add-child.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAWpE,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;AAE1D,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,YAAY,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,uFAAuF;IACvF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,wBAAgB,eAAe,CAC7B,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,eAAe,EACxB,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,CAmE3B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { addModelEffectToModel, type AddModelEffectOptions, } from './add-model-effect';
|
|
2
2
|
export { addDependencyToModel, type AddDependencyOptions, } from './add-dependency';
|
|
3
|
+
export { addChildToModel, type AddChildOptions, type ChildShape, } from './add-child';
|
|
3
4
|
export { addTopicHandlerToModel, type AddTopicHandlerOptions, } from './add-topic-handler';
|
|
4
5
|
export { addConfigPropertyToModel, type AddConfigPropertyOptions, } from './add-config-property';
|
|
5
6
|
export { addPropertyToModel, type AddPropertyOptions } from './add-property';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/member-mutators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,sBAAsB,EACtB,KAAK,sBAAsB,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EACxB,KAAK,wBAAwB,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EACL,wBAAwB,EACxB,KAAK,wBAAwB,GAC9B,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/member-mutators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,EACtB,KAAK,sBAAsB,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EACxB,KAAK,wBAAwB,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EACL,wBAAwB,EACxB,KAAK,wBAAwB,GAC9B,MAAM,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-model-index.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/update-model-index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG/D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,iBAAiB,EAC5B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"update-model-index.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/update-model-index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG/D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,iBAAiB,EAC5B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,IAAI,CAkDN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-codegen-core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.7",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"module": "./index.mjs",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"kos": {
|
|
27
27
|
"build": {
|
|
28
|
-
"gitHash": "
|
|
28
|
+
"gitHash": "65e37c8c2fa31716451cc469c9d23f1e4871b818"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -11,15 +11,16 @@
|
|
|
11
11
|
import type {
|
|
12
12
|
IKosDataModel
|
|
13
13
|
} from "../../../core/core/kosModel";
|
|
14
|
-
import type { KosModelRegistrationType } from "../../../core/core/registration/model-registration";
|
|
15
|
-
import type {
|
|
14
|
+
<% if (singleton === false) { %>import type { KosModelRegistrationType } from "../../../core/core/registration/model-registration";
|
|
15
|
+
<% } else { %>import type { SingletonKosModelRegistrationFactory } from "../../../core/core/registration/singleton-kos-model-registration-factory";
|
|
16
|
+
<% } %>import type { IKosIdentifiable } from "../../../core/core/types";
|
|
16
17
|
import type { PublicModelInterface } from "../../../core/types";
|
|
17
18
|
<% } else { %>import { kosModel, kosContainerAware, type KosContainerAware } from "@kosdev-code/kos-ui-sdk";
|
|
18
|
-
import { type KosModelRegistrationType
|
|
19
|
+
import { type <%= singleton === false ? "KosModelRegistrationType" : "SingletonKosModelRegistrationFactory" %>, IKosDataModel, IKosIdentifiable, PublicModelInterface, kosLoggerAware, type KosLoggerAware } from "@kosdev-code/kos-ui-sdk";<% } %>
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
import type { <%= nameProperCase %>Options } from "./types";
|
|
22
|
-
import
|
|
23
|
+
import { <%= modelNameProperCase %>, type <%= modelNameProperCase %>Model } from "./<%= modelNameDashCase %>-model";
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
export const MODEL_TYPE = "<%= nameDashCase %>-model";
|
|
@@ -29,13 +30,19 @@ export type <%= nameProperCase %>Model = PublicModelInterface<<%= nameProperCase
|
|
|
29
30
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
30
31
|
export interface <%= nameProperCase %>ModelImpl extends KosLoggerAware, KosContainerAware<<%= modelNameProperCase %>Model> {}
|
|
31
32
|
|
|
32
|
-
@kosModel({ modelTypeId: MODEL_TYPE, singleton: true
|
|
33
|
+
@kosModel({ modelTypeId: MODEL_TYPE, singleton: <%= singleton === false ? "false" : "true" %><% if (autoRegister) { %>, autoRegister: true<% } %> })
|
|
33
34
|
@kosContainerAware<<%= modelNameProperCase %>Model>()
|
|
34
35
|
@kosLoggerAware()
|
|
35
36
|
export class <%= nameProperCase %>ModelImpl implements IKosIdentifiable, IKosDataModel {
|
|
36
37
|
|
|
37
|
-
// Registration property for type safety - actual value injected by @kosModel
|
|
38
|
-
|
|
38
|
+
// Registration property for type safety - actual value injected by @kosModel
|
|
39
|
+
// decorator; the annotation must match the decorator's singleton flag (the
|
|
40
|
+
// decorator injects SingletonKosModelRegistrationFactory when singleton: true,
|
|
41
|
+
// KosModelRegistrationFactory when false).
|
|
42
|
+
static Registration: <%= singleton === false ? "KosModelRegistrationType" : "SingletonKosModelRegistrationFactory" %><
|
|
43
|
+
<%= nameProperCase %>Model,
|
|
44
|
+
<%= nameProperCase %>Options
|
|
45
|
+
>;
|
|
39
46
|
|
|
40
47
|
|
|
41
48
|
id: string;
|