declare enum ServiceTypes { AMAZON = 'amazon', AMAZON_MUSIC = 'amazonMusic', ANGHAMI = 'anghami', APPLE_MUSIC = 'appleMusic', AUDIOMACK = 'audiomack', AUDIUS = 'audius', AWA = 'awa', BANDCAMP = 'bandcamp', BANDSINTOWN = 'bandsintown', BEATPORT = 'beatport', BOOMPLAY = 'boomplay', DEEZER = 'deezer', DISCOGS = 'discogs', FACEBOOK = 'facebook', FLO = 'flo', GAANA = 'gaana', GENIUS = 'genius', IHEART_RADIO = 'iHeartRadio', IMDB = 'imdb', INSTAGRAM = 'instagram', ITUNES_STORE = 'itunesStore', JIO_SAAVN = 'jioSaavn', JOOX = 'joox', KKBOX = 'kkbox', LINE_MUSIC = 'lineMusic', MUSIC_BRAINZ = 'musicBrainz', NAPSTER = 'napster', NETEASE = 'netease', PANDORA = 'pandora', QOBUZ = 'qobuz', QQ_MUSIC = 'qqMusic', SEVEN_DIGITAL = 'sevenDigital', SHAZAM = 'shazam', SNAPCHAT = 'snapchat', SONGKICK = 'songkick', SOUNDCLOUD = 'soundcloud', SPOTIFY = 'spotify', TELMORE_MUSIK = 'telmoreMusik', THREADS = 'threads', TICKETMASTER = 'ticketmaster', TIDAL = 'tidal', TIKTOK = 'tiktok', TREBEL = 'trebel', TWITTER = 'x', WIKIPEDIA = 'wikipedia', YANDEX = 'yandex', YOUSEE_MUSIK = 'youseeMusik', YOUTUBE = 'youtube', YOUTUBE_MUSIC = 'youtubeMusic', YOUTUBE_SHORTS = 'youtubeShorts', /** * Deprecated Services * These services are retained in the list to prevent errors * when they are passed as parameters. */ TIKTOK_MUSIC = 'tiktokMusic', RESSO = 'resso', WYNK_MUSIC = 'wynkMusic', } // enum to union - https://stackoverflow.com/a/52396706/516629 type ServiceType$1 = `${ServiceTypes}`; interface LookupUrlApiRequestParams { url: string; country?: string; services?: string; withTracks?: 'true' | 'false'; withAllLinks?: 'true' | 'false'; withPerformance?: 'true' | 'false'; } interface LookupHealthResult { [key: string]: | { status: 'ok'; performance: number; } | { status: 'error'; performance: number; error: string; } | { status: 'unknown'; }; } type ItemGenres = string[]; declare enum ItemTypes { ARTIST = 'artist', ALBUM = 'album', TRACK = 'track', VIDEO = 'video', } interface Geolocation { latitude: number; longitude: number; } interface Link { url: string; countries?: string[]; } interface Image { url: string; width?: number; height?: number; dominantColor?: string; } type BaseSerialized = { id?: string; service: ServiceTypes; name?: string; originalName?: string; // not required as not all services have country specific content/links country?: string; images?: Image[]; links?: Link[]; type: unknown; link?: string; }; interface SerializedTrack extends BaseSerialized { type: ItemTypes.TRACK; artists?: SerializedArtist[]; albums?: SerializedAlbum[]; previewUrl?: string; duration?: number; isExplicit?: boolean; isrc?: string; label?: string; cLine?: string; pLine?: string } type TrackLyrics = { text: string }[]; interface SerializedVideo extends BaseSerialized { type: ItemTypes.VIDEO; channelTitle?: string; releaseDate?: Date; aspect: number | undefined; isEmbeddable?: boolean; description?: string; tracks?: SerializedTrack[]; } interface SerializedAlbum extends BaseSerialized { type: ItemTypes.ALBUM; name: string; artists?: SerializedArtist[]; tracks?: (SerializedTrack | SerializedVideo)[]; children?: SerializedChildAlbum[]; isSingle?: boolean; description?: string; releaseDate?: Date | string; totalTracks?: number; upc?: string; isExplicit?: boolean; } type SerializedChildAlbum = Pick< SerializedAlbum, 'type' | 'service' | 'id' | 'images' | 'links' | 'link' >; interface SerializedArtist extends BaseSerialized { type: ItemTypes.ARTIST; name: string; dateOfBirth?: string; dateOfDeath?: string; hometown?: string; description?: string; genres?: ItemGenres; albums?: SerializedAlbum[]; children?: SerializedChildArtist[]; shows?: ArtistShow[]; } type SerializedChildArtist = Pick< SerializedArtist, 'type' | 'id' | 'images' | 'links' | 'link' > & { service: ServiceTypes; }; interface ArtistShow { name: string; venueName: string; url: string; // YYYY-MM-DD localDate: string; // HH:mm:ss // Optional because some shows don't have a start time, // in the case of festival tickets for example localTime?: string; geolocation?: Geolocation; } type ItemServices< TOptions extends { withAllLinks?: boolean } = { withAllLinks: false } > = { [K in ServiceType$1]?: { id?: string; service?: ServiceTypes; } & (TOptions['withAllLinks'] extends true ? { links: { url: string; countries?: string[]; }[]; } : { link: string; }); }; type ReducedTrack< TOptions extends { withAllLinks?: boolean } = { withAllLinks: false } > = { type: 'track'; name: string; artists?: ReducedArtist[]; image?: Image; images?: Image[]; duration?: number; isrc?: string; isExplicit?: boolean; previewUrl?: string; releaseDate: string | undefined; lyrics?: TrackLyrics; services?: ItemServices; albums?: ReducedAlbum[]; label?: string; copyright?: string; distributor?: string; }; type ReducedAlbum< TOptions extends { withAllLinks?: boolean } = { withAllLinks: false } > = Pick< SerializedAlbum, 'name' | 'releaseDate' | 'upc' | 'isExplicit' | 'description' | 'totalTracks' > & { type: 'album'; artists?: ReducedArtist[]; image?: Image; images?: Image[]; previewUrl?: string; releaseDate?: string; services?: ItemServices; tracks?: ReducedTrack[]; label?: string; copyright?: string; }; type ReduceArtistOptions = { withAllLinks?: boolean }; type ReducedArtist< TOptions extends ReduceArtistOptions = { withAllLinks: false } > = Pick & { type: 'artist'; image?: Image; previewUrl?: string; releaseDate?: string; services?: ItemServices; dateOfBirth?: string; dateOfDeath?: string; hometown?: string; albums?: ReducedAlbum[]; shows?: ArtistShow[]; videos?: { service: ServiceType$1; id: string; link: string; image?: Image; }[]; }; /* eslint-disable @typescript-eslint/ban-types */ // force TS to use new naming type MusicfetchArtist = ReducedArtist & { _?: never }; type MusicfetchAlbum = ReducedAlbum & { _?: never }; type MusicfetchTrack = ReducedTrack & { _?: never }; type MusicfetchItem = | MusicfetchArtist | MusicfetchAlbum | MusicfetchTrack; type MusicfetchLookupResult< TResult = MusicfetchTrack | MusicfetchAlbum | MusicfetchArtist > = { result: TResult; performance?: Record; }; type MusicfetchLookupStreamResult< TResult = MusicfetchTrack | MusicfetchAlbum | MusicfetchArtist > = { result: TResult; statuses: Record< ServiceType, { status: 'done' | 'error' | 'pending' | 'no-result'; duration?: number; message?: string; } >; }; type MusicfetchLookupArtistResult = MusicfetchLookupResult; type MusicfetchLookupAlbumUResult = MusicfetchLookupResult; type MusicfetchLookupTrackResult = MusicfetchLookupResult; declare type Primitive = string | number | symbol | bigint | boolean | null | undefined; declare namespace util { type AssertEqual = (() => V extends T ? 1 : 2) extends () => V extends U ? 1 : 2 ? true : false; export type isAny = 0 extends 1 & T ? true : false; export const assertEqual: (val: AssertEqual) => AssertEqual; export function assertIs(_arg: T): void; export function assertNever(_x: never): never; export type Omit = Pick>; export type OmitKeys = Pick>; export type MakePartial = Omit & Partial>; export type Exactly = T & Record, never>; export const arrayToEnum: (items: U) => { [k in U[number]]: k; }; export const getValidEnumValues: (obj: any) => any[]; export const objectValues: (obj: any) => any[]; export const objectKeys: ObjectConstructor["keys"]; export const find: (arr: T[], checker: (arg: T) => any) => T | undefined; export type identity = objectUtil.identity; export type flatten = objectUtil.flatten; export type noUndefined = T extends undefined ? never : T; export const isInteger: NumberConstructor["isInteger"]; export function joinValues(array: T, separator?: string): string; export const jsonStringifyReplacer: (_: string, value: any) => any; export { }; } declare namespace objectUtil { export type MergeShapes = { [k in Exclude]: U[k]; } & V; type optionalKeys = { [k in keyof T]: undefined extends T[k] ? k : never; }[keyof T]; type requiredKeys = { [k in keyof T]: undefined extends T[k] ? never : k; }[keyof T]; export type addQuestionMarks = { [K in requiredKeys]: T[K]; } & { [K in optionalKeys]?: T[K]; } & { [k in keyof T]?: unknown; }; export type identity = T; export type flatten = identity<{ [k in keyof T]: T[k]; }>; export type noNeverKeys = { [k in keyof T]: [T[k]] extends [never] ? never : k; }[keyof T]; export type noNever = identity<{ [k in noNeverKeys]: k extends keyof T ? T[k] : never; }>; export const mergeShapes: (first: U, second: T) => T & U; export type extendShape = { [K in keyof A as K extends keyof B ? never : K]: A[K]; } & { [K in keyof B]: B[K]; }; export { }; } declare const ZodParsedType: { function: "function"; number: "number"; string: "string"; nan: "nan"; integer: "integer"; float: "float"; boolean: "boolean"; date: "date"; bigint: "bigint"; symbol: "symbol"; undefined: "undefined"; null: "null"; array: "array"; object: "object"; unknown: "unknown"; promise: "promise"; void: "void"; never: "never"; map: "map"; set: "set"; }; declare type ZodParsedType = keyof typeof ZodParsedType; declare type allKeys = T extends any ? keyof T : never; declare type typeToFlattenedError = { formErrors: U[]; fieldErrors: { [P in allKeys]?: U[]; }; }; declare const ZodIssueCode: { invalid_type: "invalid_type"; invalid_literal: "invalid_literal"; custom: "custom"; invalid_union: "invalid_union"; invalid_union_discriminator: "invalid_union_discriminator"; invalid_enum_value: "invalid_enum_value"; unrecognized_keys: "unrecognized_keys"; invalid_arguments: "invalid_arguments"; invalid_return_type: "invalid_return_type"; invalid_date: "invalid_date"; invalid_string: "invalid_string"; too_small: "too_small"; too_big: "too_big"; invalid_intersection_types: "invalid_intersection_types"; not_multiple_of: "not_multiple_of"; not_finite: "not_finite"; }; declare type ZodIssueCode = keyof typeof ZodIssueCode; declare type ZodIssueBase = { path: (string | number)[]; message?: string; }; interface ZodInvalidTypeIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_type; expected: ZodParsedType; received: ZodParsedType; } interface ZodInvalidLiteralIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_literal; expected: unknown; received: unknown; } interface ZodUnrecognizedKeysIssue extends ZodIssueBase { code: typeof ZodIssueCode.unrecognized_keys; keys: string[]; } interface ZodInvalidUnionIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_union; unionErrors: ZodError[]; } interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_union_discriminator; options: Primitive[]; } interface ZodInvalidEnumValueIssue extends ZodIssueBase { received: string | number; code: typeof ZodIssueCode.invalid_enum_value; options: (string | number)[]; } interface ZodInvalidArgumentsIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_arguments; argumentsError: ZodError; } interface ZodInvalidReturnTypeIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_return_type; returnTypeError: ZodError; } interface ZodInvalidDateIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_date; } declare type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "base64" | { includes: string; position?: number; } | { startsWith: string; } | { endsWith: string; }; interface ZodInvalidStringIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_string; validation: StringValidation; } interface ZodTooSmallIssue extends ZodIssueBase { code: typeof ZodIssueCode.too_small; minimum: number | bigint; inclusive: boolean; exact?: boolean; type: "array" | "string" | "number" | "set" | "date" | "bigint"; } interface ZodTooBigIssue extends ZodIssueBase { code: typeof ZodIssueCode.too_big; maximum: number | bigint; inclusive: boolean; exact?: boolean; type: "array" | "string" | "number" | "set" | "date" | "bigint"; } interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_intersection_types; } interface ZodNotMultipleOfIssue extends ZodIssueBase { code: typeof ZodIssueCode.not_multiple_of; multipleOf: number | bigint; } interface ZodNotFiniteIssue extends ZodIssueBase { code: typeof ZodIssueCode.not_finite; } interface ZodCustomIssue extends ZodIssueBase { code: typeof ZodIssueCode.custom; params?: { [k: string]: any; }; } declare type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue; declare type ZodIssue = ZodIssueOptionalMessage & { fatal?: boolean; message: string; }; declare type recursiveZodFormattedError = T extends [any, ...any[]] ? { [K in keyof T]?: ZodFormattedError; } : T extends any[] ? { [k: number]: ZodFormattedError; } : T extends object ? { [K in keyof T]?: ZodFormattedError; } : unknown; declare type ZodFormattedError = { _errors: U[]; } & recursiveZodFormattedError>; declare class ZodError extends Error { issues: ZodIssue[]; get errors(): ZodIssue[]; constructor(issues: ZodIssue[]); format(): ZodFormattedError; format(mapper: (issue: ZodIssue) => U): ZodFormattedError; static create: (issues: ZodIssue[]) => ZodError; static assert(value: unknown): asserts value is ZodError; toString(): string; get message(): string; get isEmpty(): boolean; addIssue: (sub: ZodIssue) => void; addIssues: (subs?: ZodIssue[]) => void; flatten(): typeToFlattenedError; flatten(mapper?: (issue: ZodIssue) => U): typeToFlattenedError; get formErrors(): typeToFlattenedError; } declare type stripPath = T extends any ? util.OmitKeys : never; declare type IssueData = stripPath & { path?: (string | number)[]; fatal?: boolean; }; declare type ErrorMapCtx = { defaultError: string; data: any; }; declare type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => { message: string; }; declare type ParseParams = { path: (string | number)[]; errorMap: ZodErrorMap; async: boolean; }; declare type ParsePathComponent = string | number; declare type ParsePath = ParsePathComponent[]; interface ParseContext { readonly common: { readonly issues: ZodIssue[]; readonly contextualErrorMap?: ZodErrorMap; readonly async: boolean; }; readonly path: ParsePath; readonly schemaErrorMap?: ZodErrorMap; readonly parent: ParseContext | null; readonly data: any; readonly parsedType: ZodParsedType; } declare type ParseInput = { data: any; path: (string | number)[]; parent: ParseContext; }; declare class ParseStatus { value: "aborted" | "dirty" | "valid"; dirty(): void; abort(): void; static mergeArray(status: ParseStatus, results: SyncParseReturnType[]): SyncParseReturnType; static mergeObjectAsync(status: ParseStatus, pairs: { key: ParseReturnType; value: ParseReturnType; }[]): Promise>; static mergeObjectSync(status: ParseStatus, pairs: { key: SyncParseReturnType; value: SyncParseReturnType; alwaysSet?: boolean; }[]): SyncParseReturnType; } declare type INVALID = { status: "aborted"; }; declare const INVALID: INVALID; declare type DIRTY = { status: "dirty"; value: T; }; declare const DIRTY: (value: T) => DIRTY; declare type OK = { status: "valid"; value: T; }; declare const OK: (value: T) => OK; declare type SyncParseReturnType = OK | DIRTY | INVALID; declare type AsyncParseReturnType = Promise>; declare type ParseReturnType = SyncParseReturnType | AsyncParseReturnType; declare namespace errorUtil { type ErrMessage = string | { message?: string; }; const errToObj: (message?: ErrMessage | undefined) => { message?: string | undefined; }; const toString: (message?: ErrMessage | undefined) => string | undefined; } interface RefinementCtx { addIssue: (arg: IssueData) => void; path: (string | number)[]; } declare type ZodTypeAny = ZodType; declare type TypeOf> = T["_output"]; declare type input> = T["_input"]; declare type output> = T["_output"]; declare type CustomErrorParams = Partial>; interface ZodTypeDef { errorMap?: ZodErrorMap; description?: string; } declare type RawCreateParams = { errorMap?: ZodErrorMap; invalid_type_error?: string; required_error?: string; message?: string; description?: string; } | undefined; declare type SafeParseSuccess = { success: true; data: Output; error?: never; }; declare type SafeParseError = { success: false; error: ZodError; data?: never; }; declare type SafeParseReturnType = SafeParseSuccess | SafeParseError; declare abstract class ZodType { readonly _type: Output; readonly _output: Output; readonly _input: Input; readonly _def: Def; get description(): string | undefined; abstract _parse(input: ParseInput): ParseReturnType; _getType(input: ParseInput): string; _getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext; _processInputParams(input: ParseInput): { status: ParseStatus; ctx: ParseContext; }; _parseSync(input: ParseInput): SyncParseReturnType; _parseAsync(input: ParseInput): AsyncParseReturnType; parse(data: unknown, params?: Partial): Output; safeParse(data: unknown, params?: Partial): SafeParseReturnType; parseAsync(data: unknown, params?: Partial): Promise; safeParseAsync(data: unknown, params?: Partial): Promise>; /** Alias of safeParseAsync */ spa: (data: unknown, params?: Partial | undefined) => Promise>; refine(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects; refine(check: (arg: Output) => unknown | Promise, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects; refinement(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects; refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects; _refinement(refinement: RefinementEffect["refinement"]): ZodEffects; superRefine(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects; superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects; superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise): ZodEffects; constructor(def: Def); optional(): ZodOptional; nullable(): ZodNullable; nullish(): ZodOptional>; array(): ZodArray; promise(): ZodPromise; or(option: T): ZodUnion<[this, T]>; and(incoming: T): ZodIntersection; transform(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise): ZodEffects; default(def: util.noUndefined): ZodDefault; default(def: () => util.noUndefined): ZodDefault; brand(brand?: B): ZodBranded; catch(def: Output): ZodCatch; catch(def: (ctx: { error: ZodError; input: Input; }) => Output): ZodCatch; describe(description: string): this; pipe(target: T): ZodPipeline; readonly(): ZodReadonly; isOptional(): boolean; isNullable(): boolean; } interface ZodArrayDef extends ZodTypeDef { type: T; typeName: ZodFirstPartyTypeKind.ZodArray; exactLength: { value: number; message?: string; } | null; minLength: { value: number; message?: string; } | null; maxLength: { value: number; message?: string; } | null; } declare type ArrayCardinality = "many" | "atleastone"; declare type arrayOutputType = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][]; declare class ZodArray extends ZodType, ZodArrayDef, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> { _parse(input: ParseInput): ParseReturnType; get element(): T; min(minLength: number, message?: errorUtil.ErrMessage): this; max(maxLength: number, message?: errorUtil.ErrMessage): this; length(len: number, message?: errorUtil.ErrMessage): this; nonempty(message?: errorUtil.ErrMessage): ZodArray; static create: (schema: T_1, params?: RawCreateParams) => ZodArray; } declare type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>; interface ZodUnionDef> extends ZodTypeDef { options: T; typeName: ZodFirstPartyTypeKind.ZodUnion; } declare class ZodUnion extends ZodType, T[number]["_input"]> { _parse(input: ParseInput): ParseReturnType; get options(): T; static create: (types: T_1, params?: RawCreateParams) => ZodUnion; } interface ZodIntersectionDef extends ZodTypeDef { left: T; right: U; typeName: ZodFirstPartyTypeKind.ZodIntersection; } declare class ZodIntersection extends ZodType, T["_input"] & U["_input"]> { _parse(input: ParseInput): ParseReturnType; static create: (left: T_1, right: U_1, params?: RawCreateParams) => ZodIntersection; } interface ZodPromiseDef extends ZodTypeDef { type: T; typeName: ZodFirstPartyTypeKind.ZodPromise; } declare class ZodPromise extends ZodType, ZodPromiseDef, Promise> { unwrap(): T; _parse(input: ParseInput): ParseReturnType; static create: (schema: T_1, params?: RawCreateParams) => ZodPromise; } declare type RefinementEffect = { type: "refinement"; refinement: (arg: T, ctx: RefinementCtx) => any; }; declare type TransformEffect = { type: "transform"; transform: (arg: T, ctx: RefinementCtx) => any; }; declare type PreprocessEffect = { type: "preprocess"; transform: (arg: T, ctx: RefinementCtx) => any; }; declare type Effect = RefinementEffect | TransformEffect | PreprocessEffect; interface ZodEffectsDef extends ZodTypeDef { schema: T; typeName: ZodFirstPartyTypeKind.ZodEffects; effect: Effect; } declare class ZodEffects, Input = input> extends ZodType, Input> { innerType(): T; sourceType(): T; _parse(input: ParseInput): ParseReturnType; static create: (schema: I, effect: Effect, params?: RawCreateParams) => ZodEffects>; static createWithPreprocess: (preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects; } interface ZodOptionalDef extends ZodTypeDef { innerType: T; typeName: ZodFirstPartyTypeKind.ZodOptional; } declare class ZodOptional extends ZodType, T["_input"] | undefined> { _parse(input: ParseInput): ParseReturnType; unwrap(): T; static create: (type: T_1, params?: RawCreateParams) => ZodOptional; } interface ZodNullableDef extends ZodTypeDef { innerType: T; typeName: ZodFirstPartyTypeKind.ZodNullable; } declare class ZodNullable extends ZodType, T["_input"] | null> { _parse(input: ParseInput): ParseReturnType; unwrap(): T; static create: (type: T_1, params?: RawCreateParams) => ZodNullable; } interface ZodDefaultDef extends ZodTypeDef { innerType: T; defaultValue: () => util.noUndefined; typeName: ZodFirstPartyTypeKind.ZodDefault; } declare class ZodDefault extends ZodType, ZodDefaultDef, T["_input"] | undefined> { _parse(input: ParseInput): ParseReturnType; removeDefault(): T; static create: (type: T_1, params: { errorMap?: ZodErrorMap | undefined; invalid_type_error?: string | undefined; required_error?: string | undefined; message?: string | undefined; description?: string | undefined; } & { default: T_1["_input"] | (() => util.noUndefined); }) => ZodDefault; } interface ZodCatchDef extends ZodTypeDef { innerType: T; catchValue: (ctx: { error: ZodError; input: unknown; }) => T["_input"]; typeName: ZodFirstPartyTypeKind.ZodCatch; } declare class ZodCatch extends ZodType, unknown> { _parse(input: ParseInput): ParseReturnType; removeCatch(): T; static create: (type: T_1, params: { errorMap?: ZodErrorMap | undefined; invalid_type_error?: string | undefined; required_error?: string | undefined; message?: string | undefined; description?: string | undefined; } & { catch: T_1["_output"] | (() => T_1["_output"]); }) => ZodCatch; } interface ZodBrandedDef extends ZodTypeDef { type: T; typeName: ZodFirstPartyTypeKind.ZodBranded; } declare const BRAND: unique symbol; declare type BRAND = { [BRAND]: { [k in T]: true; }; }; declare class ZodBranded extends ZodType, ZodBrandedDef, T["_input"]> { _parse(input: ParseInput): ParseReturnType; unwrap(): T; } interface ZodPipelineDef extends ZodTypeDef { in: A; out: B; typeName: ZodFirstPartyTypeKind.ZodPipeline; } declare class ZodPipeline extends ZodType, A["_input"]> { _parse(input: ParseInput): ParseReturnType; static create(a: A, b: B): ZodPipeline; } declare type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | { readonly [Symbol.toStringTag]: string; } | Date | Error | Generator | Promise | RegExp; declare type MakeReadonly = T extends Map ? ReadonlyMap : T extends Set ? ReadonlySet : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array ? ReadonlyArray : T extends BuiltIn ? T : Readonly; interface ZodReadonlyDef extends ZodTypeDef { innerType: T; typeName: ZodFirstPartyTypeKind.ZodReadonly; } declare class ZodReadonly extends ZodType, ZodReadonlyDef, MakeReadonly> { _parse(input: ParseInput): ParseReturnType; static create: (type: T_1, params?: RawCreateParams) => ZodReadonly; unwrap(): T; } declare enum ZodFirstPartyTypeKind { ZodString = "ZodString", ZodNumber = "ZodNumber", ZodNaN = "ZodNaN", ZodBigInt = "ZodBigInt", ZodBoolean = "ZodBoolean", ZodDate = "ZodDate", ZodSymbol = "ZodSymbol", ZodUndefined = "ZodUndefined", ZodNull = "ZodNull", ZodAny = "ZodAny", ZodUnknown = "ZodUnknown", ZodNever = "ZodNever", ZodVoid = "ZodVoid", ZodArray = "ZodArray", ZodObject = "ZodObject", ZodUnion = "ZodUnion", ZodDiscriminatedUnion = "ZodDiscriminatedUnion", ZodIntersection = "ZodIntersection", ZodTuple = "ZodTuple", ZodRecord = "ZodRecord", ZodMap = "ZodMap", ZodSet = "ZodSet", ZodFunction = "ZodFunction", ZodLazy = "ZodLazy", ZodLiteral = "ZodLiteral", ZodEnum = "ZodEnum", ZodEffects = "ZodEffects", ZodNativeEnum = "ZodNativeEnum", ZodOptional = "ZodOptional", ZodNullable = "ZodNullable", ZodDefault = "ZodDefault", ZodCatch = "ZodCatch", ZodPromise = "ZodPromise", ZodBranded = "ZodBranded", ZodPipeline = "ZodPipeline", ZodReadonly = "ZodReadonly" } type Optional = Omit & Partial; interface CachedItemRecord { id: string; keys: string[]; /** * ISO date string */ createdAt: string; /** * ISO date string */ refreshedAt: string; /** * ISO date string */ updatedAt: string; fetchedServices: { [country: string]: ServiceType$1[]; }; source: { url: string; country: string; // isrc?: string; // upc?: string; }; data: | MusicfetchArtist<{ withAllLinks: true }> | MusicfetchAlbum<{ withAllLinks: true }> | MusicfetchTrack<{ withAllLinks: true }>; } type SerializedCachedItem = Optional< CachedItemRecord, 'keys' | 'createdAt' | 'updatedAt' | 'refreshedAt' >; type MusicfetchOpenArtist = Omit< MusicfetchArtist, 'artists' | 'services' | 'albums' > & { id: string; services: Record< ServiceType$1, { link: string; } >; }; type MusicfetchOpenTrack = Omit< MusicfetchTrack, 'artists' | 'services' > & { id: string; services: Record< ServiceType$1, { link: string; } >; artists?: Omit[0], 'services'>[]; albums?: Omit[0], 'services'>[]; }; type MusicfetchOpenAlbum = Omit< MusicfetchAlbum, 'artists' | 'tracks' > & { id: string; services: Record< ServiceType$1, { link: string; } >; artists?: Omit[0], 'services'>[]; tracks?: Omit[0], 'services'>[]; }; type MusicfetchOpenItem = | MusicfetchOpenArtist | MusicfetchOpenTrack | MusicfetchOpenAlbum; declare const putOpenUrlParamsSchema = z.object({ url: z.string().url(), country: z.string().optional(), services: z.string().transform((val) => { const values = val.split(',').filter(isTruthy); return lookupUrlParamsSchema.shape.services.parse(values); }), }); type PutOpenUrlParams = TypeOf; type GetOpenUrlResult = { result: MusicfetchOpenItem; }; type GetCacheUrlResult = { result: TOptions['asRaw'] extends true ? SerializedCachedItem : MusicfetchItem; }; export { type GetCacheUrlResult, type GetOpenUrlResult, type LookupHealthResult, type LookupUrlApiRequestParams, type MusicfetchAlbum, type MusicfetchArtist, type MusicfetchItem, type MusicfetchLookupAlbumUResult, type MusicfetchLookupArtistResult, type MusicfetchLookupResult, type MusicfetchLookupStreamResult, type MusicfetchLookupTrackResult, type MusicfetchOpenItem, type MusicfetchTrack, type PutOpenUrlParams, type ServiceType$1 as ServiceType, ServiceTypes, putOpenUrlParamsSchema };