Skip to main content
Version: 0.7.x

index

@agros/common

@agros/common

Table of contents

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

AsyncModuleClass

Ƭ AsyncModuleClass<T>: Type<T> | Promise<Type> | ValueProvider

Type parameters

NameType
Tany

Defined in

packages/agros-common/src/types.ts:52


ComponentMetadata

Ƭ ComponentMetadata: Omit<ComponentDecoratorOptions, "declarations"> & { factory?: () => any ; uuid: string }

Defined in

packages/agros-common/src/types.ts:41


ExportMode

Ƭ ExportMode: "default" | "named" | "namedIdentifier" | "defaultIdentifier"

Defined in

packages/agros-common/src/detectors.ts:42


ImportSpecifierMap

Ƭ ImportSpecifierMap: Record<string, string>

Defined in

packages/agros-common/src/detectors.ts:163


LinterPlugin

Ƭ LinterPlugin: (code: string, fromPath: string) => Promise<string>

Type declaration

▸ (code, fromPath): Promise<string>

Parameters
NameType
codestring
fromPathstring
Returns

Promise<string>

Defined in

packages/agros-common/src/linters.ts:9


Type

Ƭ Type<T>: (...args: any[]) => T

Type parameters

NameType
Tany

Type declaration

• (...args)

Parameters
NameType
...argsany[]

Defined in

packages/agros-common/src/types.ts:51


Updater

Ƭ Updater<T>: (data: { classImportItem: ClassImportItem<t.ClassDeclaration> ; initialResult: UpdateItem[] ; options?: T ; sourceDescriptor: EntityDescriptor ; targetAST: ParseResult<t.File> ; targetDescriptor: EntityDescriptor }) => Promise<UpdateItem[]>

Type parameters

Name
T

Type declaration

▸ (data): Promise<UpdateItem[]>

Parameters
NameType
dataObject
data.classImportItemClassImportItem<t.ClassDeclaration>
data.initialResultUpdateItem[]
data.options?T
data.sourceDescriptorEntityDescriptor
data.targetASTParseResult<t.File>
data.targetDescriptorEntityDescriptor
Returns

Promise<UpdateItem[]>

Defined in

packages/agros-common/src/updaters.ts:26


UpdaterWithChecker

Ƭ UpdaterWithChecker<T>: (sourceDescriptor: EntityDescriptor, targetDescriptor: EntityDescriptor, options?: T) => Promise<UpdateItem[]>

Type parameters

NameType
Tany

Type declaration

▸ (sourceDescriptor, targetDescriptor, options?): Promise<UpdateItem[]>

Parameters
NameType
sourceDescriptorEntityDescriptor
targetDescriptorEntityDescriptor
options?T
Returns

Promise<UpdateItem[]>

Defined in

packages/agros-common/src/updaters.ts:35


UseInterceptorsDecoratorOptions

Ƭ UseInterceptorsDecoratorOptions: Type[]

Defined in

packages/agros-common/src/types.ts:117

Variables

DI_DEPS_SYMBOL

Const DI_DEPS_SYMBOL: typeof DI_DEPS_SYMBOL

Defined in

packages/agros-common/src/constants.ts:1


DI_GLOBAL_MODULE_SYMBOL

Const DI_GLOBAL_MODULE_SYMBOL: typeof DI_GLOBAL_MODULE_SYMBOL

Defined in

packages/agros-common/src/constants.ts:2


DI_METADATA_COMPONENT_SYMBOL

Const DI_METADATA_COMPONENT_SYMBOL: typeof DI_METADATA_COMPONENT_SYMBOL

Defined in

packages/agros-common/src/constants.ts:5


DI_METADATA_MODULE_SYMBOL

Const DI_METADATA_MODULE_SYMBOL: typeof DI_METADATA_MODULE_SYMBOL

Defined in

packages/agros-common/src/constants.ts:4


DI_METADATA_USE_INTERCEPTORS_SYMBOL

Const DI_METADATA_USE_INTERCEPTORS_SYMBOL: typeof DI_METADATA_USE_INTERCEPTORS_SYMBOL

Defined in

packages/agros-common/src/constants.ts:6


ROUTES_FEATURE

Const ROUTES_FEATURE: "agros:internal:routes:feature"

Defined in

packages/agros-common/src/constants.ts:9


ROUTES_ROOT

Const ROUTES_ROOT: "agros:internal:routes:root"

