mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 11:02:11 +08:00
typings for precond library added
This commit is contained in:
43
precond/precond-tests.ts
Normal file
43
precond/precond-tests.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
/// <reference path="./precond.d.ts" />
|
||||
|
||||
import precond = require('precond');
|
||||
|
||||
precond.checkArgument(true);
|
||||
precond.checkArgument(true, "msg");
|
||||
precond.checkArgument(true, "%s %s %s", 1, "two");
|
||||
|
||||
precond.checkState(true);
|
||||
precond.checkState(true, "msg");
|
||||
precond.checkState(true, "%s %s %s", 1, "two");
|
||||
|
||||
precond.checkIsDef(true);
|
||||
precond.checkIsDef(true, "msg");
|
||||
precond.checkIsDef(true, "%s %s %s", 1, "two");
|
||||
|
||||
precond.checkIsDefAndNotNull(true);
|
||||
precond.checkIsDefAndNotNull(true, "msg");
|
||||
precond.checkIsDefAndNotNull(true, "%s %s %s", 1, "two");
|
||||
|
||||
precond.checkIsString(true);
|
||||
precond.checkIsString(true, "msg");
|
||||
precond.checkIsString(true, "%s %s %s", 1, "two");
|
||||
|
||||
precond.checkIsArray(true);
|
||||
precond.checkIsArray(true, "msg");
|
||||
precond.checkIsArray(true, "%s %s %s", 1, "two");
|
||||
|
||||
precond.checkIsNumber(true);
|
||||
precond.checkIsNumber(true, "msg");
|
||||
precond.checkIsNumber(true, "%s %s %s", 1, "two");
|
||||
|
||||
precond.checkIsBoolean(true);
|
||||
precond.checkIsBoolean(true, "msg");
|
||||
precond.checkIsBoolean(true, "%s %s %s", 1, "two");
|
||||
|
||||
precond.checkIsFunction(true);
|
||||
precond.checkIsFunction(true, "msg");
|
||||
precond.checkIsFunction(true, "%s %s %s", 1, "two");
|
||||
|
||||
precond.checkIsObject(true);
|
||||
precond.checkIsObject(true, "msg");
|
||||
precond.checkIsObject(true, "%s %s %s", 1, "two");
|
||||
1
precond/precond-tests.ts.tscparams
Normal file
1
precond/precond-tests.ts.tscparams
Normal file
@@ -0,0 +1 @@
|
||||
--noImplicitAny --module commonjs
|
||||
17
precond/precond.d.ts
vendored
Normal file
17
precond/precond.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Type definitions for precond 0.2.3
|
||||
// Project: https://github.com/MathieuTurcotte/node-precond
|
||||
// Definitions by: Oliver Schneider <https://github.com/olsio>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "precond" {
|
||||
export function checkArgument(value: any, message?: string, ...formatArgs: any[]): void;
|
||||
export function checkState(value: any, message?: string, ...formatArgs: any[]): void;
|
||||
export function checkIsDef(value: any, message?: string, ...formatArgs: any[]): any;
|
||||
export function checkIsDefAndNotNull(value: any, message?: string, ...formatArgs: any[]): any;
|
||||
export function checkIsString(value: any, message?: string, ...formatArgs: any[]): any;
|
||||
export function checkIsArray(value: any, message?: string, ...formatArgs: any[]): any;
|
||||
export function checkIsNumber(value: any, message?: string, ...formatArgs: any[]): any;
|
||||
export function checkIsBoolean(value: any, message?: string, ...formatArgs: any[]): any;
|
||||
export function checkIsFunction(value: any, message?: string, ...formatArgs: any[]): any;
|
||||
export function checkIsObject(value: any, message?: string, ...formatArgs: any[]): any;
|
||||
}
|
||||
Reference in New Issue
Block a user