1.23.4 • Published 6 months ago

@types/httpsnippet v1.23.4

Weekly downloads
246
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/httpsnippet

Summary

This package contains type definitions for httpsnippet (https://github.com/Kong/httpsnippet).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/httpsnippet.

index.d.ts

// Type definitions for httpsnippet 1.23
// Project: https://github.com/Kong/httpsnippet
// Definitions by: Marcell Toth <https://github.com/marcelltoth>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import { Har, Request } from 'har-format';

/*~ This declaration specifies that the class constructor function
 *~ is the exported object from the file
 */
export = HTTPSnippet;

/*~ Write your module's methods and properties in this class */
declare class HTTPSnippet {
    constructor(data: HTTPSnippet.Data);

    convert(target: string, options?: HTTPSnippet.Options): string | false;

    convert(target: string, client?: string, options?: HTTPSnippet.Options): string | false;

    static addTarget(target: HTTPSnippet.Target): void;

    static addTargetClient(target: string, client: HTTPSnippet.TargetClient): void;

    static availableTargets: string[];

    static extName(target: string): string;
}

declare namespace HTTPSnippet {
    type Data = Har | Request;

    type Options = object;

    interface TargetClientInfo {
        key: string;
        title: string;
        link?: string | undefined;
        description?: string | undefined;
    }

    interface TargetClient {
        (source: Request, options: Options): string;
        info: TargetClientInfo;
    }

    interface TargetInfo<C extends string> {
        key: string;
        title: string;
        extname: string;
        default: C;
    }

    type Target<C extends string = string> = {
        info: TargetInfo<C>;
    } & Record<C, TargetClient>;
}

Additional Details

  • Last updated: Thu, 08 Jul 2021 14:22:57 GMT
  • Dependencies: @types/har-format
  • Global values: none

Credits

These definitions were written by Marcell Toth.

1.23.2

8 months ago

1.23.3

7 months ago

1.23.4

6 months ago

1.23.1

3 years ago

1.23.0

4 years ago