@types/simpl-schema 1.12.8 → 1.12.9

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: Fri, 10 May 2024 20:35:45 GMT
11
+ * Last updated: Sat, 02 Nov 2024 18:36:07 GMT
12
12
  * Dependencies: [@types/meteor](https://npmjs.com/package/@types/meteor)
13
13
 
14
14
  # Credits
simpl-schema/index.d.ts CHANGED
@@ -85,7 +85,7 @@ export interface AutoValueContext {
85
85
  type Validator = (this: CustomValidationContext) => undefined | string | SimpleSchemaValidationError;
86
86
 
87
87
  export interface SchemaDefinition {
88
- type: any;
88
+ type: SchemaDefinitionType;
89
89
  label?: string | (() => string) | undefined;
90
90
  optional?: boolean | (() => boolean) | undefined;
91
91
  required?: boolean | (() => boolean) | undefined;
@@ -138,24 +138,29 @@ interface SimpleSchemaValidationError {
138
138
  [key: string]: number | string;
139
139
  }
140
140
 
141
- type IntegerSchema = "SimpleSchema.Integer";
141
+ interface Class {
142
+ new(...args: any[]): any;
143
+ }
144
+
145
+ type IntegerSchemaType = "SimpleSchema.Integer";
146
+ type AnySchemaType = "___Any___";
147
+
148
+ export type SchemaDefinitionType =
149
+ | SchemaDefinition
150
+ | ObjectConstructor
151
+ | BooleanConstructor
152
+ | StringConstructor
153
+ | NumberConstructor
154
+ | DateConstructor
155
+ | ArrayConstructor
156
+ | IntegerSchemaType
157
+ | FunctionConstructor
158
+ | RegExp
159
+ | SimpleSchema
160
+ | Class;
142
161
 
143
162
  export type SimpleSchemaDefinition = {
144
- [key: string]:
145
- | SchemaDefinition
146
- | BooleanConstructor
147
- | StringConstructor
148
- | NumberConstructor
149
- | DateConstructor
150
- | ArrayConstructor
151
- | IntegerSchema
152
- | [StringConstructor]
153
- | [NumberConstructor]
154
- | [IntegerSchema]
155
- | [SimpleSchema]
156
- | string
157
- | RegExp
158
- | SimpleSchema;
163
+ [key: string]: SchemaDefinitionType | SchemaDefinitionType[];
159
164
  } | any[];
160
165
 
161
166
  type SimpleSchemaCreateFunc = (options: { label: string; regExp: string }) => string;
@@ -174,20 +179,7 @@ export class SimpleSchema {
174
179
  addValidator(validator: Validator): void;
175
180
  pick(...fields: string[]): SimpleSchema;
176
181
  omit(...fields: string[]): SimpleSchema;
177
- static oneOf(
178
- ...types: Array<
179
- (
180
- | RegExp
181
- | SchemaDefinition
182
- | BooleanConstructor
183
- | StringConstructor
184
- | NumberConstructor
185
- | DateConstructor
186
- | ArrayConstructor
187
- | IntegerSchema
188
- )
189
- >
190
- ): SimpleSchema;
182
+ static oneOf(...types: SchemaDefinitionType[]): SimpleSchema;
191
183
  clean(doc: any, options?: CleanOption): any;
192
184
  schema(key?: string): SchemaDefinition;
193
185
  getDefinition(key: string, propList?: any, functionContext?: any): any;
@@ -195,7 +187,6 @@ export class SimpleSchema {
195
187
  keyIsInBlackBox(key: string): boolean;
196
188
  labels(labels: { [key: string]: string }): void;
197
189
  label(key: any): any;
198
- static Integer: IntegerSchema;
199
190
  messages(messages: any): any;
200
191
  messageForError(type: any, key: any, def: any, value: any): string;
201
192
  allowsKey(key: any): string;
@@ -206,6 +197,8 @@ export class SimpleSchema {
206
197
  validator(options?: ValidatorOption): (obj: any) => boolean;
207
198
  extend(otherSchema: SimpleSchema | SimpleSchemaDefinition): SimpleSchema;
208
199
  static extendOptions(options: readonly string[]): void;
200
+ static Integer: IntegerSchemaType;
201
+ static Any: AnySchemaType;
209
202
  static RegEx: {
210
203
  Email: RegExp;
211
204
  EmailWithTLD: RegExp;
simpl-schema/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/simpl-schema",
3
- "version": "1.12.8",
3
+ "version": "1.12.9",
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,7 @@
47
47
  "dependencies": {
48
48
  "@types/meteor": "*"
49
49
  },
50
- "typesPublisherContentHash": "def7710e199f371afe3a990e61843c9ec4bdeeaa0b643490aa7226ae9b81b032",
51
- "typeScriptVersion": "4.7"
50
+ "peerDependencies": {},
51
+ "typesPublisherContentHash": "9ffcbc7ac41653cbce310413e40fda8a07a55119c66163a90e14f7dd073293a0",
52
+ "typeScriptVersion": "4.8"
52
53
  }