mirror of
https://github.com/coollabsio/coolify.git
synced 2026-03-11 08:55:47 +00:00
fix(types): inertia type declaration and shared props typing
- when there is no import or export statement on a .d.ts file ts treats it as a "script" instead of a "module". In a "script", declare module "X" is an ambient module declaration that replaces the module. Adding any import or empty export makes the file a module, which changes declare module "X" to a module augmentation that merges with the real module. See: https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules
This commit is contained in:
parent
fa149a9da3
commit
5ed3b2e498
2 changed files with 13 additions and 11 deletions
11
resources/js/global.d.ts
vendored
11
resources/js/global.d.ts
vendored
|
|
@ -1,11 +0,0 @@
|
|||
declare module "@inertiajs/core" {
|
||||
export interface InertiaConfig {
|
||||
sharedPageProps: {
|
||||
appName: string
|
||||
}
|
||||
// flashDataType: {
|
||||
// toast?: { type: "success" | "error"; message: string };
|
||||
// };
|
||||
errorValueType: string[];
|
||||
}
|
||||
}
|
||||
13
resources/js/inertia.d.ts
vendored
Normal file
13
resources/js/inertia.d.ts
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import "@inertiajs/core";
|
||||
|
||||
declare module "@inertiajs/core" {
|
||||
export interface InertiaConfig {
|
||||
sharedPageProps: {
|
||||
appName: string;
|
||||
};
|
||||
// flashDataType: {
|
||||
// toast?: { type: "success" | "error"; message: string };
|
||||
// };
|
||||
errorValueType: string[];
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue