@nextcloud/typings
Advanced tools
Comparing version 1.9.0 to 1.9.1
@@ -5,2 +5,8 @@ # Changelog | ||
## 1.9.1 - 2024-07-04 | ||
### Fixed | ||
* fix: Add missing types for `OCP.Files.Router` | ||
* fix: Use Typescript source files for types | ||
* fix: Add missing types for confirmation dialogs | ||
## 1.9.0 - 2024-06-25 | ||
@@ -7,0 +13,0 @@ ### Added |
@@ -22,2 +22,5 @@ /// <reference types="jquery" /> | ||
readonly YES_NO_BUTTONS: number, | ||
readonly OK_BUTTONS: number, | ||
filepicker( | ||
@@ -30,3 +33,34 @@ title: string, | ||
type?: number, | ||
path?: string): void; | ||
path?: string, | ||
): void; | ||
/** | ||
* Displays confirmation dialog | ||
* @param text content of dialog | ||
* @param title dialog title | ||
* @param callback which will be triggered when user presses OK (true or false would be passed to callback respectively) | ||
* @param modal make the dialog modal | ||
*/ | ||
confirm( | ||
text: string, | ||
title: string, | ||
callback: (answer: boolean) => void, | ||
modal?: boolean, | ||
): Promise<void>; | ||
/** | ||
* Displays confirmation dialog | ||
* @param text content of dialog | ||
* @param title dialog title | ||
* @param buttons text content of buttons | ||
* @param callback which will be triggered when user presses OK (true or false would be passed to callback respectively) | ||
* @param modal make the dialog modal | ||
*/ | ||
confirmDestructive( | ||
text: string, | ||
title: string, | ||
buttons: number | { type: number, confirm: string, cancel: string, confirmClasses: string }, | ||
callback: (answer: boolean) => void, | ||
modal?: boolean, | ||
): Promise<void>; | ||
} | ||
@@ -33,0 +67,0 @@ |
@@ -7,8 +7,4 @@ declare namespace Nextcloud.v17 { | ||
interface Dialogs { | ||
FILEPICKER_TYPE_CHOOSE: number; | ||
FILEPICKER_TYPE_MOVE: number; | ||
FILEPICKER_TYPE_COPY: number; | ||
FILEPICKER_TYPE_COPY_MOVE: number; | ||
interface Dialogs extends Omit<Nextcloud.v16.OC['dialogs'], 'filepicker'>{ | ||
// options parameter was added | ||
filepicker( | ||
@@ -22,3 +18,4 @@ title: string, | ||
path?: string, | ||
options?: FilePickerOptions): void; | ||
options?: FilePickerOptions, | ||
): void; | ||
} | ||
@@ -25,0 +22,0 @@ |
@@ -38,3 +38,3 @@ declare namespace Nextcloud.v27 { | ||
goToRoute( | ||
name?: string, | ||
name?: string | null, | ||
params?: Record<string, string>, | ||
@@ -41,0 +41,0 @@ query?: Record<string, string | (string | null)[] | null | undefined>, |
@@ -119,2 +119,17 @@ declare namespace Nextcloud.v28 { | ||
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'> { | ||
@@ -128,3 +143,3 @@ /** | ||
Files: { | ||
Router: Nextcloud.v27.FilesRouter | ||
Router: FilesRouter | ||
Navigation: FilesNavigation | ||
@@ -131,0 +146,0 @@ } |
{ | ||
"name": "@nextcloud/typings", | ||
"version": "1.9.0", | ||
"version": "1.9.1", | ||
"description": "Nextcloud TypeScript typings", | ||
"main": "dist/index.js", | ||
"typings": "dist/index.d.ts", | ||
"typings": "lib/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts" | ||
"types": "./lib/index.d.ts" | ||
}, | ||
"./ocs": { | ||
"types": "./dist/ocs.d.ts" | ||
"types": "./lib/ocs.d.ts" | ||
} | ||
@@ -14,0 +14,0 @@ }, |
69418
714
29