From 063aa276e2f30f928a108a930f603a234e22ff11 Mon Sep 17 00:00:00 2001 From: Princesseuh Date: Fri, 3 Feb 2023 16:51:49 +0100 Subject: [PATCH] fix(types): Attempt to fix type generation --- packages/astro/src/@types/astro.ts | 6 ------ packages/astro/src/assets/types.ts | 3 +-- packages/astro/src/assets/vite-plugin-assets.ts | 8 +++++++- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index ddb026458c..ea3e5cd3cf 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -17,7 +17,6 @@ import type { SerializedSSRManifest } from '../core/app/types'; import type { PageBuildData } from '../core/build/types'; import type { AstroConfigSchema } from '../core/config'; import type { AstroCookies } from '../core/cookies'; -import type { LogOptions } from '../core/logger/core'; import type { AstroComponentFactory, AstroComponentInstance } from '../runtime/server'; import { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './../core/constants.js'; export type { @@ -1377,11 +1376,6 @@ export interface AstroIntegration { }; } -export interface AstroPluginOptions { - settings: AstroSettings; - logging: LogOptions; -} - export type RouteType = 'page' | 'endpoint'; export interface RoutePart { diff --git a/packages/astro/src/assets/types.ts b/packages/astro/src/assets/types.ts index 315e07838c..66243cb7d7 100644 --- a/packages/astro/src/assets/types.ts +++ b/packages/astro/src/assets/types.ts @@ -25,8 +25,7 @@ export type OutputFormat = 'avif' | 'png' | 'webp' | 'jpeg' | 'jpg' | 'gif'; type WithRequired = T & { [P in K]-?: T[P] }; -interface ImageSharedProps - extends WithRequired, 'src' | 'width' | 'height'>, 'alt'> { +interface ImageSharedProps extends Omit, 'src' | 'width' | 'height'> { /** * Width of the image, the value of this property will be used to assign the `width` property on the final `img` element. * diff --git a/packages/astro/src/assets/vite-plugin-assets.ts b/packages/astro/src/assets/vite-plugin-assets.ts index bbeda5e33a..a6db41312f 100644 --- a/packages/astro/src/assets/vite-plugin-assets.ts +++ b/packages/astro/src/assets/vite-plugin-assets.ts @@ -1,9 +1,15 @@ import type * as vite from 'vite'; -import type { AstroPluginOptions } from '../@types/astro'; +import type { AstroSettings } from '../@types/astro.js'; +import { LogOptions } from '../core/logger/core.js'; import { VIRTUAL_MODULE_ID } from './consts.js'; const resolvedVirtualModuleId = '\0' + VIRTUAL_MODULE_ID; +interface AstroPluginOptions { + settings: AstroSettings; + logging: LogOptions; +} + export default function assets({ settings, logging }: AstroPluginOptions): vite.Plugin { return { name: 'astro:assets',