UNPKG

unmock-core

Version:

[![npm](https://img.shields.io/npm/v/unmock-core.svg)][npmjs] [![CircleCI](https://circleci.com/gh/unmock/unmock-js.svg?style=svg)](https://circleci.com/gh/unmock/unmock-js) [![codecov](https://codecov.io/gh/unmock/unmock-js/branch/dev/graph/badge.svg)](h

42 lines 1.65 kB
import NodeBackend from "./backend"; import { HTTPMethod } from "./interfaces"; import { Schema } from "./service/interfaces"; import { ServiceStore } from "./service/serviceStore"; declare const DynamicJSONSymbol: unique symbol; interface IDynamicJSONValue { dynamic: typeof DynamicJSONSymbol; } export declare const u: { str(): import("json-schema-strictly-typed").JSSTSimpleString<IDynamicJSONValue>; number(): import("json-schema-strictly-typed").JSSTNumber<IDynamicJSONValue>; int(): import("json-schema-strictly-typed").JSSTInteger<IDynamicJSONValue>; city(): import("json-schema-strictly-typed").JSSTSimpleString<IDynamicJSONValue>; }; declare type UpdateCallback = ({ statusCode, data, }: { statusCode: number; data: Schema; }) => ServiceStore; declare type Primitives = string | number | boolean; declare type InputToPoet = { [k: string]: any; } | Primitives | Primitives[]; export declare class DynamicServiceSpec { private updater; private statusCode; private baseUrl; private name?; private data; constructor(updater: UpdateCallback, statusCode: number, baseUrl: string, name?: string | undefined); reply(statusCode: number, data?: InputToPoet | InputToPoet[]): FluentDynamicService; reply(data: InputToPoet | InputToPoet[]): FluentDynamicService; } declare type FluentDynamicService = { [k in HTTPMethod]: (endpoint: string) => DynamicServiceSpec; }; export declare const nockify: ({ backend, baseUrl, name, }: { backend: NodeBackend; baseUrl: string; name?: string | undefined; }) => FluentDynamicService; export {}; //# sourceMappingURL=nock.d.ts.map