Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ts: change declare by .d.ts referencing @nextcloud/typings
Inspired by readme of typing [1] and usage in another module [2]. Despite basing on v29 the version 28 was chosen because there's no v29 in "typings" yet. After replacing the "any" type definition by the type reference tsc complained: ``` TS2339: Property 'confirm' does not exist on type 'Dialogs & { filepicker(title: string, callback: Function, multiselect?: boolean | undefined, mimeTypeFilter?: string[] | undefined, modal?: boolean | undefined, type?: number | undefined, path?: string | undefined, options?: FilePickerOptions | undefined): void; }'. ``` This is due to "confirm()" not being defined in @nextcloud/types. Searching the history of typings [1] it is and never was defined. The upgrade guide for the upcoming v30 [3] discourages using "OC.dialogs.confirm()" and refers to @nextcloud/dialogs [4], which does currently not provice "confirm()". Thus a type extension was added. [1]: https://github.com/nextcloud-libraries/nextcloud-typings [2]: https://github.com/nextcloud-libraries/nextcloud-router/blob/v3.0.1/lib/oc.d.ts#L1 [3]: https://docs.nextcloud.com/server/latest/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_30.html#deprecated-apis [4]: https://nextcloud-libraries.github.io/nextcloud-dialogs/
- Loading branch information