DefinitelyTyped/types/ipcheck/index.d.ts
Ben Grynhaus c6614dd157 Added types for 'ipcheck' (#23813)
* Added types for 'ipcheck'

* Fixed tests got be according to linting guidelines

* Made tsconfig stricter

* Standard tslint file

* Standartize ipcheck.d.ts

* tslint disable in .d.ts file

* disabled interface-name rule
2018-02-26 13:45:54 -08:00

30 lines
777 B
TypeScript

// Type definitions for ipcheck 0.1
// Project: https://github.com/gosquared/ipcheck
// Definitions by: Ben Grynhaus <https://github.com/bengry>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
declare const ipcheck: ipcheck.IPCheckStatic;
export = ipcheck;
export as namespace ipcheck;
declare namespace ipcheck {
interface IPCheck {
address: number[];
input: string;
ipv: 4 | 6 | 0;
mask: number;
valid: boolean;
match(cidr: IPCheck | string): boolean;
}
interface IPCheckConstructor {
new (input: string): IPCheck;
}
interface IPCheckStatic extends IPCheckConstructor {
match(ip: IPCheck | string, cidr: IPCheck | string): boolean;
}
}