mirror of
https://github.com/Xevion/rdap.git
synced 2025-12-16 22:12:56 -06:00
Make proper, cohesive TargetType/SimplifiedTargetType types
why didn't I do this before? maybe i'll find out soon
This commit is contained in:
11
src/types.ts
11
src/types.ts
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user