Skip to content

Commit 16a7bb1

Browse files
committed
Rename interfaces from "Schema" to "JsonSchema"
1 parent 98eecd3 commit 16a7bb1

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export {
2-
JsonSchema, AnySchema, ObjectSchema, ArraySchema, IntegerSchema, NumberSchema, StringSchema, BooleanSchema, NullSchema,
2+
JsonSchema, AnyJsonSchema, ObjectJsonSchema, ArrayJsonSchema, IntegerJsonSchema, NumberJsonSchema, StringJsonSchema, BooleanJsonSchema, NullJsonSchema,
33
} from './jsonSchema';

src/jsonSchema.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
interface CommonSchema<
1+
interface CommonJsonSchema<
22
SchemaType,
33
MappedTypeScriptType,
44
LogicSubschema,
@@ -19,35 +19,35 @@ interface CommonSchema<
1919
writeOnly?: boolean
2020
}
2121

22-
export interface NullSchema extends CommonSchema<'null', null, NullSchema> {
22+
export interface NullJsonSchema extends CommonJsonSchema<'null', null, NullJsonSchema> {
2323
}
2424

25-
export interface BooleanSchema extends CommonSchema<'boolean', boolean, BooleanSchema> {
25+
export interface BooleanJsonSchema extends CommonJsonSchema<'boolean', boolean, BooleanJsonSchema> {
2626
}
2727

28-
export interface StringSchema extends CommonSchema<'string', string, StringSchema> {
28+
export interface StringJsonSchema extends CommonJsonSchema<'string', string, StringJsonSchema> {
2929
maxLength?: number,
3030
minLength?: number,
3131
pattern?: string,
3232
}
3333

34-
export interface NumberSchema extends CommonSchema<'number', number, NumberSchema> {
34+
export interface NumberJsonSchema extends CommonJsonSchema<'number', number, NumberJsonSchema> {
3535
exclusiveMaximum?: number,
3636
exclusiveMinimum?: number,
3737
maximum?: number,
3838
minimum?: number,
3939
multipleOf?: number,
4040
}
4141

42-
export interface IntegerSchema extends CommonSchema<'integer', number, IntegerSchema> {
42+
export interface IntegerJsonSchema extends CommonJsonSchema<'integer', number, IntegerJsonSchema> {
4343
exclusiveMaximum?: number,
4444
exclusiveMinimum?: number,
4545
maximum?: number,
4646
minimum?: number,
4747
multipleOf?: number,
4848
}
4949

50-
export interface ArraySchema extends CommonSchema<'array', Array<any>, ArraySchema> {
50+
export interface ArrayJsonSchema extends CommonJsonSchema<'array', Array<any>, ArrayJsonSchema> {
5151
contains?: JsonSchema,
5252
items?: JsonSchema,
5353
maxContains?: number,
@@ -58,7 +58,7 @@ export interface ArraySchema extends CommonSchema<'array', Array<any>, ArraySche
5858
uniqueItems?: boolean
5959
}
6060

61-
export interface ObjectSchema extends CommonSchema<'object', Record<string, any>, ObjectSchema> {
61+
export interface ObjectJsonSchema extends CommonJsonSchema<'object', Record<string, any>, ObjectJsonSchema> {
6262
additionalProperties?: JsonSchema,
6363
dependentRequired?: Record<string, Array<string>>,
6464
maxProperties?: number,
@@ -69,16 +69,16 @@ export interface ObjectSchema extends CommonSchema<'object', Record<string, any>
6969
required?: Array<string>,
7070
}
7171

72-
type CommonProperties = keyof CommonSchema<any, any, any>;
72+
type CommonProperties = keyof CommonJsonSchema<any, any, any>;
7373

74-
export interface AnySchema extends Omit<NullSchema, CommonProperties>,
75-
Omit<BooleanSchema, CommonProperties>,
76-
Omit<StringSchema, CommonProperties>,
77-
Omit<NumberSchema, CommonProperties>,
78-
Omit<IntegerSchema, CommonProperties>,
79-
Omit<ArraySchema, CommonProperties>,
80-
Omit<ObjectSchema, CommonProperties>,
81-
CommonSchema<undefined | Array<'string' | 'integer' | 'number' | 'array' | 'object' | 'boolean' | 'null'>, any, JsonSchema> {
74+
export interface AnyJsonSchema extends Omit<NullJsonSchema, CommonProperties>,
75+
Omit<BooleanJsonSchema, CommonProperties>,
76+
Omit<StringJsonSchema, CommonProperties>,
77+
Omit<NumberJsonSchema, CommonProperties>,
78+
Omit<IntegerJsonSchema, CommonProperties>,
79+
Omit<ArrayJsonSchema, CommonProperties>,
80+
Omit<ObjectJsonSchema, CommonProperties>,
81+
CommonJsonSchema<undefined | Array<'string' | 'integer' | 'number' | 'array' | 'object' | 'boolean' | 'null'>, any, JsonSchema> {
8282
}
8383

84-
export type JsonSchema = NullSchema | BooleanSchema | StringSchema | NumberSchema | IntegerSchema | ArraySchema | ObjectSchema | AnySchema;
84+
export type JsonSchema = NullJsonSchema | BooleanJsonSchema | StringJsonSchema | NumberJsonSchema | IntegerJsonSchema | ArrayJsonSchema | ObjectJsonSchema | AnyJsonSchema;

0 commit comments

Comments
 (0)