-
Notifications
You must be signed in to change notification settings - Fork 2
Improve Typescript Types #13
Copy link
Copy link
Open
Description
Hello, you;ve recently added typescript support which is nice but the return type of most function is type as Record<string, unknown> | undefined
This gives almost no information to the user of the SDK.
A better approach would be to type the return of each function explicitly.
validateEmail(
email: string,
options?: ValidateEmailOptions | string | null
): Promise<EmailValidationResponse>;
type EmailValidationResponse = {
ok: false;
error: string;
} | {
ok: true;
response: {
status: ValidationStatus
sub_status: ValidationSubStatus
....
}
}this would help user to use the SDK without having to refer to the documentation to know which fields are available.
It would be appreciated, thanks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels