@piying/view-angular-core 1.7.8 → 1.8.0

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,11 +1,7 @@
1
+ import { JsonSchemaDraft202012Object, JsonSchemaDraft202012 } from '@hyperjump/json-schema/draft-2020-12';
1
2
  import * as v from 'valibot';
2
- import { JsonSchemaDraft202012Object } from '@hyperjump/json-schema/draft-2020-12';
3
+ import * as _angular_core from '@angular/core';
3
4
 
4
- type JSType = NonNullable<Exclude<JsonSchemaDraft202012Object['type'], any[]>>;
5
- type ResolvedSchema = v.BaseSchema<any, any, any> | v.SchemaWithPipe<readonly [
6
- v.BaseSchema<any, any, any>,
7
- ...(v.BaseSchema<any, any, any> | v.PipeAction<any, any, v.BaseIssue<unknown>>)[]
8
- ]>;
9
5
  interface JSONSchemaRaw extends JsonSchemaDraft202012Object {
10
6
  actions?: {
11
7
  name: string;
@@ -26,6 +22,13 @@ type ResolvedJsonSchema = JSONSchemaNoRef & {
26
22
  isResolved: boolean;
27
23
  };
28
24
  };
25
+ type JSType = NonNullable<Exclude<JsonSchemaDraft202012Object['type'], any[]>>;
26
+ type OptionJSType = JSType | 'const' | 'enum';
27
+ type BaseAction = v.BaseMetadata<any> | v.BaseValidation<any, any, any>;
28
+ type ResolvedSchema = v.BaseSchema<any, any, any> | v.SchemaWithPipe<readonly [
29
+ v.BaseSchema<any, any, any>,
30
+ ...(v.BaseSchema<any, any, any> | v.PipeAction<any, any, v.BaseIssue<unknown>>)[]
31
+ ]>;
29
32
  /** 合并schema
30
33
  * 子级需要解析
31
34
  */
@@ -39,14 +42,59 @@ interface J2VOptions {
39
42
  afterResolve?: (vSchema: ResolvedSchema, jSchema: ResolvedJsonSchema) => ResolvedSchema | undefined;
40
43
  };
41
44
  }
45
+
46
+ declare const enum ChildKind {
47
+ child = 0,
48
+ condition = 1
49
+ }
50
+ declare class TypeContext {
51
+ parent?: TypeContext;
52
+ parentObject?: TypeContext;
53
+ level: number;
54
+ instance?: BaseTypeService;
55
+ }
56
+ interface ParseOptions {
57
+ kind?: ChildKind;
58
+ }
59
+ declare class BaseTypeService {
60
+ static index: number;
61
+ context: TypeContext;
62
+ parent?: BaseTypeService;
63
+ instance: JsonSchemaToValibot;
64
+ schema: ResolvedJsonSchema;
65
+ name: OptionJSType | 'fixedList';
66
+ index: number;
67
+ instanceNamePrefix$$: _angular_core.Signal<string>;
68
+ constructor(instance: JsonSchemaToValibot, schema: ResolvedJsonSchema);
69
+ getAllActionList(actionList: BaseAction[]): BaseAction[];
70
+ isOptional(): boolean;
71
+ parseBase(actionList: BaseAction[]): ResolvedSchema;
72
+ parse(actionList: BaseAction[]): ResolvedSchema;
73
+ getBaseDefine(): ResolvedSchema;
74
+ getValidationActionList(schema: ResolvedJsonSchema): any[];
75
+ getExtraActionList(): BaseAction[];
76
+ typeParse(type: string, schema: ResolvedJsonSchema, actionList: BaseAction[], options?: ParseOptions): ResolvedSchema;
77
+ getTypeParse(type: string, schema: ResolvedJsonSchema, options?: ParseOptions): BaseTypeService;
78
+ commonTypeParse(schema: JsonSchemaDraft202012, options?: ParseOptions): ResolvedSchema;
79
+ resolveSchema2(schema: JsonSchemaDraft202012Object): ResolvedJsonSchema;
80
+ schemahasRef(schema: JsonSchemaDraft202012): boolean;
81
+ extraData: Record<string, any>;
82
+ getData(): Record<string, any>;
83
+ setData(data: any): void;
84
+ getFixedChild(): {};
85
+ getFixedChildBy(key: string): string;
86
+ }
87
+
42
88
  declare function jsonSchemaToValibot(schema: Record<string, any>, options?: J2VOptions): ResolvedSchema;
43
89
  declare class JsonSchemaToValibot {
44
90
  #private;
45
91
  root: JSONSchemaRaw;
92
+ options: J2VOptions | undefined;
46
93
  private cacheSchema;
47
94
  constructor(root: JSONSchemaRaw, options?: J2VOptions);
48
95
  convert(): ResolvedSchema;
96
+ resolveSchema2(schema: JsonSchemaDraft202012Object): ResolvedJsonSchema;
97
+ getTypeParser(type: string): typeof BaseTypeService;
49
98
  }
50
99
 
51
100
  export { JsonSchemaToValibot, jsonSchemaToValibot };
52
- export type { JSType, TypeHandle };