-
Notifications
You must be signed in to change notification settings - Fork 20
/
index.d.ts
46 lines (33 loc) · 1.23 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// tslint:disable max-classes-per-file
import {GraphQLScalarType} from "graphql";
declare namespace graphqlCustomTypes {
type IASTParser<TResult = any> = (ast: {kind: string, value: string}) => TResult;
interface IFactoryOptions {
name: string;
regex: RegExp;
description: string;
error?: string;
}
class Factory {
public getRegexScalar(options: IFactoryOptions): GraphQLCustomScalarType;
public getCustomScalar(name: string, description: string, parser: IASTParser): GraphQLCustomScalarType;
}
class GraphQLCustomScalarType extends GraphQLScalarType {
constructor(name: string, description: string, parser: IASTParser);
}
const GraphQLEmail: GraphQLCustomScalarType;
const GraphQLURL: GraphQLCustomScalarType;
const GraphQLDateTime: GraphQLCustomScalarType;
const GraphQLUUID: GraphQLCustomScalarType;
class GraphQLPassword extends GraphQLCustomScalarType {
constructor(min?: number, max?: number, alphabet?: string, complexity?: {
alphaNumeric?: boolean,
mixedCase?: boolean,
specialChars?: boolean,
});
}
class GraphQLLimitedString extends GraphQLCustomScalarType {
constructor(min?: number, max?: number, alphabet?: boolean)
}
}
export = graphqlCustomTypes;