mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
* [APM] Improve license check * Remove unneeded strings * Add translations * Use React.FunctionComponent * Update copy
36 lines
1 KiB
TypeScript
36 lines
1 KiB
TypeScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
*/
|
|
|
|
// Everything in here should be moved to http://github.com/sqren/react-redux-request
|
|
|
|
declare module 'react-redux-request' {
|
|
import React from 'react';
|
|
|
|
// status and args are optional, especially for places that use initial data in a reducer
|
|
export interface RRRRenderResponse<T, P = any[]> {
|
|
status?: 'SUCCESS' | 'LOADING' | 'FAILURE';
|
|
data: T;
|
|
args?: P;
|
|
}
|
|
|
|
export type RRRRender<T, P = any[]> = (
|
|
res: RRRRenderResponse<T, P>
|
|
) => React.ReactNode;
|
|
|
|
export interface RequestProps<T, P> {
|
|
id: string;
|
|
fn: (args: any) => Promise<any>;
|
|
selector?: (state: any) => any;
|
|
args?: any[];
|
|
render?: RRRRender<T, P>;
|
|
}
|
|
|
|
export function reducer(state: any): any;
|
|
|
|
export class Request<T, P = any[]> extends React.Component<
|
|
RequestProps<T, P>
|
|
> {}
|
|
}
|