Skip to content

Commit 717030b

Browse files
committed
wip
Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent 7d17347 commit 717030b

File tree

5 files changed

+182
-2
lines changed

5 files changed

+182
-2
lines changed

package-lock.json

Lines changed: 82 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "laravel-nova-devtool",
33
"description": "Laravel Nova DevTool",
4+
"types": "types/index.d.ts",
45
"dependencies": {
56
"@vue/compiler-sfc": "^3.4.38",
67
"autoprefixer": "^10.4.20",
@@ -11,9 +12,11 @@
1112
"vue-loader": "^16.8.3"
1213
},
1314
"peerDependencies": {
15+
"@inertiajs/vue3": "^1.0.0",
1416
"axios": "^1.7.4",
1517
"lodash": "^4.17.21",
1618
"tailwindcss": "^3.4.10",
17-
"vue": "^3.4.38"
19+
"vue": "^3.4.38",
20+
"vuex": "^4.0.2"
1821
}
1922
}

types/components.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export type Badge = {
2+
typeClass: string;
3+
value: any;
4+
};

types/index.d.ts

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import type { Menu } from './menu'
2+
3+
type BootingCallback = ((app: any, store: any) => void);
4+
5+
type Color = {
6+
[key: string]: string;
7+
}
8+
9+
export type AppConfig = {
10+
algoliaApiKey?: any;
11+
algoliaAppId?: any;
12+
appName: string;
13+
base: string;
14+
brandColors: Color[];
15+
brandColorsCSS: string;
16+
customLoginPath: boolean;
17+
customLogoutPath: boolean;
18+
debounce: number;
19+
footer: string;
20+
forgotPasswordPath: string | boolean;
21+
globalSearchEnabled: boolean;
22+
hasGloballySearchableResources: boolean;
23+
initialPath: string;
24+
locale: string;
25+
logo?: string;
26+
mainMenu: Menu[];
27+
notificationCenterEnabled: boolean;
28+
notificationPollingInterval: number;
29+
pagination: string;
30+
resetPasswordPath: boolean;
31+
resources: Resource[];
32+
rtlEnabled: boolean;
33+
themeSwitcherEnabled: boolean;
34+
timezone: string;
35+
translations: Translations;
36+
userId: number;
37+
userMenu: Menu[];
38+
userTimezone?: any;
39+
version: string;
40+
withAuthentication: boolean;
41+
withPasswordReset: boolean;
42+
}
43+
44+
type Resource = {
45+
uriKey: string;
46+
label: string;
47+
singularLabel: string;
48+
createButtonLabel: string;
49+
updateButtonLabel: string;
50+
authorizedToCreate: boolean;
51+
searchable: boolean;
52+
perPageOptions: number[];
53+
tableStyle: string;
54+
showColumnBorders: boolean;
55+
debounce: number;
56+
clickAction: string;
57+
};
58+
59+
type Translations = {
60+
[key: string]: string;
61+
}
62+
63+
export declare type NovaApp = {
64+
$router: import('@inertiajs/core').Router;
65+
app: import('vue').App<Element>;
66+
appConfig: AppConfig;
67+
mountTo: Element;
68+
store: import('vuex').Store<any>;
69+
boot: () => void;
70+
booting: (callback: BootingCallback) => void;
71+
config: (key: string|null) => any;
72+
countdown(): Promise<void>;
73+
request: (options: Object) => import('axios').AxiosInstance;
74+
liftOff(): void;
75+
}
76+
77+
declare global {
78+
interface Window {
79+
Nova: NovaApp
80+
}
81+
}

types/menu.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export type Menu = {
2+
key: string;
3+
name: string;
4+
component: "menu-section" | "menu-group" | "menu-item";
5+
items: (Menu | MenuItem)[];
6+
collapsable: boolean;
7+
icon: string;
8+
path: string;
9+
active?: boolean;
10+
badge?: import('./components.d').Badge;
11+
};

0 commit comments

Comments
 (0)