/** * The result of sub-address (tag) detection. */ interface TagResult { /** The local part with the tag and separator removed (the "real" mailbox). */ baseLocalPart: string; /** True when a sub-address tag was found. */ hasTag: boolean; /** The separator that introduced the tag (`+` or `-`), if any. */ separator?: string; /** The detected tag value (everything after the separator), if any. */ tag?: string; } /** * Detects plus-addressing / sub-addressing tags in an email address. * * Most providers (Gmail, Outlook, iCloud, Proton, …) delimit the tag with `+`; * a few (Fastmail, Yahoo) use `-`. The returned {@link TagResult.baseLocalPart} * is the canonical mailbox with the tag stripped. * @param email The email address to inspect. * @returns The tag detection result. * @example * ```ts * import { detectTag } from "@visulima/email-verifier/checks/tag"; * * detectTag("user+newsletter@gmail.com"); * // { hasTag: true, tag: "newsletter", separator: "+", baseLocalPart: "user" } * ``` */ declare const detectTag: (email: string) => TagResult; export { type TagResult, detectTag as default, detectTag };