UNPKG

shadcn-svelte

Version:
455 lines (454 loc) 18.6 kB
import { z } from "zod"; //#region src/utils/registry/schema.d.ts type RegistryItemType = z.infer<typeof registryItemTypeSchema>; declare const registryItemTypeSchema: z.ZodEnum<{ "registry:lib": "registry:lib"; "registry:block": "registry:block"; "registry:component": "registry:component"; "registry:ui": "registry:ui"; "registry:hook": "registry:hook"; "registry:page": "registry:page"; "registry:file": "registry:file"; "registry:theme": "registry:theme"; "registry:style": "registry:style"; "registry:item": "registry:item"; "registry:base": "registry:base"; "registry:font": "registry:font"; "registry:example": "registry:example"; "registry:internal": "registry:internal"; }>; type RegistryItemFileType = z.infer<typeof registryItemFileTypeSchema>; declare const registryItemFileTypeSchema: z.ZodEnum<{ "registry:lib": "registry:lib"; "registry:block": "registry:block"; "registry:component": "registry:component"; "registry:ui": "registry:ui"; "registry:hook": "registry:hook"; "registry:page": "registry:page"; "registry:file": "registry:file"; "registry:theme": "registry:theme"; "registry:style": "registry:style"; "registry:item": "registry:item"; "registry:base": "registry:base"; "registry:font": "registry:font"; }>; type RegistryItemFile = z.infer<typeof registryItemFileSchema>; declare const registryItemFileSchema: z.ZodObject<{ content: z.ZodString; type: z.ZodEnum<{ "registry:lib": "registry:lib"; "registry:block": "registry:block"; "registry:component": "registry:component"; "registry:ui": "registry:ui"; "registry:hook": "registry:hook"; "registry:page": "registry:page"; "registry:file": "registry:file"; "registry:theme": "registry:theme"; "registry:style": "registry:style"; "registry:item": "registry:item"; "registry:base": "registry:base"; "registry:font": "registry:font"; }>; target: z.ZodString; }, z.core.$strip>; type RegistryIndexItem = z.infer<typeof registryIndexItemSchema>; /** Schema for registry items defined in the index */ declare const registryIndexItemSchema: z.ZodObject<{ name: z.ZodString; title: z.ZodOptional<z.ZodString>; type: z.ZodEnum<{ "registry:lib": "registry:lib"; "registry:block": "registry:block"; "registry:component": "registry:component"; "registry:ui": "registry:ui"; "registry:hook": "registry:hook"; "registry:page": "registry:page"; "registry:file": "registry:file"; "registry:theme": "registry:theme"; "registry:style": "registry:style"; "registry:item": "registry:item"; "registry:base": "registry:base"; "registry:font": "registry:font"; "registry:example": "registry:example"; "registry:internal": "registry:internal"; }>; author: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; devDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; relativeUrl: z.ZodString; }, z.core.$strip>; type RegistryIndex = z.infer<typeof registryIndexSchema>; /** Schema for the registry's index (e.g. `https://example.com/registry/index.json`) */ declare const registryIndexSchema: z.ZodArray<z.ZodObject<{ name: z.ZodString; title: z.ZodOptional<z.ZodString>; type: z.ZodEnum<{ "registry:lib": "registry:lib"; "registry:block": "registry:block"; "registry:component": "registry:component"; "registry:ui": "registry:ui"; "registry:hook": "registry:hook"; "registry:page": "registry:page"; "registry:file": "registry:file"; "registry:theme": "registry:theme"; "registry:style": "registry:style"; "registry:item": "registry:item"; "registry:base": "registry:base"; "registry:font": "registry:font"; "registry:example": "registry:example"; "registry:internal": "registry:internal"; }>; author: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; devDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; relativeUrl: z.ZodString; }, z.core.$strip>>; /** Schema for base color endpoints (e.g. `https://example.com/registry/colors/slate.json`) */ declare const registryBaseColorSchema: z.ZodObject<{ cssVars: z.ZodObject<{ light: z.ZodRecord<z.ZodString, z.ZodString>; dark: z.ZodRecord<z.ZodString, z.ZodString>; }, z.core.$strip>; }, z.core.$strip>; type CssVars = z.infer<typeof registryItemCssVarsSchema>; declare const registryItemCssVarsSchema: z.ZodObject<{ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; light: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; dark: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; }, z.core.$strip>; type CssSchema = { [x: string]: string | CssSchema; }; declare const registryItemCommonSchema: z.ZodObject<{ docs: z.ZodOptional<z.ZodString>; categories: z.ZodOptional<z.ZodArray<z.ZodString>>; css: z.ZodOptional<z.ZodType<CssSchema, CssSchema, z.core.$ZodTypeInternals<CssSchema, CssSchema>>>; cssVars: z.ZodOptional<z.ZodObject<{ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; light: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; dark: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; }, z.core.$strip>>; files: z.ZodOptional<z.ZodArray<z.ZodObject<{ content: z.ZodString; type: z.ZodEnum<{ "registry:lib": "registry:lib"; "registry:block": "registry:block"; "registry:component": "registry:component"; "registry:ui": "registry:ui"; "registry:hook": "registry:hook"; "registry:page": "registry:page"; "registry:file": "registry:file"; "registry:theme": "registry:theme"; "registry:style": "registry:style"; "registry:item": "registry:item"; "registry:base": "registry:base"; "registry:font": "registry:font"; }>; target: z.ZodString; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional<z.ZodString>; type: z.ZodEnum<{ "registry:lib": "registry:lib"; "registry:block": "registry:block"; "registry:component": "registry:component"; "registry:ui": "registry:ui"; "registry:hook": "registry:hook"; "registry:page": "registry:page"; "registry:file": "registry:file"; "registry:theme": "registry:theme"; "registry:style": "registry:style"; "registry:item": "registry:item"; "registry:base": "registry:base"; "registry:font": "registry:font"; "registry:example": "registry:example"; "registry:internal": "registry:internal"; }>; author: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; devDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; $schema: z.ZodOptional<z.ZodString>; }, z.core.$strip>; declare const registryItemFontSchema: z.ZodObject<{ family: z.ZodString; provider: z.ZodLiteral<"google">; import: z.ZodString; variable: z.ZodString; weight: z.ZodOptional<z.ZodArray<z.ZodString>>; subsets: z.ZodOptional<z.ZodArray<z.ZodString>>; selector: z.ZodOptional<z.ZodString>; dependency: z.ZodOptional<z.ZodString>; }, z.core.$strip>; type RegistryFont = z.infer<typeof registryItemFontSchema>; type RegistryItem = z.infer<typeof registryItemSchema>; /** Schema for registry item endpoints (e.g. `https://example.com/registry/item.json`) */ declare const registryItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ docs: z.ZodOptional<z.ZodString>; categories: z.ZodOptional<z.ZodArray<z.ZodString>>; css: z.ZodOptional<z.ZodType<CssSchema, CssSchema, z.core.$ZodTypeInternals<CssSchema, CssSchema>>>; cssVars: z.ZodOptional<z.ZodObject<{ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; light: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; dark: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; }, z.core.$strip>>; files: z.ZodOptional<z.ZodArray<z.ZodObject<{ content: z.ZodString; type: z.ZodEnum<{ "registry:lib": "registry:lib"; "registry:block": "registry:block"; "registry:component": "registry:component"; "registry:ui": "registry:ui"; "registry:hook": "registry:hook"; "registry:page": "registry:page"; "registry:file": "registry:file"; "registry:theme": "registry:theme"; "registry:style": "registry:style"; "registry:item": "registry:item"; "registry:base": "registry:base"; "registry:font": "registry:font"; }>; target: z.ZodString; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional<z.ZodString>; author: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; devDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; $schema: z.ZodOptional<z.ZodString>; type: z.ZodLiteral<"registry:base">; config: z.ZodOptional<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ docs: z.ZodOptional<z.ZodString>; categories: z.ZodOptional<z.ZodArray<z.ZodString>>; css: z.ZodOptional<z.ZodType<CssSchema, CssSchema, z.core.$ZodTypeInternals<CssSchema, CssSchema>>>; cssVars: z.ZodOptional<z.ZodObject<{ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; light: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; dark: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; }, z.core.$strip>>; files: z.ZodOptional<z.ZodArray<z.ZodObject<{ content: z.ZodString; type: z.ZodEnum<{ "registry:lib": "registry:lib"; "registry:block": "registry:block"; "registry:component": "registry:component"; "registry:ui": "registry:ui"; "registry:hook": "registry:hook"; "registry:page": "registry:page"; "registry:file": "registry:file"; "registry:theme": "registry:theme"; "registry:style": "registry:style"; "registry:item": "registry:item"; "registry:base": "registry:base"; "registry:font": "registry:font"; }>; target: z.ZodString; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional<z.ZodString>; author: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; devDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; $schema: z.ZodOptional<z.ZodString>; type: z.ZodLiteral<"registry:font">; font: z.ZodObject<{ family: z.ZodString; provider: z.ZodLiteral<"google">; import: z.ZodString; variable: z.ZodString; weight: z.ZodOptional<z.ZodArray<z.ZodString>>; subsets: z.ZodOptional<z.ZodArray<z.ZodString>>; selector: z.ZodOptional<z.ZodString>; dependency: z.ZodOptional<z.ZodString>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ docs: z.ZodOptional<z.ZodString>; categories: z.ZodOptional<z.ZodArray<z.ZodString>>; css: z.ZodOptional<z.ZodType<CssSchema, CssSchema, z.core.$ZodTypeInternals<CssSchema, CssSchema>>>; cssVars: z.ZodOptional<z.ZodObject<{ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; light: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; dark: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; }, z.core.$strip>>; files: z.ZodOptional<z.ZodArray<z.ZodObject<{ content: z.ZodString; type: z.ZodEnum<{ "registry:lib": "registry:lib"; "registry:block": "registry:block"; "registry:component": "registry:component"; "registry:ui": "registry:ui"; "registry:hook": "registry:hook"; "registry:page": "registry:page"; "registry:file": "registry:file"; "registry:theme": "registry:theme"; "registry:style": "registry:style"; "registry:item": "registry:item"; "registry:base": "registry:base"; "registry:font": "registry:font"; }>; target: z.ZodString; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional<z.ZodString>; author: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; devDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; $schema: z.ZodOptional<z.ZodString>; type: z.ZodEnum<{ "registry:lib": "registry:lib"; "registry:block": "registry:block"; "registry:component": "registry:component"; "registry:ui": "registry:ui"; "registry:hook": "registry:hook"; "registry:page": "registry:page"; "registry:file": "registry:file"; "registry:theme": "registry:theme"; "registry:style": "registry:style"; "registry:item": "registry:item"; "registry:example": "registry:example"; "registry:internal": "registry:internal"; }>; }, z.core.$strip>], "type">; type Registry = z.infer<typeof registrySchema>; /** Schema for `registry.json` */ declare const registrySchema: z.ZodObject<{ $schema: z.ZodOptional<z.ZodString>; name: z.ZodString; homepage: z.ZodString; overrideDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; aliases: z.ZodOptional<z.ZodObject<{ lib: z.ZodOptional<z.ZodString>; ui: z.ZodOptional<z.ZodString>; components: z.ZodOptional<z.ZodString>; utils: z.ZodOptional<z.ZodString>; hooks: z.ZodOptional<z.ZodString>; }, z.core.$strip>>; items: z.ZodArray<z.ZodObject<{ name: z.ZodString; title: z.ZodOptional<z.ZodString>; type: z.ZodEnum<{ "registry:lib": "registry:lib"; "registry:block": "registry:block"; "registry:component": "registry:component"; "registry:ui": "registry:ui"; "registry:hook": "registry:hook"; "registry:page": "registry:page"; "registry:file": "registry:file"; "registry:theme": "registry:theme"; "registry:style": "registry:style"; "registry:item": "registry:item"; "registry:base": "registry:base"; "registry:font": "registry:font"; "registry:example": "registry:example"; "registry:internal": "registry:internal"; }>; author: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; devDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>; meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; files: z.ZodArray<z.ZodObject<{ content: z.ZodOptional<z.ZodString>; target: z.ZodOptional<z.ZodString>; path: z.ZodString; type: z.ZodEnum<{ "registry:lib": "registry:lib"; "registry:block": "registry:block"; "registry:component": "registry:component"; "registry:ui": "registry:ui"; "registry:hook": "registry:hook"; "registry:page": "registry:page"; "registry:file": "registry:file"; "registry:theme": "registry:theme"; "registry:style": "registry:style"; "registry:item": "registry:item"; "registry:base": "registry:base"; "registry:font": "registry:font"; }>; }, z.core.$strip>>; registryDependencies: z.ZodArray<z.ZodString>; cssVars: z.ZodOptional<z.ZodObject<{ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; light: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; dark: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; }, z.core.$strip>>; css: z.ZodOptional<z.ZodType<CssSchema, CssSchema, z.core.$ZodTypeInternals<CssSchema, CssSchema>>>; font: z.ZodOptional<z.ZodObject<{ family: z.ZodString; provider: z.ZodLiteral<"google">; import: z.ZodString; variable: z.ZodString; weight: z.ZodOptional<z.ZodArray<z.ZodString>>; subsets: z.ZodOptional<z.ZodArray<z.ZodString>>; selector: z.ZodOptional<z.ZodString>; dependency: z.ZodOptional<z.ZodString>; }, z.core.$strip>>; }, z.core.$strip>>; }, z.core.$strip>; /** Schema for a project's `components.json` config file. */ declare const componentsJsonSchema: z.ZodObject<{ $schema: z.ZodOptional<z.ZodString>; style: z.ZodOptional<z.ZodString>; tailwind: z.ZodObject<{ css: z.ZodString; baseColor: z.ZodString; config: z.ZodOptional<z.ZodString>; }, z.core.$strip>; aliases: z.ZodObject<{ components: z.ZodString; utils: z.ZodString; ui: z.ZodOptional<z.ZodString>; hooks: z.ZodOptional<z.ZodString>; lib: z.ZodOptional<z.ZodString>; }, z.core.$strip>; registry: z.ZodOptional<z.ZodString>; typescript: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{ config: z.ZodString; }, z.core.$strip>]>>; iconLibrary: z.ZodOptional<z.ZodEnum<{ lucide: "lucide"; tabler: "tabler"; hugeicons: "hugeicons"; phosphor: "phosphor"; remixicon: "remixicon"; }>>; menuColor: z.ZodOptional<z.ZodEnum<{ default: "default"; inverted: "inverted"; "default-translucent": "default-translucent"; "inverted-translucent": "inverted-translucent"; }>>; menuAccent: z.ZodOptional<z.ZodEnum<{ bold: "bold"; subtle: "subtle"; }>>; }, z.core.$strip>; /** * A highly naive implementation of deep partialification. Unfortunately the latest version of zod doesn't support this at this time. If there ever comes a time where it does let's replace this method ASAP. * * @see https://github.com/colinhacks/zod/issues/2854 * * @param schema * @returns */ declare function naiveDeepPartialify(schema: z.ZodObject): z.ZodObject; //#endregion export { registryItemFileSchema as _, RegistryIndex as a, registrySchema as b, RegistryItemFile as c, componentsJsonSchema as d, naiveDeepPartialify as f, registryItemCommonSchema as g, registryIndexSchema as h, RegistryFont as i, RegistryItemFileType as l, registryIndexItemSchema as m, CssVars as n, RegistryIndexItem as o, registryBaseColorSchema as p, Registry as r, RegistryItem as s, CssSchema as t, RegistryItemType as u, registryItemFontSchema as v, registryItemSchema as y };