@types/simpl-schema 1.10.5 → 1.12.2

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.
simpl-schema/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for simpl-schema (https://github.com/alde
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/simpl-schema.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Tue, 06 Jul 2021 16:34:49 GMT
11
+ * Last updated: Tue, 19 Apr 2022 18:31:28 GMT
12
12
  * Dependencies: [@types/meteor](https://npmjs.com/package/@types/meteor)
13
13
  * Global values: none
14
14
 
simpl-schema/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for simpl-schema 1.10
1
+ // Type definitions for simpl-schema 1.12
2
2
  // Project: https://github.com/aldeed/simpl-schema
3
3
  // Definitions by: Andreas Richter <https://github.com/arichter83>
4
4
  // Qkramer <https://github.com/Qkramer>
@@ -7,7 +7,7 @@
7
7
  // Rafa Horo <https://github.com/rafahoro>
8
8
  // Stepan Yurtsiv <https://github.com/yurtsiv>
9
9
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
10
- // Minimum TypeScript Version: 3.7
10
+ // Minimum TypeScript Version: 4.1
11
11
 
12
12
  import { check } from 'meteor/check';
13
13
 
@@ -99,6 +99,7 @@ export interface SchemaDefinition {
99
99
  type: any;
100
100
  label?: string | (() => string) | undefined;
101
101
  optional?: boolean | (() => boolean) | undefined;
102
+ required?: boolean | (() => boolean) | undefined;
102
103
  min?: number | boolean | Date | (() => number | boolean | Date) | undefined;
103
104
  max?: number | boolean | Date | (() => number | boolean | Date) | undefined;
104
105
  minCount?: number | (() => number) | undefined;
@@ -129,6 +130,9 @@ interface CleanOption {
129
130
  isModifier?: boolean | undefined;
130
131
  extendAutoValueContext?: boolean | undefined;
131
132
  removeNullsFromArrays?: boolean | undefined;
133
+ mutate?: boolean | undefined;
134
+ isUpsert?: boolean | undefined;
135
+ mongoObject?: boolean | undefined;
132
136
  }
133
137
 
134
138
  interface SimpleSchemaOptions {
@@ -198,7 +202,7 @@ export class SimpleSchema {
198
202
  objectKeys(keyPrefix?: any): any[];
199
203
  validate(obj: any, options?: ValidationOption): void;
200
204
  static validate(obj: any, schema: SimpleSchema, options?: ValidationOption): void;
201
- validator(options?: ValidationOption): (obj: any) => boolean;
205
+ validator(options?: ValidatorOption): (obj: any) => boolean;
202
206
  extend(otherSchema: SimpleSchema | SimpleSchemaDefinition): SimpleSchema;
203
207
  static extendOptions(options: ReadonlyArray<string>): void;
204
208
  static RegEx: {
@@ -239,33 +243,18 @@ export class SimpleSchema {
239
243
  interface ValidationOption {
240
244
  modifier?: boolean | undefined;
241
245
  upsert?: boolean | undefined;
242
- clean?: boolean | undefined;
243
- filter?: boolean | undefined;
244
- upsertextendedCustomContext?: boolean | undefined;
246
+ extendedCustomContext?: Record<string, any> | undefined;
247
+ ignore?: string[];
245
248
  keys?: string[] | undefined;
246
249
  }
247
250
 
248
- interface SimpleSchemaValidationContextStaticKeys {
249
- name: string;
250
- type: string;
251
- value?: any;
252
- }
253
-
254
- interface SimpleSchemaError {
255
- name: string;
256
- type: string;
257
- }
251
+ type ValidatorOption = ({clean: true} & ValidationOption & CleanOption) | ({clean?: false | undefined} & ValidationOption);
258
252
 
259
253
  interface SimpleSchemaValidationContextStatic {
260
254
  validate(obj: any, options?: ValidationOption): boolean;
261
- validateOne(doc: any, keyName: string, options?: ValidationOption): boolean;
262
- resetValidation(): void;
263
255
  isValid(): boolean;
264
- invalidKeys(): SimpleSchemaValidationContextStaticKeys[];
265
- addInvalidKeys(errors: ReadonlyArray<SimpleSchemaError>): void;
266
256
  keyIsInvalid(name: any): boolean;
267
257
  keyErrorMessage(name: any): string;
268
- getErrorObject(): any;
269
258
  }
270
259
 
271
260
  interface MongoObjectStatic {
simpl-schema/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/simpl-schema",
3
- "version": "1.10.5",
3
+ "version": "1.12.2",
4
4
  "description": "TypeScript definitions for simpl-schema",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/simpl-schema",
6
6
  "license": "MIT",
@@ -47,6 +47,6 @@
47
47
  "dependencies": {
48
48
  "@types/meteor": "*"
49
49
  },
50
- "typesPublisherContentHash": "173a81a0355d451af56da5ac36a92b526c3de63aab7f8cc8d7be04333da151ed",
51
- "typeScriptVersion": "3.7"
50
+ "typesPublisherContentHash": "619137cd56bf558c5b9381718f2105fa3e9baafd8880a4096ef7d4c3405444f7",
51
+ "typeScriptVersion": "4.1"
52
52
  }