Skip to content
Open

V3 1 #84

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"presets": [
"react",
["env",{
"targets":{
"browsers": "last 2 versions"
},
"loose": true, //makes bundle smaller
"modules": false //tells babel to NOT transpile the modules
}]
],
"plugins":[
"react-hot-loader/babel",
"babel-plugin-transform-class-properties"
],
"env":{
"test": {
"plugins": [
"babel-plugin-transform-es2015-modules-commonjs"
]
}
}
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
public/
node_modules/
18 changes: 18 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["plugin:flowtype/recommended", "airbnb", "prettier", "prettier/react"],
"plugins": ["flowtype", "prettier"],
"parserOptions": {
"ecmaVersion": 2016,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"parser": "babel-eslint",
"env": {
"es6": true,
"browser": true,
"node": true,
"jest": true
}
}
8 changes: 8 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[ignore]
<PROJECT_ROOT>/node_modules/styled-components/*
[include]

[libs]
styled-components

[options]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
public/bundle.js
node_modules/
flow-typed/npm
.eslintcache
coverage/
.nyc_output
Expand Down
120 changes: 120 additions & 0 deletions flow-typed/npm/axios_v0.16.x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
// flow-typed signature: f285c927f7d16d32a7e2030a3b3c7f87
// flow-typed version: d634799bc1/axios_v0.16.x/flow_>=v0.25.x

declare module 'axios' {
declare interface ProxyConfig {
host: string;
port: number;
}
declare interface Cancel {
constructor(message?: string): Cancel;
message: string;
}
declare interface Canceler {
(message?: string): void;
}
declare interface CancelTokenSource {
token: CancelToken;
cancel: Canceler;
}
declare interface CancelToken {
constructor(executor: (cancel: Canceler) => void): CancelToken;
static source(): CancelTokenSource;
promise: Promise<Cancel>;
reason?: Cancel;
throwIfRequested(): void;
}
declare interface AxiosXHRConfigBase<T> {
adapter?: <T>(config: AxiosXHRConfig<T>) => Promise<AxiosXHR<T>>;
auth?: {
username: string,
password: string
};
baseURL?: string,
cancelToken?: CancelToken;
headers?: Object;
httpAgent?: mixed; // Missing the type in the core flow node libdef
httpsAgent?: mixed; // Missing the type in the core flow node libdef
maxContentLength?: number;
maxRedirects?: 5,
params?: Object;
paramsSerializer?: (params: Object) => string;
progress?: (progressEvent: Event) => void | mixed;
proxy?: ProxyConfig;
responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
timeout?: number;
transformRequest?: Array<<U>(data: T) => U|Array<<U>(data: T) => U>>;
transformResponse?: Array<<U>(data: T) => U>;
validateStatus?: (status: number) => boolean,
withCredentials?: boolean;
xsrfCookieName?: string;
xsrfHeaderName?: string;
}
declare type $AxiosXHRConfigBase<T> = AxiosXHRConfigBase<T>;
declare interface AxiosXHRConfig<T> extends AxiosXHRConfigBase<T> {
data?: T;
method?: string;
url: string;
}
declare type $AxiosXHRConfig<T> = AxiosXHRConfig<T>;
declare class AxiosXHR<T> {
config: AxiosXHRConfig<T>;
data: T;
headers: Object;
status: number;
statusText: string,
request: http$ClientRequest | XMLHttpRequest
}
declare type $AxiosXHR<T> = AxiosXHR<T>;
declare class AxiosInterceptorIdent extends String {}
declare class AxiosRequestInterceptor<T> {
use(
successHandler: ?(response: AxiosXHRConfig<T>) => Promise<AxiosXHRConfig<*>> | AxiosXHRConfig<*>,
errorHandler: ?(error: mixed) => mixed,
): AxiosInterceptorIdent;
eject(ident: AxiosInterceptorIdent): void;
}
declare class AxiosResponseInterceptor<T> {
use(
successHandler: ?(response: AxiosXHR<T>) => mixed,
errorHandler: ?(error: mixed) => mixed,
): AxiosInterceptorIdent;
eject(ident: AxiosInterceptorIdent): void;
}
declare type AxiosPromise<T> = Promise<AxiosXHR<T>>;
declare class Axios {
constructor<T>(config?: AxiosXHRConfigBase<T>): void;
$call: <T>(config: AxiosXHRConfig<T> | string, config?: AxiosXHRConfig<T>) => AxiosPromise<T>;
request<T>(config: AxiosXHRConfig<T>): AxiosPromise<T>;
delete<T>(url: string, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
get<T>(url: string, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
head<T>(url: string, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
post<T>(url: string, data?: mixed, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
put<T>(url: string, data?: mixed, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
patch<T>(url: string, data?: mixed, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
interceptors: {
request: AxiosRequestInterceptor<mixed>,
response: AxiosResponseInterceptor<mixed>,
};
defaults: AxiosXHRConfig<*> & { headers: Object };
}

declare class AxiosError<T> extends Error {
config: AxiosXHRConfig<T>;
response: AxiosXHR<T>;
code?: string;
}

declare type $AxiosError<T> = AxiosError<T>;

declare interface AxiosExport extends Axios {
Axios: typeof Axios;
Cancel: Class<Cancel>;
CancelToken: Class<CancelToken>;
isCancel(value: any): boolean;
create(config?: AxiosXHRConfigBase<any>): Axios;
all: typeof Promise.all;
spread(callback: Function): (arr: Array<any>) => Function
}
declare module.exports: AxiosExport;
}
Loading