ConfirmationOptions and ConfirmationService d.ts updated

pull/3711/head
Tuğçe Küçükoğlu 2023-03-06 10:22:29 +03:00
parent 4e5f5e4c46
commit 6a96ccc50c
5 changed files with 62 additions and 17 deletions

View File

@ -1,5 +1,16 @@
type ConfirmationPositionType = 'center' | 'top' | 'bottom' | 'left' | 'right' | 'topleft' | 'topright' | 'bottomleft' | 'bottomright' | undefined;
/**
*
* [Live Demo](https://www.primevue.org/confirmdialog/)
*
* @module confirmationoptions
*
*/
/**
* Confirmation Service options.
*
* @group Interfaces
*/
export interface ConfirmationOptions {
/**
* Element to align the overlay.
@ -18,11 +29,10 @@ export interface ConfirmationOptions {
*/
group?: string | undefined;
/**
* Position of the dialog, options are 'center', 'top', 'bottom', 'left', 'right', 'topleft', 'topright', 'bottomleft' or 'bottomright'.
* @see ConfirmationPositionType
* Default value is 'center'.
* Position of the dialog.
* @defaultValue 'center'
*/
position?: ConfirmationPositionType;
position?: 'center' | 'top' | 'bottom' | 'left' | 'right' | 'topleft' | 'topright' | 'bottomleft' | 'bottomright' | undefined;
/**
* Icon to display next to the message.
*/
@ -34,15 +44,15 @@ export interface ConfirmationOptions {
/**
* Callback to execute when action is confirmed.
*/
accept?: () => void;
accept?(): void;
/**
* Callback to execute when action is rejected.
*/
reject?: () => void;
reject?(): void;
/**
* Callback to execute when dialog is hidden.
*/
onHide?: () => void;
onHide?(): void;
/**
* Label of the accept button. Defaults to PrimeVue Locale configuration.
*/

View File

@ -1,19 +1,32 @@
/**
*
* [Live Demo](https://www.primevue.org/confirmdialog/)
*
* @module confirmationservice
*
*/
import { Plugin } from 'vue';
import { ConfirmationOptions } from '../confirmationoptions';
declare const plugin: Plugin;
export default plugin;
/**
* Confirmation Service methods.
*
* @group Interfaces
*
*/
export interface ConfirmationServiceMethods {
/**
* Displays the dialog using the confirmation object options.
* @param {ConfirmationOptions} options - Confirmation Object
*/
require(options: ConfirmationOptions): void;
require: (options: ConfirmationOptions) => void;
/**
* Hides the dialog without invoking accept or reject callbacks.
*/
close(): void;
close: () => void;
}
declare module 'vue/types/vue' {

View File

@ -1,11 +1,21 @@
type TerminalServiceActionType = 'command' | 'response' | undefined;
/**
* Confirmation Service methods.
*
* @group Interfaces
*
*/
export interface TerminalServiceOptions {
on(action: TerminalServiceActionType, fn: any): void;
emit(action: TerminalServiceActionType, params?: any): void;
off(action: TerminalServiceActionType, fn: any): void;
on: (action: 'command' | 'response' | undefined, fn: any) => void;
emit: (action: 'command' | 'response' | undefined, params?: any) => void;
off: (action: 'command' | 'response' | undefined, fn: any) => void;
}
declare const TerminalService: TerminalServiceOptions;
/**
* [Live Demo](https://www.primevue.org/terminal/)
*
* @module terminalservice
*
*/
export default TerminalService;

View File

@ -1,5 +1,11 @@
<template>
<DocComponent title="Vue Confirmation Dialog Component" header="ConfirmDialog" description="ConfirmDialog uses a Dialog UI that is integrated with the Confirmation API." :componentDocs="docs" :apiDocs="['ConfirmDialog']" />
<DocComponent
title="Vue Confirmation Dialog Component"
header="ConfirmDialog"
description="ConfirmDialog uses a Dialog UI that is integrated with the Confirmation API."
:componentDocs="docs"
:apiDocs="['ConfirmDialog', 'ConfirmationService', 'ConfirmationOptions']"
/>
</template>
<script>

View File

@ -1,5 +1,11 @@
<template>
<DocComponent title="Vue Confirmation Popup Component" header="ConfirmPopup" description="ConfirmPopup displays a confirmation overlay displayed relatively to its target." :componentDocs="docs" :apiDocs="['ConfirmPopup']" />
<DocComponent
title="Vue Confirmation Popup Component"
header="ConfirmPopup"
description="ConfirmPopup displays a confirmation overlay displayed relatively to its target."
:componentDocs="docs"
:apiDocs="['ConfirmPopup', 'ConfirmationService', 'ConfirmationOptions']"
/>
</template>
<script>