@studiocms/html
Version:
Add HTML Support to your StudioCMS project with ease!
63 lines (62 loc) • 2.92 kB
TypeScript
import { z } from 'astro/zod';
/**
* Defines the schema for HTML configuration options.
*
* The schema includes an optional `sanitize` property, which is validated
* using the `StudioCMSSanitizeOptionsSchema`. If no value is provided,
* the default is an empty object.
*/
export declare const HTMLSchema: z.ZodDefault<z.ZodOptional<z.ZodObject<{
/** Sanitization options for HTML content. See {@link StudioCMSSanitizeOptionsSchema} for details. */
sanitize: z.ZodOptional<z.ZodObject<{
allowElements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
blockElements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
dropElements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
allowAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
dropAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
allowComponents: z.ZodOptional<z.ZodBoolean>;
allowCustomElements: z.ZodOptional<z.ZodBoolean>;
allowComments: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
allowElements?: string[] | undefined;
blockElements?: string[] | undefined;
dropElements?: string[] | undefined;
allowAttributes?: Record<string, string[]> | undefined;
dropAttributes?: Record<string, string[]> | undefined;
allowComponents?: boolean | undefined;
allowCustomElements?: boolean | undefined;
allowComments?: boolean | undefined;
}, {
allowElements?: string[] | undefined;
blockElements?: string[] | undefined;
dropElements?: string[] | undefined;
allowAttributes?: Record<string, string[]> | undefined;
dropAttributes?: Record<string, string[]> | undefined;
allowComponents?: boolean | undefined;
allowCustomElements?: boolean | undefined;
allowComments?: boolean | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
sanitize?: {
allowElements?: string[] | undefined;
blockElements?: string[] | undefined;
dropElements?: string[] | undefined;
allowAttributes?: Record<string, string[]> | undefined;
dropAttributes?: Record<string, string[]> | undefined;
allowComponents?: boolean | undefined;
allowCustomElements?: boolean | undefined;
allowComments?: boolean | undefined;
} | undefined;
}, {
sanitize?: {
allowElements?: string[] | undefined;
blockElements?: string[] | undefined;
dropElements?: string[] | undefined;
allowAttributes?: Record<string, string[]> | undefined;
dropAttributes?: Record<string, string[]> | undefined;
allowComponents?: boolean | undefined;
allowCustomElements?: boolean | undefined;
allowComments?: boolean | undefined;
} | undefined;
}>>>;
export type HTMLSchemaOptions = z.infer<typeof HTMLSchema>;