@zodash/idcard
Version:
chinese id card parser, generator and validator
49 lines (48 loc) • 1.09 kB
TypeScript
import { generate } from './generate';
export declare class IDCard {
private readonly cardNumber;
static REGEXP: RegExp;
static generate: typeof generate;
private parsed;
constructor(cardNumber: string);
getAddressCode(): string;
getAddress(): {
text: string;
list: string[];
};
getAddressProvince(): {
name: string;
code: string;
};
getAddressCity(): {
name: string;
code: string;
};
getAddressRegion(): {
name: string;
code: string;
};
getBirthday(): string;
getSex(): number;
getAge(): number;
getCheckCode(): string;
toJSON(): {
address: string;
birthday: string;
age: number;
sex: number;
};
valueOf(): string;
toString(): {
address: string;
birthday: string;
age: number;
sex: number;
};
length(): number;
isValid(): boolean;
isAgeGreaterThanOrEquals(age: number): boolean;
isAdult(): boolean;
isMale(): boolean;
isFemale(): boolean;
}