Defined in

packages/agros-common/src/constants.ts:8

Functions

applyUpdates

applyUpdates(updates, code): string

Parameters

NameType
updatesUpdateItem[]
codestring

Returns

string

Defined in

packages/agros-common/src/apply-updates.ts:4


checkEntities

checkEntities(entities): void

Parameters

NameType
entitiesEntityDescriptor[]

Returns

void

Defined in

packages/agros-common/src/check-entities.ts:3


detectDecorators

detectDecorators(tree, name): Decorator[]

Parameters

NameType
treeParseResult<File>
namestring

Returns

Decorator[]

Defined in

packages/agros-common/src/detectors.ts:200


detectEOLCharacter

detectEOLCharacter(code): string

Parameters

NameType
codestring

Returns

string

Defined in

packages/agros-common/src/detectors.ts:381


detectExports

detectExports<T>(ast, type): ExportItem<T>[]

Type parameters

NameType
Textends Statement | Expression

Parameters

NameType
astParseResult<File>
type"ObjectExpression" | "ObjectPattern" | "ImportDeclaration" | "ArrayExpression" | "AssignmentExpression" | "BinaryExpression" | "CallExpression" | "ConditionalExpression" | "FunctionExpression" | "Identifier" | "StringLiteral" | "NumericLiteral" | "NullLiteral" | "BooleanLiteral" | "RegExpLiteral" | "LogicalExpression" | "MemberExpression" | "NewExpression" | "SequenceExpression" | "ParenthesizedExpression" | "ThisExpression" | "UnaryExpression" | "UpdateExpression" | "ArrowFunctionExpression" | "ClassExpression" | "MetaProperty" | "Super" | "TaggedTemplateExpression" | "TemplateLiteral" | "YieldExpression" | "AwaitExpression" | "Import" | "BigIntLiteral" | "OptionalMemberExpression" | "OptionalCallExpression" | "TypeCastExpression" | "JSXElement" | "JSXFragment" | "BindExpression" | "DoExpression" | "RecordExpression" | "TupleExpression" | "DecimalLiteral" | "ModuleExpression" | "TopicReference" | "PipelineTopicExpression" | "PipelineBareFunction" | "PipelinePrimaryTopicReference" | "TSInstantiationExpression" | "TSAsExpression" | "TSTypeAssertion" | "TSNonNullExpression" | "BlockStatement" | "BreakStatement" | "ContinueStatement" | "DebuggerStatement" | "DoWhileStatement" | "EmptyStatement" | "ExpressionStatement" | "ForInStatement" | "ForStatement" | "FunctionDeclaration" | "IfStatement" | "LabeledStatement" | "ReturnStatement" | "SwitchStatement" | "ThrowStatement" | "TryStatement" | "VariableDeclaration" | "WhileStatement" | "WithStatement" | "ClassDeclaration" | "ExportAllDeclaration" | "ExportDefaultDeclaration" | "ExportNamedDeclaration" | "ForOfStatement" | "DeclareClass" | "DeclareFunction" | "DeclareInterface" | "DeclareModule" | "DeclareModuleExports" | "DeclareTypeAlias" | "DeclareOpaqueType" | "DeclareVariable" | "DeclareExportDeclaration" | "DeclareExportAllDeclaration" | "InterfaceDeclaration" | "OpaqueType" | "TypeAlias" | "EnumDeclaration" | "TSDeclareFunction" | "TSInterfaceDeclaration" | "TSTypeAliasDeclaration" | "TSEnumDeclaration" | "TSModuleDeclaration" | "TSImportEqualsDeclaration" | "TSExportAssignment" | "TSNamespaceExportDeclaration" | "V8IntrinsicIdentifier" | "Decorator" | "File" | "AnyTypeAnnotation" | "ArgumentPlaceholder" | "ArrayPattern" | "ArrayTypeAnnotation" | "AssignmentPattern" | "BooleanLiteralTypeAnnotation" | "BooleanTypeAnnotation" | "CatchClause" | "ClassAccessorProperty" | "ClassBody" | "ClassImplements" | "ClassMethod" | "ClassPrivateMethod" | "ClassPrivateProperty" | "ClassProperty" | "DeclaredPredicate" | "Directive" | "DirectiveLiteral" | "EmptyTypeAnnotation" | "EnumBooleanBody" | "EnumBooleanMember" | "EnumDefaultedMember" | "EnumNumberBody" | "EnumNumberMember" | "EnumStringBody" | "EnumStringMember" | "EnumSymbolBody" | "ExistsTypeAnnotation" | "ExportDefaultSpecifier" | "ExportNamespaceSpecifier" | "ExportSpecifier" | "FunctionTypeAnnotation" | "FunctionTypeParam" | "GenericTypeAnnotation" | "ImportAttribute" | "ImportDefaultSpecifier" | "ImportNamespaceSpecifier" | "ImportSpecifier" | "IndexedAccessType" | "InferredPredicate" | "InterfaceExtends" | "InterfaceTypeAnnotation" | "InterpreterDirective" | "IntersectionTypeAnnotation" | "JSXAttribute" | "JSXClosingElement" | "JSXClosingFragment" | "JSXEmptyExpression" | "JSXExpressionContainer" | "JSXIdentifier" | "JSXMemberExpression" | "JSXNamespacedName" | "JSXOpeningElement" | "JSXOpeningFragment" | "JSXSpreadAttribute" | "JSXSpreadChild" | "JSXText" | "MixedTypeAnnotation" | "Noop" | "NullLiteralTypeAnnotation" | "NullableTypeAnnotation" | "NumberLiteral" | "NumberLiteralTypeAnnotation" | "NumberTypeAnnotation" | "ObjectMethod" | "ObjectProperty" | "ObjectTypeAnnotation" | "ObjectTypeCallProperty" | "ObjectTypeIndexer" | "ObjectTypeInternalSlot" | "ObjectTypeProperty" | "ObjectTypeSpreadProperty" | "OptionalIndexedAccessType" | "Placeholder" | "PrivateName" | "Program" | "QualifiedTypeIdentifier" | "RegexLiteral" | "RestElement" | "RestProperty" | "SpreadElement" | "SpreadProperty" | "StaticBlock" | "StringLiteralTypeAnnotation" | "StringTypeAnnotation" | "SwitchCase" | "SymbolTypeAnnotation" | "TSAnyKeyword" | "TSArrayType" | "TSBigIntKeyword" | "TSBooleanKeyword" | "TSCallSignatureDeclaration" | "TSConditionalType" | "TSConstructSignatureDeclaration" | "TSConstructorType" | "TSDeclareMethod" | "TSEnumMember" | "TSExpressionWithTypeArguments" | "TSExternalModuleReference" | "TSFunctionType" | "TSImportType" | "TSIndexSignature" | "TSIndexedAccessType" | "TSInferType" | "TSInterfaceBody" | "TSIntersectionType" | "TSIntrinsicKeyword" | "TSLiteralType" | "TSMappedType" | "TSMethodSignature" | "TSModuleBlock" | "TSNamedTupleMember" | "TSNeverKeyword" | "TSNullKeyword" | "TSNumberKeyword" | "TSObjectKeyword" | "TSOptionalType" | "TSParameterProperty" | "TSParenthesizedType" | "TSPropertySignature" | "TSQualifiedName" | "TSRestType" | "TSStringKeyword" | "TSSymbolKeyword" | "TSThisType" | "TSTupleType" | "TSTypeAnnotation" | "TSTypeLiteral" | "TSTypeOperator" | "TSTypeParameter" | "TSTypeParameterDeclaration" | "TSTypeParameterInstantiation" | "TSTypePredicate" | "TSTypeQuery" | "TSTypeReference" | "TSUndefinedKeyword" | "TSUnionType" | "TSUnknownKeyword" | "TSVoidKeyword" | "TemplateElement" | "ThisTypeAnnotation" | "TupleTypeAnnotation" | "TypeAnnotation" | "TypeParameter" | "TypeParameterDeclaration" | "TypeParameterInstantiation" | "TypeofTypeAnnotation" | "UnionTypeAnnotation" | "VariableDeclarator" | "Variance" | "VoidTypeAnnotation"

