DefinitelyTyped/types/chai-uuid/index.d.ts
Rebecca Turner 12453a8fe1 [chai] Provide type definitions for chai.use (#37451)
* chai: Add types for chai.use and chai.util

Helps developers write Chai plugins; requested in #29922.

Closes #29922.

* Updated dependencies on Chai

- Minimum TS version: 3.0
    - Version bumps to TS 3.0 for the following type definitions which
      depend on chai directly or indirectly:
            bardjs, chai, chai-almost, chai-arrays, chai-as-promised,
            chai-datetime, chai-dom, chai-enzyme, chai-fs, chai-fuzzy,
            chai-jest-snapshot, chai-jquery, chai-json-schema,
            chai-moment, chai-oequal, chai-roughly, chai-spies,
            chai-string, chai-subset, chai-things, chai-uuid,
            chai-webdriverio, chai-xml, d3kit, deep-equal-in-any-order,
            dirty-chai, ember-mocha, hexo, hexo-log, hexo-util,
            jsx-chai, karma-chai, karma-chai-sinon, redux-test-utils,
            and sinon-chai
- Use Chai.ChaiPlugin instead of (chai: any, utils: any) => void

* Factor out pathval types

- Forgot that the pathval types aren't merged yet

* Factor out pathval types

- Forgot that the pathval types aren't merged yet

* Make 'chainingBehavior' non-mandatory
2019-08-08 08:58:47 -07:00

28 lines
745 B
TypeScript

// Type definitions for chai-uuid 1.0
// Project: https://github.com/rfrench/chai-uuid
// Definitions by: Harm van der Werf <https://github.com/harm-less>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
/// <reference types="node" />
/// <reference types="chai" />
declare global {
namespace Chai {
type UuidVersion = 'v1' | 'v2' | 'v3' | 'v4' | 'v5' | '';
interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
uuid(uuid?: UuidVersion): void;
guid(guid?: any): void;
}
interface Assert {
uuid(uuid: string, version?: UuidVersion): void;
guid(guid: string, version?: any): void;
}
}
}
declare const chaiUuid: Chai.ChaiPlugin;
export = chaiUuid;