Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/sync-fetch

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/sync-fetch

TypeScript definitions for sync-fetch

  • 0.4.3
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12K
decreased by-7.03%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/sync-fetch

Summary

This package contains type definitions for sync-fetch (https://github.com/larsgw/sync-fetch).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sync-fetch.

index.d.ts

import NodeFetch = require("node-fetch");

type Blob = NodeFetch.Blob;
type Headers = NodeFetch.Headers;
type HeadersInit = NodeFetch.HeadersInit;
type RequestContext = NodeFetch.RequestContext;
type RequestRedirect = NodeFetch.RequestRedirect;
type ResponseInit = NodeFetch.ResponseInit;
type ResponseType = NodeFetch.ResponseType;

type SyncFetch = (url: SyncRequestInfo, init?: SyncRequestInit) => SyncResponse;

type SyncRequestInfo = string | URLLike | SyncRequest;

declare class SyncRequest extends SyncBody {
    constructor(input: SyncRequestInfo, init?: SyncRequestInit);
    clone: () => SyncRequest;
    context: RequestContext;
    headers: Headers;
    method: string;
    redirect: RequestRedirect;
    referrer: string;
    url: string;
    compress: boolean;
    counter: number;
    follow: number;
    hostname: string;
    port?: number;
    protocol: string;
    size: number;
    timeout: number;
}

interface SyncRequestInit {
    body?: SyncBodyInit;
    headers?: HeadersInit;
    method?: string;
    redirect?: RequestRedirect;
    compress?: boolean;
    follow?: number;
    size?: number;
    timeout?: number;
}

declare class SyncResponse extends SyncBody {
    constructor(body?: SyncBodyInit, init?: ResponseInit);
    clone: () => SyncResponse;
    headers: Headers;
    ok: boolean;
    redirected: boolean;
    status: number;
    statusText: string;
    type: ResponseType;
    url: string;
}

declare class SyncBody {
    constructor(body?: any, opts?: { size?: number; timeout?: number });
    arrayBuffer: () => ArrayBuffer;
    blob: () => Promise<Blob>;
    body: NodeJS.ReadableStream;
    bodyUsed: boolean;
    buffer: () => Buffer;
    json: () => any;
    size: number;
    text: () => string;
    timeout: number;
}

type SyncBodyInit = string | ArrayBuffer | ArrayBufferView | URLSearchParams;

interface URLLike {
    href: string;
}

declare const syncFetch: SyncFetch & {
    FetchError: typeof NodeFetch.FetchError;
    Headers: typeof NodeFetch.Headers;
    Request: typeof SyncRequest;
    Response: typeof SyncResponse;
};

export = syncFetch;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: @types/node-fetch

Credits

These definitions were written by Alex Laz.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc