index
@agros/common
@agros/common
Table of contents
Classes
Interfaces
- BootstrapConfigItem
- ClassImportItem
- Collection
- CollectionDescriptor
- CollectionGenerateResult
- CollectionWriteFileOptions
- ComponentDecoratorOptions
- ComponentInstanceMetadata
- Container
- ContainerForwardedComponentProps
- Decorator
- EntityDescriptor
- ExportItem
- Factory
- ImportedItem
- Interceptor
- LinterOptions
- ModuleCollectionMap
- ModuleDecoratorOptions
- ModuleInstanceMetadata
- ModuleMetadata
- PathDescriptor
- RootContainerProps
- RootPointDescriptor
- RouteOptionItem
- RouteProps
- RouterItem
- UpdateBaseOptions
- UpdateImportedEntityToModuleOptions
- UpdateImportedServiceToServiceOptions
- UpdateItem
- UpdateRouteToModuleOptions
- ValueProvider
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
Type Aliases
AsyncModuleClass
Ƭ AsyncModuleClass<T
>: Type
<T
> | Promise
<Type
> | ValueProvider
Type parameters
Name | Type |
---|---|
T | any |
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
Name | Type |
---|---|
code | string |
fromPath | string |
Returns
Promise
<string
>
Defined in
packages/agros-common/src/linters.ts:9
Type
Ƭ Type<T
>: (...args
: any
[]) => T
Type parameters
Name | Type |
---|---|
T | any |
Type declaration
• (...args
)
Parameters
Name | Type |
---|---|
...args | any [] |
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
Name | Type |
---|---|
data | Object |
data.classImportItem | ClassImportItem <t.ClassDeclaration > |
data.initialResult | UpdateItem [] |
data.options? | T |
data.sourceDescriptor | EntityDescriptor |
data.targetAST | ParseResult <t.File > |
data.targetDescriptor | EntityDescriptor |
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
Name | Type |
---|---|
T | any |
Type declaration
▸ (sourceDescriptor
, targetDescriptor
, options?
): Promise
<UpdateItem
[]>
Parameters
Name | Type |
---|---|
sourceDescriptor | EntityDescriptor |
targetDescriptor | EntityDescriptor |
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
Name | Type |
---|---|
updates | UpdateItem [] |
code | string |
Returns
string
Defined in
packages/agros-common/src/apply-updates.ts:4
checkEntities
▸ checkEntities(entities
): void
Parameters
Name | Type |
---|---|
entities | EntityDescriptor [] |
Returns
void
Defined in
packages/agros-common/src/check-entities.ts:3
detectDecorators
▸ detectDecorators(tree
, name
): Decorator
[]
Parameters
Name | Type |
---|---|
tree | ParseResult <File > |
name | string |
Returns
Defined in
packages/agros-common/src/detectors.ts:200
detectEOLCharacter
▸ detectEOLCharacter(code
): string
Parameters
Name | Type |
---|---|
code | string |
Returns
string
Defined in
packages/agros-common/src/detectors.ts:381
detectExports
▸ detectExports<T
>(ast
, type
): ExportItem
<T
>[]
Type parameters
Name | Type |
---|---|
T | extends Statement | Expression |
Parameters
Name | Type |
---|---|
ast | ParseResult <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
Name | Type |
---|---|
ast | ParseResult <File > |
Returns
Defined in
packages/agros-common/src/detectors.ts:165
detectImportedClass
▸ detectImportedClass(sourcePath
, targetPath
, dynamic?
): Promise
<ClassImportItem
<ClassDeclaration
>>
Parameters
Name | Type | Default value |
---|---|---|
sourcePath | string | undefined |
targetPath | string | undefined |
dynamic | boolean | false |
Returns
Promise
<ClassImportItem
<ClassDeclaration
>>
Defined in
packages/agros-common/src/detectors.ts:233
detectLastImportLine
▸ detectLastImportLine(ast
): number
Parameters
Name | Type |
---|---|
ast | ParseResult <File > |
Returns
number
Defined in
packages/agros-common/src/detectors.ts:367
detectNamedImports
▸ detectNamedImports(ast
, name
, sourceNameFilter?
): ImportSpecifier
[]
Parameters
Name | Type |
---|---|
ast | ParseResult <File > |
name | string |
sourceNameFilter | (sourceName : string ) => boolean |
Returns
ImportSpecifier
[]
Defined in
packages/agros-common/src/detectors.ts:146
detectRootPoint
▸ detectRootPoint(): RootPointDescriptor
Returns
Defined in
packages/agros-common/src/detectors.ts:405
getCollectionType
▸ getCollectionType(pathname
): CollectionType
Parameters
Name | Type |
---|---|
pathname | string |
Returns
CollectionType
Defined in
packages/agros-common/src/utils.ts:88
getESLintIndentSize
▸ getESLintIndentSize(eslintPath?
): number
Parameters
Name | Type |
---|---|
eslintPath | string |
Returns
number
Defined in
packages/agros-common/src/utils.ts:150
getEntityDescriptorWithAlias
▸ getEntityDescriptorWithAlias(pathname
): EntityDescriptor
Parameters
Name | Type |
---|---|
pathname | string |
Returns
Defined in
packages/agros-common/src/utils.ts:56
getFileEntityIdentifier
▸ getFileEntityIdentifier(pathname
): string
Parameters
Name | Type |
---|---|
pathname | string |
Returns
string
Defined in
packages/agros-common/src/utils.ts:122
getPathDescriptorWithAlias
▸ getPathDescriptorWithAlias(pathname
): PathDescriptor
Parameters
Name | Type |
---|---|
pathname | string |
Returns
Defined in
packages/agros-common/src/utils.ts:31
lintCode
▸ lintCode(code
, options?
): Promise
<string
>
Parameters
Name | Type |
---|---|
code | string |
options | LinterOptions |
Returns
Promise
<string
>
Defined in
packages/agros-common/src/linters.ts:15
lintWithPrettier
▸ lintWithPrettier(code
, fromPath?
): Promise
<string
>
Parameters
Name | Type |
---|---|
code | string |
fromPath | string |
Returns
Promise
<string
>
Defined in
packages/agros-common/src/linters.ts:92
matchAlias
▸ matchAlias(pathname
): boolean
Parameters
Name | Type |
---|---|
pathname | string |
Returns
boolean
Defined in
packages/agros-common/src/utils.ts:101
normalizeAbsolutePath
▸ normalizeAbsolutePath(pathname
, dirname?
): string
Parameters
Name | Type |
---|---|
pathname | string |
dirname | string |
Returns
string
Defined in
packages/agros-common/src/normalizers.ts:21
normalizeAlias
▸ normalizeAlias(aliasKey
): string
Parameters
Name | Type |
---|---|
aliasKey | string |
Returns
string
Defined in
packages/agros-common/src/normalizers.ts:33
normalizeCLIPath
▸ normalizeCLIPath(pathname
, entities
, collectionType?
): EntityDescriptor
Parameters
Name | Type |
---|---|
pathname | string |
entities | EntityDescriptor [] |
collectionType? | string |
Returns
Defined in
packages/agros-common/src/normalizers.ts:83
normalizeCollectionPattern
▸ normalizeCollectionPattern(pattern
): string
Parameters
Name | Type |
---|---|
pattern | string |
Returns
string
Defined in
packages/agros-common/src/normalizers.ts:47
normalizeEntityFileName
▸ normalizeEntityFileName(type
, name
, fallbackSchema?
): string
Parameters
Name | Type |
---|---|
type | CollectionType |
name | string |
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
Name | Type |
---|---|
pathname | string |
Returns
string
Defined in
packages/agros-common/src/normalizers.ts:61
normalizeRelativePath
▸ normalizeRelativePath(pathname
, dirname?
): string
Parameters
Name | Type |
---|---|
pathname | string |
dirname | string |
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
Name | Type |
---|---|
entityDescriptor | EntityDescriptor |
Returns
Defined in
packages/agros-common/src/scanner.ts:23
scanProjectEntities
▸ scanProjectEntities(startPath?
): EntityDescriptor
[]
Parameters
Name | Type |
---|---|
startPath | string |
Returns
Defined in
packages/agros-common/src/scanner.ts:90
transformAliasedPathToPath
▸ transformAliasedPathToPath(aliasedPath
): string
Parameters
Name | Type |
---|---|
aliasedPath | string |
Returns
string
Defined in
packages/agros-common/src/transformers.ts:56
transformPathToAliasedPath
▸ transformPathToAliasedPath(absolutePath
, dirname?
): string
Parameters
Name | Type | Default value |
---|---|---|
absolutePath | string | undefined |
dirname | string | '' |
Returns
string
Defined in
packages/agros-common/src/transformers.ts:10
updateImportedEntityToComponent
▸ updateImportedEntityToComponent(sourceDescriptor
, targetDescriptor
, options?
): Promise
<UpdateItem
[]>
Parameters
Name | Type |
---|---|
sourceDescriptor | EntityDescriptor |
targetDescriptor | EntityDescriptor |
options? | Record <string , any > |
Returns
Promise
<UpdateItem
[]>
Defined in
packages/agros-common/src/updaters.ts:35
updateImportedEntityToModule
▸ updateImportedEntityToModule(sourceDescriptor
, targetDescriptor
, options?
): Promise
<UpdateItem
[]>
Parameters
Name | Type |
---|---|
sourceDescriptor | EntityDescriptor |
targetDescriptor | EntityDescriptor |
options? | UpdateImportedEntityToModuleOptions |
Returns
Promise
<UpdateItem
[]>
Defined in
packages/agros-common/src/updaters.ts:35
updateImportedInjectableToInjectable
▸ updateImportedInjectableToInjectable(sourceDescriptor
, targetDescriptor
, options?
): Promise
<UpdateItem
[]>
Parameters
Name | Type |
---|---|
sourceDescriptor | EntityDescriptor |
targetDescriptor | EntityDescriptor |
options? | UpdateImportedServiceToServiceOptions |
Returns
Promise
<UpdateItem
[]>
Defined in
packages/agros-common/src/updaters.ts:35
updateRouteToModule
▸ updateRouteToModule(sourceDescriptor
, targetDescriptor
, options?
): Promise
<UpdateItem
[]>
Parameters
Name | Type |
---|---|
sourceDescriptor | EntityDescriptor |
targetDescriptor | EntityDescriptor |
options? | UpdateRouteToModuleOptions |
Returns
Promise
<UpdateItem
[]>