|
1 | 1 | import Ajv, { Options as AjvOptions } from "ajv"
|
| 2 | + |
2 | 3 | declare namespace build {
|
3 | 4 | interface BaseSchema {
|
4 | 5 | /**
|
@@ -189,13 +190,13 @@ interface StandaloneOption extends build.Options {
|
189 | 190 | declare function build(schema: build.AnySchema, options: DebugOption): { code: string, ajv: Ajv };
|
190 | 191 | declare function build(schema: build.AnySchema, options: DeprecateDebugOption): { code: string, ajv: Ajv };
|
191 | 192 | declare function build(schema: build.AnySchema, options: StandaloneOption): string;
|
192 |
| -declare function build(schema: build.AnySchema, options?: build.Options): (doc: any) => any; |
193 |
| -declare function build(schema: build.StringSchema, options?: build.Options): (doc: string) => string; |
194 |
| -declare function build(schema: build.IntegerSchema | build.NumberSchema, options?: build.Options): (doc: number) => string; |
195 |
| -declare function build(schema: build.NullSchema, options?: build.Options): (doc: null) => "null"; |
196 |
| -declare function build(schema: build.BooleanSchema, options?: build.Options): (doc: boolean) => string; |
197 |
| -declare function build(schema: build.ArraySchema | build.TupleSchema, options?: build.Options): (doc: any[]) => string; |
198 |
| -declare function build(schema: build.ObjectSchema, options?: build.Options): (doc: object) => string; |
199 |
| -declare function build(schema: build.Schema, options?: build.Options): (doc: object | any[] | string | number | boolean | null) => string; |
| 193 | +declare function build(schema: build.AnySchema, options?: build.Options): <TDoc = any>(doc: TDoc) => any; |
| 194 | +declare function build(schema: build.StringSchema, options?: build.Options): <TDoc extends string = string>(doc: TDoc) => string; |
| 195 | +declare function build(schema: build.IntegerSchema | build.NumberSchema, options?: build.Options): <TDoc extends number = number>(doc: TDoc) => string; |
| 196 | +declare function build(schema: build.NullSchema, options?: build.Options): <TDoc extends null = null>(doc: TDoc) => "null"; |
| 197 | +declare function build(schema: build.BooleanSchema, options?: build.Options): <TDoc extends boolean = boolean>(doc: TDoc) => string; |
| 198 | +declare function build(schema: build.ArraySchema | build.TupleSchema, options?: build.Options): <TDoc extends any[]= any[]>(doc: TDoc) => string; |
| 199 | +declare function build(schema: build.ObjectSchema, options?: build.Options): <TDoc extends object = object>(doc: TDoc) => string; |
| 200 | +declare function build(schema: build.Schema, options?: build.Options): <TDoc = object | any[] | string | number | boolean | null> (doc: TDoc) => string; |
200 | 201 |
|
201 | 202 | export = build;
|
0 commit comments