JSPM

  • Created
  • Published
  • Downloads 108182
  • Score
    100M100P100Q167645F
  • License MIT

TypeScript definitions for power-assert

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@types/power-assert) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Installation

    npm install --save @types/power-assert

    Summary

    This package contains type definitions for power-assert (https://github.com/twada/power-assert).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/power-assert.

    index.d.ts

    // copy from assert external module in node.d.ts
    
    import { Options as EmpowerOptions } from "empower";
    import { Options as PowerAssertFormatterOptions } from "power-assert-formatter";
    
    export = assert;
    export as namespace assert;
    
    declare function assert(value: unknown, message?: string): void;
    declare namespace assert {
        class AssertionError implements Error {
            name: string;
            message: string;
            actual: unknown;
            expected: unknown;
            operator: string;
            generatedMessage: boolean;
    
            constructor(options?: {
                message?: string | undefined;
                actual?: unknown;
                expected?: unknown;
                operator?: string | undefined;
                stackStartFunction?: () => void | undefined;
            });
        }
    
        function fail(actual?: unknown, expected?: unknown, message?: string, operator?: string): never;
        function ok(value: unknown, message?: string): void;
        function equal(actual: unknown, expected: unknown, message?: string): void;
        function notEqual(actual: unknown, expected: unknown, message?: string): void;
        function deepEqual(actual: unknown, expected: unknown, message?: string): void;
        function notDeepEqual(actual: unknown, expected: unknown, message?: string): void;
        function strictEqual(actual: unknown, expected: unknown, message?: string): void;
        function notStrictEqual(actual: unknown, expected: unknown, message?: string): void;
        function deepStrictEqual(actual: unknown, expected: unknown, message?: string): void;
        function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string): void;
        const throws: {
            (block: () => unknown, message?: string): void;
            (
                block: () => unknown,
                error: (new() => object) | RegExp | ((err: unknown) => boolean),
                message?: string,
            ): void;
        };
        const doesNotThrow: {
            (block: () => unknown, message?: string): void;
            (block: () => unknown, error: (new() => object) | RegExp | ((err: any) => boolean), message?: string): void;
        };
        function ifError(value: unknown): void | undefined;
    
        const strict: typeof assert;
    
        interface Options {
            assertion?: EmpowerOptions | undefined;
            output?: PowerAssertFormatterOptions | undefined;
        }
    
        function customize(options: Options): typeof assert;
    }
    

    Additional Details

    Credits

    These definitions were written by vvakame, and Christian Murphy.