Make proper, cohesive TargetType/SimplifiedTargetType types

why didn't I do this before? maybe i'll find out soon
This commit is contained in:
2024-05-10 01:47:59 -05:00
parent d819920f8a
commit abab1b357b
2 changed files with 15 additions and 7 deletions

View File

@@ -7,15 +7,20 @@ import type {
IpNetworkSchema,
LinkSchema,
NameserverSchema,
ObjectTypeEnum,
TargetTypeEnum,
RegisterSchema,
StatusEnum,
RootRegistryEnum,
} from "@/schema";
export type ObjectType = z.infer<typeof ObjectTypeEnum>;
// All precise target types that can be placed in the search bar.
export type TargetType = z.infer<typeof TargetTypeEnum>;
// Target types that can be selected by the user; IPv4 and IPv6 are combined into a single type for simplicity (IP/CIDR)
export type SimplifiedTargetType = Exclude<TargetType, "ip4" | "ip6"> | "ip";
// Root registry types that associate with a bootstrap file provided by the RDAP registry.
export type RootRegistryType = z.infer<typeof RootRegistryEnum>;
export type TargetType = Exclude<ObjectType, "ip"> | "ip4" | "ip6";
export type RdapStatusType = z.infer<typeof StatusEnum>;
export type Link = z.infer<typeof LinkSchema>;