Open
Description
Describe the problem
Current type: https://svelte.dev/docs/kit/configuration#typescript
config?: (config: Record<string, any>) => Record<string, any> | void;
Describe the proposed solution
Since the config
param is generated by SvelteKit, it can be narrowed like this:
import type { CompilerOptions } from 'typescript';
type Config = {
compilerOptions: CompilerOptions;
include: string[];
exclude: string[];
};
Alternatives considered
This does not work:
/**
* @typedef {import('typescript').CompilerOptions} CompilerOptions
* @typedef {Object} Config
* @property {CompilerOptions} compilerOptions
* @property {string[]} include
* @property {string[]} exclude
* @param {Config} config
*/v
Type 'Record<string, any>' is missing the following properties from type 'Config': compilerOptions, include, exclude ts(2322)
Importance
nice to have
Additional Information
No response