functional-models 1.1.11 → 1.1.12
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/interfaces.d.ts +5 -4
- package/interfaces.js.map +1 -1
- package/package.json +1 -1
package/interfaces.d.ts
CHANGED
|
@@ -103,14 +103,15 @@ declare type ModelDefinition<T extends FunctionalModel> = {
|
|
|
103
103
|
readonly modelValidators?: readonly ModelComponentValidator[];
|
|
104
104
|
};
|
|
105
105
|
declare type ModelFactory = <T extends FunctionalModel>(modelName: string, modelDefinition: ModelDefinition<T>, options?: OptionalModelOptions) => Model<T>;
|
|
106
|
+
declare type CreateParams<T extends FunctionalModel> = (ModelInstanceInputData<T> & {
|
|
107
|
+
readonly id?: PrimaryKeyType;
|
|
108
|
+
}) | ModelInstanceInputData<T>;
|
|
106
109
|
declare type Model<T extends FunctionalModel> = {
|
|
107
110
|
readonly getName: () => string;
|
|
108
111
|
readonly getPrimaryKeyName: () => string;
|
|
109
112
|
readonly getModelDefinition: () => ModelDefinition<T>;
|
|
110
113
|
readonly getPrimaryKey: (t: ModelInstanceInputData<T>) => PrimaryKeyType;
|
|
111
|
-
readonly create: (data:
|
|
112
|
-
readonly id?: PrimaryKeyType;
|
|
113
|
-
}) | ModelInstanceInputData<T>) => ModelInstance<T>;
|
|
114
|
+
readonly create: (data: CreateParams<T>) => ModelInstance<T>;
|
|
114
115
|
readonly methods: ModelMethodGetters<T>;
|
|
115
116
|
};
|
|
116
117
|
declare type ReferenceFunctions = {
|
|
@@ -144,4 +145,4 @@ declare type ModelOptions = {
|
|
|
144
145
|
declare type OptionalModelOptions = {
|
|
145
146
|
readonly instanceCreatedCallback?: Nullable<Arrayable<(instance: ModelInstance<any>) => void>>;
|
|
146
147
|
} | undefined;
|
|
147
|
-
export { MaybeFunction, Maybe, MaybePromise, Nullable, Arrayable, MaybeLazy, JsonAble, toObj, ModelInstance, Model, PropertyValidatorComponent, PropertyValidatorComponentSync, PropertyValidatorComponentAsync, PropertyValidatorComponentType, PropertyValidator, ModelComponentValidator, PropertyInstance, PropertyConfig, FunctionalType, ValueGetter, ReferenceValueType, ModelDefinition, ModelOptions, ModelMethod, OptionalModelOptions, ReferencePropertyInstance, PropertyGetters, PropertyValidators, PropertyValidatorComponentTypeAdvanced, ModelInstanceMethod, ModelInstanceMethodTyped, FunctionalModel, ModelInstanceInputData, ModelMethodTyped, ModelMethodGetters, InstanceMethodGetters, ReferenceFunctions, ModelErrors, MaybeEmpty, PrimaryKeyType, ModelFactory, ModelFetcher, };
|
|
148
|
+
export { MaybeFunction, Maybe, MaybePromise, Nullable, Arrayable, MaybeLazy, JsonAble, toObj, ModelInstance, Model, PropertyValidatorComponent, PropertyValidatorComponentSync, PropertyValidatorComponentAsync, PropertyValidatorComponentType, PropertyValidator, ModelComponentValidator, PropertyInstance, PropertyConfig, FunctionalType, ValueGetter, ReferenceValueType, ModelDefinition, ModelOptions, ModelMethod, OptionalModelOptions, ReferencePropertyInstance, PropertyGetters, PropertyValidators, PropertyValidatorComponentTypeAdvanced, ModelInstanceMethod, ModelInstanceMethodTyped, FunctionalModel, ModelInstanceInputData, ModelMethodTyped, ModelMethodGetters, InstanceMethodGetters, ReferenceFunctions, ModelErrors, MaybeEmpty, PrimaryKeyType, ModelFactory, ModelFetcher, CreateParams, };
|
package/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA,mCAAmC;;
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA,mCAAmC;;AAwUnC,kCAAkC"}
|