Skip to content

Commit

Permalink
Merge pull request #263 from nextcloud-libraries/fix/files-router
Browse files Browse the repository at this point in the history
fix: Add missing types for OCP.Files.Router
  • Loading branch information
susnux authored Jul 2, 2024
2 parents 76f339f + f616d2b commit 40aa78d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/v27/OC.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ declare namespace Nextcloud.v27 {
* @see https://v3.router.vuejs.org/guide/essentials/navigation.html
*/
goToRoute(
name?: string,
name?: string | null,
params?: Record<string, string>,
query?: Record<string, string | (string | null)[] | null | undefined>,
replace?: boolean,
Expand Down
17 changes: 16 additions & 1 deletion lib/v28/OC.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,21 @@ declare namespace Nextcloud.v28 {
views: View[]
}

interface FilesRouter extends Nextcloud.v27.FilesRouter {
/**
* Name of the current route
*/
readonly name: string | null | undefined
/**
* Query options of the current route
*/
readonly query: Nextcloud.v27.Dictionary<string | (string | null)[] | null | undefined>
/**
* Params of the current route
*/
readonly params: Nextcloud.v27.Dictionary<string>
}

interface OC extends Omit<Nextcloud.v27.OC, 'appSettings'|'addScript'|'addStyle'> {
/**
* 'appSettings', 'addScript', and 'addStyle' were removed in Nextcloud 28
Expand All @@ -124,7 +139,7 @@ declare namespace Nextcloud.v28 {

interface OCP extends Omit<Nextcloud.v27.OCP, 'Files'> {
Files: {
Router: Nextcloud.v27.FilesRouter
Router: FilesRouter
Navigation: FilesNavigation
}
}
Expand Down

0 comments on commit 40aa78d

Please sign in to comment.