npm.io
2.3.6 • Published 2 years ago

@types/jquery-mockjax

Licence
MIT
Version
2.3.6
Deps
1
Size
7 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/jquery-mockjax

Summary

This package contains type definitions for jquery-mockjax (https://github.com/jakerella/jquery-mockjax).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jquery-mockjax.

index.d.ts

/// <reference types="jquery" />

type MockJaxLoggingFunction = (message?: any, ...additionalParameters: any[]) => void;

interface MockJaxStandardLogger {
    error?: MockJaxLoggingFunction | undefined;
    warn?: MockJaxLoggingFunction | undefined;
    info?: MockJaxLoggingFunction | undefined;
    log?: MockJaxLoggingFunction | undefined;
    debug?: MockJaxLoggingFunction | undefined;
}

interface MockJaxCustomLogger {
    [key: string]: MockJaxLoggingFunction;
}

interface MockJaxSettingsHeaders {
    [key: string]: string;
}

interface MockJaxSettings {
    url?: string | RegExp | undefined;
    urlParams?: string[] | undefined;
    data?: any;
    type?: string | undefined;
    headers?: MockJaxSettingsHeaders | undefined;
    logging?: boolean | number | undefined;
    status?: number | undefined;
    statusText?: string | undefined;
    responseTime?: number | undefined;
    isTimeout?: boolean | undefined;
    dataType?: string | undefined;
    contentType?: string | undefined;
    response?: ((settings: any, done?: Function) => void) | undefined;
    responseText?: string | Object | undefined;
    responseXml?: string | undefined;
    proxy?: string | undefined;
    proxyType?: string | undefined;
    lastModified?: string | undefined;
    etag?: string | undefined;
    onAfterSuccess?: Function | undefined;
    onAfterError?: Function | undefined;
    onAfterComplete?: Function | undefined;
    logger?: MockJaxStandardLogger | MockJaxCustomLogger | undefined;
    logLevelMethods?: string[] | undefined;
    namespace?: string | undefined;
    throwUnmocked?: boolean | undefined;
    retainAjaxCalls?: boolean | undefined;
}

interface MockJaxStatic {
    (options: MockJaxSettings): number;
    (options: MockJaxSettings[]): number[];
    handler(id?: number): any;
    clear(id?: number): void;
    mockedAjaxCalls(): any[];
    unfiredHandlers(): any[];
    unmockedAjaxCalls(): any[];
    clearRetainedAjaxCalls(): void;
}

interface JQueryStatic {
    mockjax: MockJaxStatic;
    mockjaxSettings: MockJaxSettings;
}

Additional Details

  • Last updated: Thu, 25 Jan 2024 2226 GMT
  • Dependencies: @types/jquery

Credits

These definitions were written by Laszlo Jakab, and James Johnson.