From c0ec5b9357291ab5a9f0b0e67381095e5adc0a00 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Wed, 1 Dec 2021 16:44:02 +0300 Subject: [PATCH] Fixed #1836 - For Inplace --- src/components/inplace/Inplace.d.ts | 69 ++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 12 deletions(-) diff --git a/src/components/inplace/Inplace.d.ts b/src/components/inplace/Inplace.d.ts index 07ddac403..f04f4cc04 100755 --- a/src/components/inplace/Inplace.d.ts +++ b/src/components/inplace/Inplace.d.ts @@ -1,20 +1,65 @@ import { VNode } from 'vue'; +import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; -interface InplaceProps { - closable?: boolean; - active?: boolean; - disabled?: boolean; +export interface InplaceProps { + /** + * Displays a button to switch back to display mode. + */ + closable?: boolean | undefined; + /** + * Whether the content is displayed or not. + */ + active?: boolean | undefined; + /** + * When present, it specifies that the element should be disabled. + */ + disabled?: boolean | undefined; } -declare class Inplace { - $props: InplaceProps; - $emit(eventName: 'update:active', value: boolean): this; - $emit(eventName: 'open', e: Event): this; - $emit(eventName: 'close', e: Event): this; - $slots: { - display: VNode[]; - content: VNode[]; +export interface InplaceSlots { + /** + * Custom display template. + */ + display: () => VNode[]; + /** + * Custom content template. + */ + content: () => VNode[]; +} + +export declare type InplaceEmits = { + /** + * Emitted when the active changes. + * @param {boolean} value - New value. + */ + 'update:active': (value: boolean) => void; + /** + * Callback to invoke when inplace is opened. + * @param {Event} event - Browser event. + */ + 'open': (event: Event) => void; + /** + * Callback to invoke when inplace is closed. + * @param {Event} event - Browser event. + */ + 'close': (event: Event) => void; +} + +declare class Inplace extends ClassComponent { } + +declare module '@vue/runtime-core' { + interface GlobalComponents { + Inplace: GlobalComponentConstructor } } +/** + * + * Inplace provides an easy to do editing and display at the same time where clicking the output displays the actual content. + * + * Demos: + * + * - [Inplace](https://www.primefaces.org/primevue/showcase/#/inplace) + * + */ export default Inplace;