@aiao/rxdb-client-generator 0.0.2 → 0.0.3

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.
@@ -1,6 +1,5 @@
1
1
  import { EntityMetadataOptions, EntityType } from '@aiao/rxdb';
2
- import { SetRequired } from 'type-fest';
3
- import { Project } from './ts-morph-browser';
2
+ import { Project } from './ts_morph_browser';
4
3
  export interface RxDBClientGeneratorOptions {
5
4
  /**
6
5
  * 关系查询深度
@@ -11,28 +10,24 @@ export interface RxDBClientGeneratorOptions {
11
10
  */
12
11
  relationQueryDeep?: number;
13
12
  }
14
- /**
15
- * 生成时使用的 metadata
16
- * ‘extends’ 必填,因为 json 并不能算出继承关系
17
- *
18
- */
19
- export type GeneratorEntityMetadataOptions = SetRequired<EntityMetadataOptions, 'extends'>;
20
13
  /**
21
14
  * RxDB Client 生成器
22
15
  */
23
16
  export declare class RxDBClientGenerator {
17
+ private metadataMap;
24
18
  project: Project;
25
19
  metadataSet: Set<import('type-fest/source/readonly-deep').ReadonlyObjectDeep<import('@aiao/rxdb').EntityMetadataType>>;
26
- metadataMap: Map<string, import('type-fest/source/readonly-deep').ReadonlyObjectDeep<import('@aiao/rxdb').EntityMetadataType>>;
27
20
  config: Required<RxDBClientGeneratorOptions>;
28
21
  constructor(options?: RxDBClientGeneratorOptions);
29
22
  /**
30
23
  * 添加实体配置
31
24
  * @param value 实体
32
25
  */
33
- addEntity(value: GeneratorEntityMetadataOptions | EntityType): void;
26
+ addEntity(value: EntityMetadataOptions | EntityType, options?: EntityMetadataOptions[]): void;
27
+ getMetadata(mappedEntity: string, mappedNamespace: string): import('type-fest/source/readonly-deep').ReadonlyObjectDeep<import('@aiao/rxdb').EntityMetadataType> | undefined;
34
28
  /**
35
29
  * 执行生成器
36
30
  */
37
31
  exec(): void;
32
+ getSourceFiles(): import('./ts_morph_browser').SourceFile[];
38
33
  }
@@ -1,5 +1,5 @@
1
1
  import { EntityMetadata, EntityPropertyMetadata } from '@aiao/rxdb';
2
- import { PropertyDeclarationStructure } from './ts-morph-browser';
2
+ import { PropertyDeclarationStructure } from './ts_morph_browser';
3
3
  /**
4
4
  * 获取属性配置
5
5
  */
@@ -0,0 +1,13 @@
1
+ import { EntityMetadataOptions } from '@aiao/rxdb';
2
+ import { Project } from 'ts-morph';
3
+ interface AnalyzeFileResult {
4
+ decoratorName: string;
5
+ metadataOptions: EntityMetadataOptions;
6
+ extendMetadataOptions: EntityMetadataOptions[];
7
+ implements: string[];
8
+ }
9
+ /**
10
+ * 分析文件中的类
11
+ */
12
+ declare const _default: (filePath: string, project?: Project) => AnalyzeFileResult[];
13
+ export default _default;