app.d.ts is a script-context declaration file. A `declare module 'x' {}`
in a script file is an ambient module declaration that completely replaces
the package's types — not an augmentation. This caused svelte-check to see
@lucide/svelte as exporting only IconProps, producing 1131 "class" errors
and 237 "no exported member" errors for every icon import.
Moving the augmentation to src/lucide-augment.d.ts with `export {}` makes
it a module file, so `declare module` becomes a proper augmentation that
merges with the package types. Result: Lucide errors drop from 1368 to 0.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
37 lines
862 B
TypeScript
37 lines
862 B
TypeScript
// See https://kit.svelte.dev/docs/types#app
|
|
// for information about these interfaces
|
|
// and what to do when importing types
|
|
declare namespace App {
|
|
interface Locals {
|
|
userid: string;
|
|
}
|
|
// interface PageData {}
|
|
// interface Error {}
|
|
// interface Platform {}
|
|
}
|
|
|
|
declare global {
|
|
namespace App {
|
|
interface Platform {}
|
|
}
|
|
|
|
interface Window {
|
|
native_app: any;
|
|
}
|
|
|
|
// eslint-disable-next-line no-var
|
|
var native_app: any;
|
|
}
|
|
|
|
// Stripe Buy Button web component — needed so Svelte templates accept the element without TS errors.
|
|
declare module 'svelte/elements' {
|
|
interface IntrinsicElements {
|
|
'stripe-buy-button': {
|
|
'buy-button-id': string;
|
|
'publishable-key': string;
|
|
'client-reference-id'?: string;
|
|
[attr: string]: any;
|
|
};
|
|
}
|
|
}
|