Saltearse al contenido

types

Esta página aún no está disponible en tu idioma.

type MarkdownSchemaOptions = z.infer<typeof MarkdownSchema>;

Defined in: studiocms/packages/@studiocms/md/src/types.ts:83^


type StudioCMSMarkdownOptions = z.infer<typeof StudioCMSMarkdownSchema>;

Defined in: studiocms/packages/@studiocms/md/src/types.ts:82^

const AstroMarkdownSchema: ZodObject<{
flavor: ZodLiteral<"astro">;
sanitize: ZodOptional<ZodObject<{
allowAttributes: ZodOptional<ZodRecord<ZodString, ZodArray<ZodString, "many">>>;
allowComments: ZodOptional<ZodBoolean>;
allowComponents: ZodOptional<ZodBoolean>;
allowCustomElements: ZodOptional<ZodBoolean>;
allowElements: ZodOptional<ZodArray<ZodString, "many">>;
blockElements: ZodOptional<ZodArray<ZodString, "many">>;
dropAttributes: ZodOptional<ZodRecord<ZodString, ZodArray<ZodString, "many">>>;
dropElements: ZodOptional<ZodArray<ZodString, "many">>;
}, "strip", ZodTypeAny, {
allowAttributes: Record<string, string[]>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: string[];
blockElements: string[];
dropAttributes: Record<string, string[]>;
dropElements: string[];
}, {
allowAttributes: Record<string, string[]>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: string[];
blockElements: string[];
dropAttributes: Record<string, string[]>;
dropElements: string[];
}>>;
}, "strip", ZodTypeAny, {
flavor: "astro";
sanitize: {
allowAttributes: Record<string, string[]>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: string[];
blockElements: string[];
dropAttributes: Record<string, string[]>;
dropElements: string[];
};
}, {
flavor: "astro";
sanitize: {
allowAttributes: Record<string, string[]>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: string[];
blockElements: string[];
dropAttributes: Record<string, string[]>;
dropElements: string[];
};
}>;

Defined in: studiocms/packages/@studiocms/md/src/types.ts:17^

Schema definition for Astro-flavored Markdown content.

This schema is used to validate Markdown objects that are specifically intended for use with the Astro flavor. It ensures that the flavor property is set to 'astro' and that the sanitize property conforms to the StudioCMSSanitizeOptionsSchema.


const MarkdownSchema: ZodDefault<ZodOptional<ZodUnion<[ZodObject<{
flavor: ZodLiteral<"astro">;
sanitize: ZodOptional<ZodObject<{
allowAttributes: ZodOptional<ZodRecord<..., ...>>;
allowComments: ZodOptional<ZodBoolean>;
allowComponents: ZodOptional<ZodBoolean>;
allowCustomElements: ZodOptional<ZodBoolean>;
allowElements: ZodOptional<ZodArray<..., ...>>;
blockElements: ZodOptional<ZodArray<..., ...>>;
dropAttributes: ZodOptional<ZodRecord<..., ...>>;
dropElements: ZodOptional<ZodArray<..., ...>>;
}, "strip", ZodTypeAny, {
allowAttributes: Record<..., ...>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: ...[];
blockElements: ...[];
dropAttributes: Record<..., ...>;
dropElements: ...[];
}, {
allowAttributes: Record<..., ...>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: ...[];
blockElements: ...[];
dropAttributes: Record<..., ...>;
dropElements: ...[];
}>>;
}, "strip", ZodTypeAny, {
flavor: "astro";
sanitize: {
allowAttributes: Record<string, ...[]>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: string[];
blockElements: string[];
dropAttributes: Record<string, ...[]>;
dropElements: string[];
};
}, {
flavor: "astro";
sanitize: {
allowAttributes: Record<string, ...[]>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: string[];
blockElements: string[];
dropAttributes: Record<string, ...[]>;
dropElements: string[];
};
}>, ZodObject<{
sanitize: ZodOptional<ZodObject<{
allowAttributes: ZodOptional<...>;
allowComments: ZodOptional<...>;
allowComponents: ZodOptional<...>;
allowCustomElements: ZodOptional<...>;
allowElements: ZodOptional<...>;
blockElements: ZodOptional<...>;
dropAttributes: ZodOptional<...>;
dropElements: ZodOptional<...>;
}, "strip", ZodTypeAny, {
allowAttributes: ... | ...;
allowComments: ... | ... | ...;
allowComponents: ... | ... | ...;
allowCustomElements: ... | ... | ...;
allowElements: ... | ...;
blockElements: ... | ...;
dropAttributes: ... | ...;
dropElements: ... | ...;
}, {
allowAttributes: ... | ...;
allowComments: ... | ... | ...;
allowComponents: ... | ... | ...;
allowCustomElements: ... | ... | ...;
allowElements: ... | ...;
blockElements: ... | ...;
dropAttributes: ... | ...;
dropElements: ... | ...;
}>>;
} & {
autoLinkHeadings: ZodDefault<ZodOptional<ZodBoolean>>;
callouts: ZodDefault<ZodOptional<ZodUnion<[..., ..., ..., ...]>>>;
discordSubtext: ZodDefault<ZodOptional<ZodBoolean>>;
flavor: ZodLiteral<"studiocms">;
}, "strip", ZodTypeAny, {
autoLinkHeadings: boolean;
callouts: false | "github" | "obsidian" | "vitepress";
discordSubtext: boolean;
flavor: "studiocms";
sanitize: {
allowAttributes: Record<string, ...[]>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: string[];
blockElements: string[];
dropAttributes: Record<string, ...[]>;
dropElements: string[];
};
}, {
autoLinkHeadings: boolean;
callouts: false | "github" | "obsidian" | "vitepress";
discordSubtext: boolean;
flavor: "studiocms";
sanitize: {
allowAttributes: Record<string, ...[]>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: string[];
blockElements: string[];
dropAttributes: Record<string, ...[]>;
dropElements: string[];
};
}>]>>>;

