@nextcloud/typings
Advanced tools
Comparing version 1.8.0 to 1.9.0
@@ -5,2 +5,14 @@ # Changelog | ||
## 1.9.0 - 2024-06-25 | ||
### Added | ||
* feat: Add type information for Nextcloud 29 | ||
### Fixed | ||
* fix: Do not depend on vue or vue-router for the public interface of `OC.Files.Router` | ||
* fix: Add types for missing `OC` constants | ||
### Changed | ||
* chore(deps-dev): Bump typescript to 5.5.2 | ||
* chore(deps-dev): Bump braces 3.0.3 | ||
## 1.8.0 - 2024-02-23 | ||
@@ -7,0 +19,0 @@ ### Added |
@@ -14,1 +14,2 @@ /// <reference path="v16/OC.d.ts" /> | ||
/// <reference path="v28/OC.d.ts" /> | ||
/// <reference path="v29/OC.d.ts" /> |
@@ -7,3 +7,13 @@ /// <reference types="jquery" /> | ||
interface OC extends Nextcloud.Common.OC { | ||
coreApps: string[] | ||
menuSpeed: number | ||
TAG_FAVORITE: string | ||
PERMISSION_NONE: 0 | ||
PERMISSION_READ: 1 | ||
PERMISSION_UPDATE: 2 | ||
PERMISSION_CREATE: 4 | ||
PERMISSION_DELETE: 8 | ||
PERMISSION_SHARE: 16 | ||
PERMISSION_ALL: 31 | ||
} | ||
@@ -10,0 +20,0 @@ |
@@ -1,46 +0,58 @@ | ||
import type { Route } from 'vue-router' | ||
declare namespace Nextcloud.v27 { | ||
type Dictionary<T> = { [index: string]: T } | ||
declare global { | ||
namespace Nextcloud.v27 { | ||
interface FilesRouter { | ||
/** | ||
* Trigger a route change on the files app | ||
* | ||
* @param path the url path, eg: '/trashbin?dir=/Deleted' | ||
* @param replace replace the current history (default false) | ||
* @see https://router.vuejs.org/guide/essentials/navigation.html#navigate-to-a-different-location | ||
*/ | ||
goTo(path: string, replace?: boolean): Promise<Route>; | ||
/** | ||
* Trigger a route change on the files App | ||
* | ||
* @param name the route name | ||
* @param params the route parameters | ||
* @param query the url query parameters | ||
* @param replace replace the current history | ||
* @see https://router.vuejs.org/guide/essentials/navigation.html#navigate-to-a-different-location | ||
*/ | ||
goToRoute( | ||
name?: string, | ||
params?: Record<string, string>, | ||
query?: Record<string, string | (string | null)[] | null | undefined>, | ||
replace?: boolean, | ||
): Promise<Route>; | ||
} | ||
interface Vue2RouteMeta extends Record<string | number | symbol, any> {} | ||
interface OC extends Nextcloud.v26.OC { | ||
interface Vue2Route { | ||
path: string | ||
name?: string | null | ||
hash: string | ||
query: Dictionary<string | (string | null)[]> | ||
params: Dictionary<string> | ||
fullPath: string | ||
matched: any[] | ||
redirectedFrom?: string | ||
meta?: Vue2RouteMeta | ||
} | ||
} | ||
interface FilesRouter { | ||
/** | ||
* Trigger a route change on the files app | ||
* | ||
* @param path the url path, eg: '/trashbin?dir=/Deleted' | ||
* @param replace replace the current history (default false) | ||
* @see https://v3.router.vuejs.org/guide/essentials/navigation.html | ||
*/ | ||
goTo(path: string, replace?: boolean): Promise<Vue2Route>; | ||
/** | ||
* Trigger a route change on the files App | ||
* | ||
* @param name the route name | ||
* @param params the route parameters | ||
* @param query the url query parameters | ||
* @param replace replace the current history | ||
* @see https://v3.router.vuejs.org/guide/essentials/navigation.html | ||
*/ | ||
goToRoute( | ||
name?: string, | ||
params?: Record<string, string>, | ||
query?: Record<string, string | (string | null)[] | null | undefined>, | ||
replace?: boolean, | ||
): Promise<Vue2Route>; | ||
} | ||
interface OCP extends Omit<Nextcloud.v26.OCP, 'Files'> { | ||
Files: { | ||
Router: FilesRouter | ||
} | ||
} | ||
interface OC extends Nextcloud.v26.OC { | ||
interface WindowWithGlobals extends Nextcloud.Common.DayMonthConstants, Window { | ||
} | ||
interface OCP extends Omit<Nextcloud.v26.OCP, 'Files'> { | ||
Files: { | ||
Router: FilesRouter | ||
} | ||
} | ||
} | ||
interface WindowWithGlobals extends Nextcloud.Common.DayMonthConstants, Window { | ||
} | ||
} |
{ | ||
"name": "@nextcloud/typings", | ||
"version": "1.8.0", | ||
"version": "1.9.0", | ||
"description": "Nextcloud TypeScript typings", | ||
@@ -41,5 +41,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@types/jquery": "3.5.16", | ||
"vue": "^2.7.15", | ||
"vue-router": "<4" | ||
"@types/jquery": "3.5.16" | ||
}, | ||
@@ -46,0 +44,0 @@ "devDependencies": { |
68490
1
32
702
- Removedvue@^2.7.15
- Removedvue-router@<4
- Removed@babel/helper-string-parser@7.25.9(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@babel/parser@7.26.9(transitive)
- Removed@babel/types@7.26.9(transitive)
- Removed@vue/compiler-sfc@2.7.16(transitive)
- Removedcsstype@3.1.3(transitive)
- Removednanoid@3.3.8(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedpostcss@8.5.2(transitive)
- Removedprettier@2.8.8(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedsource-map-js@1.2.1(transitive)
- Removedvue@2.7.16(transitive)
- Removedvue-router@3.6.5(transitive)