@based/schema 1.0.2 → 1.0.4

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/dist/error.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { BasedSetHandlers } from './types';
2
1
  export declare enum ParseError {
3
2
  'incorrectFieldType' = 0,
4
3
  'incorrectNodeType' = 1,
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Language } from './languages';
2
- import type { PartialDeep, SetOptional } from 'type-fest';
2
+ import type { PartialDeep } from 'type-fest';
3
3
  import { ParseError } from './error';
4
4
  import { ArgsClass, Path } from './walker';
5
5
  export type AllowedTypes = (string | {
@@ -179,21 +179,5 @@ export type BasedSetTarget = {
179
179
  path: Path;
180
180
  }[];
181
181
  };
182
- export type BasedSchemaCollectProps = {
183
- path: (string | number)[];
184
- value: any;
185
- typeSchema: BasedSchemaType;
186
- fieldSchema: BasedSchemaField;
187
- target: BasedSetTarget;
188
- };
189
- export type BasedSetHandlers = {
190
- collectErrors: (props: {
191
- message: string;
192
- code: ParseError;
193
- }) => void;
194
- collect: (props: BasedSchemaCollectProps) => void;
195
- checkRequiredFields: (path: (string | number)[]) => Promise<boolean>;
196
- referenceFilterCondition: (referenceId: string, $filter: any) => Promise<boolean>;
197
- };
198
- export type BasedSetOptionalHandlers = SetOptional<BasedSetHandlers, 'collectErrors' | 'collect'>;
182
+ export type BasedSchemaCollectProps = ArgsClass<BasedSetTarget>;
199
183
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@based/schema",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/types.ts CHANGED
@@ -349,28 +349,4 @@ export type BasedSetTarget = {
349
349
  errors: { code: ParseError; path: Path }[]
350
350
  }
351
351
 
352
- export type BasedSchemaCollectProps = {
353
- path: (string | number)[]
354
- value: any
355
- typeSchema: BasedSchemaType
356
- fieldSchema: BasedSchemaField
357
- target: BasedSetTarget
358
- }
359
-
360
- export type BasedSetHandlers = {
361
- collectErrors: (props: { message: string; code: ParseError }) => void
362
-
363
- collect: (props: BasedSchemaCollectProps) => void
364
-
365
- checkRequiredFields: (path: (string | number)[]) => Promise<boolean>
366
-
367
- referenceFilterCondition: (
368
- referenceId: string,
369
- $filter: any
370
- ) => Promise<boolean>
371
- }
372
-
373
- export type BasedSetOptionalHandlers = SetOptional<
374
- BasedSetHandlers,
375
- 'collectErrors' | 'collect'
376
- >
352
+ export type BasedSchemaCollectProps = ArgsClass<BasedSetTarget>