Skip to main content
Version: 4.5

Class: TsMorphMetadataProvider#

reflection.TsMorphMetadataProvider

Hierarchy#

Constructors#

constructor#

+ new TsMorphMetadataProvider(config: IConfiguration): TsMorphMetadataProvider

Parameters:#

NameType
configIConfiguration

Returns: TsMorphMetadataProvider

Inherited from: MetadataProvider

Defined in: packages/core/src/metadata/MetadataProvider.ts:9

Properties#

config#

Protected Readonly config: IConfiguration

Inherited from: MetadataProvider.config


project#

Private Readonly project: Project

Defined in: packages/reflection/src/TsMorphMetadataProvider.ts:6


sources#

Private sources: SourceFile[]

Defined in: packages/reflection/src/TsMorphMetadataProvider.ts:12

Methods#

extractType#

PrivateextractType(prop: EntityProperty<any>): string

Parameters:#

NameType
propEntityProperty<any>

Returns: string

Defined in: packages/reflection/src/TsMorphMetadataProvider.ts:62


getExistingSourceFile#

getExistingSourceFile(path: string, ext?: string, validate?: boolean): Promise<SourceFile>

Parameters:#

NameTypeDefault value
pathstring-
ext?string-
validatebooleantrue

Returns: Promise<SourceFile>

Defined in: packages/reflection/src/TsMorphMetadataProvider.ts:26


getSourceFile#

PrivategetSourceFile(tsPath: string, validate: boolean): Promise<undefined | SourceFile>

Parameters:#

NameType
tsPathstring
validateboolean

Returns: Promise<undefined | SourceFile>

Defined in: packages/reflection/src/TsMorphMetadataProvider.ts:137


initProperties#

ProtectedinitProperties(meta: EntityMetadata<any>): Promise<void>

Parameters:#

NameType
metaEntityMetadata<any>

Returns: Promise<void>

Overrides: MetadataProvider

Defined in: packages/reflection/src/TsMorphMetadataProvider.ts:49


initPropertyType#

PrivateinitPropertyType(meta: EntityMetadata<any>, prop: EntityProperty<any>): Promise<void>

Parameters:#

NameType
metaEntityMetadata<any>
propEntityProperty<any>

Returns: Promise<void>

Defined in: packages/reflection/src/TsMorphMetadataProvider.ts:74


initSourceFiles#

PrivateinitSourceFiles(): Promise<void>

Returns: Promise<void>

Defined in: packages/reflection/src/TsMorphMetadataProvider.ts:171


loadEntityMetadata#

loadEntityMetadata(meta: EntityMetadata<any>, name: string): Promise<void>

Parameters:#

NameType
metaEntityMetadata<any>
namestring

Returns: Promise<void>

Overrides: MetadataProvider

Defined in: packages/reflection/src/TsMorphMetadataProvider.ts:18


loadFromCache#

loadFromCache(meta: EntityMetadata<any>, cache: EntityMetadata<any>): void

Re-hydrates missing attributes like customType (functions/instances are lost when caching to JSON)

Parameters:#

NameType
metaEntityMetadata<any>
cacheEntityMetadata<any>

Returns: void

Overrides: MetadataProvider

Defined in: packages/reflection/src/TsMorphMetadataProvider.ts:39


processWrapper#

PrivateprocessWrapper(prop: EntityProperty<any>, wrapper: string): void

Parameters:#

NameType
propEntityProperty<any>
wrapperstring

Returns: void

Defined in: packages/reflection/src/TsMorphMetadataProvider.ts:151


readTypeFromSource#

PrivatereadTypeFromSource(meta: EntityMetadata<any>, prop: EntityProperty<any>): Promise<{ optional?: boolean ; type: string }>

Parameters:#

NameType
metaEntityMetadata<any>
propEntityProperty<any>

Returns: Promise<{ optional?: boolean ; type: string }>

Defined in: packages/reflection/src/TsMorphMetadataProvider.ts:87


useCache#

useCache(): boolean

Returns: boolean

Overrides: MetadataProvider

Defined in: packages/reflection/src/TsMorphMetadataProvider.ts:14

Last updated on by Renovate Bot