@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.
- package/RxDBClientGenerator.d.ts +5 -10
- package/RxDBClientGenerator.utils.d.ts +1 -1
- package/analyze_file.d.ts +13 -0
- package/build_rxdb_client_lib-BPIw_COZ.js +961 -0
- package/build_rxdb_client_lib.d.ts +3 -0
- package/cli.d.ts +1 -1
- package/cli.interface.d.ts +5 -0
- package/cli.js +54 -86
- package/find_files.d.ts +2 -0
- package/generator_all_entity_definition.d.ts +1 -1
- package/generator_entity_definition.d.ts +1 -1
- package/generator_entity_properties.d.ts +3 -2
- package/generator_entity_relations.d.ts +1 -1
- package/generator_entity_rules.d.ts +1 -1
- package/generator_repository_methods.d.ts +3 -1
- package/generator_tree_repository_methods.d.ts +1 -1
- package/index.d.ts +1 -0
- package/index.js +4 -855
- package/package.json +3 -4
- package/{ts-morph-browser.d.ts → ts_morph_browser.d.ts} +134 -16
- package/vite.d.ts +2 -5
- package/vite.js +7 -3
package/RxDBClientGenerator.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EntityMetadataOptions, EntityType } from '@aiao/rxdb';
|
|
2
|
-
import {
|
|
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:
|
|
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
|
}
|
|
@@ -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;
|