
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@types/react-request
Advanced tools
npm install --save @types/react-request
This package contains type definitions for react-request (https://github.com/jamesplease/react-request).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-request.
// Type definitions for react-request 3.1
// Project: https://github.com/jamesplease/react-request
// Definitions by: Danny Cochran <https://github.com/dannycochran>
// Angus Fretwell <https://github.com/angusfretwell>
// Jonathan Ly <https://github.com/jonathanly>
// Alberto Juan <https://github.com/albertojuanl>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9
import * as React from "react";
export interface FetchResponse<T> {
url: string;
init: any;
failed: boolean;
requestKey: string;
response: Response | null;
data: T | null;
error: Error | null;
didUnmount: boolean;
}
export interface RenderProps<T> extends FetchResponse<T> {
requestName: string;
fetching: boolean;
doFetch: DoFetch<T>;
}
export interface FetchRequestProps extends RequestInit {
lazy?: boolean | undefined;
url: string;
}
export type ResponseType = "arrayBuffer" | "blob" | "formData" | "json" | "text";
export interface FetchProps<T = any> extends FetchRequestProps {
afterFetch?: ((args: FetchResponse<T>) => void) | undefined;
transformData?: ((data: any) => T) | undefined;
responseType?: ResponseType | undefined;
children?: ((renderProps: RenderProps<T>) => React.ReactNode) | undefined;
}
export interface DoFetchOptions extends RequestInit {
url?: string | undefined;
}
export type DoFetch<T = any> = (
options?: DoFetchOptions,
) => Promise<FetchResponse<T>>;
// TODO(dannycochran) RequestKeyOptions, ProxyRequest, fetchDedupe, getRequestKey, isRequestInFlight, clearRequestCache
// should all be defined in an adjacent typings directory for fetch-dedupe.
export interface RequestKeyOptions {
url?: string | undefined;
method?: string | undefined;
responseType?: string | undefined;
body?: string | undefined;
}
export interface ProxyRequest {
requestKey: string;
res: Response;
}
// TODO(dannycochran) Fill out fetchDedupe options.
export function fetchDedupe(
input: any,
init?: any,
dedupeOptions?: any,
): Promise<ProxyRequest>;
export function getRequestKey(keyOptions?: RequestKeyOptions): string;
export function isRequestInFlight(): boolean;
export function clearRequestCache(): void;
export function clearResponseCache(): void;
export class Fetch<T = any> extends React.Component<FetchProps<T>> {}
These definitions were written by Danny Cochran, Angus Fretwell, Jonathan Ly, and Alberto Juan.
FAQs
TypeScript definitions for react-request
The npm package @types/react-request receives a total of 340 weekly downloads. As such, @types/react-request popularity was classified as not popular.
We found that @types/react-request demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.