Skip to main content

Function: makeModel()

makeModel<ND>(rawConfig, rawDefinition?): ExtendableModel <OmitNever<object> & UnionToIntersection<object | { [K in string | number | symbol]: ModelParsedDefinition<ND>[K] extends ModelComposable<CD> ? ModelFlattenDefinition<CD> : never }[keyof ND]> & OmitNever<{ [K in string | number | symbol]: ModelParsedDefinition<ND>[K] extends ModelComposable<any> ? never : ModelParsedDefinition<ND>[K] }>, ModelInstance <OmitNever<object> & UnionToIntersection<object | { [K in string | number | symbol]: ModelParsedDefinition<ND>[K] extends ModelComposable<CD> ? ModelFlattenDefinition<CD> : never }[keyof ND]> & OmitNever<{ [K in string | number | symbol]: ModelParsedDefinition<ND>[K] extends ModelComposable<any> ? never : ModelParsedDefinition<ND>[K] }>>>

Type parameters

ND extends object

Parameters

rawConfig: string | ModelConfig & object

rawDefinition?: ND & ThisType <ModelInstance <OmitNever<object> & UnionToIntersection<object | { [K in string | number | symbol]: (...)[(...)] extends ModelComposable<(...)> ? ModelFlattenDefinition<(...)> : never }[keyof ND]> & OmitNever<{ [K in string | number | symbol]: ModelParsedDefinition<ND>[K] extends ModelComposable<any> ? never : ModelParsedDefinition<ND>[K] }>>>

Returns

ExtendableModel <OmitNever<object> & UnionToIntersection<object | { [K in string | number | symbol]: ModelParsedDefinition<ND>[K] extends ModelComposable<CD> ? ModelFlattenDefinition<CD> : never }[keyof ND]> & OmitNever<{ [K in string | number | symbol]: ModelParsedDefinition<ND>[K] extends ModelComposable<any> ? never : ModelParsedDefinition<ND>[K] }>, ModelInstance <OmitNever<object> & UnionToIntersection<object | { [K in string | number | symbol]: ModelParsedDefinition<ND>[K] extends ModelComposable<CD> ? ModelFlattenDefinition<CD> : never }[keyof ND]> & OmitNever<{ [K in string | number | symbol]: ModelParsedDefinition<ND>[K] extends ModelComposable<any> ? never : ModelParsedDefinition<ND>[K] }>>>

Source

packages/core/src/model/makeModel.ts:3