Returns

ExportItem<T>[]

Defined in

packages/agros-common/src/detectors.ts:66


detectImportSpecifierMap

detectImportSpecifierMap(ast): ImportSpecifierMap

Parameters

NameType
astParseResult<File>

Returns

ImportSpecifierMap

Defined in

packages/agros-common/src/detectors.ts:165


detectImportedClass

detectImportedClass(sourcePath, targetPath, dynamic?): Promise<ClassImportItem<ClassDeclaration>>

Parameters

NameTypeDefault value
sourcePathstringundefined
targetPathstringundefined
dynamicbooleanfalse

Returns

Promise<ClassImportItem<ClassDeclaration>>

Defined in

packages/agros-common/src/detectors.ts:233


detectLastImportLine

detectLastImportLine(ast): number

Parameters

NameType
astParseResult<File>

Returns

number

Defined in

packages/agros-common/src/detectors.ts:367


detectNamedImports

detectNamedImports(ast, name, sourceNameFilter?): ImportSpecifier[]

Parameters

NameType
astParseResult<File>
namestring
sourceNameFilter(sourceName: string) => boolean

Returns

ImportSpecifier[]

Defined in

packages/agros-common/src/detectors.ts:146


detectRootPoint

detectRootPoint(): RootPointDescriptor

Returns

