Skip to content

Commit

Permalink
fix: Adjust type definitions for global Nextcloud variables
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Jul 22, 2024
1 parent 59fa86e commit f560326
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 22 deletions.
18 changes: 6 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"engines": {
"node": "^20.0.0",
"npm": "^9.0.0"
"npm": "^10.0.0"
},
"devDependencies": {
"@babel/preset-react": "^7.24.1",
Expand All @@ -25,6 +25,7 @@
"@nextcloud/cypress": "^1.0.0-beta.6",
"@nextcloud/eslint-config": "^8.3.0",
"@nextcloud/stylelint-config": "^2.4.0",
"@nextcloud/typings": "^1.9.1",
"@nextcloud/webpack-vue-config": "^5.5.1",
"@types/bootstrap": "^5.2.10",
"@types/dockerode": "^3.3.30",
Expand Down
2 changes: 1 addition & 1 deletion src/custom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
*
*/
declare module '*.svg?raw' {
const content: any
const content: string
export default content
}
16 changes: 16 additions & 0 deletions src/globals.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/// <reference types="@nextcloud/typings" />

declare global {
interface Window {
OC: Nextcloud.v29.OC
OCP: Nextcloud.v29.OCP
// eslint-disable-next-line @typescript-eslint/no-explicit-any
OCA: any
}
/**
* Injected by webpack
*/
const appName: string
}

export {}
8 changes: 0 additions & 8 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ import FolderSvg from '@mdi/svg/svg/folder-account.svg?raw'
import { getContents } from './services/groupfolders'
import './actions/openGroupfolderAction'

declare global {
interface Window {
OCA: any
OCP: any
}
const appName: string
}

const Navigation = getNavigation()
Navigation.register(new View({
id: appName,
Expand Down

0 comments on commit f560326

Please sign in to comment.