@kravc/schema 2.7.2 → 2.7.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.d.ts +10 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kravc/schema",
3
- "version": "2.7.2",
3
+ "version": "2.7.4",
4
4
  "description": "Advanced JSON schema manipulation and validation library.",
5
5
  "keywords": [
6
6
  "JSON",
package/src/index.d.ts CHANGED
@@ -1,11 +1,20 @@
1
1
  declare type SchemaAttribute = object;
2
+ export declare type SchemaAttributes = Record<string, SchemaAttribute>;
3
+ declare type Enum = { enum: string[] };
4
+ declare type Source = Enum | SchemaAttributes;
2
5
 
3
6
  export declare class Schema {
4
7
  constructor(
5
- source: Record<string, SchemaAttribute>,
8
+ source: Source,
6
9
  id: string,
7
10
  url?: string
8
11
  )
12
+
13
+ get id(): string;
14
+
15
+ only(propertyNames: string[], id?: string): Schema;
16
+ wrap(propertyName: string, options?: Record<string, any>, id?: string): Schema;
17
+ extend(properties: Record<string, any>, id?: string): Schema;
9
18
  }
10
19
 
11
20
  export declare class Validator {