RootPointDescriptor

Defined in

packages/agros-common/src/detectors.ts:405


getCollectionType

getCollectionType(pathname): CollectionType

Parameters

NameType
pathnamestring

Returns

CollectionType

Defined in

packages/agros-common/src/utils.ts:88


getESLintIndentSize

getESLintIndentSize(eslintPath?): number

Parameters

NameType
eslintPathstring

Returns

number

Defined in

packages/agros-common/src/utils.ts:150


getEntityDescriptorWithAlias

getEntityDescriptorWithAlias(pathname): EntityDescriptor

Parameters

NameType
pathnamestring

Returns

EntityDescriptor

Defined in

packages/agros-common/src/utils.ts:56


getFileEntityIdentifier

getFileEntityIdentifier(pathname): string

Parameters

NameType
pathnamestring

Returns

string

Defined in

packages/agros-common/src/utils.ts:122


getPathDescriptorWithAlias

getPathDescriptorWithAlias(pathname): PathDescriptor

Parameters

NameType
pathnamestring

Returns

PathDescriptor

Defined in

packages/agros-common/src/utils.ts:31


lintCode

lintCode(code, options?): Promise<string>

Parameters

NameType
codestring
optionsLinterOptions

Returns

Promise<string>

Defined in

packages/agros-common/src/linters.ts:15


lintWithPrettier

lintWithPrettier(code, fromPath?): Promise<string>

Parameters

NameType
codestring
fromPathstring

Returns

Promise<string>

Defined in

packages/agros-common/src/linters.ts:92


matchAlias

matchAlias(pathname): boolean

Parameters

NameType
pathnamestring

Returns

boolean

Defined in

packages/agros-common/src/utils.ts:101


normalizeAbsolutePath

normalizeAbsolutePath(pathname, dirname?): string

Parameters

NameType
pathnamestring
dirnamestring

Returns

string

Defined in

packages/agros-common/src/normalizers.ts:21


normalizeAlias

normalizeAlias(aliasKey): string

Parameters

NameType
aliasKeystring

Returns

string

Defined in

packages/agros-common/src/normalizers.ts:33


normalizeCLIPath

normalizeCLIPath(pathname, entities, collectionType?): EntityDescriptor

Parameters

NameType
pathnamestring
entitiesEntityDescriptor[]
collectionType?string

Returns

EntityDescriptor

Defined in

packages/agros-common/src/normalizers.ts:83


normalizeCollectionPattern

normalizeCollectionPattern(pattern): string

Parameters

NameType
patternstring

Returns

string

Defined in

packages/agros-common/src/normalizers.ts:47


normalizeEntityFileName

normalizeEntityFileName(type, name, fallbackSchema?): string

Parameters

NameType
typeCollectionType
namestring
fallbackSchema?string

Returns

string

Defined in

packages/agros-common/src/normalizers.ts:63


normalizeModulesPath

normalizeModulesPath(): string

Returns

string

Defined in

packages/agros-common/src/normalizers.ts:29


normalizeNoExtensionPath

normalizeNoExtensionPath(pathname): string

Parameters

NameType
pathnamestring

Returns

string

Defined in

packages/agros-common/src/normalizers.ts:61


normalizeRelativePath

normalizeRelativePath(pathname, dirname?): string

Parameters

NameType
pathnamestring
dirnamestring

Returns

string

Defined in

packages/agros-common/src/normalizers.ts:25


normalizeSrcPath

normalizeSrcPath(): string

normalize a relative pathname with project src path example: ./modules/foo/foo.module.ts => src/modules/foo/foo.module.ts

