From 6c6069c0867e5eca642796b6f5fbc37db9073c1e Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 2 Jul 2024 11:50:47 +0200 Subject: [PATCH 1/2] fix: Adjust type for OCP.Files.Router.goToRoute to also allow `null` `null` is used to stay on the current route but only adjust params. Signed-off-by: Ferdinand Thiessen --- lib/v27/OC.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/v27/OC.d.ts b/lib/v27/OC.d.ts index 595bfa9..c52353d 100644 --- a/lib/v27/OC.d.ts +++ b/lib/v27/OC.d.ts @@ -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, query?: Record, replace?: boolean, From f616d2ba8b63b4b6de3e4c6f1a4bff2d890d065e Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 2 Jul 2024 11:54:34 +0200 Subject: [PATCH 2/2] fix: Add missing types for getters on files router added with Nextcloud 28 Signed-off-by: Ferdinand Thiessen --- lib/v28/OC.d.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/v28/OC.d.ts b/lib/v28/OC.d.ts index 9b99c2f..c7b4e7e 100644 --- a/lib/v28/OC.d.ts +++ b/lib/v28/OC.d.ts @@ -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 + /** + * Params of the current route + */ + readonly params: Nextcloud.v27.Dictionary + } + interface OC extends Omit { /** * 'appSettings', 'addScript', and 'addStyle' were removed in Nextcloud 28 @@ -124,7 +139,7 @@ declare namespace Nextcloud.v28 { interface OCP extends Omit { Files: { - Router: Nextcloud.v27.FilesRouter + Router: FilesRouter Navigation: FilesNavigation } }