Repository: withastro/astro
File: packages/astro/src/types/public/config.ts (TypeScript)

Code before:
					 *         "img-src 'self' https://images.cdn.example.com"
					 *       ]
					 *     }
					 *   }
					 * });
					 * ```
					 * After the build, the `<meta>` element will add your directives into the `content` value alongside Astro's default directives:
					 *
					 * ```html
					 * <meta
					 *   http-equiv="content-security-policy"
					 *   content="
					 *     default-src 'self';
					 *     img-src 'self' 'https://images.cdn.example.com';
					 *     script-src 'self' 'sha256-somehash';
					 *     style-src 'self' 'sha256-somehash';
					 *   "
					 * >
					 * ```
					 */
					directives?: CspDirective[];

					/**
					 * @docs
					 * @name security.csp.styleDirective
					 * @type {{ hashes?: CspHash[], resources?: string[] }}
					 * @default `undefined`
					 * @version 6.0.0
					 * @description
					 *
					 * A configuration object that allows you to override the default sources for the `style-src` directive with the [`resources`](https://v6.docs.astro.build/en/reference/configuration-reference/#resources) property, or to provide additional [hashes]((https://v6.docs.astro.build/en/reference/configuration-reference#hashes) to be rendered.					 */
					styleDirective?: {
						/**
						 * @docs
						 * @name security.csp.styleDirective.hashes
						 * @type {CspHash[]}
						 * @default `[]`
						 * @version 6.0.0
						 * @description
						 *
						 * A list of additional hashes to be rendered.
						 *
						 * You must provide hashes that start with `sha384-`, `sha512-` or `sha256-`. Other values will cause a validation error. These hashes are added to all pages.
						 *
						 * ```js title="astro.config.mjs"
						 * import { defineConfig } from 'astro/config';
						 *
						 * export default defineConfig({
						 *   security: {
						 *     csp: {
						 *       styleDirective: {

Review comment (bug):
Looking at the failing tests, I think this is because the [library used in docgen](https://github.com/jsdoc2md/jsdoc-api) to validate the JSDoc doesn't handle Typescript optional properties. This wasn't failing before because `docgen` wasn't run.

We could replace `?:` with `:`:

```suggestion
					 * @type {{ hashes: CspHash[], resources: string[] }}
```
But we loose the information those properties are optional.

I don't know if there is an alternative, but I can reproduce the issue locally using `jsdoc-api` directly.

Code after:
					 *     csp: {
					 *       directives: [
					 *         "default-src 'self'",
					 *         "img-src 'self' https://images.cdn.example.com"
					 *       ]
					 *     }
					 *   }
					 * });
					 * ```
					 * After the build, the `<meta>` element will add your directives into the `content` value alongside Astro's default directives:
					 *
					 * ```html
					 * <meta
					 *   http-equiv="content-security-policy"
					 *   content="
					 *     default-src 'self';
					 *     img-src 'self' 'https://images.cdn.example.com';
					 *     script-src 'self' 'sha256-somehash';
					 *     style-src 'self' 'sha256-somehash';
					 *   "
					 * >
					 * ```
					 */
					directives?: CspDirective[];

					/**
					 * @docs
					 * @name security.csp.styleDirective
					 * @type {CspStyleDirective}
					 * @default `undefined`
					 * @version 6.0.0
					 * @description
					 *
					 * A configuration object that allows you to override the default sources for the `style-src` directive with the [`resources`](https://v6.docs.astro.build/en/reference/configuration-reference/#resources) property, or to provide additional [hashes]((https://v6.docs.astro.build/en/reference/configuration-reference#hashes) to be rendered.					 */
					styleDirective?: {
						/**
						 * @docs
						 * @name security.csp.styleDirective.hashes
						 * @type {CspHash[]}
						 * @default `[]`
						 * @version 6.0.0
						 * @description
						 *
						 * A list of additional hashes to be rendered.
						 *
						 * You must provide hashes that start with `sha384-`, `sha512-` or `sha256-`. Other values will cause a validation error. These hashes are added to all pages.
						 *
						 * ```js title="astro.config.mjs"
						 * import { defineConfig } from 'astro/config';
						 *
						 * export default defineConfig({