Defined in: studiocms/packages/@studiocms/md/src/types.ts:77^

Defines a Zod schema for Markdown content, allowing either AstroMarkdownSchema or StudioCMSMarkdownSchema. The schema is optional and defaults to an object with the flavor set to ‘studiocms’.

This schema is useful for validating Markdown data that may conform to different formats, providing flexibility in content handling within the application.


const StudioCMSMarkdownSchema: ZodObject<{
sanitize: ZodOptional<ZodObject<{
allowAttributes: ZodOptional<ZodRecord<ZodString, ZodArray<ZodString, "many">>>;
allowComments: ZodOptional<ZodBoolean>;
allowComponents: ZodOptional<ZodBoolean>;
allowCustomElements: ZodOptional<ZodBoolean>;
allowElements: ZodOptional<ZodArray<ZodString, "many">>;
blockElements: ZodOptional<ZodArray<ZodString, "many">>;
dropAttributes: ZodOptional<ZodRecord<ZodString, ZodArray<ZodString, "many">>>;
dropElements: ZodOptional<ZodArray<ZodString, "many">>;
}, "strip", ZodTypeAny, {
allowAttributes: Record<string, string[]>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: string[];
blockElements: string[];
dropAttributes: Record<string, string[]>;
dropElements: string[];
}, {
allowAttributes: Record<string, string[]>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: string[];
blockElements: string[];
dropAttributes: Record<string, string[]>;
dropElements: string[];
}>>;
} & {
autoLinkHeadings: ZodDefault<ZodOptional<ZodBoolean>>;
callouts: ZodDefault<ZodOptional<ZodUnion<[ZodLiteral<"github">, ZodLiteral<"obsidian">, ZodLiteral<"vitepress">, ZodLiteral<false>]>>>;
discordSubtext: ZodDefault<ZodOptional<ZodBoolean>>;
flavor: ZodLiteral<"studiocms">;
}, "strip", ZodTypeAny, {
autoLinkHeadings: boolean;
callouts: false | "github" | "obsidian" | "vitepress";
discordSubtext: boolean;
flavor: "studiocms";
sanitize: {
allowAttributes: Record<string, string[]>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: string[];
blockElements: string[];
dropAttributes: Record<string, string[]>;
dropElements: string[];
};
}, {
autoLinkHeadings: boolean;
callouts: false | "github" | "obsidian" | "vitepress";
discordSubtext: boolean;
flavor: "studiocms";
sanitize: {
allowAttributes: Record<string, string[]>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: string[];
blockElements: string[];
dropAttributes: Record<string, string[]>;
dropElements: string[];
};
}>;

Defined in: studiocms/packages/@studiocms/md/src/types.ts:43^

Schema definition for StudioCMS Markdown configuration.