Returns

string

pathname

Defined in

packages/agros-common/src/normalizers.ts:17


scanModuleCollectionMap

scanModuleCollectionMap(entityDescriptor): ModuleCollectionMap

Parameters

NameType
entityDescriptorEntityDescriptor

Returns

ModuleCollectionMap

Defined in

packages/agros-common/src/scanner.ts:23


scanProjectEntities

scanProjectEntities(startPath?): EntityDescriptor[]

Parameters

NameType
startPathstring

Returns

EntityDescriptor[]

Defined in

packages/agros-common/src/scanner.ts:90


transformAliasedPathToPath

transformAliasedPathToPath(aliasedPath): string

Parameters

NameType
aliasedPathstring

Returns

string

Defined in

packages/agros-common/src/transformers.ts:56


transformPathToAliasedPath

transformPathToAliasedPath(absolutePath, dirname?): string

Parameters

NameTypeDefault value
absolutePathstringundefined
dirnamestring''

Returns

string

Defined in

packages/agros-common/src/transformers.ts:10


updateImportedEntityToComponent

updateImportedEntityToComponent(sourceDescriptor, targetDescriptor, options?): Promise<UpdateItem[]>

Parameters

NameType
sourceDescriptorEntityDescriptor
targetDescriptorEntityDescriptor
options?Record<string, any>

Returns

Promise<UpdateItem[]>

Defined in

packages/agros-common/src/updaters.ts:35


updateImportedEntityToModule

updateImportedEntityToModule(sourceDescriptor, targetDescriptor, options?): Promise<UpdateItem[]>

Parameters

NameType
sourceDescriptorEntityDescriptor
targetDescriptorEntityDescriptor
options?UpdateImportedEntityToModuleOptions

Returns

Promise<UpdateItem[]>

Defined in

packages/agros-common/src/updaters.ts:35


updateImportedInjectableToInjectable

updateImportedInjectableToInjectable(sourceDescriptor, targetDescriptor, options?): Promise<UpdateItem[]>

Parameters

NameType
sourceDescriptorEntityDescriptor
targetDescriptorEntityDescriptor
options?UpdateImportedServiceToServiceOptions

Returns

Promise<UpdateItem[]>

Defined in

packages/agros-common/src/updaters.ts:35


updateRouteToModule

updateRouteToModule(sourceDescriptor, targetDescriptor, options?): Promise<UpdateItem[]>

Parameters

NameType
sourceDescriptorEntityDescriptor
targetDescriptorEntityDescriptor
options?UpdateRouteToModuleOptions

Returns

Promise<UpdateItem[]>

Defined in

packages/agros-common/src/updaters.ts:35

  • Table of contents
  • Type Aliases
    • AsyncModuleClass
    • ComponentMetadata
    • ExportMode
    • ImportSpecifierMap
    • LinterPlugin
    • Type
    • Updater
    • UpdaterWithChecker
    • UseInterceptorsDecoratorOptions
  • Variables
    • DI_DEPS_SYMBOL
    • DI_GLOBAL_MODULE_SYMBOL
    • DI_METADATA_COMPONENT_SYMBOL
    • DI_METADATA_MODULE_SYMBOL
    • DI_METADATA_USE_INTERCEPTORS_SYMBOL
    • ROUTES_FEATURE
    • ROUTES_ROOT
  • Functions
    • applyUpdates
    • checkEntities
    • detectDecorators
    • detectEOLCharacter
    • detectExports
    • detectImportSpecifierMap
    • detectImportedClass
    • detectLastImportLine
    • detectNamedImports
    • detectRootPoint
    • getCollectionType
    • getESLintIndentSize
    • getEntityDescriptorWithAlias
    • getFileEntityIdentifier
    • getPathDescriptorWithAlias
    • lintCode
    • lintWithPrettier
    • matchAlias
    • normalizeAbsolutePath
    • normalizeAlias
    • normalizeCLIPath
    • normalizeCollectionPattern
    • normalizeEntityFileName
    • normalizeModulesPath
    • normalizeNoExtensionPath
    • normalizeRelativePath
    • normalizeSrcPath
    • scanModuleCollectionMap
    • scanProjectEntities
    • transformAliasedPathToPath
    • transformPathToAliasedPath
    • updateImportedEntityToComponent
    • updateImportedEntityToModule
    • updateImportedInjectableToInjectable
    • updateRouteToModule