-
Notifications
You must be signed in to change notification settings - Fork 248
Add typescript types #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add typescript types #136
Conversation
Suggestion - in eg: import {AxiosResponse, AxiosRequestConfig, AxiosInstance} from 'axios';
export declare class VueAuthenticate {
public constructor($http: AxiosInstance, overrideOptions: AuthenticateOptions);
// .. other method declarations
} |
Also, export interface AuthenticateOptions {
withCredentials?: boolean;
} |
Thanks. I added the missing definitions. In the meantime I stopped using this library because it's missing some features I needed and it turned out to be more effective to just write one myself. I'm happy to support with merging this though. |
Hi @ilari-makimattila , thanks for this PR. Can you please tell me which features are the key ones and the reason why you stopped using One thing bothers me here. You made typings for Axios only ( I see that you don't have motivation to test other libraries, but i can't merge half-finished work into master. |
We decided to go with a hosted solution instead of managing our own user database and it felt easiest to just write a vue plugin instead of looking for an existing solution. These types would more or less force any typescript user to use axios. But to be honest I don't really know how to write the type declarations in a way that wouldn't force the you to do explicit casts for every return value. |
} | ||
|
||
export declare class VueAuthenticate { | ||
public constructor($http: AxiosInstance, overrideOptions?: AuthenticateOptions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May it be that line 3 has to be: import { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
@@ -0,0 +1,7 @@ | |||
import { VueAuthenticate } from 'vue-authenticate'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like import Vue from "vue";
is missing here.
Hi, what is the status of this? Cheers |
Please see #196 |
Add definition files for Typescript. Fixes #117.
HTTP request and response are typed to corresponding axios objects. Mainly because I don't have motivation to test other providers.